diff -Nru cloog-0.18.2/aclocal.m4 cloog-0.18.4/aclocal.m4 --- cloog-0.18.2/aclocal.m4 2013-12-18 12:36:07.000000000 +0000 +++ cloog-0.18.4/aclocal.m4 2015-07-27 12:06:00.000000000 +0000 @@ -1,8 +1,7 @@ -# generated automatically by aclocal 1.11.3 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, -# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -12,33 +11,31 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, -[m4_warning([this file was generated for autoconf 2.68. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.11' +[am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.3], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -54,24 +51,22 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.3])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and @@ -90,7 +85,7 @@ # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you +# harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, @@ -116,22 +111,19 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 9 - # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl @@ -150,16 +142,14 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, -# 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 12 -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing @@ -169,7 +159,7 @@ # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was @@ -182,12 +172,13 @@ AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], @@ -195,8 +186,8 @@ # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're @@ -236,16 +227,16 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -254,8 +245,8 @@ test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else @@ -263,7 +254,7 @@ fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -311,7 +302,7 @@ # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl @@ -321,9 +312,13 @@ # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' @@ -338,20 +333,18 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ - # Autoconf 2.62 quotes --file arguments for eval, but not when files + # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in @@ -364,7 +357,7 @@ # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but + # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. @@ -376,21 +369,19 @@ continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. + # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` @@ -408,7 +399,7 @@ # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will +# is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], @@ -418,18 +409,21 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 16 - # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -442,7 +436,7 @@ # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.62])dnl +[AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -471,31 +465,40 @@ # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AM_PROG_MKDIR_P])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl @@ -506,34 +509,78 @@ [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) -_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl -dnl The `parallel-tests' driver may need to know about EXEEXT, so add the -dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro -dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) -dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -555,15 +602,12 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, -# Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -577,16 +621,14 @@ install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi -AC_SUBST(install_sh)]) +AC_SUBST([install_sh])]) -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], @@ -602,14 +644,12 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 - # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. @@ -627,7 +667,7 @@ _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. +# Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include @@ -654,15 +694,12 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 6 - # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], @@ -670,11 +707,10 @@ $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) - # AM_MISSING_HAS_RUN # ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl @@ -687,54 +723,22 @@ esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) + AC_MSG_WARN(['missing' script is too old or missing]) fi ]) -# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, -# Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_PROG_MKDIR_P -# --------------- -# Check for `mkdir -p'. -AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) - # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 - # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], @@ -744,7 +748,7 @@ # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ @@ -758,24 +762,82 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Check to make sure that the build environment is sane. -*- Autoconf -*- +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 -# Free Software Foundation, Inc. +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -786,32 +848,40 @@ esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$[2]" = conftest.file ) then @@ -821,31 +891,50 @@ AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -AC_MSG_RESULT(yes)]) +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) -# Copyright (C) 2009, 2011 Free Software Foundation, Inc. +# Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT -# (`yes' being less verbose, `no' or empty being verbose). +# ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], -[ --enable-silent-rules less verbose build output (undo: `make V=1') - --disable-silent-rules verbose build output (undo: `make V=0')]) -case $enable_silent_rules in -yes) AM_DEFAULT_VERBOSITY=0;; -no) AM_DEFAULT_VERBOSITY=1;; -*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl -dnl A few `make' implementations (e.g., NonStop OS and NextStep) +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} @@ -863,7 +952,7 @@ am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then - dnl Using `$V' instead of `$(V)' breaks IRIX make. + dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else @@ -880,44 +969,40 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_PROG_INSTALL_STRIP # --------------------- -# One issue with vendor `install' (even GNU) is that you can't +# One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize +# always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. +# Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 - # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. @@ -931,18 +1016,16 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. +# Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory @@ -952,76 +1035,114 @@ # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar +# AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. + +# We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR diff -Nru cloog-0.18.2/autoconf/compile cloog-0.18.4/autoconf/compile --- cloog-0.18.2/autoconf/compile 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/autoconf/compile 2014-10-02 14:14:47.000000000 +0000 @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program 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 2, or (at your option) +# any later version. +# +# This program 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 this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru cloog-0.18.2/autoconf/config.sub cloog-0.18.4/autoconf/config.sub --- cloog-0.18.2/autoconf/config.sub 2013-12-18 12:36:05.000000000 +0000 +++ cloog-0.18.4/autoconf/config.sub 2014-10-02 14:14:47.000000000 +0000 @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2013-10-01' +timestamp='2013-08-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -265,7 +265,6 @@ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ @@ -325,7 +324,7 @@ c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -382,7 +381,6 @@ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ - | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ diff -Nru cloog-0.18.2/autoconf/depcomp cloog-0.18.4/autoconf/depcomp --- cloog-0.18.2/autoconf/depcomp 2013-12-18 12:36:08.000000000 +0000 +++ cloog-0.18.4/autoconf/depcomp 2014-10-02 14:14:47.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2011-12-04.11; # UTC +scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,9 +27,9 @@ case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] @@ -40,8 +39,8 @@ Environment variables: depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. @@ -57,6 +56,66 @@ ;; esac +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 @@ -69,6 +128,9 @@ rm -f "$tmpdepfile" +# Avoid interferences from the environment. +gccflag= dashmflag= + # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case @@ -80,26 +142,32 @@ fi if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc fi case "$depmode" in @@ -122,8 +190,7 @@ done "$@" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -131,13 +198,17 @@ ;; gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then @@ -145,33 +216,31 @@ fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. + # The second -e expression handles DOS-style file names with drive + # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. +## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory +## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -189,8 +258,7 @@ "$@" -MDupdate "$tmpdepfile" fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -198,43 +266,41 @@ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the + # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" + make_dummy_depfile fi rm -f "$tmpdepfile" ;; +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the + # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u @@ -247,9 +313,7 @@ "$@" -M fi stat=$? - - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi @@ -258,44 +322,100 @@ do test -f "$tmpdepfile" && break done - if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : + # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -307,8 +427,8 @@ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -319,9 +439,8 @@ # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d @@ -332,8 +451,7 @@ "$@" +Maked fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi @@ -343,77 +461,61 @@ test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" else - echo "#dummy" > "$depfile" + make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mechanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; msvc7) if test "$libtool" = yes; then @@ -424,8 +526,7 @@ "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" - if test "$stat" = 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -443,14 +544,15 @@ p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g -s/\(.*\)/ \1 \\/p +s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { - s/.*/ / + s/.*/'"$tab"'/ G p }' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; @@ -478,7 +580,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -498,18 +600,18 @@ done test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' + # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -562,11 +664,12 @@ # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; @@ -583,7 +686,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -602,10 +705,10 @@ esac done - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" @@ -637,23 +740,23 @@ shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; + set fnord "$@" + shift + shift + ;; *) - set fnord "$@" "$arg" - shift - shift - ;; + set fnord "$@" "$arg" + shift + shift + ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; diff -Nru cloog-0.18.2/autoconf/ltmain.sh cloog-0.18.4/autoconf/ltmain.sh --- cloog-0.18.2/autoconf/ltmain.sh 2013-12-18 12:36:05.000000000 +0000 +++ cloog-0.18.4/autoconf/ltmain.sh 2014-10-02 14:14:44.000000000 +0000 @@ -1,10 +1,9 @@ -#! /bin/sh -# libtool (GNU libtool) 2.4.2.418 -# Provide generalized library-building support services. +# libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -24,2013 +23,881 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -PROGRAM=libtool -PACKAGE=libtool -VERSION=2.4.2.418 -package_revision=2.4.2.418 - - -## ------ ## -## Usage. ## -## ------ ## - -# Run './libtool --help' for help with using this script from the -# command line. - - -## ------------------------------- ## -## User overridable command paths. ## -## ------------------------------- ## - -# After configure completes, it has a better idea of some of the -# shell tools we need than the defaults used by the functions shared -# with bootstrap, so set those here where they can still be over- -# ridden by the user, but otherwise take precedence. - -: ${AUTOCONF="autoconf"} -: ${AUTOMAKE="automake"} - - -## -------------------------- ## -## Source external libraries. ## -## -------------------------- ## - -# Much of our low-level functionality needs to be sourced from external -# libraries, which are installed to $pkgauxdir. - -# Set a version string for this script. -scriptversion=2013-08-23.20; # UTC - -# General shell script boiler plate, and helper functions. -# Written by Gary V. Vaughan, 2004 - -# Copyright (C) 2004-2013 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program 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 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES 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 this program. If not, see . - -# Please report bugs or propose patches to gary@gnu.org. +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -## ------ ## -## Usage. ## -## ------ ## - -# Evaluate this file near the top of your script to gain access to -# the functions and variables defined here: +# Usage: $progname [OPTION]... [MODE-ARG]... # -# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# Provide generalized library-building support services. # -# If you need to override any of the default environment variable -# settings, do that before evaluating this file. - +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --no-warn don't display warning messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . -## -------------------- ## -## Shell normalisation. ## -## -------------------- ## - -# Some shells need a little help to be as Bourne compatible as possible. -# Before doing anything else, make sure all that help has been provided! +PROGRAM=libtool +PACKAGE=libtool +VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1" +TIMESTAMP="" +package_revision=1.3337 -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} -# NLS nuisances: We save the old values in case they are required later. -_G_user_locale= -_G_safe_locale= -for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do - eval "if test set = \"\${$_G_var+set}\"; then - save_$_G_var=\$$_G_var - $_G_var=C - export $_G_var - _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" - _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +$lt_unset CDPATH -# Make sure IFS has a sensible default -sp=' ' -nl=' -' -IFS="$sp $nl" -# There are still modern systems that have problems with 'echo' mis- -# handling backslashes, among others, so make sure $bs_echo is set to a -# command that correctly interprets backslashes. -# (this code from Autoconf 2.68) - -# Printing a long string crashes Solaris 7 /usr/bin/printf. -bs_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo -bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $bs_echo`" = "X$bs_echo") 2>/dev/null; then - bs_echo='print -r --' - bs_echo_n='print -rn --' -elif (test "X`printf %s $bs_echo`" = "X$bs_echo") 2>/dev/null; then - bs_echo='printf %s\n' - bs_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $bs_echo) 2>/dev/null`" = "X-n $bs_echo"; then - bs_echo_body='eval /usr/ucb/echo -n "$1$nl"' - bs_echo_n='/usr/ucb/echo -n' - else - bs_echo_body='eval expr "X$1" : "X\\(.*\\)"' - bs_echo_n_body='eval - arg=$1; - case $arg in #( - *"$nl"*) - expr "X$arg" : "X\\(.*\\)$nl"; - arg=`expr "X$arg" : ".*$nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$nl" - ' - export bs_echo_n_body - bs_echo_n='sh -c $bs_echo_n_body bs_echo' - fi - export bs_echo_body - bs_echo='sh -c $bs_echo_body bs_echo' -fi +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" -## ------------------------------- ## -## User overridable command paths. ## -## ------------------------------- ## - -# All uppercase variable names are used for environment variables. These -# variables can be overridden by the user before calling a script that -# uses them if a suitable command of that name is not already available -# in the command search PATH. : ${CP="cp -f"} -: ${ECHO="$bs_echo"} -: ${EGREP="grep -E"} -: ${FGREP="grep -F"} -: ${GREP="grep"} -: ${LN_S="ln -s"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} -: ${SED="sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. -## -------------------- ## -## Useful sed snippets. ## -## -------------------- ## +exit_status=$EXIT_SUCCESS -sed_dirname='s|/[^/]*$||' -sed_basename='s|^.*/||' +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s|\([`"$\\]\)|\\\1|g' +dirname="s,/[^/]*$,," +basename="s,^.*/,," -# Same as above, but do not quote variable references. -sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation -# Sed substitution that turns a string into a regex matching for the -# string literally. -sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' -# Sed substitution that converts a w32 file name or path -# that contains forward slashes, into one that contains -# (escaped) backslashes. A very naive implementation. -sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation -# Re-'\' parameter expansions in output of sed_double_quote_subst that -# were '\'-ed in input to the same. If an odd number of '\' preceded a -# '$' in input to sed_double_quote_subst, that '$' was protected from -# expansion. Since each input '\' is now two '\'s, look for any number -# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. -_G_bs='\\' -_G_bs2='\\\\' -_G_bs4='\\\\\\\\' -_G_dollar='\$' -sed_double_backslash="\ - s/$_G_bs4/&\\ -/g - s/^$_G_bs2$_G_dollar/$_G_bs&/ - s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g - s/\n//g" +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation -## ----------------- ## -## Global variables. ## -## ----------------- ## - -# Except for the global variables explicitly listed below, the following -# functions in the '^func_' namespace, and the '^require_' namespace -# variables initialised in the 'Resource management' section, sourcing -# this file will not pollute your global namespace with anything -# else. There's no portable way to scope variables in Bourne shell -# though, so actually running these functions will sometimes place -# results into a variable named after the function, and often use -# temporary variables in the '^_G_' namespace. If you are careful to -# avoid using those namespaces casually in your sourcing script, things -# should continue to work as you expect. And, of course, you can freely -# overwrite any of the functions or variables defined here before -# calling anything to customize them. -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation -# Allow overriding, eg assuming that you follow the convention of -# putting '$debug_cmd' at the start of all your functions, you can get -# bash to show function call trace with: -# -# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name -debug_cmd=${debug_cmd-":"} -exit_cmd=: -# By convention, finish your script with: -# -# exit $exit_status -# -# so that you can set exit_status to non-zero if you want to indicate -# something went wrong during execution without actually bailing out at -# the point of failure. -exit_status=$EXIT_SUCCESS +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath=$0 +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done -# The name of this program. -progname=`$bs_echo "$progpath" |$SED "$sed_basename"` + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result -# Make sure we have an absolute progpath for reexecution: +# Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) - progdir=`$bs_echo "$progpath" |$SED "$sed_dirname"` + progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` - progpath=$progdir/$progname + progpath="$progdir/$progname" ;; *) - _G_IFS=$IFS + save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do - IFS=$_G_IFS + IFS="$save_IFS" test -x "$progdir/$progname" && break done - IFS=$_G_IFS + IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` - progpath=$progdir/$progname + progpath="$progdir/$progname" ;; esac +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' -## ----------------- ## -## Standard options. ## -## ----------------- ## - -# The following options affect the operation of the functions defined -# below, and should be set appropriately depending on run-time para- -# meters passed on the command line. +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" +# Standard options: opt_dry_run=false +opt_help=false opt_quiet=false opt_verbose=false +opt_warning=: -# Categories 'all' and 'none' are always available. Append any others -# you will pass as the first argument to func_warning from your own -# code. -warning_categories= - -# By default, display warnings according to 'opt_warning_types'. Set -# 'warning_func' to ':' to elide all warnings, or func_fatal_error to -# treat the next displayed warning as a fatal error. -warning_func=func_warn_and_continue - -# Set to 'all' to display all warnings, 'none' to suppress all -# warnings, or a space delimited list of some subset of -# 'warning_categories' to display only the listed warnings. -opt_warning_types=all - - -## -------------------- ## -## Resource management. ## -## -------------------- ## - -# This section contains definitions for functions that each ensure a -# particular resource (a file, or a non-empty configuration variable for -# example) is available, and if appropriate to extract default values -# from pertinent package files. Call them using their associated -# 'require_*' variable to ensure that they are executed, at most, once. -# -# It's entirely deliberate that calling these functions can set -# variables that don't obey the namespace limitations obeyed by the rest -# of this file, in order that that they be as useful as possible to -# callers. - - -# require_term_colors -# ------------------- -# Allow display of bold text on terminals that support it. -require_term_colors=func_require_term_colors -func_require_term_colors () -{ - $debug_cmd - - test -t 1 && { - # COLORTERM and USE_ANSI_COLORS environment variables take - # precedence, because most terminfo databases neglect to describe - # whether color sequences are supported. - test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} - - if test 1 = "$USE_ANSI_COLORS"; then - # Standard ANSI escape sequences - tc_reset='' - tc_bold=''; tc_standout='' - tc_red=''; tc_green='' - tc_blue=''; tc_cyan='' - else - # Otherwise trust the terminfo database after all. - test -n "`tput sgr0 2>/dev/null`" && { - tc_reset=`tput sgr0` - test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` - tc_standout=$tc_bold - test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` - test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` - test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` - test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` - test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` - } - fi - } - - require_term_colors=: +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} -## ----------------- ## -## Function library. ## -## ----------------- ## - -# This section contains a variety of useful functions to call in your -# scripts. Take note of the portable wrappers for features provided by -# some modern shells, which will fall back to slower equivalents on -# less featureful shells. - - -# func_append VAR VALUE -# --------------------- -# Append VALUE onto the existing contents of VAR. - - # We should try to minimise forks, especially on Windows where they are - # unreasonably slow, so skip the feature probes when bash or zsh are - # being used: - if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then - : ${_G_HAVE_ARITH_OP="yes"} - : ${_G_HAVE_XSI_OPS="yes"} - # The += operator was introduced in bash 3.1 - case $BASH_VERSION in - [12].* | 3.0 | 3.0*) ;; - *) - : ${_G_HAVE_PLUSEQ_OP="yes"} - ;; - esac - fi - - # _G_HAVE_PLUSEQ_OP - # Can be empty, in which case the shell is probed, "yes" if += is - # useable or anything else if it does not work. - test -z "$_G_HAVE_PLUSEQ_OP" \ - && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ - && _G_HAVE_PLUSEQ_OP=yes - -if test yes = "$_G_HAVE_PLUSEQ_OP" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_append () - { - $debug_cmd - - eval "$1+=\$2" - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_append () - { - $debug_cmd - - eval "$1=\$$1\$2" - } -fi - - -# func_append_quoted VAR VALUE -# ---------------------------- -# Quote VALUE and append to the end of shell variable VAR, separated -# by a space. -if test yes = "$_G_HAVE_PLUSEQ_OP"; then - eval 'func_append_quoted () - { - $debug_cmd - - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" - }' -else - func_append_quoted () - { - $debug_cmd - - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" - } -fi - - -# func_append_uniq VAR VALUE -# -------------------------- -# Append unique VALUE onto the existing contents of VAR, assuming -# entries are delimited by the first character of VALUE. For example: -# -# func_append_uniq options " --another-option option-argument" -# -# will only append to $options if " --another-option option-argument " -# is not already present somewhere in $options already (note spaces at -# each end implied by leading space in second argument). -func_append_uniq () -{ - $debug_cmd - - eval _G_current_value='`$bs_echo $'$1'`' - _G_delim=`expr "$2" : '\(.\)'` - - case $_G_delim$_G_current_value$_G_delim in - *"$2$_G_delim"*) ;; - *) func_append "$@" ;; - esac + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : } - -# func_arith TERM... -# ------------------ -# Set func_arith_result to the result of evaluating TERMs. - test -z "$_G_HAVE_ARITH_OP" \ - && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ - && _G_HAVE_ARITH_OP=yes - -if test yes = "$_G_HAVE_ARITH_OP"; then - eval 'func_arith () - { - $debug_cmd - - func_arith_result=$(( $* )) - }' -else - func_arith () - { - $debug_cmd - - func_arith_result=`expr "$@"` - } -fi - - -# func_basename FILE -# ------------------ -# Set func_basename_result to FILE with everything up to and including -# the last / stripped. -if test yes = "$_G_HAVE_XSI_OPS"; then - # If this shell supports suffix pattern removal, then use it to avoid - # forking. Hide the definitions single quotes in case the shell chokes - # on unsupported syntax... - _b='func_basename_result=${1##*/}' - _d='case $1 in - */*) func_dirname_result=${1%/*}$2 ;; - * ) func_dirname_result=$3 ;; - esac' - -else - # ...otherwise fall back to using sed. - _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' - _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` - if test "X$func_dirname_result" = "X$1"; then - func_dirname_result=$3 - else - func_append func_dirname_result "$2" - fi' -fi - -eval 'func_basename () +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () { - $debug_cmd - - '"$_b"' -}' + $ECHO "$*" +} +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 +} -# func_dirname FILE APPEND NONDIR_REPLACEMENT -# ------------------------------------------- -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -eval 'func_dirname () +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () { - $debug_cmd + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 - '"$_d"' -}' + # bash bug again: + : +} +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} -# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT -# -------------------------------------------------------- -# Perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# For efficiency, we do not delegate to the functions above but instead -# duplicate the functionality here. -eval 'func_dirname_and_basename () -{ - $debug_cmd - - '"$_b"' - '"$_d"' -}' - - -# func_echo ARG... -# ---------------- -# Echo program name prefixed message. -func_echo () -{ - $debug_cmd - - _G_message=$* - - func_echo_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_IFS - $bs_echo "$progname: $_G_line" - done - IFS=$func_echo_IFS -} - - -# func_echo_all ARG... -# -------------------- -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - - -# func_echo_infix_1 INFIX ARG... -# ------------------------------ -# Echo program name, followed by INFIX on the first line, with any -# additional lines not showing INFIX. -func_echo_infix_1 () -{ - $debug_cmd - - $require_term_colors - - _G_infix=$1; shift - _G_indent=$_G_infix - _G_prefix="$progname: $_G_infix: " - _G_message=$* - - # Strip color escape sequences before counting printable length - for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" - do - test -n "$_G_tc" && { - _G_esc_tc=`$bs_echo "$_G_tc" | sed "$sed_make_literal_regex"` - _G_indent=`$bs_echo "$_G_indent" | sed "s|$_G_esc_tc||g"` - } - done - _G_indent="$progname: "`echo "$_G_indent" | sed 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes - - func_echo_infix_1_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_infix_1_IFS - $bs_echo "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 - _G_prefix=$_G_indent - done - IFS=$func_echo_infix_1_IFS -} - - -# func_error ARG... -# ----------------- -# Echo program name prefixed message to standard error. -func_error () -{ - $debug_cmd - - $require_term_colors - - func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 -} - - -# func_fatal_error ARG... -# ----------------------- -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - $debug_cmd - - func_error "$*" - exit $EXIT_FAILURE -} - - -# func_grep EXPRESSION FILENAME -# ----------------------------- -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $debug_cmd - - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_len STRING -# --------------- -# Set func_len_result to the length of STRING. STRING may not -# start with a hyphen. - test -z "$_G_HAVE_XSI_OPS" \ - && (eval 'x=a/b/c; - test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ - && _G_HAVE_XSI_OPS=yes - -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_len () - { - $debug_cmd - - func_len_result=${#1} - }' -else - func_len () - { - $debug_cmd - - func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` - } -fi - - -# func_mkdir_p DIRECTORY-PATH -# --------------------------- -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - $debug_cmd - - _G_directory_path=$1 - _G_dir_list= - - if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then - - # Protect directory names starting with '-' - case $_G_directory_path in - -*) _G_directory_path=./$_G_directory_path ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$_G_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - _G_dir_list=$_G_directory_path:$_G_dir_list - - # If the last portion added has no slash in it, the list is done - case $_G_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` - done - _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` - - func_mkdir_p_IFS=$IFS; IFS=: - for _G_dir in $_G_dir_list; do - IFS=$func_mkdir_p_IFS - # mkdir can fail with a 'File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$_G_dir" 2>/dev/null || : - done - IFS=$func_mkdir_p_IFS - - # Bail out if we (or some other process) failed to create a directory. - test -d "$_G_directory_path" || \ - func_fatal_error "Failed to create '$1'" - fi -} - - -# func_mktempdir [BASENAME] -# ------------------------- -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, BASENAME is the basename for that directory. -func_mktempdir () -{ - $debug_cmd - - _G_template=${TMPDIR-/tmp}/${1-$progname} - - if test : = "$opt_dry_run"; then - # Return a directory name, but don't create it in dry-run mode - _G_tmpdir=$_G_template-$$ - else - - # If mktemp works, use that first and foremost - _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` - - if test ! -d "$_G_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - _G_tmpdir=$_G_template-${RANDOM-0}$$ - - func_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$_G_tmpdir" - umask $func_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$_G_tmpdir" || \ - func_fatal_error "cannot create temporary directory '$_G_tmpdir'" - fi - - $ECHO "$_G_tmpdir" -} - - -# func_normal_abspath PATH -# ------------------------ -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -func_normal_abspath () -{ - $debug_cmd - - # These SED scripts presuppose an absolute path with a trailing slash. - _G_pathcar='s|^/\([^/]*\).*$|\1|' - _G_pathcdr='s|^/[^/]*||' - _G_removedotparts=':dotsl - s|/\./|/|g - t dotsl - s|/\.$|/|' - _G_collapseslashes='s|/\{1,\}|/|g' - _G_finalslash='s|/*$|/|' - - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` - while :; do - # Processed it all yet? - if test / = "$func_normal_abspath_tpath"; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result"; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} - - -# func_notquiet ARG... -# -------------------- -# Echo program name prefixed message only when not in quiet mode. -func_notquiet () -{ - $debug_cmd - - $opt_quiet || func_echo ${1+"$@"} - - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : -} - - -# func_relative_path SRCDIR DSTDIR -# -------------------------------- -# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. -func_relative_path () -{ - $debug_cmd - - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=$func_dirname_result - if test -z "$func_relative_path_tlibdir"; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done - - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test -n "$func_stripname_result"; then - func_append func_relative_path_result "/$func_stripname_result" - fi - - # Normalisation. If bindir is libdir, return '.' else relative path. - if test -n "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - fi - - test -n "$func_relative_path_result" || func_relative_path_result=. - - : -} - - -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () -{ - $debug_cmd - - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - case $1 in - *[\\\`\"\$]*) - _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; - *) - _G_unquoted_arg=$1 ;; - esac - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" - fi - - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_quoted_arg=\"$_G_unquoted_arg\" - ;; - *) - _G_quoted_arg=$_G_unquoted_arg - ;; - esac - - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" - else - func_append func_quote_for_eval_result "$_G_quoted_arg" - fi - shift - done -} - - -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - $debug_cmd - - case $1 in - *[\\\`\"]*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; - esac - - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_arg=\"$_G_arg\" - ;; - esac - - func_quote_for_expand_result=$_G_arg -} - - -# func_stripname PREFIX SUFFIX NAME -# --------------------------------- -# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_stripname () - { - $debug_cmd - - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary variable first. - func_stripname_result=$3 - func_stripname_result=${func_stripname_result#"$1"} - func_stripname_result=${func_stripname_result%"$2"} - }' -else - func_stripname () - { - $debug_cmd - - case $2 in - .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; - *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; - esac - } -fi - - -# func_show_eval CMD [FAIL_EXP] -# ----------------------------- -# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - $debug_cmd - - _G_cmd=$1 - _G_fail_exp=${2-':'} - - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" - - $opt_dry_run || { - eval "$_G_cmd" - _G_status=$? - if test 0 -ne "$_G_status"; then - eval "(exit $_G_status); $_G_fail_exp" - fi - } -} - - -# func_show_eval_locale CMD [FAIL_EXP] -# ------------------------------------ -# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - $debug_cmd - - _G_cmd=$1 - _G_fail_exp=${2-':'} - - $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - $opt_dry_run || { - eval "$_G_user_locale - $_G_cmd" - _G_status=$? - eval "$_G_safe_locale" - if test 0 -ne "$_G_status"; then - eval "(exit $_G_status); $_G_fail_exp" - fi - } -} - - -# func_tr_sh -# ---------- -# Turn $1 into a string suitable for a shell variable name. -# Result is stored in $func_tr_sh_result. All characters -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, -# if $1 begins with a digit, a '_' is prepended as well. -func_tr_sh () -{ - $debug_cmd - - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` - ;; - * ) - func_tr_sh_result=$1 - ;; - esac -} - - -# func_verbose ARG... -# ------------------- -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $debug_cmd - - $opt_verbose && func_echo "$*" - - : -} - - -# func_warn_and_continue ARG... -# ----------------------------- -# Echo program name prefixed warning message to standard error. -func_warn_and_continue () -{ - $debug_cmd - - $require_term_colors - - func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 -} - - -# func_warning CATEGORY ARG... -# ---------------------------- -# Echo program name prefixed warning message to standard error. Warning -# messages can be filtered according to CATEGORY, where this function -# elides messages where CATEGORY is not listed in the global variable -# 'opt_warning_types'. -func_warning () -{ - $debug_cmd - - # CATEGORY must be in the warning_categories list! - case " $warning_categories " in - *" $1 "*) ;; - *) func_internal_error "invalid warning category '$1'" ;; - esac - - _G_category=$1 - shift - - case " $opt_warning_types " in - *" $_G_category "*) $warning_func ${1+"$@"} ;; - esac -} - - -# func_sort_ver VER1 VER2 -# ----------------------- -# 'sort -V' is not generally available. -# Note this deviates from the version comparison in automake -# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a -# but this should suffice as we won't be specifying old -# version formats or redundant trailing .0 in bootstrap.conf. -# If we did want full compatibility then we should probably -# use m4_version_compare from autoconf. -func_sort_ver () -{ - $debug_cmd - - ver1=$1 - ver2=$2 - - # Split on '.' and compare each component. - i=1 - while :; do - p1=`echo "$ver1" |cut -d. -f$i` - p2=`echo "$ver2" |cut -d. -f$i` - if test ! "$p1"; then - echo "$1 $2" - break - elif test ! "$p2"; then - echo "$2 $1" - break - elif test ! "$p1" = "$p2"; then - if test "$p1" -gt "$p2" 2>/dev/null; then # numeric comparison - echo "$2 $1" - elif test "$p2" -gt "$p1" 2>/dev/null; then # numeric comparison - echo "$1 $2" - else # numeric, then lexicographic comparison - lp=`printf "$p1\n$p2\n" |sort -n |tail -n1` - if test "$lp" = "$p2"; then - echo "$1 $2" - else - echo "$2 $1" - fi - fi - break - fi - i=`expr $i + 1` - done -} - - -# Local variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" -# time-stamp-time-zone: "UTC" -# End: -#! /bin/sh - -# Set a version string for this script. -scriptversion=2012-10-21.11; # UTC - -# A portable, pluggable option parser for Bourne shell. -# Written by Gary V. Vaughan, 2010 - -# Copyright (C) 2010-2013 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program 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 of the License, or -# (at your option) any later version. - -# This program 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 this program. If not, see . - -# Please report bugs or propose patches to gary@gnu.org. - - -## ------ ## -## Usage. ## -## ------ ## - -# This file is a library for parsing options in your shell scripts along -# with assorted other useful supporting features that you can make use -# of too. -# -# For the simplest scripts you might need only: -# -# #!/bin/sh -# . relative/path/to/funclib.sh -# . relative/path/to/options-parser -# scriptversion=1.0 -# func_options ${1+"$@"} -# eval set dummy "$func_options_result"; shift -# ...rest of your script... -# -# In order for the '--version' option to work, you will need to have a -# suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. -# -# For '-h' and '--help' to work, you will also need a one line -# description of your script's purpose in a comment directly above the -# '# Written by ' line, like the one at the top of this file. -# -# The default options also support '--debug', which will turn on shell -# execution tracing (see the comment above debug_cmd below for another -# use), and '--verbose' and the func_verbose function to allow your script -# to display verbose messages only when your user has specified -# '--verbose'. -# -# After sourcing this file, you can plug processing for additional -# options by amending the variables from the 'Configuration' section -# below, and following the instructions in the 'Option parsing' -# section further down. - -## -------------- ## -## Configuration. ## -## -------------- ## - -# You should override these variables in your script after sourcing this -# file so that they reflect the customisations you have added to the -# option parser. - -# The usage line for option parsing errors and the start of '-h' and -# '--help' output messages. You can embed shell variables for delayed -# expansion at the time the message is displayed, but you will need to -# quote other shell meta-characters carefully to prevent them being -# expanded when the contents are evaled. -usage='$progpath [OPTION]...' - -# Short help message in response to '-h' and '--help'. Add to this or -# override it after sourcing this library to reflect the full set of -# options your script accepts. -usage_message="\ - --debug enable verbose shell tracing - -W, --warnings=CATEGORY - report the warnings falling in CATEGORY [all] - -v, --verbose verbosely report processing - --version print version information and exit - -h, --help print short or long help message and exit -" - -# Additional text appended to 'usage_message' in response to '--help'. -long_help_message=" -Warning categories include: - 'all' show all warnings - 'none' turn off all the warnings - 'error' warnings are treated as fatal errors" - -# Help message printed before fatal option parsing errors. -fatal_help="Try '\$progname --help' for more information." - - - -## ------------------------- ## -## Hook function management. ## -## ------------------------- ## - -# This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. - -# func_hookable FUNC_NAME -# ----------------------- -# Declare that FUNC_NAME will run hooks added with -# 'func_add_hook FUNC_NAME ...'. -func_hookable () -{ - $debug_cmd - - func_append hookable_fns " $1" -} - - -# func_add_hook FUNC_NAME HOOK_FUNC -# --------------------------------- -# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must -# first have been declared "hookable" by a call to 'func_hookable'. -func_add_hook () -{ - $debug_cmd - - case " $hookable_fns " in - *" $1 "*) ;; - *) func_fatal_error "'$1' does not accept hook functions." ;; - esac - - eval func_append ${1}_hooks '" $2"' -} - - -# func_remove_hook FUNC_NAME HOOK_FUNC -# ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. -func_remove_hook () -{ - $debug_cmd - - eval ${1}_hooks='`$bs_echo "\$'$1'_hooks" |$SED "s| '$2'||"`' -} - - -# func_run_hooks FUNC_NAME [ARG]... -# --------------------------------- -# Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more -# than a whitespace-delimited list of legal shell function names, and -# no effort is wasted trying to catch shell meta-characters or preserve -# whitespace. -func_run_hooks () -{ - $debug_cmd - - case " $hookable_fns " in - *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; - esac - - eval _G_hook_fns=\$$1_hooks; shift - - for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift - done - - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result -} - - - -## --------------- ## -## Option parsing. ## -## --------------- ## - -# In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed -# options in '_result', escaped suitably for -# 'eval'. Like this: -# -# my_options_prep () -# { -# $debug_cmd -# -# # Extend the existing usage message. -# usage_message=$usage_message' -# -s, --silent don'\''t print informational messages -# ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result -# } -# func_add_hook func_options_prep my_options_prep -# -# -# my_silent_option () -# { -# $debug_cmd -# -# # Note that for efficiency, we parse as many options as we can -# # recognise in a loop before passing the remainder back to the -# # caller on the first unrecognised argument we encounter. -# while test $# -gt 0; do -# opt=$1; shift -# case $opt in -# --silent|-s) opt_silent=: ;; -# # Separate non-argument short options: -# -s*) func_split_short_opt "$_G_opt" -# set dummy "$func_split_short_opt_name" \ -# "-$func_split_short_opt_arg" ${1+"$@"} -# shift -# ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; -# esac -# done -# -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result -# } -# func_add_hook func_parse_options my_silent_option -# -# -# my_option_validation () -# { -# $debug_cmd -# -# $opt_silent && $opt_verbose && func_fatal_help "\ -# '--silent' and '--verbose' options are mutually exclusive." -# -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result -# } -# func_add_hook func_validate_options my_option_validation -# -# You'll alse need to manually amend $usage_message to reflect the extra -# options you parse. It's preferable to append if you can, so that -# multiple option parsing hooks can be added safely. - - -# func_options [ARG]... -# --------------------- -# All the functions called inside func_options are hookable. See the -# individual implementations for details. -func_hookable func_options -func_options () +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () { - $debug_cmd - - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} - - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} - - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result + func_error ${1+"$@"} + func_fatal_error "$help" } +help="Try \`$progname --help' for more information." ## default -# func_options_prep [ARG]... -# -------------------------- -# All initialisations required before starting the option parse loop. -# Note that when calling hook functions, we pass through the list of -# positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning. -func_hookable func_options_prep -func_options_prep () +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () { - $debug_cmd - - # Option defaults: - opt_verbose=false - opt_warning_types= - - func_run_hooks func_options_prep ${1+"$@"} - - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result + $GREP "$1" "$2" >/dev/null 2>&1 } -# func_parse_options [ARG]... -# --------------------------- -# The main option parsing loop. -func_hookable func_parse_options -func_parse_options () +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () { - $debug_cmd + my_directory_path="$1" + my_dir_list= - func_parse_options_result= + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then - # this just eases exit handling - while test $# -gt 0; do - # Defer to hook functions for initial option parsing, so they - # get priority in the event of reusing an option name. - func_run_hooks func_parse_options ${1+"$@"} + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" - # Break out of the loop if we already parsed every option. - test $# -gt 0 || break + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac - _G_opt=$1 - shift - case $_G_opt in - --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" - $debug_cmd - ;; - - --no-warnings|--no-warning|--no-warn) - set dummy --warnings none ${1+"$@"} - shift - ;; + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` - --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break - case " $warning_categories $1" in - *" $1 "*) - # trailing space prevents matching last $1 above - func_append_uniq opt_warning_types " $1" - ;; - *all) - opt_warning_types=$warning_categories - ;; - *none) - opt_warning_types=none - warning_func=: - ;; - *error) - opt_warning_types=$warning_categories - warning_func=func_fatal_error - ;; - *) - func_fatal_error \ - "unsupported warning category: '$1'" - ;; - esac - shift - ;; - - --verbose|-v) opt_verbose=: ;; - --version) func_version ;; - -\?|-h) func_usage ;; - --help) func_help ;; - - # Separate optargs to long options (plugins may need this): - --*=*) func_split_equals "$_G_opt" - set dummy "$func_split_equals_lhs" \ - "$func_split_equals_rhs" ${1+"$@"} - shift - ;; - - # Separate optargs to short options: - -W*) - func_split_short_opt "$_G_opt" - set dummy "$func_split_short_opt_name" \ - "$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - # Separate non-argument short options: - -\?*|-h*|-v*|-x*) - func_split_short_opt "$_G_opt" - set dummy "$func_split_short_opt_name" \ - "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - --) break ;; - -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; - esac - done + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi } -# func_validate_options [ARG]... -# ------------------------------ -# Perform any sanity checks on option settings and/or unconsumed -# arguments. -func_hookable func_validate_options -func_validate_options () +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () { - $debug_cmd - - # Display all warnings if -W was not given. - test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" + my_template="${TMPDIR-/tmp}/${1-$progname}" - func_run_hooks func_validate_options ${1+"$@"} - - # Bail if the options were screwed! - $exit_cmd $EXIT_FAILURE + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result -} + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi -## ------------------## -## Helper functions. ## -## ------------------## + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi -# This section contains the helper functions used by the rest of the -# hookable option parser framework in ascii-betical order. + $ECHO "$my_tmpdir" +} -# func_fatal_help ARG... -# ---------------------- -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () { - $debug_cmd + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac - eval \$bs_echo \""Usage: $usage"\" - eval \$bs_echo \""$fatal_help"\" - func_error ${1+"$@"} - exit $EXIT_FAILURE + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac } -# func_help -# --------- -# Echo long help message to standard output and exit. -func_help () +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () { - $debug_cmd + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac - func_usage_message - $bs_echo "$long_help_message" - exit 0 + func_quote_for_expand_result="$my_arg" } -# func_missing_arg ARGNAME -# ------------------------ -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () { - $debug_cmd + my_cmd="$1" + my_fail_exp="${2-:}" - func_error "Missing argument for '$1'." - exit_cmd=exit -} + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} -# func_split_equals STRING -# ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. -test -z "$_G_HAVE_XSI_OPS" \ - && (eval 'x=a/b/c; - test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ - && _G_HAVE_XSI_OPS=yes - -if test yes = "$_G_HAVE_XSI_OPS" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_split_equals () - { - $debug_cmd - func_split_equals_lhs=${1%%=*} - func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_split_equals () - { - $debug_cmd +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" - func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` - func_split_equals_rhs= - test "x$func_split_equals_lhs" = "x$1" \ - || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` - } -fi #func_split_equals + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} -# func_split_short_opt SHORTOPT -# ----------------------------- -# Set func_split_short_opt_name and func_split_short_opt_arg shell -# variables after splitting SHORTOPT after the 2nd character. -if test yes = "$_G_HAVE_XSI_OPS" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_split_short_opt () - { - $debug_cmd +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} - func_split_short_opt_arg=${1#??} - func_split_short_opt_name=${1%"$func_split_short_opt_arg"} - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_split_short_opt () - { - $debug_cmd - func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` - func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` - } -fi #func_split_short_opt +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $opt_debug + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} # func_usage -# ---------- # Echo short help message to standard output and exit. func_usage () { - $debug_cmd + $opt_debug - func_usage_message - $bs_echo "Run '$progname --help |${PAGER-more}' for full usage" - exit 0 + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? } +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $opt_debug + + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ + p + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} -# func_usage_message -# ------------------ -# Echo short help message to standard output. -func_usage_message () +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () { - $debug_cmd + $opt_debug - eval \$bs_echo \""Usage: $usage"\" - echo - $SED -n 's|^# || - /^Written by/{ - x;p;x - } - h - /^Written by/q' < "$progpath" - echo - eval \$bs_echo \""$usage_message"\" + func_error "missing argument for $1." + exit_cmd=exit } -# func_version -# ------------ -# Echo version message to standard output and exit. -func_version () +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () { - $debug_cmd + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' - printf '%s\n' "$progname $scriptversion" - $SED -n '/^##/q - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more - } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| - p - } - /^# Written by / { - s|^# || - p - } - /^warranty; /q' < "$progpath" + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation - exit $? -} +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' -# Local variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" -# time-stamp-time-zone: "UTC" -# End: + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation -# Set a version string. -scriptversion='(GNU libtool) 2.4.2.418' +exit_cmd=: -# func_echo ARG... -# ---------------- -# Libtool also displays the current mode in messages, so override -# funclib.sh func_echo with this custom definition. -func_echo () -{ - $debug_cmd - _G_message=$* - func_echo_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_IFS - $bs_echo "$progname${opt_mode+: $opt_mode}: $_G_line" - done - IFS=$func_echo_IFS -} +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" -# func_warning ARG... -# ------------------- -# Libtool warnings are not categorized, so override funclib.sh -# func_warning with this simpler definition. -func_warning () -{ - $debug_cmd +# Global variables. +nonopt= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 - $warning_func ${1+"$@"} -} +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}=\$${1}\${2}" +} # func_append may be replaced by extended shell implementation -## ---------------- ## -## Options parsing. ## -## ---------------- ## - -# Hook in the functions to make sure our own options are parsed during -# the option parsing loop. - -usage='$progpath [OPTION]... [MODE-ARG]...' - -# Short help message in response to '-h'. -usage_message="Options: - --config show all configuration variables - --debug enable verbose shell tracing - -n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --mode=MODE use operation mode MODE - --no-warnings equivalent to '-Wnone' - --preserve-dup-deps don't remove duplicate dependency libraries - --quiet, --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - -v, --verbose print more informational messages than default - --version print version information - -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] - -h, --help, --help-all print short, long, or detailed help message -" +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}=\$${1}\\ \$func_quote_for_eval_result" +} # func_append_quoted may be replaced by extended shell implementation -# Additional text appended to 'usage_message' in response to '--help'. -long_help_message=$long_help_message" -MODE must be one of the following: +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "${@}"` +} # func_arith may be replaced by extended shell implementation - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. When passed as first option, -'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. -Try '$progname --help --mode=MODE' for a more detailed description of MODE. - -When reporting a bug, please describe a test case to reproduce it and -include the following information: - - host-triplet: $host - shell: $SHELL - compiler: $LTCC - compiler flags: $LTCFLAGS - linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.2.418 - automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` - autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` - -Report bugs to . -GNU libtool home page: . -General help using GNU software: ." - - -# func_lo2o OBJECT-NAME -# --------------------- -# Transform OBJECT-NAME from a '.lo' suffix to the platform specific -# object suffix. -lo2o=s/\\.lo\$/.$objext/ -o2lo=s/\\.$objext\$/.lo/ +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_lo2o () - { - case $1 in - *.lo) func_lo2o_result=${1%.lo}.$objext ;; - * ) func_lo2o_result=$1 ;; - esac - }' - # func_xform LIBOBJ-OR-SOURCE - # --------------------------- - # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) - # suffix to a '.lo' libtool-object suffix. - eval 'func_xform () - { - func_xform_result=${1%.*}.lo - }' -else - # ...otherwise fall back to using sed. - func_lo2o () - { - func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` - } +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation - func_xform () - { - func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` - } -fi + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation -# func_fatal_configuration ARG... -# ------------------------------- +# func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { - func__fatal_error ${1+"$@"} \ - "See the $PACKAGE documentation for more information." \ - "Fatal configuration error." + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." } # func_config -# ----------- # Display the configuration for all the tags in this script. func_config () { @@ -2048,19 +915,17 @@ exit $? } - # func_features -# ------------- # Display the features supported by this script. func_features () { echo "host: $host" - if test yes = "$build_libtool_libs"; then + if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi - if test yes = "$build_old_libs"; then + if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" @@ -2069,325 +934,298 @@ exit $? } - -# func_enable_tag TAGNAME -# ----------------------- +# func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { - # Global variable: - tagname=$1 + # Global variable: + tagname="$1" - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf=/$re_begincf/,/$re_endcf/p - - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac } - # func_check_version_match -# ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF - else - cat >&2 <<_LT_EOF + else + cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF - fi - else - cat >&2 <<_LT_EOF + fi + else + cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF - fi - - exit $EXIT_MISMATCH fi -} - - -# libtool_options_prep [ARG]... -# ----------------------------- -# Preparation for options parsed by libtool. -libtool_options_prep () -{ - $debug_mode - - # Option defaults: - opt_config=false - opt_dlopen= - opt_dry_run=false - opt_help=false - opt_mode= - opt_preserve_dup_deps=false - opt_quiet=false - - nonopt= - preserve_args= - - # Shorthand for --mode=foo, only valid as the first argument - case $1 in - clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; - compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; - execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; - finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; - install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; - link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; - uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; - esac - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + exit $EXIT_MISMATCH + fi } -func_add_hook func_options_prep libtool_options_prep - - -# libtool_parse_options [ARG]... -# --------------------------------- -# Provide handling for libtool specific options. -libtool_parse_options () -{ - $debug_cmd - # Perform our own loop to consume as many options as possible in - # each iteration. - while test $# -gt 0; do - _G_opt=$1 - shift - case $_G_opt in - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - - --config) func_config ;; - - --dlopen|-dlopen) - opt_dlopen="${opt_dlopen+$opt_dlopen -}$1" - shift - ;; - - --preserve-dup-deps) - opt_preserve_dup_deps=: ;; - - --features) func_features ;; - - --finish) set dummy --mode finish ${1+"$@"}; shift ;; - - --help) opt_help=: ;; - - --help-all) opt_help=': help-all' ;; - - --mode) test $# = 0 && func_missing_arg $_G_opt && break - opt_mode=$1 - case $1 in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $_G_opt" - exit_cmd=exit - break - ;; - esac - shift - ;; - - --no-silent|--no-quiet) - opt_quiet=false - func_append preserve_args " $_G_opt" - ;; - - --no-warnings|--no-warning|--no-warn) - opt_warning=false - func_append preserve_args " $_G_opt" - ;; - - --no-verbose) - opt_verbose=false - func_append preserve_args " $_G_opt" - ;; - - --silent|--quiet) - opt_quiet=: - opt_verbose=false - func_append preserve_args " $_G_opt" - ;; - - --tag) test $# = 0 && func_missing_arg $_G_opt && break - opt_tag=$1 - func_append preserve_args " $_G_opt $1" - func_enable_tag "$1" - shift - ;; - - --verbose|-v) opt_quiet=false - opt_verbose=: - func_append preserve_args " $_G_opt" - ;; - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; - esac - done +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result -} -func_add_hook func_parse_options libtool_parse_options +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false -# libtool_validate_options [ARG]... -# --------------------------------- -# Perform any sanity checks on option settings and/or unconsumed -# arguments. -libtool_validate_options () +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. { - # save first non-option argument - if test 0 -lt $#; then - nonopt=$1 - shift - fi + # this just eases exit handling + while test $# -gt 0; do + opt="$1" + shift + case $opt in + --debug|-x) opt_debug='set -x' + func_echo "enabling shell trace mode" + $opt_debug + ;; + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" + shift + ;; + --preserve-dup-deps) + opt_preserve_dup_deps=: + ;; + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) + opt_silent=false +func_append preserve_args " $opt" + ;; + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" + shift + ;; + + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + + # Separate optargs to long options: + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done - # preserve --debug - test : = "$debug_cmd" || func_append preserve_args " --debug" + # Validate options: - case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi - $opt_help || { - # Sanity checks first: - func_check_version_match - - test yes != "$build_libtool_libs" \ - && test yes != "$build_old_libs" \ - && func_fatal_configuration "not configured to build any kind of library" - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test execute != "$opt_mode"; then - func_error "unrecognized option '-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help=$help - help="Try '$progname --help --mode=$opt_mode' for more information." - } + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac - # Pass back the unparsed argument list - func_quote_for_eval ${1+"$@"} - libtool_validate_options_result=$func_quote_for_eval_result -} -func_add_hook func_validate_options libtool_validate_options + $opt_help || { + # Sanity checks first: + func_check_version_match + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi -# Process options as early as possible so that --help and --version -# can return quickly. -func_options ${1+"$@"} -eval set dummy "$func_options_result"; shift + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } -## ----------- ## -## Main. ## -## ----------- ## -magic='%%%MAGIC variable%%%' -magic_exe='%%%MAGIC EXE variable%%%' + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} -# Global variables. -extracted_archives= -extracted_serial=0 -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} +## ----------- ## +## Main. ## +## ----------- ## # func_lalib_p file -# True iff FILE is a libtool '.la' library or '.lo' object file. +# True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () @@ -2398,12 +1236,12 @@ } # func_lalib_unsafe_p file -# True iff FILE is a libtool '.la' library or '.lo' object file. +# True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be -# fatal anyway. Works if 'file' does not exist. +# fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no @@ -2411,13 +1249,13 @@ for lalib_p_l in 1 2 3 4 do read lalib_p_line - case $lalib_p_line in + case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi - test yes = "$lalib_p" + test "$lalib_p" = yes } # func_ltwrapper_script_p file @@ -2451,7 +1289,7 @@ { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file @@ -2470,13 +1308,11 @@ # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { - $debug_cmd - + $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do - IFS=$sp$nl - eval cmd=\"$cmd\" IFS=$save_ifs + eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs @@ -2488,11 +1324,10 @@ # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing -# 'FILE.' does not work on cygwin managed mounts. +# `FILE.' does not work on cygwin managed mounts. func_source () { - $debug_cmd - + $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; @@ -2519,10 +1354,10 @@ # store the result into func_replace_sysroot_result. func_replace_sysroot () { - case $lt_sysroot:$1 in + case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result='='$func_stripname_result + func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. @@ -2539,8 +1374,7 @@ # arg is usually of the form 'gcc ...' func_infer_tag () { - $debug_cmd - + $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do @@ -2559,7 +1393,7 @@ for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. - eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. @@ -2584,7 +1418,7 @@ # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with '--tag'" + func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi @@ -2600,15 +1434,15 @@ # but don't create it if we're doing a dry run. func_write_libtool_object () { - write_libobj=$1 - if test yes = "$build_libtool_libs"; then - write_lobj=\'$2\' + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' else write_lobj=none fi - if test yes = "$build_old_libs"; then - write_oldobj=\'$3\' + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' else write_oldobj=none fi @@ -2616,7 +1450,7 @@ $opt_dry_run || { cat >${write_libobj}T </dev/null` - if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$sed_naive_backslashify"` + $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi @@ -2681,19 +1514,18 @@ # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { - $debug_cmd - + $opt_debug # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result= + func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result"; then + if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi @@ -2722,8 +1554,7 @@ # environment variable; do not put it in $PATH. func_cygpath () { - $debug_cmd - + $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then @@ -2732,7 +1563,7 @@ fi else func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath @@ -2743,11 +1574,10 @@ # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { - $debug_cmd - + $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 @@ -2758,14 +1588,13 @@ # func_to_host_file_result to ARG1). func_convert_file_check () { - $debug_cmd - - if test -z "$2" && test -n "$1"; then + $opt_debug + if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" - func_error " '$1'" + func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: - func_to_host_file_result=$1 + func_to_host_file_result="$1" fi } # end func_convert_file_check @@ -2777,11 +1606,10 @@ # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { - $debug_cmd - + $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" - func_error " '$3'" + func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. @@ -2790,7 +1618,7 @@ func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else - func_to_host_path_result=$3 + func_to_host_path_result="$3" fi fi } @@ -2802,10 +1630,9 @@ # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { - $debug_cmd - + $opt_debug case $4 in - $1 ) func_to_host_path_result=$3$func_to_host_path_result + $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in @@ -2819,7 +1646,7 @@ ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## -# invoked via '$to_host_file_cmd ARG' +# invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. @@ -2830,8 +1657,7 @@ # in func_to_host_file_result. func_to_host_file () { - $debug_cmd - + $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file @@ -2843,8 +1669,7 @@ # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { - $debug_cmd - + $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 @@ -2862,7 +1687,7 @@ # Copy ARG to func_to_host_file_result. func_convert_file_noop () { - func_to_host_file_result=$1 + func_to_host_file_result="$1" } # end func_convert_file_noop @@ -2873,12 +1698,11 @@ # func_to_host_file_result. func_convert_file_msys_to_w32 () { - $debug_cmd - - func_to_host_file_result=$1 + $opt_debug + func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" - func_to_host_file_result=$func_convert_core_msys_to_w32_result + func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -2890,9 +1714,8 @@ # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { - $debug_cmd - - func_to_host_file_result=$1 + $opt_debug + func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. @@ -2908,12 +1731,11 @@ # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { - $debug_cmd - - func_to_host_file_result=$1 + $opt_debug + func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" - func_to_host_file_result=$func_convert_core_file_wine_to_w32_result + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -2925,13 +1747,12 @@ # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { - $debug_cmd - - func_to_host_file_result=$1 + $opt_debug + func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" - func_to_host_file_result=$func_cygpath_result + func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -2944,14 +1765,13 @@ # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { - $debug_cmd - - func_to_host_file_result=$1 + $opt_debug + func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" - func_to_host_file_result=$func_cygpath_result + func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -2961,7 +1781,7 @@ ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# -# invoked via '$to_host_path_cmd ARG' +# invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. @@ -2985,11 +1805,10 @@ to_host_path_cmd= func_init_to_host_path_cmd () { - $debug_cmd - + $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd=func_convert_path_$func_stripname_result + to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } @@ -2999,8 +1818,7 @@ # in func_to_host_path_result. func_to_host_path () { - $debug_cmd - + $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } @@ -3011,7 +1829,7 @@ # Copy ARG to func_to_host_path_result. func_convert_path_noop () { - func_to_host_path_result=$1 + func_to_host_path_result="$1" } # end func_convert_path_noop @@ -3022,9 +1840,8 @@ # func_to_host_path_result. func_convert_path_msys_to_w32 () { - $debug_cmd - - func_to_host_path_result=$1 + $opt_debug + func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; @@ -3032,7 +1849,7 @@ func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result=$func_convert_core_msys_to_w32_result + func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" @@ -3046,9 +1863,8 @@ # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { - $debug_cmd - - func_to_host_path_result=$1 + $opt_debug + func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" @@ -3067,15 +1883,14 @@ # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { - $debug_cmd - - func_to_host_path_result=$1 + $opt_debug + func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result=$func_convert_core_path_wine_to_w32_result + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" @@ -3089,16 +1904,15 @@ # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { - $debug_cmd - - func_to_host_path_result=$1 + $opt_debug + func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result=$func_cygpath_result + func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" @@ -3113,9 +1927,8 @@ # func_to_host_file_result. func_convert_path_nix_to_cygwin () { - $debug_cmd - - func_to_host_path_result=$1 + $opt_debug + func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them @@ -3124,7 +1937,7 @@ func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result=$func_cygpath_result + func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" @@ -3133,31 +1946,13 @@ # end func_convert_path_nix_to_cygwin -# func_dll_def_p FILE -# True iff FILE is a Windows DLL '.def' file. -# Keep in sync with _LT_DLL_DEF_P in libtool.m4 -func_dll_def_p () -{ - $debug_cmd - - func_dll_def_p_tmp=`$SED -n \ - -e 's/^[ ]*//' \ - -e '/^\(;.*\)*$/d' \ - -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ - -e q \ - "$1"` - test DEF = "$func_dll_def_p_tmp" -} - - # func_mode_compile arg... func_mode_compile () { - $debug_cmd - + $opt_debug # Get the compilation command and the source file. base_compile= - srcfile=$nonopt # always keep a non-empty value in "srcfile" + srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal @@ -3170,12 +1965,12 @@ case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile - lastarg=$arg + lastarg="$arg" arg_mode=normal ;; target ) - libobj=$arg + libobj="$arg" arg_mode=normal continue ;; @@ -3185,7 +1980,7 @@ case $arg in -o) test -n "$libobj" && \ - func_fatal_error "you cannot specify '-o' more than once" + func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; @@ -3214,12 +2009,12 @@ func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= - save_ifs=$IFS; IFS=, + save_ifs="$IFS"; IFS=',' for arg in $args; do - IFS=$save_ifs + IFS="$save_ifs" func_append_quoted lastarg "$arg" done - IFS=$save_ifs + IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result @@ -3232,8 +2027,8 @@ # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # - lastarg=$srcfile - srcfile=$arg + lastarg="$srcfile" + srcfile="$arg" ;; esac # case $arg ;; @@ -3248,13 +2043,13 @@ func_fatal_error "you must specify an argument for -Xcompile" ;; target) - func_fatal_error "you must specify a target with '-o'" + func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" - libobj=$func_basename_result + libobj="$func_basename_result" } ;; esac @@ -3274,7 +2069,7 @@ case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) - func_fatal_error "cannot determine name of library object from '$libobj'" + func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac @@ -3283,8 +2078,8 @@ for arg in $later; do case $arg in -shared) - test yes = "$build_libtool_libs" \ - || func_fatal_configuration "cannot build a shared library" + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; @@ -3310,17 +2105,17 @@ func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && func_warning "libobj name '$libobj' may not contain shell special characters." + && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" - objname=$func_basename_result - xdir=$func_dirname_result - lobj=$xdir$objdir/$objname + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. - if test yes = "$build_old_libs"; then + if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" @@ -3332,16 +2127,16 @@ pic_mode=default ;; esac - if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c - if test no = "$compiler_c_o"; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext - lockfile=$output_obj.lock + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" else output_obj= need_locks=no @@ -3350,12 +2145,12 @@ # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file - if test yes = "$need_locks"; then + if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done - elif test warn = "$need_locks"; then + elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: @@ -3363,7 +2158,7 @@ This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you +your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -3385,11 +2180,11 @@ qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. - if test yes = "$build_libtool_libs"; then + if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile - if test no != "$pic_mode"; then + if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code @@ -3406,7 +2201,7 @@ func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - if test warn = "$need_locks" && + if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: @@ -3417,7 +2212,7 @@ This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you +your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -3433,20 +2228,20 @@ fi # Allow error messages only from the first compilation. - if test yes = "$suppress_opt"; then + if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. - if test yes = "$build_old_libs"; then - if test yes != "$pic_mode"; then + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi - if test yes = "$compiler_c_o"; then + if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi @@ -3455,7 +2250,7 @@ func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - if test warn = "$need_locks" && + if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: @@ -3466,7 +2261,7 @@ This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you +your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -3486,7 +2281,7 @@ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked - if test no != "$need_locks"; then + if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi @@ -3496,7 +2291,7 @@ } $opt_help || { - test compile = "$opt_mode" && func_mode_compile ${1+"$@"} + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () @@ -3516,7 +2311,7 @@ Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE -(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated @@ -3535,16 +2330,16 @@ -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only - -shared do not build a '.o' file suitable for static linking - -static only build a '.o' file suitable for static linking + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler -COMPILE-COMMAND is a command to be used in creating a 'standard' object file +COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix '.c' with the -library object suffix, '.lo'." +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." ;; execute) @@ -3557,7 +2352,7 @@ -dlopen FILE add the directory containing FILE to the library path -This mode sets the library path environment variable according to '-dlopen' +This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated @@ -3576,7 +2371,7 @@ Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use -the '--dry-run' option if you just want to see what would be executed." +the \`--dry-run' option if you just want to see what would be executed." ;; install) @@ -3586,7 +2381,7 @@ Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be -either the 'install' or 'cp' program. +either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: @@ -3612,7 +2407,7 @@ -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) - -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE @@ -3646,20 +2441,20 @@ -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) -All other options (arguments beginning with '-') are ignored. +All other options (arguments beginning with \`-') are ignored. -Every other argument is treated as a filename. Files ending in '.la' are +Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. -If the OUTPUT-FILE ends in '.la', then a libtool library is created, -only library objects ('.lo' files) may be specified, and '-rpath' is +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. -If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created -using 'ar' and 'ranlib', or on Windows using 'lib'. +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. -If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; @@ -3670,7 +2465,7 @@ Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE -(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. @@ -3678,17 +2473,17 @@ ;; *) - func_fatal_help "invalid operation mode '$opt_mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo - $ECHO "Try '$progname --help' for more information about other modes." + $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then - if test : = "$opt_help"; then + if test "$opt_help" = :; then func_mode_help else { @@ -3721,17 +2516,16 @@ # func_mode_execute arg... func_mode_execute () { - $debug_cmd - + $opt_debug # The first argument is the command name. - cmd=$nonopt + cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ - || func_fatal_help "'$file' is not a file" + || func_fatal_help "\`$file' is not a file" dir= case $file in @@ -3741,7 +2535,7 @@ # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ - || func_fatal_help "'$lib' is not a valid libtool archive" + || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= @@ -3752,18 +2546,18 @@ if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ - func_warning "'$file' was not linked with '-export-dynamic'" + func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." - dir=$func_dirname_result + dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; @@ -3771,18 +2565,18 @@ *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." - dir=$func_dirname_result + dir="$func_dirname_result" ;; *) - func_warning "'-dlopen' is ignored for non-libtool libraries and objects" + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir=$absdir + test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then @@ -3794,7 +2588,7 @@ # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. - libtool_execute_magic=$magic + libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= @@ -3807,12 +2601,12 @@ if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. - file=$progdir/$program + file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. - file=$progdir/$program + file="$progdir/$program" fi ;; esac @@ -3820,15 +2614,7 @@ func_append_quoted args "$file" done - if $opt_dry_run; then - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS - else + if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" @@ -3845,18 +2631,25 @@ done # Now prepare to actually exec the command. - exec_cmd=\$cmd$args + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS fi } -test execute = "$opt_mode" && func_mode_execute ${1+"$@"} +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { - $debug_cmd - + $opt_debug libs= libdirs= admincmds= @@ -3870,11 +2663,11 @@ if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else - func_warning "'$opt' is not a valid libtool archive" + func_warning "\`$opt' is not a valid libtool archive" fi else - func_fatal_error "invalid argument '$opt'" + func_fatal_error "invalid argument \`$opt'" fi done @@ -3889,12 +2682,12 @@ # Remove sysroot references if $opt_dry_run; then for lib in $libs; do - echo "removing references to $lt_sysroot and '=' prefixes from $lib" + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do - sed -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done @@ -3919,7 +2712,7 @@ fi # Exit here if they wanted silent mode. - $opt_quiet && exit $EXIT_SUCCESS + $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" @@ -3930,27 +2723,27 @@ echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the '-LLIBDIR'" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the '$shlibpath_var' environment variable" + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then - echo " - add LIBDIR to the '$runpath_var' environment variable" + echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" - $ECHO " - use the '$flag' linker flag" + $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo @@ -3969,20 +2762,18 @@ exit $EXIT_SUCCESS } -test finish = "$opt_mode" && func_mode_finish ${1+"$@"} +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { - $debug_cmd - + $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). - if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac - then + case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " @@ -4009,7 +2800,7 @@ opts= prev= install_type= - isdir=false + isdir=no stripme= no_mode=: for arg @@ -4022,7 +2813,7 @@ fi case $arg in - -d) isdir=: ;; + -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg @@ -4040,7 +2831,7 @@ *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then - if test X-m = "X$prev" && test -n "$install_override_mode"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi @@ -4065,7 +2856,7 @@ func_fatal_help "you must specify an install program" test -n "$prev" && \ - func_fatal_help "the '$prev' option requires an argument" + func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else @@ -4087,19 +2878,19 @@ dest=$func_stripname_result # Check to see that the destination is a directory. - test -d "$dest" && isdir=: - if $isdir; then - destdir=$dest + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." - destdir=$func_dirname_result - destname=$func_basename_result + destdir="$func_dirname_result" + destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ - func_fatal_help "'$dest' is not a directory" + func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; @@ -4108,7 +2899,7 @@ case $file in *.lo) ;; *) - func_fatal_help "'$destdir' must be an absolute directory name" + func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done @@ -4117,7 +2908,7 @@ # This variable tells wrapper scripts just to set variables rather # than running their programs. - libtool_install_magic=$magic + libtool_install_magic="$magic" staticlibs= future_libdirs= @@ -4137,7 +2928,7 @@ # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ - || func_fatal_help "'$file' is not a valid libtool archive" + || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= @@ -4159,7 +2950,7 @@ fi func_dirname "$file" "/" "" - dir=$func_dirname_result + dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then @@ -4173,7 +2964,7 @@ # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. @@ -4182,29 +2973,29 @@ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi - func_warning "relinking '$file'" + func_warning "relinking \`$file'" func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then - realname=$1 + realname="$1" shift - srcname=$realname - test -n "$relink_command" && srcname=${realname}T + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' - tstripme=$stripme + tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) - tstripme= + tstripme="" ;; esac ;; @@ -4215,7 +3006,7 @@ if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. - # Try 'ln -sf' first, because the 'ln' binary might depend on + # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname @@ -4226,14 +3017,14 @@ fi # Do each command in the postinstall commands. - lib=$destdir/$realname + lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" - name=$func_basename_result - instname=$dir/${name}i + name="$func_basename_result" + instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. @@ -4245,11 +3036,11 @@ # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then - destfile=$destdir/$destname + destfile="$destdir/$destname" else func_basename "$file" - destfile=$func_basename_result - destfile=$destdir/$destfile + destfile="$func_basename_result" + destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. @@ -4259,11 +3050,11 @@ staticdest=$func_lo2o_result ;; *.$objext) - staticdest=$destfile + staticdest="$destfile" destfile= ;; *) - func_fatal_help "cannot copy a libtool object to '$destfile'" + func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac @@ -4272,7 +3063,7 @@ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. - if test yes = "$build_old_libs"; then + if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result @@ -4284,23 +3075,23 @@ *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then - destfile=$destdir/$destname + destfile="$destdir/$destname" else func_basename "$file" - destfile=$func_basename_result - destfile=$destdir/$destfile + destfile="$func_basename_result" + destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install - stripped_ext= + stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result - stripped_ext=.exe + stripped_ext=".exe" fi ;; esac @@ -4328,19 +3119,19 @@ # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script '$wrapper'" + func_fatal_error "invalid libtool wrapper script \`$wrapper'" - finalize=: + finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi - libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "'$lib' has not been installed in '$libdir'" - finalize=false + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no fi done @@ -4348,29 +3139,29 @@ func_source "$wrapper" outputname= - if test no = "$fast_install" && test -n "$relink_command"; then + if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { - if $finalize; then + if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" - file=$func_basename_result - outputname=$tmpdir/$file + file="$func_basename_result" + outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - $opt_quiet || { + $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else - func_error "error: relink '$file' with the above command before installing it" + func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi - file=$outputname + file="$outputname" else - func_warning "cannot relink '$file'" + func_warning "cannot relink \`$file'" fi } else @@ -4407,10 +3198,10 @@ for file in $staticlibs; do func_basename "$file" - name=$func_basename_result + name="$func_basename_result" # Set up the ranlib parameters. - oldlib=$destdir/$name + oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result @@ -4425,18 +3216,18 @@ done test -n "$future_libdirs" && \ - func_warning "remember to run '$progname --finish$future_libdirs'" + func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } -test install = "$opt_mode" && func_mode_install ${1+"$@"} +test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p @@ -4444,17 +3235,16 @@ # a dlpreopen symbol table. func_generate_dlsyms () { - $debug_cmd - - my_outputname=$1 - my_originator=$2 - my_pic_p=${3-false} + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms=${my_outputname}S.c + my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi @@ -4465,7 +3255,7 @@ "") ;; *.c) # Discover the nlist of each of the dlfiles. - nlist=$output_objdir/$my_outputname.nm + nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" @@ -4473,36 +3263,34 @@ func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif -#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE -/* DATA imports from DLLs on WIN32 can't be const, because runtime +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST -#elif defined __osf__ +#elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif -#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) - /* External symbol declarations for the compiler. */\ " - if test yes = "$dlself"; then - func_verbose "generating symbol list for '$output'" + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" @@ -4510,7 +3298,7 @@ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from '$func_to_tool_file_result'" + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done @@ -4530,10 +3318,10 @@ # Prepare the list of exported symbols if test -z "$export_symbols"; then - export_symbols=$output_objdir/$outputname.exp + export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols - eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' @@ -4543,7 +3331,7 @@ } else $opt_dry_run || { - eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in @@ -4557,22 +3345,22 @@ fi for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from '$dlprefile'" + func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" - name=$func_basename_result + name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename= + dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname"; then + if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" - dlprefile_dlbasename=$func_basename_result + dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" @@ -4580,7 +3368,7 @@ fi fi $opt_dry_run || { - if test -n "$dlprefile_dlbasename"; then + if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" @@ -4636,11 +3424,6 @@ echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi - func_show_eval '$RM "${nlist}I"' - if test -n "$global_symbol_to_import"; then - eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' - fi - echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ @@ -4649,30 +3432,11 @@ void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[];\ -" - - if test -s "$nlist"I; then - echo >> "$output_objdir/$my_dlsyms" "\ -static void lt_syminit(void) -{ - LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; - for (; symbol->name; ++symbol) - {" - $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" - echo >> "$output_objdir/$my_dlsyms" "\ - } -}" - fi - echo >> "$output_objdir/$my_dlsyms" "\ +lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = -{ {\"$my_originator\", (void *) 0}," - - if test -s "$nlist"I; then - echo >> "$output_objdir/$my_dlsyms" "\ - {\"@INIT@\", (void *) <_syminit}," - fi +{\ + { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) @@ -4714,7 +3478,9 @@ *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) - $my_pic_p && pic_flag_for_symtable=" $pic_flag" + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi ;; esac ;; @@ -4731,10 +3497,10 @@ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. - symfileobj=$output_objdir/${my_outputname}S.$objext + symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then @@ -4752,7 +3518,7 @@ esac ;; *) - func_fatal_error "unknown suffix for '$my_dlsyms'" + func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else @@ -4766,32 +3532,6 @@ fi } -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $debug_cmd - - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $debug_cmd - - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - # func_win32_libid arg # return the library type of file 'arg' # @@ -4801,9 +3541,8 @@ # Despite the name, also deal with 64 bit binaries. func_win32_libid () { - $debug_cmd - - win32_libid_type=unknown + $opt_debug + win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import @@ -4813,29 +3552,16 @@ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - case $nm_interface in - "MS dumpbin") - if func_cygming_ms_implib_p "$1" || - func_cygming_gnu_implib_p "$1" - then - win32_nmres=import - else - win32_nmres= - fi - ;; - *) - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' 1,100{ / I /{ - s|.*|import| + s,.*,import, p q } }'` - ;; - esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; @@ -4867,8 +3593,7 @@ # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { - $debug_cmd - + $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } @@ -4885,8 +3610,7 @@ # specified import library. func_cygming_dll_for_implib_fallback_core () { - $debug_cmd - + $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ @@ -4922,8 +3646,8 @@ /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the - # archive that possess that section. Heuristic: eliminate - # all those that have a first or second character that is + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually @@ -4934,6 +3658,30 @@ $SED -e '/^\./d;/^.\./d;q' } +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified @@ -4947,17 +3695,16 @@ # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { - $debug_cmd - - if func_cygming_gnu_implib_p "$1"; then + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1"; then + elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown - sharedlib_from_linklib_result= + sharedlib_from_linklib_result="" fi } @@ -4965,11 +3712,10 @@ # func_extract_an_archive dir oldlib func_extract_an_archive () { - $debug_cmd - - f_ex_an_ar_dir=$1; shift - f_ex_an_ar_oldlib=$1 - if test yes = "$lock_old_archive_extraction"; then + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" @@ -4978,7 +3724,7 @@ fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' - if test yes = "$lock_old_archive_extraction"; then + if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then @@ -4992,23 +3738,22 @@ # func_extract_archives gentop oldlib ... func_extract_archives () { - $debug_cmd - - my_gentop=$1; shift + $opt_debug + my_gentop="$1"; shift my_oldlibs=${1+"$@"} - my_oldobjs= - my_xlib= - my_xabs= - my_xdir= + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" - my_xlib=$func_basename_result + my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in @@ -5020,7 +3765,7 @@ esac done extracted_archives="$extracted_archives $my_xlib_u" - my_xdir=$my_gentop/$my_xlib_u + my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" @@ -5033,20 +3778,19 @@ cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` - func_basename "$darwin_archive" - darwin_base_archive=$func_basename_result + darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches; do - func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" - $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" - cd "unfat-$$/$darwin_base_archive-$darwin_arch" - func_extract_an_archive "`pwd`" "$darwin_base_archive" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" - $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` @@ -5071,7 +3815,7 @@ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done - func_extract_archives_result=$my_oldobjs + func_extract_archives_result="$my_oldobjs" } @@ -5086,7 +3830,7 @@ # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script -# will assume that the directory where it is stored is +# will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () @@ -5097,7 +3841,7 @@ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. @@ -5154,9 +3898,9 @@ # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ that is used only on +# /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options that match +# (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and @@ -5189,7 +3933,7 @@ # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then - echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } @@ -5200,7 +3944,7 @@ lt_dump_args_N=1; for lt_arg do - \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } @@ -5214,7 +3958,7 @@ *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then - \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} @@ -5224,7 +3968,7 @@ *) $ECHO "\ if test -n \"\$lt_option_debug\"; then - \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} @@ -5299,13 +4043,13 @@ test -n \"\$absdir\" && thisdir=\"\$absdir\" " - if test yes = "$fast_install"; then + if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" @@ -5357,7 +4101,7 @@ fi # Export our shlibpath_var if we have one. - if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" @@ -5377,7 +4121,7 @@ fi else # The program doesn't exist. - \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 @@ -5396,7 +4140,7 @@ cat < #include -#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) - /* declarations of non-ANSI functions */ -#if defined __MINGW32__ +#if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif -#elif defined __CYGWIN__ +#elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif -/* #elif defined other_platform || defined ... */ +/* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ -#if defined _MSC_VER +#if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC -#elif defined __MINGW32__ +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv -#elif defined __CYGWIN__ +#elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" -/* #elif defined other platforms ... */ +/* #elif defined (other platforms) ... */ #endif -#if defined PATH_MAX +#if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX -#elif defined MAXPATHLEN +#elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 @@ -5488,8 +4234,8 @@ # define PATH_SEPARATOR ':' #endif -#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ - defined __OS2__ +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 @@ -5522,10 +4268,10 @@ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ - if (stale) { free (stale); stale = 0; } \ + if (stale) { free ((void *) stale); stale = 0; } \ } while (0) -#if defined LT_DEBUGWRAPPER +#if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; @@ -5558,7 +4304,7 @@ const char * LIB_PATH_VARNAME = "$shlibpath_var"; EOF - if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then func_to_host_path "$temp_rpath" cat < 0) && IS_PATH_SEPARATOR (new_value[len-1])) + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { - new_value[--len] = '\0'; + new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); @@ -6336,8 +5082,7 @@ # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { - $debug_cmd - + $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; @@ -6347,18 +5092,17 @@ # func_mode_link arg... func_mode_link () { - $debug_cmd - + $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out - # what system we are compiling for in order to pass an extra + # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll that has undefined symbols, in which case not + # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. @@ -6405,7 +5149,7 @@ non_pic_objects= precious_files_regex= prefer_static_libs=no - preload=false + preload=no prev= prevarg= release= @@ -6417,7 +5161,7 @@ vinfo= vinfo_number=no weak_libs= - single_module=$wl-single_module + single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. @@ -6425,15 +5169,15 @@ do case $arg in -shared) - test yes != "$build_libtool_libs" \ - && func_fatal_configuration "cannot build a shared library" + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) - if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then @@ -6466,7 +5210,7 @@ # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do - arg=$1 + arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result @@ -6483,21 +5227,21 @@ case $prev in bindir) - bindir=$arg + bindir="$arg" prev= continue ;; dlfiles|dlprefiles) - $preload || { + if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" - preload=: - } + preload=yes + fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) - if test no = "$dlself"; then + if test "$dlself" = no; then dlself=needless export_dynamic=yes fi @@ -6505,9 +5249,9 @@ continue ;; self) - if test dlprefiles = "$prev"; then + if test "$prev" = dlprefiles; then dlself=yes - elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless @@ -6517,7 +5261,7 @@ continue ;; *) - if test dlfiles = "$prev"; then + if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" @@ -6528,14 +5272,14 @@ esac ;; expsyms) - export_symbols=$arg + export_symbols="$arg" test -f "$arg" \ - || func_fatal_error "symbol file '$arg' does not exist" + || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) - export_symbols_regex=$arg + export_symbols_regex="$arg" prev= continue ;; @@ -6553,13 +5297,7 @@ continue ;; inst_prefix) - inst_prefix_dir=$arg - prev= - continue - ;; - mllvm) - # Clang does not use LLVM to link, so we can simply discard any - # '-mllvm $arg' options when doing the link step. + inst_prefix_dir="$arg" prev= continue ;; @@ -6583,21 +5321,21 @@ if test -z "$pic_object" || test -z "$non_pic_object" || - test none = "$pic_object" && - test none = "$non_pic_object"; then - func_fatal_error "cannot find name of object for '$arg'" + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir=$func_dirname_result + xdir="$func_dirname_result" - if test none != "$pic_object"; then + if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. - pic_object=$xdir$pic_object + pic_object="$xdir$pic_object" - if test dlfiles = "$prev"; then - if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue @@ -6608,7 +5346,7 @@ fi # CHECK ME: I think I busted this. -Ossama - if test dlprefiles = "$prev"; then + if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= @@ -6616,23 +5354,23 @@ # A PIC object. func_append libobjs " $pic_object" - arg=$pic_object + arg="$pic_object" fi # Non-PIC object. - if test none != "$non_pic_object"; then + if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. - non_pic_object=$xdir$non_pic_object + non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test none = "$pic_object"; then - arg=$non_pic_object + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. - non_pic_object=$pic_object + non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else @@ -6640,7 +5378,7 @@ if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir=$func_dirname_result + xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result @@ -6648,24 +5386,24 @@ func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else - func_fatal_error "'$arg' is not a valid libtool object" + func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else - func_fatal_error "link input file '$arg' does not exist" + func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) - precious_files_regex=$arg + precious_files_regex="$arg" prev= continue ;; release) - release=-$arg + release="-$arg" prev= continue ;; @@ -6677,7 +5415,7 @@ func_fatal_error "only absolute run-paths are allowed" ;; esac - if test rpath = "$prev"; then + if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; @@ -6692,7 +5430,7 @@ continue ;; shrext) - shrext_cmds=$arg + shrext_cmds="$arg" prev= continue ;; @@ -6732,7 +5470,7 @@ esac fi # test -n "$prev" - prevarg=$arg + prevarg="$arg" case $arg in -all-static) @@ -6746,7 +5484,7 @@ -allow-undefined) # FIXME: remove this flag sometime in the future. - func_fatal_error "'-allow-undefined' must not be used because it is the default" + func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) @@ -6778,7 +5516,7 @@ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi - if test X-export-symbols = "X$arg"; then + if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex @@ -6812,9 +5550,9 @@ func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then - func_fatal_error "require no space between '-L' and '$1'" + func_fatal_error "require no space between \`-L' and \`$1'" else - func_fatal_error "need path for '-L' option" + func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" @@ -6825,8 +5563,8 @@ *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of '$dir'" - dir=$absdir + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" ;; esac case "$deplibs " in @@ -6861,7 +5599,7 @@ ;; -l*) - if test X-lc = "X$arg" || test X-lm = "X$arg"; then + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) @@ -6869,11 +5607,11 @@ ;; *-*-os2*) # These systems don't actually have a C library (as such) - test X-lc = "X$arg" && continue + test "X$arg" = "X-lc" && continue ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. - test X-lc = "X$arg" && continue + test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework @@ -6882,16 +5620,16 @@ ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype - test X-lc = "X$arg" && continue + test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work - test X-lc = "X$arg" && continue + test "X$arg" = "X-lc" && continue ;; esac - elif test X-lc_r = "X$arg"; then + elif test "X$arg" = "X-lc_r"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -6901,11 +5639,6 @@ continue ;; - -mllvm) - prev=mllvm - continue - ;; - -module) module=yes continue @@ -6935,7 +5668,7 @@ ;; -multi_module) - single_module=$wl-multi_module + single_module="${wl}-multi_module" continue ;; @@ -6949,8 +5682,8 @@ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. - func_warning "'-no-install' is ignored for $host" - func_warning "assuming '-no-fast-install' instead" + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; @@ -7055,14 +5788,14 @@ func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= - save_ifs=$IFS; IFS=, + save_ifs="$IFS"; IFS=',' for flag in $args; do - IFS=$save_ifs + IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done - IFS=$save_ifs + IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; @@ -7071,15 +5804,15 @@ func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= - save_ifs=$IFS; IFS=, + save_ifs="$IFS"; IFS=',' for flag in $args; do - IFS=$save_ifs + IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done - IFS=$save_ifs + IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; @@ -7102,7 +5835,7 @@ # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: @@ -7117,13 +5850,12 @@ # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support - # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization - # -stdlib=* select c++ std lib with clang + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-stdlib=*) + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" @@ -7133,7 +5865,7 @@ # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + arg="$func_quote_for_eval_result" ;; *.$objext) @@ -7154,21 +5886,21 @@ if test -z "$pic_object" || test -z "$non_pic_object" || - test none = "$pic_object" && - test none = "$non_pic_object"; then - func_fatal_error "cannot find name of object for '$arg'" + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir=$func_dirname_result + xdir="$func_dirname_result" - test none = "$pic_object" || { + if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. - pic_object=$xdir$pic_object + pic_object="$xdir$pic_object" - if test dlfiles = "$prev"; then - if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue @@ -7179,7 +5911,7 @@ fi # CHECK ME: I think I busted this. -Ossama - if test dlprefiles = "$prev"; then + if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= @@ -7187,23 +5919,23 @@ # A PIC object. func_append libobjs " $pic_object" - arg=$pic_object - } + arg="$pic_object" + fi # Non-PIC object. - if test none != "$non_pic_object"; then + if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. - non_pic_object=$xdir$non_pic_object + non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test none = "$pic_object"; then - arg=$non_pic_object + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. - non_pic_object=$pic_object + non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else @@ -7211,7 +5943,7 @@ if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir=$func_dirname_result + xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result @@ -7219,7 +5951,7 @@ func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else - func_fatal_error "'$arg' is not a valid libtool object" + func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; @@ -7235,11 +5967,11 @@ # A libtool-controlled library. func_resolve_sysroot "$arg" - if test dlfiles = "$prev"; then + if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= - elif test dlprefiles = "$prev"; then + elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= @@ -7254,7 +5986,7 @@ # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + arg="$func_quote_for_eval_result" ;; esac # arg @@ -7266,9 +5998,9 @@ done # argument parsing loop test -n "$prev" && \ - func_fatal_help "the '$prevarg' option requires an argument" + func_fatal_help "the \`$prevarg' option requires an argument" - if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" @@ -7277,12 +6009,12 @@ oldlibs= # calculate the name of the file, without its directory func_basename "$output" - outputname=$func_basename_result - libobjs_save=$libobjs + outputname="$func_basename_result" + libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi @@ -7290,7 +6022,7 @@ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" - output_objdir=$func_dirname_result$objdir + output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. @@ -7313,7 +6045,7 @@ # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do - if $opt_preserve_dup_deps; then + if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac @@ -7321,7 +6053,7 @@ func_append libs " $deplib" done - if test lib = "$linkmode"; then + if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps @@ -7353,7 +6085,7 @@ case $file in *.la) ;; *) - func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done @@ -7361,7 +6093,7 @@ prog) compile_deplibs= finalize_deplibs= - alldeplibs=false + alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" @@ -7373,29 +6105,32 @@ for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... - if test lib,link = "$linkmode,$pass"; then + if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done - deplibs=$tmp_deplibs + deplibs="$tmp_deplibs" fi - if test lib,link = "$linkmode,$pass" || - test prog,scan = "$linkmode,$pass"; then - libs=$deplibs + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" deplibs= fi - if test prog = "$linkmode"; then + if test "$linkmode" = prog; then case $pass in - dlopen) libs=$dlfiles ;; - dlpreopen) libs=$dlprefiles ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; esac fi - if test lib,dlpreopen = "$linkmode,$pass"; then + if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs @@ -7416,26 +6151,26 @@ esac done done - libs=$dlprefiles + libs="$dlprefiles" fi - if test dlopen = "$pass"; then + if test "$pass" = dlopen; then # Collect dlpreopened libraries - save_deplibs=$deplibs + save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= - found=false + found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - if test prog,link = "$linkmode,$pass"; then + if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" - if test lib = "$linkmode"; then + if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; @@ -7445,13 +6180,13 @@ continue ;; -l*) - if test lib != "$linkmode" && test prog != "$linkmode"; then - func_warning "'-l' is ignored for archives/objects" + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result - if test lib = "$linkmode"; then + if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" @@ -7459,22 +6194,31 @@ for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library - lib=$searchdir/lib$name$search_ext + lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then - if test .la = "$search_ext"; then - found=: + if test "$search_ext" = ".la"; then + found=yes else - found=false + found=no fi break 2 fi done done - if $found; then - # deplib is a libtool library + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. - if test yes = "$allow_libtool_libs_with_static_runtimes"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then @@ -7482,19 +6226,19 @@ old_library= func_source "$lib" for l in $old_library $library_names; do - ll=$l + ll="$l" done - if test "X$ll" = "X$old_library"; then # only static version available - found=false + if test "X$ll" = "X$old_library" ; then # only static version available + found=no func_dirname "$lib" "" "." - ladir=$func_dirname_result + ladir="$func_dirname_result" lib=$ladir/$old_library - if test prog,link = "$linkmode,$pass"; then + if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" - test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi @@ -7503,25 +6247,15 @@ *) ;; esac fi - else - # deplib doesn't seem to be a libtool library - if test prog,link = "$linkmode,$pass"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" - fi - continue fi ;; # -l *.ltframework) - if test prog,link = "$linkmode,$pass"; then + if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" - if test lib = "$linkmode"; then + if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; @@ -7534,18 +6268,18 @@ case $linkmode in lib) deplibs="$deplib $deplibs" - test conv = "$pass" && continue + test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) - if test conv = "$pass"; then + if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi - if test scan = "$pass"; then + if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" @@ -7556,13 +6290,13 @@ func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) - func_warning "'-L' is ignored for archives/objects" + func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) - if test link = "$pass"; then + if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result @@ -7580,7 +6314,7 @@ lib=$func_resolve_sysroot_result ;; *.$libext) - if test conv = "$pass"; then + if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi @@ -7591,26 +6325,21 @@ case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) - valid_a_lib=false + valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=: + valid_a_lib=yes fi ;; pass_all) - valid_a_lib=: + valid_a_lib=yes ;; esac - if $valid_a_lib; then - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - else + if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" @@ -7618,13 +6347,18 @@ echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) - if test link != "$pass"; then + if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" @@ -7635,10 +6369,10 @@ esac # linkmode ;; # *.$libext *.lo | *.$objext) - if test conv = "$pass"; then + if test "$pass" = conv; then deplibs="$deplib $deplibs" - elif test prog = "$linkmode"; then - if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" @@ -7651,20 +6385,22 @@ continue ;; %DEPLIBS%) - alldeplibs=: + alldeplibs=yes continue ;; esac # case $deplib - $found || test -f "$lib" \ - || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ - || func_fatal_error "'$lib' is not a valid libtool archive" + || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." - ladir=$func_dirname_result + ladir="$func_dirname_result" dlname= dlopen= @@ -7694,36 +6430,36 @@ done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test lib,link = "$linkmode,$pass" || - test prog,scan = "$linkmode,$pass" || - { test prog != "$linkmode" && test lib != "$linkmode"; }; then + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi - if test conv = "$pass"; then + if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for '$lib'" + func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" - elif test prog != "$linkmode" && test lib != "$linkmode"; then - func_fatal_error "'$lib' is not a convenience library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" fi - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done continue fi # $pass = conv @@ -7731,26 +6467,26 @@ # Get the name of the library we link against. linklib= if test -n "$old_library" && - { test yes = "$prefer_static_libs" || - test built,no = "$prefer_static_libs,$installed"; }; then + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do - linklib=$l + linklib="$l" done fi if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for '$lib'" + func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. - if test dlopen = "$pass"; then - test -z "$libdir" \ - && func_fatal_error "cannot -dlopen a convenience library: '$lib'" + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi if test -z "$dlname" || - test yes != "$dlopen_support" || - test no = "$build_libtool_libs" - then + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't @@ -7764,40 +6500,40 @@ # We need an absolute path. case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of '$ladir'" + func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" - abs_ladir=$ladir + abs_ladir="$ladir" fi ;; esac func_basename "$lib" - laname=$func_basename_result + laname="$func_basename_result" # Find the relevant object directory and library name. - if test yes = "$installed"; then + if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library '$lib' was moved." - dir=$ladir - absdir=$abs_ladir - libdir=$abs_ladir + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" else - dir=$lt_sysroot$libdir - absdir=$lt_sysroot$libdir + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$libdir" fi - test yes = "$hardcode_automatic" && avoidtemprpath=yes + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir=$ladir - absdir=$abs_ladir + dir="$ladir" + absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else - dir=$ladir/$objdir - absdir=$abs_ladir/$objdir + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi @@ -7806,11 +6542,11 @@ name=$func_stripname_result # This library was specified with -dlpreopen. - if test dlpreopen = "$pass"; then - if test -z "$libdir" && test prog = "$linkmode"; then - func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi - case $host in + case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both @@ -7854,9 +6590,9 @@ if test -z "$libdir"; then # Link the convenience library - if test lib = "$linkmode"; then + if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" - elif test prog,link = "$linkmode,$pass"; then + elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else @@ -7866,14 +6602,14 @@ fi - if test prog = "$linkmode" && test link != "$pass"; then + if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" - linkalldeplibs=false - if test no != "$link_all_deplibs" || test -z "$library_names" || - test no = "$build_libtool_libs"; then - linkalldeplibs=: + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes fi tmp_libs= @@ -7885,14 +6621,14 @@ ;; esac # Need to link against all dependency_libs? - if $linkalldeplibs; then + if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi - if $opt_preserve_dup_deps; then + if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac @@ -7902,15 +6638,15 @@ continue fi # $linkmode = prog... - if test prog,link = "$linkmode,$pass"; then + if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && - { { test no = "$prefer_static_libs" || - test built,yes = "$prefer_static_libs,$installed"; } || + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. - case $temp_rpath: in + case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac @@ -7939,9 +6675,9 @@ esac fi # $linkmode,$pass = prog,link... - if $alldeplibs && - { test pass_all = "$deplibs_check_method" || - { test yes = "$build_libtool_libs" && + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue @@ -7950,11 +6686,11 @@ link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs - if test built = "$use_static_libs" && test yes = "$installed"; then + if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && - { test no = "$use_static_libs" || test -z "$old_library"; }; then + { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded @@ -7962,7 +6698,7 @@ need_relink=no ;; *) - if test no = "$installed"; then + if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi @@ -7972,24 +6708,24 @@ # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule= + dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule=$dlpremoduletest + dlopenmodule="$dlpremoduletest" break fi done - if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo - if test prog = "$linkmode"; then + if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi - if test lib = "$linkmode" && - test yes = "$hardcode_into_libs"; then + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. @@ -8017,43 +6753,43 @@ # figure out the soname set dummy $library_names shift - realname=$1 + realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then - soname=$dlname + soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result - versuffix=-$major + versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else - soname=$realname + soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use - soroot=$soname + soroot="$soname" func_basename "$soroot" - soname=$func_basename_result + soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else - func_verbose "extracting exported symbol list from '$soname'" + func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for '$soname'" + func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library @@ -8061,58 +6797,58 @@ linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" - if test prog = "$linkmode" || test relink != "$opt_mode"; then + if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) - if test no = "$hardcode_direct"; then - add=$dir/$linklib + if test "$hardcode_direct" = no; then + add="$dir/$linklib" case $host in - *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; - *-*-sysv4*uw2*) add_dir=-L$dir ;; + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir=-L$dir ;; + *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) - # if the lib is a (non-dlopened) module then we cannot + # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null; then + $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library"; then + if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else - add=$dir/$old_library + add="$dir/$old_library" fi elif test -n "$old_library"; then - add=$dir/$old_library + add="$dir/$old_library" fi fi esac - elif test no = "$hardcode_minus_L"; then + elif test "$hardcode_minus_L" = no; then case $host in - *-*-sunos*) add_shlibpath=$dir ;; + *-*-sunos*) add_shlibpath="$dir" ;; esac - add_dir=-L$dir - add=-l$name - elif test no = "$hardcode_shlibpath_var"; then - add_shlibpath=$dir - add=-l$name + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" else lib_linked=no fi ;; relink) - if test yes = "$hardcode_direct" && - test no = "$hardcode_direct_absolute"; then - add=$dir/$linklib - elif test yes = "$hardcode_minus_L"; then - add_dir=-L$absdir + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in @@ -8121,10 +6857,10 @@ ;; esac fi - add=-l$name - elif test yes = "$hardcode_shlibpath_var"; then - add_shlibpath=$dir - add=-l$name + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" else lib_linked=no fi @@ -8132,7 +6868,7 @@ *) lib_linked=no ;; esac - if test yes != "$lib_linked"; then + if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi @@ -8142,15 +6878,15 @@ *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi - if test prog = "$linkmode"; then + if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" - if test yes != "$hardcode_direct" && - test yes != "$hardcode_minus_L" && - test yes = "$hardcode_shlibpath_var"; then + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; @@ -8159,33 +6895,33 @@ fi fi - if test prog = "$linkmode" || test relink = "$opt_mode"; then + if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. - if test yes = "$hardcode_direct" && - test no = "$hardcode_direct_absolute"; then - add=$libdir/$linklib - elif test yes = "$hardcode_minus_L"; then - add_dir=-L$libdir - add=-l$name - elif test yes = "$hardcode_shlibpath_var"; then + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac - add=-l$name - elif test yes = "$hardcode_automatic"; then + add="-l$name" + elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib"; then - add=$inst_prefix_dir$libdir/$linklib + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" else - add=$libdir/$linklib + add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. - add_dir=-L$libdir + add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in @@ -8194,10 +6930,10 @@ ;; esac fi - add=-l$name + add="-l$name" fi - if test prog = "$linkmode"; then + if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else @@ -8205,43 +6941,43 @@ test -n "$add" && deplibs="$add $deplibs" fi fi - elif test prog = "$linkmode"; then + elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. - if test unsupported != "$hardcode_direct"; then - test -n "$old_library" && linklib=$old_library + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi - elif test yes = "$build_libtool_libs"; then + elif test "$build_libtool_libs" = yes; then # Not a shared library - if test pass_all != "$deplibs_check_method"; then + if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo - $ECHO "*** Warning: This system cannot link to static lib archive $lib." + $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." - if test yes = "$module"; then + if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." - echo "*** 'nm' from GNU binutils and a full rebuild may help." + echo "*** \`nm' from GNU binutils and a full rebuild may help." fi - if test no = "$build_old_libs"; then + if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else @@ -8254,11 +6990,11 @@ fi fi # link shared/static library? - if test lib = "$linkmode"; then + if test "$linkmode" = lib; then if test -n "$dependency_libs" && - { test yes != "$hardcode_into_libs" || - test yes = "$build_old_libs" || - test yes = "$link_static"; }; then + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do @@ -8272,12 +7008,12 @@ *) func_append temp_deplibs " $libdir";; esac done - dependency_libs=$temp_deplibs + dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library - test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do @@ -8287,7 +7023,7 @@ func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac - if $opt_preserve_dup_deps; then + if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; @@ -8296,12 +7032,12 @@ func_append tmp_libs " $func_resolve_sysroot_result" done - if test no != "$link_all_deplibs"; then + if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in - -L*) path=$deplib ;; + -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result @@ -8309,12 +7045,12 @@ dir=$func_dirname_result # We need an absolute path. case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of '$dir'" - absdir=$dir + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" fi ;; esac @@ -8322,35 +7058,35 @@ case $host in *-*-darwin*) depdepl= - eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names"; then - for tmp in $deplibrary_names; do + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do depdepl=$tmp done - if test -f "$absdir/$objdir/$depdepl"; then - depdepl=$absdir/$objdir/$depdepl - darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then - darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi - func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" - func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) - path=-L$absdir/$objdir + path="-L$absdir/$objdir" ;; esac else - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ - func_fatal_error "'$deplib' is not a valid libtool archive" + func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ - func_warning "'$deplib' seems to be moved" + func_warning "\`$deplib' seems to be moved" - path=-L$absdir + path="-L$absdir" fi ;; esac @@ -8362,23 +7098,23 @@ fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs - if test link = "$pass"; then - if test prog = "$linkmode"; then + if test "$pass" = link; then + if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi - dependency_libs=$newdependency_libs - if test dlpreopen = "$pass"; then + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi - if test dlopen != "$pass"; then - test conv = "$pass" || { + if test "$pass" != dlopen; then + if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do @@ -8388,12 +7124,12 @@ esac done newlib_search_path= - } + fi - if test prog,link = "$linkmode,$pass"; then - vars="compile_deplibs finalize_deplibs" + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" else - vars=deplibs + vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order @@ -8454,59 +7190,59 @@ # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= - for i in $dependency_libs; do + for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) - i= + i="" ;; esac - if test -n "$i"; then + if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass - if test prog = "$linkmode"; then - dlfiles=$newdlfiles + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" fi - if test prog = "$linkmode" || test lib = "$linkmode"; then - dlprefiles=$newdlprefiles + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then - func_warning "'-dlopen' is ignored for archives" + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) - func_warning "'-l' and '-L' are ignored for archives" ;; + func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ - func_warning "'-rpath' is ignored for archives" + func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ - func_warning "'-R' is ignored for archives" + func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ - func_warning "'-version-info/-version-number' is ignored for archives" + func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ - func_warning "'-release' is ignored for archives" + func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ - func_warning "'-export-symbols' is ignored for archives" + func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no - oldlibs=$output + oldlibs="$output" func_append objs "$old_deplibs" ;; lib) - # Make sure we only generate libraries of the form 'libNAME.la'. + # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" @@ -8515,10 +7251,10 @@ eval libname=\"$libname_spec\" ;; *) - test no = "$module" \ - && func_fatal_help "libtool library '$output' must begin with 'lib'" + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" - if test no != "$need_lib_prefix"; then + if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result @@ -8532,8 +7268,8 @@ esac if test -n "$objs"; then - if test pass_all != "$deplibs_check_method"; then - func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" @@ -8542,21 +7278,21 @@ fi fi - test no = "$dlself" \ - || func_warning "'-dlopen self' is ignored for libtool libraries" + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift - test 1 -lt "$#" \ - && func_warning "ignoring multiple '-rpath's for a libtool library" + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" - install_libdir=$1 + install_libdir="$1" oldlibs= if test -z "$rpath"; then - if test yes = "$build_libtool_libs"; then + if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. - # Some compilers have problems with a '.al' extension so + # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" @@ -8565,20 +7301,20 @@ fi test -n "$vinfo" && \ - func_warning "'-version-info/-version-number' is ignored for convenience libraries" + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ - func_warning "'-release' is ignored for convenience libraries" + func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. - save_ifs=$IFS; IFS=: + save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift - IFS=$save_ifs + IFS="$save_ifs" test -n "$7" && \ - func_fatal_help "too many parameters to '-version-info'" + func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts @@ -8586,42 +7322,45 @@ case $vinfo_number in yes) - number_major=$1 - number_minor=$2 - number_revision=$3 + number_major="$1" + number_minor="$2" + number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix - # that has an extra 1 added just for fun + # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result - age=$number_minor - revision=$number_revision + age="$number_minor" + revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) - current=$number_major - revision=$number_minor - age=0 + current="$number_major" + revision="$number_minor" + age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result - age=$number_minor - revision=$number_minor + age="$number_minor" + revision="$number_minor" lt_irix_increment=no ;; + *) + func_fatal_configuration "$modename: unknown library version type \`$version_type'" + ;; esac ;; no) - current=$1 - revision=$2 - age=$3 + current="$1" + revision="$2" + age="$3" ;; esac @@ -8629,30 +7368,30 @@ case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "CURRENT '$current' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "REVISION '$revision' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "AGE '$age' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then - func_error "AGE '$age' is greater than the current interface number '$current'" - func_fatal_error "'$vinfo' is not valid version information" + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. @@ -8667,35 +7406,26 @@ # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result - versuffix=$major.$age.$revision + versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result - xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - # On Darwin other compilers - case $CC in - nagfor*) - verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" - ;; - *) - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - esac ;; freebsd-aout) - major=.$current - versuffix=.$current.$revision + major=".$current" + versuffix=".$current.$revision"; ;; freebsd-elf) - major=.$current - versuffix=.$current + major=".$current" + versuffix=".$current" ;; irix | nonstopux) - if test no = "$lt_irix_increment"; then + if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 @@ -8706,69 +7436,69 @@ nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac - verstring=$verstring_prefix$major.$revision + verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision - while test 0 -ne "$loop"; do + while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result - verstring=$verstring_prefix$major.$iface:$verstring + verstring="$verstring_prefix$major.$iface:$verstring" done - # Before this point, $major must not contain '.'. + # Before this point, $major must not contain `.'. major=.$major - versuffix=$major.$revision + versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result - versuffix=$major.$age.$revision + versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result - versuffix=.$current.$age.$revision - verstring=$current.$age.$revision + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age - while test 0 -ne "$loop"; do + while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result - verstring=$verstring:$iface.0 + verstring="$verstring:${iface}.0" done # Make executables depend on our current version. - func_append verstring ":$current.0" + func_append verstring ":${current}.0" ;; qnx) - major=.$current - versuffix=.$current + major=".$current" + versuffix=".$current" ;; sunos) - major=.$current - versuffix=.$current.$revision + major=".$current" + versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 file systems. + # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result - versuffix=-$major + versuffix="-$major" ;; *) - func_fatal_configuration "unknown library version type '$version_type'" + func_fatal_configuration "unknown library version type \`$version_type'" ;; esac @@ -8782,45 +7512,42 @@ verstring= ;; *) - verstring=0.0 + verstring="0.0" ;; esac - if test no = "$need_version"; then + if test "$need_version" = no; then versuffix= else - versuffix=.0.0 + versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided - if test yes,no = "$avoid_version,$need_version"; then + if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= - verstring= + verstring="" fi # Check to see if the archive will have undefined symbols. - if test yes = "$allow_undefined"; then - if test unsupported = "$allow_undefined_flag"; then - if test yes = "$build_old_libs"; then - func_warning "undefined symbols not allowed in $host shared libraries; building static only" - build_libtool_libs=no - else - func_fatal_error "can't build $host shared library unless -no-undefined is specified" - fi + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes fi else # Don't allow undefined symbols. - allow_undefined_flag=$no_undefined_flag + allow_undefined_flag="$no_undefined_flag" fi fi - func_generate_dlsyms "$libname" "$libname" : + func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" - test " " = "$libobjs" && libobjs= + test "X$libobjs" = "X " && libobjs= - if test relink != "$opt_mode"; then + if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= @@ -8829,8 +7556,8 @@ case $p in *.$objext | *.gcno) ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) - if test -n "$precious_files_regex"; then + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue @@ -8846,11 +7573,11 @@ fi # Now set the variables for building old libraries. - if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. @@ -8871,13 +7598,13 @@ *) func_append finalize_rpath " $libdir" ;; esac done - if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles=$dlfiles + old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in @@ -8887,7 +7614,7 @@ done # Make sure dlprefiles contains only unique files - old_dlprefiles=$dlprefiles + old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in @@ -8896,7 +7623,7 @@ esac done - if test yes = "$build_libtool_libs"; then + if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) @@ -8920,7 +7647,7 @@ ;; *) # Add libc to deplibs on all other systems if necessary. - if test yes = "$build_libtool_need_lc"; then + if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; @@ -8936,9 +7663,9 @@ # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? - release= - versuffix= - major= + release="" + versuffix="" + major="" newdeplibs= droppeddeps=no case $deplibs_check_method in @@ -8967,20 +7694,20 @@ -l*) func_stripname -l '' "$i" name=$func_stripname_result - if test yes = "$allow_libtool_libs_with_static_runtimes"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) func_append newdeplibs " $i" - i= + i="" ;; esac fi - if test -n "$i"; then + if test -n "$i" ; then libname=`eval "\\$ECHO \"$libname_spec\""` deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` set dummy $deplib_matches; shift deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then func_append newdeplibs " $i" else droppeddeps=yes @@ -9010,20 +7737,20 @@ $opt_dry_run || $RM conftest if $LTCC $LTCFLAGS -o conftest conftest.c $i; then ldd_output=`ldd conftest` - if test yes = "$allow_libtool_libs_with_static_runtimes"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) func_append newdeplibs " $i" - i= + i="" ;; esac fi - if test -n "$i"; then + if test -n "$i" ; then libname=`eval "\\$ECHO \"$libname_spec\""` deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` set dummy $deplib_matches; shift deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then func_append newdeplibs " $i" else droppeddeps=yes @@ -9060,24 +7787,24 @@ -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result - if test yes = "$allow_libtool_libs_with_static_runtimes"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" - a_deplib= + a_deplib="" ;; esac fi - if test -n "$a_deplib"; then + if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` if test -n "$file_magic_glob"; then libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` else libnameglob=$libname fi - test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob` + test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - if test yes = "$want_nocaseglob"; then + if test "$want_nocaseglob" = yes; then shopt -s nocaseglob potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` $nocaseglob @@ -9095,25 +7822,25 @@ # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? - potlib=$potent_lib + potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | $SED 's/.* -> //'` + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; - *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" - a_deplib= + a_deplib="" break 2 fi done done fi - if test -n "$a_deplib"; then + if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." @@ -9121,7 +7848,7 @@ echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib"; then + if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" @@ -9144,30 +7871,30 @@ -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result - if test yes = "$allow_libtool_libs_with_static_runtimes"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" - a_deplib= + a_deplib="" ;; esac fi - if test -n "$a_deplib"; then + if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do - potlib=$potent_lib # see symlink-check above in file_magic test + potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" - a_deplib= + a_deplib="" break 2 fi done done fi - if test -n "$a_deplib"; then + if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." @@ -9175,7 +7902,7 @@ echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib"; then + if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" @@ -9191,18 +7918,18 @@ done # Gone through all deplibs. ;; none | unknown | *) - newdeplibs= + newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test yes = "$allow_libtool_libs_with_static_runtimes"; then - for i in $predeps $postdeps; do + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo - if test none = "$deplibs_check_method"; then + if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." @@ -9226,8 +7953,8 @@ ;; esac - if test yes = "$droppeddeps"; then - if test yes = "$module"; then + if test "$droppeddeps" = yes; then + if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" @@ -9236,12 +7963,12 @@ if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." - echo "*** 'nm' from GNU binutils and a full rebuild may help." + echo "*** \`nm' from GNU binutils and a full rebuild may help." fi - if test no = "$build_old_libs"; then - oldlibs=$output_objdir/$libname.$libext + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else @@ -9252,14 +7979,14 @@ echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." - if test no = "$allow_undefined"; then + if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." - if test no = "$build_old_libs"; then - oldlibs=$output_objdir/$libname.$libext + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else @@ -9305,7 +8032,7 @@ *) func_append new_libs " $deplib" ;; esac done - deplibs=$new_libs + deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= @@ -9313,25 +8040,25 @@ dlname= # Test again, we may have decided not to build it any more - if test yes = "$build_libtool_libs"; then - # Remove $wl instances when linking with ld. + if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac - if test yes = "$hardcode_into_libs"; then + if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= - rpath=$finalize_rpath - test relink = "$opt_mode" || rpath=$compile_rpath$rpath + rpath="$finalize_rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir + hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -9356,7 +8083,7 @@ # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs + libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then @@ -9370,8 +8097,8 @@ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi - shlibpath=$finalize_shlibpath - test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath + shlibpath="$finalize_shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi @@ -9381,19 +8108,19 @@ eval library_names=\"$library_names_spec\" set dummy $library_names shift - realname=$1 + realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else - soname=$realname + soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi - lib=$output_objdir/$realname + lib="$output_objdir/$realname" linknames= for link do @@ -9407,7 +8134,7 @@ delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols=$output_objdir/$libname.uexp + export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi @@ -9416,31 +8143,31 @@ cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile - func_dll_def_p "$export_symbols" || { + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. - orig_export_symbols=$export_symbols + orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes - } + fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then - if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for '$libname.la'" - export_symbols=$output_objdir/$libname.exp + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds - save_ifs=$IFS; IFS='~' + save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do - IFS=$save_ifs + IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in @@ -9454,7 +8181,7 @@ try_normal_branch=no ;; esac - if test yes = "$try_normal_branch" \ + if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then @@ -9465,7 +8192,7 @@ output_la=$func_basename_result save_libobjs=$libobjs save_output=$output - output=$output_objdir/$output_la.nm + output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" @@ -9488,8 +8215,8 @@ break fi done - IFS=$save_ifs - if test -n "$export_symbols_regex" && test : != "$skipped_export"; then + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi @@ -9497,16 +8224,16 @@ fi if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols=$export_symbols - test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi - if test : != "$skipped_export" && test -n "$orig_export_symbols"; then + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands, which not all seds can handle. GNU sed should be fine + # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. @@ -9525,11 +8252,11 @@ ;; esac done - deplibs=$tmp_deplibs + deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && - test yes = "$compiler_needs_object" && + test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. @@ -9540,7 +8267,7 @@ eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else - gentop=$output_objdir/${outputname}x + gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience @@ -9549,18 +8276,18 @@ fi fi - if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking - if test relink = "$opt_mode"; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. - if test yes = "$module" && test -n "$module_cmds"; then + if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds @@ -9578,7 +8305,7 @@ fi fi - if test : != "$skipped_export" && + if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then @@ -9611,8 +8338,8 @@ last_robj= k=1 - if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then - output=$output_objdir/$output_la.lnkscript + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs @@ -9624,14 +8351,14 @@ func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then - output=$output_objdir/$output_la.lnk + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= - if test yes = "$compiler_needs_object"; then + if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi @@ -9646,7 +8373,7 @@ else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-$k.$objext + output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result @@ -9658,13 +8385,13 @@ func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result - if test -z "$objlist" || + if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. - if test 1 -eq "$k"; then + if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" @@ -9674,10 +8401,10 @@ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi - last_robj=$output_objdir/$output_la-$k.$objext + last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result - output=$output_objdir/$output_la-$k.$objext + output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result @@ -9689,9 +8416,9 @@ # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds$reload_cmds\" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" @@ -9699,9 +8426,9 @@ output= fi - ${skipped_export-false} && { - func_verbose "generating symbol list for '$libname.la'" - export_symbols=$output_objdir/$libname.exp + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. @@ -9710,16 +8437,16 @@ if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi - } + fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. - save_ifs=$IFS; IFS='~' + save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do - IFS=$save_ifs - $opt_quiet || { + IFS="$save_ifs" + $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } @@ -9727,7 +8454,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -9736,7 +8463,7 @@ exit $lt_exit } done - IFS=$save_ifs + IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' @@ -9744,18 +8471,18 @@ fi fi - ${skipped_export-false} && { + if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols=$export_symbols - test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands, which not all seds can handle. GNU sed should be fine + # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. @@ -9764,7 +8491,7 @@ export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi - } + fi libobjs=$output # Restore the value of output. @@ -9778,7 +8505,7 @@ # value of $libobjs for piecewise linking. # Do each of the archive commands. - if test yes = "$module" && test -n "$module_cmds"; then + if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else @@ -9800,7 +8527,7 @@ # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then - gentop=$output_objdir/${outputname}x + gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles @@ -9808,12 +8535,11 @@ test "X$libobjs" = "X " && libobjs= fi - save_ifs=$IFS; IFS='~' + save_ifs="$IFS"; IFS='~' for cmd in $cmds; do - IFS=$sp$nl + IFS="$save_ifs" eval cmd=\"$cmd\" - IFS=$save_ifs - $opt_quiet || { + $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } @@ -9821,7 +8547,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -9830,10 +8556,10 @@ exit $lt_exit } done - IFS=$save_ifs + IFS="$save_ifs" # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then @@ -9853,39 +8579,39 @@ done # If -module or -export-dynamic was specified, set the dlname. - if test yes = "$module" || test yes = "$export_dynamic"; then + if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. - dlname=$soname + dlname="$soname" fi fi ;; obj) - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then - func_warning "'-dlopen' is ignored for objects" + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) - func_warning "'-l' and '-L' are ignored for objects" ;; + func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ - func_warning "'-rpath' is ignored for objects" + func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ - func_warning "'-R' is ignored for objects" + func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ - func_warning "'-version-info' is ignored for objects" + func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ - func_warning "'-release' is ignored for objects" + func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object '$output' from non-libtool objects" + func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" @@ -9893,7 +8619,7 @@ ;; *) libobj= - obj=$output + obj="$output" ;; esac @@ -9916,7 +8642,7 @@ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else - gentop=$output_objdir/${obj}x + gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience @@ -9925,12 +8651,12 @@ fi # If we're not building shared, we need to use non_pic_objs - test yes = "$build_libtool_libs" || libobjs=$non_pic_objects + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. - reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - output=$obj + output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. @@ -9942,7 +8668,7 @@ exit $EXIT_SUCCESS fi - test yes = "$build_libtool_libs" || { + if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi @@ -9952,12 +8678,12 @@ # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS - } + fi - if test -n "$pic_flag" || test default != "$pic_mode"; then + if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" - output=$libobj + output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi @@ -9974,14 +8700,16 @@ output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ - func_warning "'-version-info' is ignored for programs" + func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ - func_warning "'-release' is ignored for programs" + func_warning "\`-release' is ignored for programs" - $preload \ - && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ - && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) @@ -9995,11 +8723,11 @@ *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). - if test CXX = "$tagname"; then + if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) - func_append compile_command " $wl-bind_at_load" - func_append finalize_command " $wl-bind_at_load" + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" ;; esac fi @@ -10035,7 +8763,7 @@ *) func_append new_libs " $deplib" ;; esac done - compile_deplibs=$new_libs + compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" @@ -10059,7 +8787,7 @@ if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir + hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -10082,7 +8810,7 @@ fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; @@ -10099,10 +8827,10 @@ # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs + libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi - compile_rpath=$rpath + compile_rpath="$rpath" rpath= hardcode_libdirs= @@ -10110,7 +8838,7 @@ if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir + hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -10135,43 +8863,45 @@ # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs + libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi - finalize_rpath=$rpath + finalize_rpath="$rpath" - if test -n "$libobjs" && test yes = "$build_old_libs"; then + if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi - func_generate_dlsyms "$outputname" "@PROGRAM@" false + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi - wrappers_required=: + wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=false + wrappers_required=no ;; *cygwin* | *mingw* ) - test yes = "$build_libtool_libs" || wrappers_required=false + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi ;; *) - if test no = "$need_relink" || test yes != "$build_libtool_libs"; then - wrappers_required=false + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no fi ;; esac - $wrappers_required || { + if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command=$compile_command$compile_rpath + link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 @@ -10184,12 +8914,12 @@ fi # Delete the generated files. - if test -f "$output_objdir/${outputname}S.$objext"; then - func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status - } + fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" @@ -10219,9 +8949,9 @@ fi fi - if test yes = "$no_install"; then + if test "$no_install" = yes; then # We don't need to create a wrapper script. - link_command=$compile_var$compile_command$compile_rpath + link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. @@ -10238,28 +8968,27 @@ exit $EXIT_SUCCESS fi - case $hardcode_action,$fast_install in - relink,*) - # Fast installation is not supported - link_command=$compile_var$compile_command$compile_rpath - relink_command=$finalize_var$finalize_command$finalize_rpath - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "'$output' will be relinked during installation" - ;; - *,yes) - link_command=$finalize_var$compile_command$finalize_rpath - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - ;; - *,no) - link_command=$compile_var$compile_command$compile_rpath - relink_command=$finalize_var$finalize_command$finalize_rpath - ;; - *,needless) - link_command=$finalize_var$compile_command$finalize_rpath - relink_command= - ;; - esac + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` @@ -10316,8 +9045,8 @@ func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result - cwrappersource=$output_path/$objdir/lt-$output_name.c - cwrapper=$output_path/$output_name.exe + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 @@ -10338,7 +9067,7 @@ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host"; then + if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result @@ -10361,27 +9090,25 @@ # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do - case $build_libtool_libs in - convenience) - oldobjs="$libobjs_save $symfileobj" - addlibs=$convenience - build_libtool_libs=no - ;; - module) - oldobjs=$libobjs_save - addlibs=$old_convenience + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" build_libtool_libs=no - ;; - *) + else oldobjs="$old_deplibs $non_pic_objects" - $preload && test -f "$symfileobj" \ - && func_append oldobjs " $symfileobj" - addlibs=$old_convenience - ;; - esac + if test "$preload" = yes && test -f "$symfileobj"; then + func_append oldobjs " $symfileobj" + fi + fi + addlibs="$old_convenience" + fi if test -n "$addlibs"; then - gentop=$output_objdir/${outputname}x + gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs @@ -10389,13 +9116,13 @@ fi # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then - gentop=$output_objdir/${outputname}x + gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles @@ -10416,7 +9143,7 @@ : else echo "copying selected object files to avoid basename conflicts..." - gentop=$output_objdir/${outputname}x + gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs @@ -10425,7 +9152,7 @@ for obj in $save_oldobjs do func_basename "$obj" - objbase=$func_basename_result + objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) @@ -10494,18 +9221,18 @@ else # the above command should be used before it gets too long oldobjs=$objlist - if test "$obj" = "$last_oldobj"; then + if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist - if test -z "$oldobjs"; then + if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" @@ -10522,7 +9249,7 @@ case $output in *.la) old_library= - test yes = "$build_old_libs" && old_library=$libname.$libext + test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior @@ -10537,31 +9264,31 @@ fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - if test yes = "$hardcode_automatic"; then + if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do - if test yes = "$installed"; then + if test "$installed" = yes; then if test -z "$install_libdir"; then break fi - output=$output_objdir/${outputname}i + output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" - name=$func_basename_result + name="$func_basename_result" func_resolve_sysroot "$deplib" - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ - func_fatal_error "'$deplib' is not a valid libtool archive" + func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) @@ -10577,23 +9304,23 @@ *) func_append newdependency_libs " $deplib" ;; esac done - dependency_libs=$newdependency_libs + dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" - name=$func_basename_result - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ - func_fatal_error "'$lib' is not a valid libtool archive" + func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done - dlfiles=$newdlfiles + dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in @@ -10603,34 +9330,34 @@ # didn't already link the preopened objects directly into # the library: func_basename "$lib" - name=$func_basename_result - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ - func_fatal_error "'$lib' is not a valid libtool archive" + func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done - dlprefiles=$newdlprefiles + dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done - dlfiles=$newdlfiles + dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done - dlprefiles=$newdlprefiles + dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin @@ -10646,9 +9373,10 @@ case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. - if test -n "$bindir"; then + if test "x$bindir" != x ; + then func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result/$dlname + tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname @@ -10657,7 +9385,7 @@ esac $ECHO > $output "\ # $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. @@ -10671,7 +9399,7 @@ # The name of the static archive. old_library='$old_library' -# Linker flags that cannot go in dependency_libs. +# Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. @@ -10697,7 +9425,7 @@ # Directory that this library needs to be installed in: libdir='$install_libdir'" - if test no,yes = "$installed,$need_relink"; then + if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi @@ -10712,29 +9440,27 @@ exit $EXIT_SUCCESS } -if test link = "$opt_mode" || test relink = "$opt_mode"; then - func_mode_link ${1+"$@"} -fi +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && + func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { - $debug_cmd - - RM=$nonopt + $opt_debug + RM="$nonopt" files= - rmforce=false + rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. - libtool_install_magic=$magic + libtool_install_magic="$magic" for arg do case $arg in - -f) func_append RM " $arg"; rmforce=: ;; + -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac @@ -10747,18 +9473,18 @@ for file in $files; do func_dirname "$file" "" "." - dir=$func_dirname_result - if test . = "$dir"; then - odir=$objdir + dir="$func_dirname_result" + if test "X$dir" = X.; then + odir="$objdir" else - odir=$dir/$objdir + odir="$dir/$objdir" fi func_basename "$file" - name=$func_basename_result - test uninstall = "$opt_mode" && odir=$dir + name="$func_basename_result" + test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates - if test clean = "$opt_mode"; then + if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; @@ -10773,11 +9499,11 @@ elif test -d "$file"; then exit_status=1 continue - elif $rmforce; then + elif test "$rmforce" = yes; then continue fi - rmfiles=$file + rmfiles="$file" case $name in *.la) @@ -10791,7 +9517,7 @@ done test -n "$old_library" && func_append rmfiles " $odir/$old_library" - case $opt_mode in + case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; @@ -10802,12 +9528,12 @@ uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; @@ -10823,19 +9549,21 @@ func_source $dir/$name # Add PIC object to the list of files to remove. - if test -n "$pic_object" && test none != "$pic_object"; then + if test -n "$pic_object" && + test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && test none != "$non_pic_object"; then + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) - if test clean = "$opt_mode"; then + if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) @@ -10862,12 +9590,12 @@ # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles - func_append rmfiles " $odir/$name $odir/${name}S.$objext" - if test yes = "$fast_install" && test -n "$relink_command"; then + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi - if test "X$noexename" != "X$name"; then - func_append rmfiles " $odir/lt-$noexename.c" + if test "X$noexename" != "X$name" ; then + func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi @@ -10876,7 +9604,7 @@ func_show_eval "$RM $rmfiles" 'exit_status=1' done - # Try to remove the $objdir's in the directories where we deleted files + # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" @@ -10886,17 +9614,16 @@ exit $exit_status } -if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then - func_mode_uninstall ${1+"$@"} -fi +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && + func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { - help=$generic_help + help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode '$opt_mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" @@ -10907,7 +9634,7 @@ # The TAGs below are defined such that we never get into a situation -# where we disable both kinds of libraries. Given conflicting +# in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support @@ -10930,3 +9657,5 @@ # mode:shell-script # sh-indentation:2 # End: +# vi:sw=2 + diff -Nru cloog-0.18.2/autoconf/missing cloog-0.18.4/autoconf/missing --- cloog-0.18.2/autoconf/missing 2013-12-18 12:36:07.000000000 +0000 +++ cloog-0.18.4/autoconf/missing 2014-10-02 14:14:47.000000000 +0000 @@ -1,11 +1,10 @@ #! /bin/sh -# Common stub for a few missing GNU programs while installing. +# Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-01-06.13; # UTC +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,68 +25,40 @@ # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "Try '$0 --help' for more information" exit 1 fi -run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi +case $1 in -msg="missing on your system" + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; -case $1 in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - yacc create \`y.tab.[ch]', if possible, from existing .[ch] + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man -Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and -\`g' are ignored when checking the name. +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. Send bug reports to ." exit $? @@ -99,228 +70,141 @@ ;; -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac -# normalize program name to check for. -program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). This is about non-GNU programs, so use $1 not -# $program. -case $1 in - lex*|yacc*) - # Not GNU programs, they don't have --version. - ;; +# Run the given program, remember its exit status. +"$@"; st=$? - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case $program in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case $f in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; +# If it succeeded, we are done. +test $st -eq 0 && exit 0 - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te*) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison*|yacc*) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if test $# -ne 1; then - eval LASTARG=\${$#} - case $LASTARG in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if test ! -f y.tab.h; then - echo >y.tab.h - fi - if test ! -f y.tab.c; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex*|flex*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if test $# -ne 1; then - eval LASTARG=\${$#} - case $LASTARG in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if test ! -f lex.yy.c; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit $? - fi - ;; - - makeinfo*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi -exit 0 +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff -Nru cloog-0.18.2/autoconf/test-driver cloog-0.18.4/autoconf/test-driver --- cloog-0.18.2/autoconf/test-driver 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/autoconf/test-driver 2014-10-02 14:14:47.000000000 +0000 @@ -0,0 +1,139 @@ +#! /bin/sh +# test-driver - basic testsuite driver script. + +scriptversion=2013-07-13.22; # UTC + +# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# +# This program 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 2, or (at your option) +# any later version. +# +# This program 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 this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +# Make unconditional expansion of undefined variables an error. This +# helps a lot in preventing typo-related bugs. +set -u + +usage_error () +{ + echo "$0: $*" >&2 + print_usage >&2 + exit 2 +} + +print_usage () +{ + cat <$log_file 2>&1 +estatus=$? +if test $enable_hard_errors = no && test $estatus -eq 99; then + estatus=1 +fi + +case $estatus:$expect_failure in + 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; + 0:*) col=$grn res=PASS recheck=no gcopy=no;; + 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; + 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; + *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; + *:*) col=$red res=FAIL recheck=yes gcopy=yes;; +esac + +# Report outcome to console. +echo "${col}${res}${std}: $test_name" + +# Register the test result, and other relevant metadata. +echo ":test-result: $res" > $trs_file +echo ":global-test-result: $res" >> $trs_file +echo ":recheck: $recheck" >> $trs_file +echo ":copy-in-global-log: $gcopy" >> $trs_file + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru cloog-0.18.2/ChangeLog cloog-0.18.4/ChangeLog --- cloog-0.18.2/ChangeLog 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/ChangeLog 2015-07-24 11:54:00.000000000 +0000 @@ -1,3 +1,9 @@ +version: 0.18.3 +date: Mon Dec 8 11:06:42 PDT 2014 +changes: + - Update to isl 0.14 + - Support for OpenScop loop extension + version: 0.18.1 date: Tue Jul 2 07:32:18 PDT 2013 changes: diff -Nru cloog-0.18.2/CLOOG_HEAD cloog-0.18.4/CLOOG_HEAD --- cloog-0.18.2/CLOOG_HEAD 2013-12-18 12:46:31.000000000 +0000 +++ cloog-0.18.4/CLOOG_HEAD 2015-07-27 12:06:07.000000000 +0000 @@ -1 +1 @@ -0.18.2 +0.18.4-b2b4f77 diff -Nru cloog-0.18.2/cmake/cloog-isl-config.cmake cloog-0.18.4/cmake/cloog-isl-config.cmake --- cloog-0.18.2/cmake/cloog-isl-config.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/cmake/cloog-isl-config.cmake 2014-10-02 14:03:59.000000000 +0000 @@ -0,0 +1,26 @@ +# Try to find the cloog-isl library + +# CLOOG_ISL_FOUND - System has cloog-isl lib +# CLOOG_ISL_INCLUDE_DIR - The cloog-isl include directory +# CLOOG_ISL_LIBRARY - Library needed to use cloog-isl + + +if (CLOOG_ISL_INCLUDE_DIR AND CLOOG_ISL_LIBRARY) + # Already in cache, be silent + set(CLOOG_ISL_FIND_QUIETLY TRUE) +endif() + +find_path(CLOOG_ISL_INCLUDE_DIR NAMES cloog/isl/cloog.h) +find_library(CLOOG_ISL_LIBRARY NAMES cloog-isl) + +if (CLOOG_ISL_LIBRARY AND CLOOG_ISL_INCLUDE_DIR) + message(STATUS "Library cloog-isl found =) ${CLOOG_ISL_LIBRARY}") +else() + message(STATUS "Library cloog-isl not found =(") +endif() + + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(CLOOG_ISL DEFAULT_MSG CLOOG_ISL_INCLUDE_DIR CLOOG_ISL_LIBRARY) + +mark_as_advanced(CLOOG_ISL_INCLUDE_DIR CLOOG_ISL_LIBRARY) diff -Nru cloog-0.18.2/cmake/isl-config.cmake cloog-0.18.4/cmake/isl-config.cmake --- cloog-0.18.2/cmake/isl-config.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/cmake/isl-config.cmake 2014-10-02 14:03:59.000000000 +0000 @@ -0,0 +1,25 @@ +# Try to find the isl library + +# ISL_FOUND - System has isl lib +# ISL_INCLUDE_DIR - The isl include directory +# ISL_LIBRARY - Library needed to use isl + + +if (ISL_INCLUDE_DIR AND ISL_LIBRARY) + # Already in cache, be silent + set(ISL_FIND_QUIETLY TRUE) +endif() + +find_path(ISL_INCLUDE_DIR NAMES isl/version.h) +find_library(ISL_LIBRARY NAMES isl) + +if (ISL_LIBRARY AND ISL_INCLUDE_DIR) + message(STATUS "Library isl found =) ${ISL_LIBRARY}") +else() + message(STATUS "Library isl not found =(") +endif() + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(ISL DEFAULT_MSG ISL_INCLUDE_DIR ISL_LIBRARY) + +mark_as_advanced(ISL_INCLUDE_DIR ISL_LIBRARY) diff -Nru cloog-0.18.2/configure cloog-0.18.4/configure --- cloog-0.18.2/configure 2013-12-18 12:36:07.000000000 +0000 +++ cloog-0.18.4/configure 2015-07-27 12:06:01.000000000 +0000 @@ -1,13 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for cloog 0.18.2. +# Generated by GNU Autoconf 2.69 for cloog 0.18.4. # # Report bugs to . # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -136,6 +134,31 @@ # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -169,7 +192,8 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -222,21 +246,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -339,6 +367,14 @@ } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -460,6 +496,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -494,16 +534,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -515,28 +555,8 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -570,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='cloog' PACKAGE_TARNAME='cloog' -PACKAGE_VERSION='0.18.2' -PACKAGE_STRING='cloog 0.18.2' +PACKAGE_VERSION='0.18.4' +PACKAGE_STRING='cloog 0.18.4' PACKAGE_BUGREPORT='cloog-development@googlegroups.com' PACKAGE_URL='' @@ -1253,8 +1273,6 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1340,7 +1358,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures cloog 0.18.2 to adapt to many kinds of systems. +\`configure' configures cloog 0.18.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1410,7 +1428,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of cloog 0.18.2:";; + short | recursive ) echo "Configuration of cloog 0.18.4:";; esac cat <<\_ACEOF @@ -1418,10 +1436,12 @@ --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-silent-rules less verbose build output (undo: `make V=1') - --disable-silent-rules verbose build output (undo: `make V=0') - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] @@ -1437,8 +1457,8 @@ --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot[=DIR] Search for dependent libraries within DIR (or the - compiler's sysroot if not specified). + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). --with-gcc-arch= use architecture for gcc -march/-mtune, instead of guessing --with-isl=no|system|build|bundled @@ -1535,10 +1555,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -cloog configure 0.18.2 -generated by GNU Autoconf 2.68 +cloog configure 0.18.4 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1614,7 +1634,7 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -2004,8 +2024,8 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by cloog $as_me 0.18.2, which was -generated by GNU Autoconf 2.68. Invocation command line was +It was created by cloog $as_me 0.18.4, which was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2386,11 +2406,11 @@ VERSION_MAJOR=0 VERSION_MINOR=18 -VERSION_REVISION=2 +VERSION_REVISION=4 versioninfo=4:0:0 -am__api_version='1.11' +am__api_version='1.14' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2429,7 +2449,7 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2487,9 +2507,6 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -2500,32 +2517,40 @@ esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 - fi + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$2" = conftest.file ) then @@ -2537,6 +2562,16 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. @@ -2559,12 +2594,12 @@ esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then @@ -2576,10 +2611,10 @@ esac fi -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. +# will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. @@ -2598,7 +2633,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2638,7 +2673,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2689,7 +2724,7 @@ test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ @@ -2718,12 +2753,6 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -2742,7 +2771,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2806,6 +2835,45 @@ fi rmdir .tst 2>/dev/null +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." @@ -2828,7 +2896,7 @@ # Define the identity of the package. PACKAGE='cloog' - VERSION='0.18.2' + VERSION='0.18.4' cat >>confdefs.h <<_ACEOF @@ -2856,27 +2924,79 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi -case $enable_silent_rules in -yes) AM_DEFAULT_VERBOSITY=0;; -no) AM_DEFAULT_VERBOSITY=1;; -*) AM_DEFAULT_VERBOSITY=0;; +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 @@ -2931,7 +3051,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2971,7 +3091,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3024,7 +3144,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3065,7 +3185,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -3123,7 +3243,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3167,7 +3287,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3613,8 +3733,7 @@ /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -3698,6 +3817,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" @@ -3717,7 +3895,7 @@ _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. +# Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include @@ -3773,8 +3951,8 @@ # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're @@ -3809,16 +3987,16 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -3827,8 +4005,8 @@ test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else @@ -3836,7 +4014,7 @@ fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -3948,7 +4126,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CD="" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3978,8 +4156,8 @@ -macro_version='2.4.2.418' -macro_revision='2.4.2.418' +macro_version='2.4.2' +macro_revision='1.3337' @@ -3993,7 +4171,7 @@ -ltmain=$ac_aux_dir/ltmain.sh +ltmain="$ac_aux_dir/ltmain.sh" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || @@ -4113,7 +4291,7 @@ $ECHO "" } -case $ECHO in +case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 @@ -4157,7 +4335,7 @@ for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue + as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in @@ -4233,7 +4411,7 @@ for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -4299,7 +4477,7 @@ for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -4366,7 +4544,7 @@ for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue + as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in @@ -4436,19 +4614,19 @@ # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld -if test yes = "$GCC"; then +if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) - # gcc leaves a trailing carriage return, which upsets mingw + # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; @@ -4462,7 +4640,7 @@ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done - test -z "$LD" && LD=$ac_prog + test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. @@ -4473,7 +4651,7 @@ with_gnu_ld=unknown ;; esac -elif test yes = "$with_gnu_ld"; then +elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else @@ -4484,32 +4662,32 @@ $as_echo_n "(cached) " >&6 else if test -z "$LD"; then - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD=$ac_dir/$ac_prog + lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } @@ -4552,33 +4730,33 @@ else if test -n "$NM"; then # Let the user override the test. - lt_cv_path_NM=$NM + lt_cv_path_NM="$NM" else - lt_nm_to_check=${ac_tool_prefix}nm + lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/$lt_tmp_nm - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. - # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" - break 2 + break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" - break 2 + break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but @@ -4589,15 +4767,15 @@ esac fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } -if test no != "$lt_cv_path_NM"; then - NM=$lt_cv_path_NM +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : @@ -4622,7 +4800,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4666,7 +4844,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4703,9 +4881,9 @@ fi fi - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) - DUMPBIN="$DUMPBIN -symbols -headers" + DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: @@ -4713,8 +4891,8 @@ esac fi - if test : != "$DUMPBIN"; then - NM=$DUMPBIN + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm @@ -4754,7 +4932,7 @@ $as_echo_n "(cached) " >&6 else i=0 - teststring=ABCD + teststring="ABCD" case $build_os in msdosdjgpp*) @@ -4794,7 +4972,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -4845,22 +5023,22 @@ *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8; do + for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && - test 17 != "$i" # 1/2 MB should be enough + test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring @@ -4878,7 +5056,7 @@ fi -if test -n "$lt_cv_sys_max_cmd_len"; then +if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else @@ -4896,6 +5074,30 @@ : ${MV="mv -f"} : ${RM="rm -f"} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else @@ -5018,13 +5220,13 @@ reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) - if test yes != "$GCC"; then + if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) - if test yes = "$GCC"; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi @@ -5056,7 +5258,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5096,7 +5298,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5152,13 +5354,13 @@ # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. -# 'unknown' -- same as none, but documents that we really don't know. +# `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path -# that responds to the $file_magic_cmd with a given extended regex. -# If you have 'file' or equivalent on your system and you're not sure -# whether 'pass_all' will *always* work, you probably want this one. +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) @@ -5185,7 +5387,8 @@ # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else @@ -5263,7 +5466,7 @@ lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else @@ -5281,8 +5484,8 @@ lt_cv_deplibs_check_method=pass_all ;; -openbsd* | bitrig*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' @@ -5397,7 +5600,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5437,7 +5640,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5492,8 +5695,8 @@ case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh; - # decide which one to use based on capabilities of $DLLTOOL + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib @@ -5505,7 +5708,7 @@ ;; *) # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd=$ECHO + lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac @@ -5541,7 +5744,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5585,7 +5788,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5660,7 +5863,7 @@ ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - if test 0 -eq "$ac_status"; then + if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 @@ -5668,7 +5871,7 @@ ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - if test 0 -ne "$ac_status"; then + if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi @@ -5681,7 +5884,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } -if test no = "$lt_cv_ar_at_file"; then +if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file @@ -5710,7 +5913,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5750,7 +5953,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5809,7 +6012,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5849,7 +6052,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5898,7 +6101,7 @@ if test -n "$RANLIB"; then case $host_os in - bitrig* | openbsd*) + openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) @@ -5988,7 +6191,7 @@ symcode='[ABCDGISTW]' ;; hpux*) - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; @@ -6021,44 +6224,14 @@ symcode='[ABCDGIRSTW]' ;; esac -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" - # Adjust the below global symbol transforms to fixup imported variables. - lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" - lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" - lt_c_name_lib_hook="\ - -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ - -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" -else - # Disable hooks by default. - lt_cv_sys_global_symbol_to_import= - lt_cdecl_hook= - lt_c_name_hook= - lt_c_name_lib_hook= -fi - # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ -$lt_cdecl_hook\ -" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ -$lt_c_name_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" - -# Transform an extracted symbol line into symbol name with lib prefix and -# symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ -$lt_c_name_lib_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -6076,24 +6249,21 @@ # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function, - # D for any global variable and I for any imported variable. + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ -" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ -" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ -" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ -" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ -" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" @@ -6141,11 +6311,11 @@ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE -/* DATA imports from DLLs on WIN32 can't be const, because runtime +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST -#elif defined __osf__ +#elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else @@ -6171,7 +6341,7 @@ { { "@PROGRAM@", (void *) 0 }, _LT_EOF - $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; @@ -6191,13 +6361,13 @@ mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS - LIBS=conftstm.$ac_objext + LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest$ac_exeext; then + test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS @@ -6218,7 +6388,7 @@ rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. - if test yes = "$pipe_works"; then + if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= @@ -6271,16 +6441,6 @@ - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } @@ -6293,9 +6453,9 @@ lt_sysroot= -case $with_sysroot in #( +case ${with_sysroot} in #( yes) - if test yes = "$GCC"; then + if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( @@ -6305,8 +6465,8 @@ no|'') ;; #( *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 -$as_echo "$with_sysroot" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac @@ -6323,14 +6483,13 @@ enableval=$enable_libtool_lock; fi -test no = "$enable_libtool_lock" || enable_libtool_lock=yes +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) - # Find out what ABI is being produced by ac_compile, and set mode - # options accordingly. + # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -6339,25 +6498,24 @@ test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) - HPUX_IA64_MODE=32 + HPUX_IA64_MODE="32" ;; *ELF-64*) - HPUX_IA64_MODE=64 + HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. + # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - if test yes = "$lt_cv_prog_gnu_ld"; then + if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" @@ -6386,50 +6544,9 @@ rm -rf conftest* ;; -mips64*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - emul=elf - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - emul="${emul}32" - ;; - *64-bit*) - emul="${emul}64" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *MSB*) - emul="${emul}btsmip" - ;; - *LSB*) - emul="${emul}ltsmip" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *N32*) - emul="${emul}n32" - ;; - esac - LD="${LD-ld} -m $emul" - fi - rm -rf conftest* - ;; - x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. Note that the listed cases only cover the - # situations where additional linker options are needed (such as when - # doing 32-bit compilation for a host where ld defaults to 64-bit, or - # vice versa); the common cases where no linker options are needed do - # not appear in the list. + # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -6452,10 +6569,10 @@ ;; esac ;; - powerpc64le-*linux*) + powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; - powerpc64-*linux*) + powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -6474,10 +6591,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - powerpcle-*linux*) + powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; - powerpc-*linux*) + powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -6495,7 +6612,7 @@ *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS=$CFLAGS + SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } @@ -6535,14 +6652,13 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } - if test yes != "$lt_cv_cc_needs_belf"; then + if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS=$SAVE_CFLAGS + CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. + # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -6554,7 +6670,7 @@ case $lt_cv_prog_gnu_ld in yes*) case $host in - i?86-*-solaris*|x86_64-*-solaris*) + i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) @@ -6563,7 +6679,7 @@ esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD=${LD-ld}_sol2 + LD="${LD-ld}_sol2" fi ;; *) @@ -6579,7 +6695,7 @@ ;; esac -need_locks=$enable_libtool_lock +need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. @@ -6598,7 +6714,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6638,7 +6754,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6690,7 +6806,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test yes != "$lt_cv_path_mainfest_tool"; then +if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi @@ -6718,7 +6834,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6758,7 +6874,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6810,7 +6926,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6850,7 +6966,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6902,7 +7018,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6942,7 +7058,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6994,7 +7110,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7034,7 +7150,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7086,7 +7202,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7126,7 +7242,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7193,7 +7309,7 @@ $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no - if test -z "$LT_MULTI_MODULE"; then + if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the @@ -7211,7 +7327,7 @@ cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. - elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 @@ -7250,7 +7366,7 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS + LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 @@ -7279,7 +7395,7 @@ _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 - elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 @@ -7292,32 +7408,32 @@ $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac - if test yes = "$lt_cv_apple_cc_single_mod"; then + if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi - if test yes = "$lt_cv_ld_exported_symbols_list"; then - _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -7628,14 +7744,14 @@ *) enable_shared=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" ;; esac else @@ -7659,14 +7775,14 @@ *) enable_static=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" ;; esac else @@ -7690,14 +7806,14 @@ *) pic_mode=default # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" ;; esac else @@ -7705,6 +7821,8 @@ fi +test -z "$pic_mode" && pic_mode=default + @@ -7720,14 +7838,14 @@ *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" ;; esac else @@ -7745,7 +7863,7 @@ # This can be used to rebuild libtool when needed -LIBTOOL_DEPS=$ltmain +LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -7794,7 +7912,7 @@ -if test -n "${ZSH_VERSION+set}"; then +if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi @@ -7833,7 +7951,7 @@ # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. - if test set != "${COLLECT_NAMES+set}"; then + if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -7844,14 +7962,14 @@ ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, +# All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a -with_gnu_ld=$lt_cv_prog_gnu_ld +with_gnu_ld="$lt_cv_prog_gnu_ld" -old_CC=$CC -old_CFLAGS=$CFLAGS +old_CC="$CC" +old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc @@ -7883,22 +8001,22 @@ else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD=$MAGIC_CMD - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/${ac_tool_prefix}file"; then - lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD=$lt_cv_path_MAGIC_CMD + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -7921,13 +8039,13 @@ break fi done - IFS=$lt_save_ifs - MAGIC_CMD=$lt_save_MAGIC_CMD + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi -MAGIC_CMD=$lt_cv_path_MAGIC_CMD +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } @@ -7949,22 +8067,22 @@ else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD=$MAGIC_CMD - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/file"; then - lt_cv_path_MAGIC_CMD=$ac_dir/"file" + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD=$lt_cv_path_MAGIC_CMD + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -7987,13 +8105,13 @@ break fi done - IFS=$lt_save_ifs - MAGIC_CMD=$lt_save_MAGIC_CMD + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi -MAGIC_CMD=$lt_cv_path_MAGIC_CMD +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } @@ -8014,7 +8132,7 @@ # Use C for the default configuration in the libtool script -lt_save_CC=$CC +lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -8076,7 +8194,7 @@ lt_prog_compiler_no_builtin_flag= -if test yes = "$GCC"; then +if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; @@ -8092,7 +8210,7 @@ lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment + lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -8122,7 +8240,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } -if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : @@ -8140,18 +8258,17 @@ lt_prog_compiler_static= - if test yes = "$GCC"; then + if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi - lt_prog_compiler_pic='-fPIC' ;; amigaos*) @@ -8162,8 +8279,8 @@ ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -8249,7 +8366,7 @@ case $host_os in aix*) lt_prog_compiler_wl='-Wl,' - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else @@ -8257,20 +8374,6 @@ fi ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - case $cc_basename in - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - esac - ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). @@ -8290,7 +8393,7 @@ ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='$wl-a ${wl}archive' + lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) @@ -8301,7 +8404,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in - # old Intel for x86_64, which still supported -KPIC. + # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' @@ -8326,12 +8429,6 @@ lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -8429,7 +8526,7 @@ ;; sysv4*MP*) - if test -d /usr/nec; then + if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi @@ -8458,7 +8555,7 @@ fi case $host_os in - # For platforms that do not support PIC, -DPIC is meaningless: + # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; @@ -8490,7 +8587,7 @@ lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -8520,7 +8617,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } -if test yes = "$lt_cv_prog_compiler_pic_works"; then +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; @@ -8552,7 +8649,7 @@ $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no - save_LDFLAGS=$LDFLAGS + save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -8571,13 +8668,13 @@ fi fi $RM -r conftest* - LDFLAGS=$save_LDFLAGS + LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } -if test yes = "$lt_cv_prog_compiler_static_works"; then +if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= @@ -8697,8 +8794,8 @@ -hard_links=nottested -if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } @@ -8710,9 +8807,9 @@ ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } - if test no = "$hard_links"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -8755,9 +8852,9 @@ # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ' (' and ')$', so one must not match beginning or - # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', - # as well as any symbol that contains 'd'. + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if @@ -8772,7 +8869,7 @@ # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. - if test yes != "$GCC"; then + if test "$GCC" != yes; then with_gnu_ld=no fi ;; @@ -8780,9 +8877,12 @@ # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; - openbsd* | bitrig*) + openbsd*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs=no + ;; esac ld_shlibs=yes @@ -8790,7 +8890,7 @@ # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no - if test yes = "$with_gnu_ld"; then + if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility @@ -8812,24 +8912,24 @@ esac fi - if test yes = "$lt_use_gnu_ld_interface"; then + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='$wl' + wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - export_dynamic_flag_spec='$wl--export-dynamic' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -8842,7 +8942,7 @@ case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken - if test ia64 != "$host_cpu"; then + if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 @@ -8861,7 +8961,7 @@ case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) @@ -8877,7 +8977,7 @@ allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi @@ -8887,7 +8987,7 @@ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='$wl--export-all-symbols' + export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes @@ -8895,61 +8995,61 @@ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='$wl-rpath,$libdir' - export_dynamic_flag_spec='$wl-E' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no - if test linux-dietlibc = "$host_os"; then + if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test no = "$tmp_diet" + && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -8960,44 +9060,42 @@ lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; - nagfor*) # NAGFOR 5.3 - tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test yes = "$supports_anon_versioning"; then + if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test yes = "$supports_anon_versioning"; then + if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -9006,13 +9104,13 @@ fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -9030,8 +9128,8 @@ _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -9043,7 +9141,7 @@ ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify @@ -9058,9 +9156,9 @@ # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -9077,15 +9175,15 @@ *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac - if test no = "$ld_shlibs"; then + if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= @@ -9101,7 +9199,7 @@ # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes - if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported @@ -9109,12 +9207,12 @@ ;; aix[4-9]*) - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag= + no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm @@ -9132,7 +9230,7 @@ # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do - if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi @@ -9155,13 +9253,13 @@ hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes - file_list_spec='$wl-f,' + file_list_spec='${wl}-f,' - if test yes = "$GCC"; then + if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` + collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -9180,35 +9278,36 @@ ;; esac shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag="$shared_flag "'$wl-G' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' fi + link_all_deplibs=no else # not using gcc - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' else - shared_flag='$wl-bM:SRE' + shared_flag='${wl}-bM:SRE' fi fi fi - export_dynamic_flag_spec='$wl-bexpall' + export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes - if test yes = "$aix_use_runtimelinking"; then + if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. - if test set = "${lt_cv_aix_libpath+set}"; then + if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : @@ -9243,7 +9342,7 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=/usr/lib:/lib + lt_cv_aix_libpath_="/usr/lib:/lib" fi fi @@ -9251,17 +9350,17 @@ aix_libpath=$lt_cv_aix_libpath_ fi - hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else - if test ia64 = "$host_cpu"; then - hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. - if test set = "${lt_cv_aix_libpath+set}"; then + if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : @@ -9296,7 +9395,7 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=/usr/lib:/lib + lt_cv_aix_libpath_="/usr/lib:/lib" fi fi @@ -9304,21 +9403,21 @@ aix_libpath=$lt_cv_aix_libpath_ fi - hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - no_undefined_flag=' $wl-bernotok' - allow_undefined_flag=' $wl-berok' - if test yes = "$with_gnu_ld"; then + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; @@ -9327,7 +9426,7 @@ case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) @@ -9357,17 +9456,16 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll + shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes @@ -9376,18 +9474,18 @@ # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # Assume MSVC wrapper @@ -9396,7 +9494,7 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll + shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. @@ -9415,24 +9513,24 @@ hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported - if test yes = "$lt_cv_ld_force_load"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes - allow_undefined_flag=$_lt_dar_allow_undefined + allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in - ifort*|nagfor*) _lt_dar_can_shared=yes ;; + ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac - if test yes = "$_lt_dar_can_shared"; then + if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no @@ -9474,33 +9572,33 @@ ;; hpux9*) - if test yes = "$GCC"; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi - hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes - export_dynamic_flag_spec='$wl-E' + export_dynamic_flag_spec='${wl}-E' ;; hpux10*) - if test yes,no = "$GCC,$with_gnu_ld"; then - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi - if test no = "$with_gnu_ld"; then - hardcode_libdir_flag_spec='$wl+b $wl$libdir' + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes - export_dynamic_flag_spec='$wl-E' + export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes @@ -9508,25 +9606,25 @@ ;; hpux11*) - if test yes,no = "$GCC,$with_gnu_ld"; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) - archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) - archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) @@ -9538,7 +9636,7 @@ $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no - save_LDFLAGS=$LDFLAGS + save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -9557,14 +9655,14 @@ fi fi $RM -r conftest* - LDFLAGS=$save_LDFLAGS + LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } -if test yes = "$lt_cv_prog_compiler__b"; then - archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi @@ -9572,8 +9670,8 @@ ;; esac fi - if test no = "$with_gnu_ld"; then - hardcode_libdir_flag_spec='$wl+b $wl$libdir' + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in @@ -9584,7 +9682,7 @@ *) hardcode_direct=yes hardcode_direct_absolute=yes - export_dynamic_flag_spec='$wl-E' + export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. @@ -9595,8 +9693,8 @@ ;; irix5* | irix6* | nonstopux*) - if test yes = "$GCC"; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + if test "$GCC" = yes; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. @@ -9606,8 +9704,8 @@ if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } @@ -9619,25 +9717,25 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS + LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test yes = "$lt_cv_irix_exported_symbol"; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -9651,7 +9749,7 @@ newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; @@ -9659,19 +9757,27 @@ *nto* | *qnx*) ;; - openbsd* | bitrig*) + openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='$wl-rpath,$libdir' - export_dynamic_flag_spec='$wl-E' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' else - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='$wl-rpath,$libdir' + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac fi else ld_shlibs=no @@ -9687,28 +9793,28 @@ ;; osf3*) - if test yes = "$GCC"; then - allow_undefined_flag=' $wl-expect_unresolved $wl\*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag - if test yes = "$GCC"; then - allow_undefined_flag=' $wl-expect_unresolved $wl\*' - archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' @@ -9719,24 +9825,24 @@ solaris*) no_undefined_flag=' -z defs' - if test yes = "$GCC"; then - wlarc='$wl' - archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' - archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) - wlarc='$wl' - archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi @@ -9746,11 +9852,11 @@ solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. GCC discards it without '$wl', + # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test yes = "$GCC"; then - whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi @@ -9760,10 +9866,10 @@ ;; sunos4*) - if test sequent = "$host_vendor"; then + if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. - archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi @@ -9812,43 +9918,43 @@ ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='$wl-z,text' + no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' - if test yes = "$GCC"; then - archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not + # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - no_undefined_flag='$wl-z,text' - allow_undefined_flag='$wl-z,nodefs' + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='$wl-R,$libdir' + hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes - export_dynamic_flag_spec='$wl-Bexport' + export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' - if test yes = "$GCC"; then - archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; @@ -9863,10 +9969,10 @@ ;; esac - if test sni = "$host_vendor"; then + if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='$wl-Blargedynsym' + export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi @@ -9874,7 +9980,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } -test no = "$ld_shlibs" && can_build_shared=no +test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -9900,7 +10006,7 @@ # Assume -lc should be added archive_cmds_need_lc=yes - if test yes,yes = "$GCC,$enable_shared"; then + if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. @@ -10115,14 +10221,14 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } -if test yes = "$GCC"; then +if test "$GCC" = yes; then case $host_os in - darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; - *) lt_awk_arg='/^libraries:/' ;; + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; - *) lt_sed_strip_eq='s|=/|/|g' ;; + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in @@ -10138,35 +10244,28 @@ ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary... + # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= - lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - # ...but if some path component already ends with the multilib dir we assume - # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). - case "$lt_multi_os_dir; $lt_search_path_spec " in - "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) - lt_multi_os_dir= - ;; - esac + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" - elif test -n "$lt_multi_os_dir"; then + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS = " "; FS = "/|\n";} { - lt_foo = ""; - lt_count = 0; +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { - lt_foo = "/" $lt_i lt_foo; + lt_foo="/" $lt_i lt_foo; } else { lt_count--; } @@ -10180,7 +10279,7 @@ # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's|/\([A-Za-z]:\)|\1|g'` ;; + $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else @@ -10189,7 +10288,7 @@ library_names_spec= libname_spec='lib$name' soname_spec= -shrext_cmds=.so +shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -10209,11 +10308,11 @@ case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='$libname$release$shared_ext$major' + soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) @@ -10221,40 +10320,40 @@ need_lib_prefix=no need_version=no hardcode_into_libs=yes - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 supports IA64 - library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with - # the line '#! .'. This would cause the generated library to - # depend on '.', always an invalid library. This was fixed in + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' - echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac - # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test yes = "$aix_use_runtimelinking"; then + if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi @@ -10265,18 +10364,18 @@ powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) - library_names_spec='$libname$shared_ext' + library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -10284,8 +10383,8 @@ bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" @@ -10297,7 +10396,7 @@ cygwin* | mingw* | pw32* | cegcc*) version_type=windows - shrext_cmds=.dll + shrext_cmds=".dll" need_version=no need_lib_prefix=no @@ -10306,8 +10405,8 @@ # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ @@ -10323,17 +10422,17 @@ case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix - soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' @@ -10342,8 +10441,8 @@ *,cl*) # Native MSVC libname_spec='$name' - soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - library_names_spec='$libname.dll.lib' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' case $build_os in mingw*) @@ -10370,7 +10469,7 @@ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) - sys_lib_search_path_spec=$LIB + sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` @@ -10383,8 +10482,8 @@ esac # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' @@ -10397,7 +10496,7 @@ *) # Assume MSVC wrapper - library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac @@ -10410,8 +10509,8 @@ version_type=darwin need_lib_prefix=no need_version=no - library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' - soname_spec='$libname$release$major$shared_ext' + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' @@ -10424,8 +10523,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -10443,12 +10542,12 @@ version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac @@ -10478,10 +10577,10 @@ need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=no + shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -10499,9 +10598,9 @@ dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - if test 32 = "$HPUX_IA64_MODE"; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" @@ -10514,8 +10613,8 @@ dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; @@ -10524,8 +10623,8 @@ dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... @@ -10538,8 +10637,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -10550,7 +10649,7 @@ case $host_os in nonstopux*) version_type=nonstopux ;; *) - if test yes = "$lt_cv_prog_gnu_ld"; then + if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix @@ -10558,8 +10657,8 @@ esac need_lib_prefix=no need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= @@ -10578,8 +10677,8 @@ esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" - sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; @@ -10588,33 +10687,13 @@ dynamic_linker=no ;; -linux*android*) - version_type=none # Android doesn't support versioned libraries. - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext' - soname_spec='$libname$release$shared_ext' - finish_cmds= - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - hardcode_libdir_flag_spec='-L$libdir' - ;; - # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -10673,17 +10752,29 @@ dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH @@ -10693,7 +10784,7 @@ newsos6) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; @@ -10702,34 +10793,45 @@ version_type=qnx need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; -openbsd* | bitrig*) +openbsd*) version_type=sunos - sys_lib_dlsearch_path_spec=/usr/lib + sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - need_version=no - else - need_version=yes - fi - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi ;; os2*) libname_spec='$name' - shrext_cmds=.dll + shrext_cmds=".dll" need_lib_prefix=no - library_names_spec='$libname$shared_ext $libname.a' + library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; @@ -10738,11 +10840,11 @@ version_type=osf need_lib_prefix=no need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) @@ -10753,8 +10855,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes @@ -10764,11 +10866,11 @@ sunos4*) version_type=sunos - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes - if test yes = "$with_gnu_ld"; then + if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes @@ -10776,8 +10878,8 @@ sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) @@ -10798,10 +10900,10 @@ ;; sysv4*MP*) - if test -d /usr/nec; then + if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' - soname_spec='$libname$shared_ext.$major' + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; @@ -10810,12 +10912,12 @@ version_type=freebsd-elf need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes - if test yes = "$with_gnu_ld"; then + if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' @@ -10833,7 +10935,7 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes @@ -10841,8 +10943,8 @@ uts4*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -10852,18 +10954,18 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } -test no = "$dynamic_linker" && can_build_shared=no +test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test yes = "$GCC"; then +if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then - sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi -if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then - sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi @@ -10962,15 +11064,15 @@ hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || - test yes = "$hardcode_automatic"; then + test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. - if test no != "$hardcode_direct" && + if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one - ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && - test no != "$hardcode_minus_L"; then + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else @@ -10985,12 +11087,12 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } -if test relink = "$hardcode_action" || - test yes = "$inherit_rpath"; then +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no -elif test yes = "$shlibpath_overrides_runpath" || - test no = "$enable_shared"; then +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi @@ -11000,7 +11102,7 @@ - if test yes != "$enable_dlopen"; then + if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown @@ -11010,23 +11112,23 @@ case $host_os in beos*) - lt_cv_dlopen=load_add_on + lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) - lt_cv_dlopen=LoadLibrary + lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) - lt_cv_dlopen=dlopen + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) - # if libdl is installed we need to link against it + # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : @@ -11064,10 +11166,10 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else - lt_cv_dlopen=dyld + lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes @@ -11075,18 +11177,10 @@ ;; - tpf*) - # Don't try to run any link tests for TPF. We know it's impossible - # because TPF is a cross-compiler, and we know how we open DSOs. - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - lt_cv_dlopen_self=no - ;; - *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : - lt_cv_dlopen=shl_load + lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } @@ -11125,11 +11219,11 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : - lt_cv_dlopen=dlopen + lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } @@ -11168,7 +11262,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } @@ -11207,7 +11301,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } @@ -11246,7 +11340,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : - lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi @@ -11267,21 +11361,21 @@ ;; esac - if test no = "$lt_cv_dlopen"; then - enable_dlopen=no - else + if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes + else + enable_dlopen=no fi case $lt_cv_dlopen in dlopen) - save_CPPFLAGS=$CPPFLAGS - test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS=$LDFLAGS + save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS=$LIBS + save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 @@ -11289,7 +11383,7 @@ if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else - if test yes = "$cross_compiling"; then : + if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -11338,7 +11432,7 @@ /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -11368,7 +11462,7 @@ (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in @@ -11388,14 +11482,14 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } - if test yes = "$lt_cv_dlopen_self"; then + if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else - if test yes = "$cross_compiling"; then : + if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -11444,7 +11538,7 @@ /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -11474,7 +11568,7 @@ (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in @@ -11495,9 +11589,9 @@ $as_echo "$lt_cv_dlopen_self_static" >&6; } fi - CPPFLAGS=$save_CPPFLAGS - LDFLAGS=$save_LDFLAGS - LIBS=$save_LIBS + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" ;; esac @@ -11541,7 +11635,7 @@ # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) - if test -n "$STRIP"; then + if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -11569,7 +11663,7 @@ - # Report what library types will actually be built + # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 @@ -11577,13 +11671,13 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } - test no = "$can_build_shared" && enable_shared=no + test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test yes = "$enable_shared" && enable_static=no + test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' @@ -11591,8 +11685,8 @@ ;; aix[4-9]*) - if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then - test yes = "$enable_shared" && enable_static=no + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no fi ;; esac @@ -11602,7 +11696,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes + test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } @@ -11616,7 +11710,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -CC=$lt_save_CC +CC="$lt_save_CC" @@ -11656,7 +11750,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_TEXI2DVI="texi2dvi" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -11686,16 +11780,38 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler vendor" >&5 $as_echo_n "checking for C compiler vendor... " >&6; } if ${ax_cv_c_compiler_vendor+:} false; then : $as_echo_n "(cached) " >&6 else - ax_cv_c_compiler_vendor=unknown - # note: don't check for gcc first since some other compilers define __GNUC__ - for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do - vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")" + # note: don't check for gcc first since some other compilers define __GNUC__ + vendors="intel: __ICC,__ECC,__INTEL_COMPILER + ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__ + pathscale: __PATHCC__,__PATHSCALE__ + clang: __clang__ + cray: _CRAYC + fujitsu: __FUJITSU + gnu: __GNUC__ + sun: __SUNPRO_C,__SUNPRO_CC + hp: __HP_cc,__HP_aCC + dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER + borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ + comeau: __COMO__ + kai: __KCC + lcc: __LCC__ + sgi: __sgi,sgi + microsoft: _MSC_VER + metrowerks: __MWERKS__ + watcom: __WATCOMC__ + portland: __PGI + tcc: __TINYC__ + unknown: UNKNOWN" + for ventest in $vendors; do + case $ventest in + *:) vendor=$ventest; continue ;; + *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;; + esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -11703,19 +11819,20 @@ main () { -#if !($vencpp) - thisisanerror; -#endif + #if !($vencpp) + thisisanerror; + #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ax_cv_c_compiler_vendor=`echo $ventest | cut -d: -f1`; break + break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done + ax_cv_c_compiler_vendor=`echo $vendor | cut -d: -f1` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_vendor" >&5 @@ -12361,7 +12478,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PRTDIAG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12621,11 +12738,11 @@ int main () { -/* FIXME: Include the comments suggested by Paul. */ + #ifndef __cplusplus - /* Ultrix mips cc rejects this. */ + /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; - const charset cs; + const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; @@ -12642,8 +12759,9 @@ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; @@ -12659,10 +12777,10 @@ iptr p = 0; ++p; } - { /* AIX XL C 1.02.0.0 rejects this saying + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; @@ -13655,6 +13773,14 @@ LTLIBOBJS=$ac_ltlibobjs +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -13993,16 +14119,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -14062,28 +14188,16 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -14104,8 +14218,8 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by cloog $as_me 0.18.2, which was -generated by GNU Autoconf 2.68. Invocation command line was +This file was extended by cloog $as_me 0.18.4, which was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -14161,11 +14275,11 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -cloog config.status 0.18.2 -configured by $0, generated by GNU Autoconf 2.68, +cloog config.status 0.18.4 +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -14245,7 +14359,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -14334,10 +14448,8 @@ GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' -lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' @@ -14455,10 +14567,8 @@ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ -lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -lt_cv_nm_interface \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ @@ -14494,7 +14604,7 @@ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -14524,7 +14634,7 @@ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -14533,16 +14643,19 @@ done ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' -# See if we are running on zsh, and set the options that allow our +# See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}"; then +if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' @@ -15021,7 +15134,7 @@ case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files + # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in @@ -15034,7 +15147,7 @@ # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but + # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. @@ -15068,21 +15181,19 @@ continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. + # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || @@ -15117,13 +15228,13 @@ ;; "libtool":C) - # See if we are running on zsh, and set the options that allow our + # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}"; then + if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi - cfgfile=${ofile}T + cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" @@ -15131,7 +15242,7 @@ #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE) $VERSION +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # @@ -15165,7 +15276,7 @@ # The names of the tagged configurations supported by this script. -available_tags='' +available_tags="" # ### BEGIN LIBTOOL CONFIG @@ -15302,22 +15413,16 @@ # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -# Transform the output of nm into a list of symbols to manually relocate. -global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import - # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix -# The name lister interface. -nm_interface=$lt_lt_cv_nm_interface - # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec -# The root where to search for dependent libraries,and where our libraries should be installed. +# The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. @@ -15504,13 +15609,13 @@ # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute @@ -15568,7 +15673,7 @@ # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. -if test set != "${COLLECT_NAMES+set}"; then +if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -15577,7 +15682,7 @@ esac -ltmain=$ac_aux_dir/ltmain.sh +ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if @@ -15587,6 +15692,165 @@ sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" diff -Nru cloog-0.18.2/configure.ac cloog-0.18.4/configure.ac --- cloog-0.18.2/configure.ac 2013-12-18 12:33:26.000000000 +0000 +++ cloog-0.18.4/configure.ac 2015-07-27 12:04:12.000000000 +0000 @@ -41,7 +41,7 @@ m4_define([version_major], [0]) m4_define([version_minor], [18]) -m4_define([version_revision], [2]) +m4_define([version_revision], [4]) AC_PREREQ(2.53) AC_INIT([cloog], [version_major.version_minor.version_revision], diff -Nru cloog-0.18.2/debian/changelog cloog-0.18.4/debian/changelog --- cloog-0.18.2/debian/changelog 2014-02-26 13:21:39.000000000 +0000 +++ cloog-0.18.4/debian/changelog 2015-11-30 10:37:11.000000000 +0000 @@ -1,3 +1,36 @@ +cloog (0.18.4-1~14.04) trusty; urgency=medium + + * PPA upload. + + -- Matthias Klose Mon, 30 Nov 2015 11:36:47 +0100 + +cloog (0.18.4-1) unstable; urgency=medium + + * New upstream version. + + -- Matthias Klose Tue, 17 Nov 2015 00:45:41 +0100 + +cloog (0.18.3-1) unstable; urgency=medium + + * New upstream version. + * Update symbols file. + + -- Matthias Klose Fri, 24 Apr 2015 15:07:57 +0200 + +cloog (0.18.2-3) experimental; urgency=medium + + * Build using isl-0.14. + * Backport patches to build with the new isl (Tobias Burnus). + + -- Matthias Klose Thu, 04 Dec 2014 17:45:42 +0100 + +cloog (0.18.2-2) experimental; urgency=medium + + * Update symbols file. + * Build using isl-0.13. + + -- Matthias Klose Wed, 25 Jun 2014 14:56:30 +0200 + cloog (0.18.2-1) unstable; urgency=medium * New upstream version. diff -Nru cloog-0.18.2/debian/cloog-isl.1 cloog-0.18.4/debian/cloog-isl.1 --- cloog-0.18.2/debian/cloog-isl.1 2013-11-26 12:20:05.000000000 +0000 +++ cloog-0.18.4/debian/cloog-isl.1 2015-11-17 22:58:07.000000000 +0000 @@ -1,10 +1,10 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.43.3. -.TH CLOOG "1" "November 2013" "CLooG 0.18.1-UNKNOWN gmp bits The Chunky Loop Generator" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.2. +.TH CLOOG "1" "November 2015" "CLooG 0.18.4-b2b4f77 gmp bits The Chunky Loop Generator" "User Commands" .SH NAME CLooG \- The Chunky Loop Generator .SH SYNOPSIS .B cloog -[ \fIoptions | file \fR] ... +[ \fI\,options | file \/\fR] ... .SH DESCRIPTION .SS "Options for code generation:" .TP diff -Nru cloog-0.18.2/debian/compat cloog-0.18.4/debian/compat --- cloog-0.18.2/debian/compat 2013-11-26 12:19:15.000000000 +0000 +++ cloog-0.18.4/debian/compat 2015-11-17 22:57:33.000000000 +0000 @@ -1 +1 @@ -5 +9 diff -Nru cloog-0.18.2/debian/control cloog-0.18.4/debian/control --- cloog-0.18.2/debian/control 2014-02-26 13:22:15.000000000 +0000 +++ cloog-0.18.4/debian/control 2015-11-17 22:56:58.000000000 +0000 @@ -3,10 +3,10 @@ Maintainer: Debian GCC Maintainers Uploaders: Matthias Klose , Michael Tautschnig Build-Depends: debhelper (>= 5), autotools-dev, - libisl-dev (>= 0.12.2), libgmp-dev, + libisl-dev (>= 0.15), libgmp-dev, texinfo, help2man # Build-Depends-Indep: libpod-latex-perl | perl (<< 5.17.0) # not needed, no docs built -Standards-Version: 3.9.5 +Standards-Version: 3.9.6 Section: libs Homepage: http://www.CLooG.org @@ -14,7 +14,7 @@ Section: libdevel Architecture: any Multi-Arch: same -Depends: libisl-dev (>= 0.11), libgmp-dev, libcloog-isl4 (= ${binary:Version}), +Depends: libisl-dev (>= 0.14), libgmp-dev, libcloog-isl4 (= ${binary:Version}), dpkg (>= 1.15.4) | install-info, ${shlibs:Depends}, ${misc:Depends} Conflicts: libcloog-ppl-dev Description: Chunky Loop Generator (development files) @@ -29,7 +29,7 @@ Section: libs Architecture: any Multi-Arch: same -Pre-Depends: multiarch-support +Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends} Description: Chunky Loop Generator (runtime library) CLooG is a software which generates loops for scanning Z-polyhedra. diff -Nru cloog-0.18.2/debian/.debhelper/generated/libcloog-isl4/triggers cloog-0.18.4/debian/.debhelper/generated/libcloog-isl4/triggers --- cloog-0.18.2/debian/.debhelper/generated/libcloog-isl4/triggers 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/debian/.debhelper/generated/libcloog-isl4/triggers 2015-11-17 22:58:08.000000000 +0000 @@ -0,0 +1,2 @@ +# Triggers added by dh_makeshlibs +activate-noawait ldconfig diff -Nru cloog-0.18.2/debian/libcloog-isl4.symbols cloog-0.18.4/debian/libcloog-isl4.symbols --- cloog-0.18.2/debian/libcloog-isl4.symbols 2013-11-26 12:19:15.000000000 +0000 +++ cloog-0.18.4/debian/libcloog-isl4.symbols 2015-04-24 13:21:22.000000000 +0000 @@ -4,6 +4,7 @@ clast_expr_is_bigger_constant@Base 0.17 clast_filter@Base 0.18 clast_pprint@Base 0.17 + clast_pprint_expr@Base 0.18.3 cloog_block_alloc@Base 0.17 cloog_block_copy@Base 0.17 cloog_block_free@Base 0.17 @@ -19,8 +20,10 @@ cloog_clast_create_from_input@Base 0.17 cloog_clast_free@Base 0.17 cloog_constraint_coefficient_get@Base 0.17 + cloog_constraint_coefficient_get_val@Base 0.18.2 cloog_constraint_coefficient_set@Base 0.17 cloog_constraint_constant_get@Base 0.17 + cloog_constraint_constant_get_val@Base 0.18.2 cloog_constraint_copy@Base 0.17 cloog_constraint_copy_coefficients@Base 0.17 cloog_constraint_from_isl_constraint@Base 0.17 @@ -112,6 +115,7 @@ cloog_input_dump_cloog@Base 0.17 cloog_input_free@Base 0.17 cloog_input_read@Base 0.17 + cloog_int_to_isl_val@Base 0.18.2 cloog_isl_state_malloc@Base 0.17 cloog_loop_add@Base 0.17 cloog_loop_add_disjoint@Base 0.17 @@ -244,6 +248,7 @@ cloog_union_domain_from_isl_union_map@Base 0.17 cloog_union_domain_read@Base 0.17 cloog_union_domain_set_name@Base 0.17 + cloog_util_rtclock@Base 0.18.3 cloog_vec_alloc@Base 0.17 cloog_vec_dump@Base 0.17 cloog_vec_free@Base 0.17 @@ -261,6 +266,7 @@ free_clast_term@Base 0.17 isl_map_from_cloog_scattering@Base 0.17 isl_set_from_cloog_domain@Base 0.17 + isl_val_to_cloog_int@Base 0.18.2 list_compare@Base 0.18 new_clast_assignment@Base 0.17 new_clast_binary@Base 0.17 diff -Nru cloog-0.18.2/debian/patches/add-cmake-files.diff cloog-0.18.4/debian/patches/add-cmake-files.diff --- cloog-0.18.2/debian/patches/add-cmake-files.diff 2014-02-26 13:26:17.000000000 +0000 +++ cloog-0.18.4/debian/patches/add-cmake-files.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -Index: b/cmake/cloog-isl-config.cmake -=================================================================== ---- /dev/null -+++ b/cmake/cloog-isl-config.cmake -@@ -0,0 +1,26 @@ -+# Try to find the cloog-isl library -+ -+# CLOOG_ISL_FOUND - System has cloog-isl lib -+# CLOOG_ISL_INCLUDE_DIR - The cloog-isl include directory -+# CLOOG_ISL_LIBRARY - Library needed to use cloog-isl -+ -+ -+if (CLOOG_ISL_INCLUDE_DIR AND CLOOG_ISL_LIBRARY) -+ # Already in cache, be silent -+ set(CLOOG_ISL_FIND_QUIETLY TRUE) -+endif() -+ -+find_path(CLOOG_ISL_INCLUDE_DIR NAMES cloog/isl/cloog.h) -+find_library(CLOOG_ISL_LIBRARY NAMES cloog-isl) -+ -+if (CLOOG_ISL_LIBRARY AND CLOOG_ISL_INCLUDE_DIR) -+ message(STATUS "Library cloog-isl found =) ${CLOOG_ISL_LIBRARY}") -+else() -+ message(STATUS "Library cloog-isl not found =(") -+endif() -+ -+ -+include(FindPackageHandleStandardArgs) -+FIND_PACKAGE_HANDLE_STANDARD_ARGS(CLOOG_ISL DEFAULT_MSG CLOOG_ISL_INCLUDE_DIR CLOOG_ISL_LIBRARY) -+ -+mark_as_advanced(CLOOG_ISL_INCLUDE_DIR CLOOG_ISL_LIBRARY) -Index: b/cmake/isl-config.cmake -=================================================================== ---- /dev/null -+++ b/cmake/isl-config.cmake -@@ -0,0 +1,25 @@ -+# Try to find the isl library -+ -+# ISL_FOUND - System has isl lib -+# ISL_INCLUDE_DIR - The isl include directory -+# ISL_LIBRARY - Library needed to use isl -+ -+ -+if (ISL_INCLUDE_DIR AND ISL_LIBRARY) -+ # Already in cache, be silent -+ set(ISL_FIND_QUIETLY TRUE) -+endif() -+ -+find_path(ISL_INCLUDE_DIR NAMES isl/version.h) -+find_library(ISL_LIBRARY NAMES isl) -+ -+if (ISL_LIBRARY AND ISL_INCLUDE_DIR) -+ message(STATUS "Library isl found =) ${ISL_LIBRARY}") -+else() -+ message(STATUS "Library isl not found =(") -+endif() -+ -+include(FindPackageHandleStandardArgs) -+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ISL DEFAULT_MSG ISL_INCLUDE_DIR ISL_LIBRARY) -+ -+mark_as_advanced(ISL_INCLUDE_DIR ISL_LIBRARY) diff -Nru cloog-0.18.2/debian/patches/series cloog-0.18.4/debian/patches/series --- cloog-0.18.2/debian/patches/series 2014-02-26 13:25:25.000000000 +0000 +++ cloog-0.18.4/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -add-cmake-files.diff diff -Nru cloog-0.18.2/debian/rules cloog-0.18.4/debian/rules --- cloog-0.18.2/debian/rules 2013-11-26 12:19:15.000000000 +0000 +++ cloog-0.18.4/debian/rules 2015-11-17 22:56:00.000000000 +0000 @@ -55,7 +55,7 @@ install: build dh_testdir dh_testroot - dh_clean -k + dh_prep dh_installdirs $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install rm -f debian/tmp/usr/share/info/dir* @@ -68,6 +68,8 @@ > debian/cloog-isl.1 endif cp debian/cloog-isl.1 debian/tmp/usr/share/man/man1/cloog-isl.1 + sed -i -e 's/ -D_FORTIFY[^ ]*//' \ + debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/cloog-isl.pc dh_install --sourcedir=debian/tmp --list-missing Binary files /tmp/8LKHgB0qpE/cloog-0.18.2/doc/cloog.pdf and /tmp/yy4tVJh_7V/cloog-0.18.4/doc/cloog.pdf differ diff -Nru cloog-0.18.2/doc/cloog.texi cloog-0.18.4/doc/cloog.texi --- cloog-0.18.2/doc/cloog.texi 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/doc/cloog.texi 2015-07-27 11:29:45.000000000 +0000 @@ -34,9 +34,9 @@ @setfilename cloog.info @settitle CLooG - a loop generator for scanning polyhedra -@set EDITION 2.1 +@set EDITION 2.1.2 @include gitversion.texi -@set UPDATED October 15th 2007 +@set UPDATED July 27th 2015 @setchapternewpage odd @c %**end of header @@ -69,7 +69,7 @@ @} @end example -Copyright @copyright{} 2002-2005 C@'edric Bastoul. +Copyright @copyright{} 2002-2014 C@'edric Bastoul. @c quotation Permission is granted to copy, distribute and/or modify this document under @@ -1275,6 +1275,8 @@ place of a given SCoP in a given file. The use of this extension is disabled when the options @emph{-compilable} or @emph{-callable} are set. + @item @emph{loop} to add loop decorations such as OpenMP + or vectorization pragmas. @end itemize @node Help @@ -2230,6 +2232,7 @@ @menu * Basic Library Utilization:: * Scanning isl Sets:: +* Source to Source Compiler:: @end menu @node Basic Library Utilization @@ -2364,6 +2367,100 @@ ./example-isl @end example +@node Source to Source Compiler +@subsection Source to Source Compiler +Here is an example of a source (to polyhedra) to source compiler. It uses the +Clan library to raise a SCoP from C to the OpenScop representation, and CLooG +to translate back the SCoP to C. You may analyze the polyhedral representation +and apply optimizing transformation to that representation to build your own +high-level optimizing compiler. That example requires to install Clan, OpenScop +and to build CLooG with the OpenScop support. This example is provided in the +@code{example} directory of the CLooG distribution. + +@example +/* poc.c A complete C to polyhedra to C compiler */ +#include +#include +#include +#include + +/* Use the Clan library to convert a SCoP from C to OpenScop */ +osl_scop_p read_scop_from_c(FILE* input, char* input_name) @{ + clan_options_p clanoptions; + osl_scop_p scop; + + clanoptions = clan_options_malloc(); + clanoptions->precision = OSL_PRECISION_MP; + CLAN_strdup(clanoptions->name, input_name); + scop = clan_scop_extract(input, clanoptions); + clan_options_free(clanoptions); + return scop; +@} + +/* Use the CLooG library to output a SCoP from OpenScop to C */ +void print_scop_to_c(FILE* output, osl_scop_p scop) @{ + CloogState* state; + CloogOptions* options; + CloogInput* input; + struct clast_stmt* clast; + + state = cloog_state_malloc(); + options = cloog_options_malloc(state); + options->openscop = 1; + cloog_options_copy_from_osl_scop(scop, options); + input = cloog_input_from_osl_scop(options->state, scop); + clast = cloog_clast_create_from_input(input, options); + clast_pprint(output, clast, 0, options); + + cloog_clast_free(clast); + options->scop = NULL; // don't free the scop + cloog_options_free(options); + cloog_state_free(state); // the input is freed inside +@} + +int main(int argc, char* argv[]) @{ + osl_scop_p scop; + FILE* input; + + if ((argc < 2) || (argc > 2)) @{ + fprintf(stderr, "usage: %s file.c\n", argv[0]); + exit(0); + @} + + if (argc == 1) + input = stdin; + else + input = fopen(argv[1], "r"); + + if (input == NULL) @{ + fprintf(stderr, "cannot open input file\n"); + exit(0); + @} + + scop = read_scop_from_c(input, argv[1]); + osl_scop_print(stdout, scop); + + // UPDATE THE SCOP IN A SMART WAY HERE + + print_scop_to_c(stdout, scop); + osl_scop_free(scop); + + fclose(input); + return 0; +@} +@end example + +@noindent The compilation (with default isl/GMP with OpenScop support +version installed, along with the OpenScop library and Clan library) +command could be: +@example +gcc -DCLOOG_INT_GMP poc.c -lcloog-isl -lclan -losl -o poc +@end example +@noindent A calling command could be: +@example +./poc scop.c +@end example + @c % ******************************** HACKING ********************************* @c @node Hacking diff -Nru cloog-0.18.2/doc/Makefile.in cloog-0.18.4/doc/Makefile.in --- cloog-0.18.2/doc/Makefile.in 2013-12-18 12:36:07.000000000 +0000 +++ cloog-0.18.4/doc/Makefile.in 2015-07-27 12:06:01.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,6 +14,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -34,7 +78,7 @@ build_triplet = @build@ host_triplet = @host@ subdir = doc -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in TODO +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cc_maxopt.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ @@ -52,14 +96,26 @@ mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -233,11 +289,11 @@ clean-libtool: -rm -rf .libs _libs -tags: TAGS -TAGS: +tags TAGS: + +ctags CTAGS: -ctags: CTAGS -CTAGS: +cscope cscopelist: distdir: $(DISTFILES) @@ -373,15 +429,16 @@ .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-am @HAVE_TEXI2DVI_TRUE@cloog.pdf: cloog.texi gitversion.texi @HAVE_TEXI2DVI_TRUE@ $(TEXI2DVI) --pdf $< diff -Nru cloog-0.18.2/examples/polyhedral_compiler/Makefile cloog-0.18.4/examples/polyhedral_compiler/Makefile --- cloog-0.18.2/examples/polyhedral_compiler/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/examples/polyhedral_compiler/Makefile 2015-07-27 10:04:10.000000000 +0000 @@ -0,0 +1,30 @@ +# Please enter here the locations for the CLooG, OpenScop and Clan +# include and library if they aren't the default values +# (i.e., /usr/lib and /usr/include). +CLOOG_INC = $(HOME)/usr/include +CLOOG_LIB = $(HOME)/usr/lib + +OPENSCOP_INC = $(HOME)/usr/include +OPENSCOP_LIB = $(HOME)/usr/lib + +CLAN_INC = $(HOME)/usr/include +CLAN_LIB = $(HOME)/usr/lib + +CC = gcc +LDLIBS= -lcloog-isl -losl -lclan +CFLAGS= -DCLOOG_INT_GMP \ + -I $(CLOOG_INC) -L $(CLOOG_LIB) \ + -I $(OPENSCOP_INC) -L $(OPENSCOP_LIB) \ + -I $(CLAN_INC) -L $(CLAN_LIB) + +example: poc.c + @echo " /*-----------------------------------------------*" + @echo " * Making Polyhedral Compiler Example *" + @echo " *-----------------------------------------------*/" + $(CC) poc.c -o poc $(CFLAGS) $(LDLIBS) + +clean: + @echo " /*-----------------------------------------------*" + @echo " * Cleaning Polyhedral Compiler Example *" + @echo " *-----------------------------------------------*/" + -rm -f poc poc.exe core Binary files /tmp/8LKHgB0qpE/cloog-0.18.2/examples/polyhedral_compiler/poc and /tmp/yy4tVJh_7V/cloog-0.18.4/examples/polyhedral_compiler/poc differ diff -Nru cloog-0.18.2/examples/polyhedral_compiler/poc.c cloog-0.18.4/examples/polyhedral_compiler/poc.c --- cloog-0.18.2/examples/polyhedral_compiler/poc.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/examples/polyhedral_compiler/poc.c 2015-07-27 10:40:22.000000000 +0000 @@ -0,0 +1,71 @@ +/* poc.c A complete C to polyhedra to C compiler */ + +#include +#include +#include +#include + +/* Use the Clan library to convert a SCoP from C to OpenScop */ +osl_scop_p read_scop_from_c(FILE* input, char* input_name) { + clan_options_p clanoptions; + osl_scop_p scop; + + clanoptions = clan_options_malloc(); + clanoptions->precision = OSL_PRECISION_MP; + CLAN_strdup(clanoptions->name, input_name); + scop = clan_scop_extract(input, clanoptions); + clan_options_free(clanoptions); + return scop; +} + +/* Use the CLooG library to output a SCoP from OpenScop to C */ +void print_scop_to_c(FILE* output, osl_scop_p scop) { + CloogState* state; + CloogOptions* options; + CloogInput* input; + struct clast_stmt* clast; + + state = cloog_state_malloc(); + options = cloog_options_malloc(state); + options->openscop = 1; + cloog_options_copy_from_osl_scop(scop, options); + input = cloog_input_from_osl_scop(options->state, scop); + clast = cloog_clast_create_from_input(input, options); + clast_pprint(output, clast, 0, options); + + cloog_clast_free(clast); + options->scop = NULL; // don't free the scop + cloog_options_free(options); + cloog_state_free(state); // the input is freed inside +} + +int main(int argc, char* argv[]) { + osl_scop_p scop; + FILE* input; + + if ((argc < 2) || (argc > 2)) { + fprintf(stderr, "usage: %s file.c\n", argv[0]); + exit(0); + } + + if (argc == 1) + input = stdin; + else + input = fopen(argv[1], "r"); + + if (input == NULL) { + fprintf(stderr, "cannot open input file\n"); + exit(0); + } + + scop = read_scop_from_c(input, argv[1]); + osl_scop_print(stdout, scop); + + // UPDATE THE SCOP IN A SMART WAY HERE + + print_scop_to_c(stdout, scop); + osl_scop_free(scop); + + fclose(input); + return 0; +} diff -Nru cloog-0.18.2/examples/README cloog-0.18.4/examples/README --- cloog-0.18.2/examples/README 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/examples/README 2015-07-27 10:37:28.000000000 +0000 @@ -39,25 +39,20 @@ # **-------------------------------------------------------------------** -# ** II. cloog2loopgen ** +# ** II. polyhedral_compiler ** # **-------------------------------------------------------------------**/ -NO MORE EXISTS ! +This example shows a complete source-to-source polyhedral compiler based on the +OpenScop polyhedral representation. It requires both the OpenScop and Clan library +to be installed, see: +- OpenScop: + https://github.com/periscop/openscop + http://icps.u-strasbg.fr/~bastoul/development/openscop +- Clan: + https://github.com/periscop/clan + http://icps.u-strasbg.fr/~bastoul/development/clan +This compiler takes as input a C file with a SCoP inside, raises that SCoP to the +OpenScop representation, and converts that representation back to C. Simply add your +optimizing algorithm in the middle and you just have an optimizing compiler in +the polyhedral model! -This example creates a program converting a CLooG input file to a LoopGen input -file. This can be useful to compare the two tools (I do not support LoopGen, -don't ask me if you find some bugs !). The usage of the created tool is: -'cloog2loopgen input_file output_file'. - - -# **-------------------------------------------------------------------** -# ** III. cloog2Omega ** -# **-------------------------------------------------------------------**/ - - -NO MORE EXISTS ! - -This example creates a program converting a CLooG input file to an Omega -CodeGen input file. This can be useful to compare the two tools (I do not -support CodeGen, don't ask me if you find some bugs !). The usage of the -created tool is: 'cloog2omega input_file output_file'. diff -Nru cloog-0.18.2/genversion.sh.in cloog-0.18.4/genversion.sh.in --- cloog-0.18.2/genversion.sh.in 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/genversion.sh.in 2015-07-27 11:35:08.000000000 +0000 @@ -5,7 +5,7 @@ if test -f $srcdir/.git/HEAD; then GIT_REPO="$srcdir/.git" - GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe` + GIT_HEAD_ID="$PACKAGE-$VERSION-`GIT_DIR=$GIT_REPO git rev-parse --short HEAD`" elif test -f $srcdir/CLOOG_HEAD; then GIT_HEAD_ID=`cat $srcdir/CLOOG_HEAD` else diff -Nru cloog-0.18.2/include/cloog/clast.h cloog-0.18.4/include/cloog/clast.h --- cloog-0.18.2/include/cloog/clast.h 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/include/cloog/clast.h 2014-10-02 14:03:59.000000000 +0000 @@ -108,6 +108,9 @@ char *private_vars; /* Comma separated list of reduction variable/operators for OpenMP parallelization */ char *reduction_vars; + /* Enable execution time reporting for this loop */ + /* Variable name to accumulate execution time this loop */ + char *time_var_name; }; struct clast_equation { diff -Nru cloog-0.18.2/include/cloog/cloog.h cloog-0.18.4/include/cloog/cloog.h --- cloog-0.18.2/include/cloog/cloog.h 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/include/cloog/cloog.h 2014-10-02 14:03:59.000000000 +0000 @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include diff -Nru cloog-0.18.2/include/cloog/isl/constraintset.h cloog-0.18.4/include/cloog/isl/constraintset.h --- cloog-0.18.2/include/cloog/isl/constraintset.h 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/include/cloog/isl/constraintset.h 2014-10-02 14:03:59.000000000 +0000 @@ -27,6 +27,12 @@ CloogConstraint *cloog_constraint_from_isl_constraint(struct isl_constraint *constraint); isl_constraint *cloog_constraint_to_isl(CloogConstraint *constraint); +__isl_give isl_val *cloog_int_to_isl_val(isl_ctx* ctx, cloog_int_t c); +void isl_val_to_cloog_int(__isl_keep isl_val *val, cloog_int_t *cint); + +__isl_give isl_val *cloog_constraint_coefficient_get_val(CloogConstraint *constraint, + int var); + #if defined(__cplusplus) } #endif diff -Nru cloog-0.18.2/include/cloog/pprint.h cloog-0.18.4/include/cloog/pprint.h --- cloog-0.18.2/include/cloog/pprint.h 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/include/cloog/pprint.h 2014-10-02 14:03:59.000000000 +0000 @@ -60,6 +60,7 @@ void clast_pprint(FILE *foo, struct clast_stmt *root, int indent, CloogOptions *options); +void clast_pprint_expr(struct cloogoptions *i, FILE *dst, struct clast_expr *e); #if defined(__cplusplus) } diff -Nru cloog-0.18.2/include/cloog/util.h cloog-0.18.4/include/cloog/util.h --- cloog-0.18.2/include/cloog/util.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/include/cloog/util.h 2014-10-02 14:03:59.000000000 +0000 @@ -0,0 +1,50 @@ + + /**-------------------------------------------------------------------** + ** CLooG ** + **-------------------------------------------------------------------** + ** util.h ** + **-------------------------------------------------------------------** + ** First version: January 8th 2014 ** + **-------------------------------------------------------------------**/ + + +/****************************************************************************** + * CLooG : the Chunky Loop Generator (experimental) * + ****************************************************************************** + * * + * Copyright (C) 2001-2005 Cedric Bastoul * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2.1 of the License, or (at your option) any later version. * + * * + * This library 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 * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + * CLooG, the Chunky Loop Generator * + * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * + * * + ******************************************************************************/ + + +#ifndef CLOOG_UTIL_H +#define CLOOG_UTIL_H +#if defined(__cplusplus) +extern "C" + { +#endif + +double cloog_util_rtclock(); + +#if defined(__cplusplus) + } +#endif +#endif /* !CLOOG_UTIL_H */ diff -Nru cloog-0.18.2/include/cloog/version.h cloog-0.18.4/include/cloog/version.h --- cloog-0.18.2/include/cloog/version.h 2013-12-18 12:36:39.000000000 +0000 +++ cloog-0.18.4/include/cloog/version.h 2015-07-27 12:06:05.000000000 +0000 @@ -34,7 +34,7 @@ #define CLOOG_VERSION_MAJOR 0 #define CLOOG_VERSION_MINOR 18 -#define CLOOG_VERSION_REVISION 2 +#define CLOOG_VERSION_REVISION 4 const char *cloog_version(void); diff -Nru cloog-0.18.2/isl/aclocal.m4 cloog-0.18.4/isl/aclocal.m4 --- cloog-0.18.2/isl/aclocal.m4 2013-12-18 12:35:59.000000000 +0000 +++ cloog-0.18.4/isl/aclocal.m4 2015-07-24 12:29:24.000000000 +0000 @@ -1,8 +1,7 @@ -# generated automatically by aclocal 1.11.3 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, -# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -12,33 +11,31 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, -[m4_warning([this file was generated for autoconf 2.68. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.11' +[am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.3], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -54,24 +51,22 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.3])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and @@ -90,7 +85,7 @@ # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you +# harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, @@ -116,22 +111,19 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 9 - # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl @@ -150,16 +142,14 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, -# 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 12 -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing @@ -169,7 +159,7 @@ # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was @@ -182,12 +172,13 @@ AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], @@ -195,8 +186,8 @@ # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're @@ -236,16 +227,16 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -254,8 +245,8 @@ test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else @@ -263,7 +254,7 @@ fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -311,7 +302,7 @@ # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl @@ -321,9 +312,13 @@ # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' @@ -338,20 +333,18 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ - # Autoconf 2.62 quotes --file arguments for eval, but not when files + # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in @@ -364,7 +357,7 @@ # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but + # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. @@ -376,21 +369,19 @@ continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. + # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` @@ -408,7 +399,7 @@ # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will +# is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], @@ -418,18 +409,21 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 16 - # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -442,7 +436,7 @@ # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.62])dnl +[AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -471,31 +465,40 @@ # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AM_PROG_MKDIR_P])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl @@ -506,34 +509,78 @@ [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) -_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl -dnl The `parallel-tests' driver may need to know about EXEEXT, so add the -dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro -dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) -dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -555,15 +602,12 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, -# Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -577,16 +621,14 @@ install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi -AC_SUBST(install_sh)]) +AC_SUBST([install_sh])]) -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], @@ -602,14 +644,12 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 - # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. @@ -627,7 +667,7 @@ _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. +# Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include @@ -654,15 +694,12 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 6 - # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], @@ -670,11 +707,10 @@ $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) - # AM_MISSING_HAS_RUN # ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl @@ -687,54 +723,22 @@ esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) + AC_MSG_WARN(['missing' script is too old or missing]) fi ]) -# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, -# Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_PROG_MKDIR_P -# --------------- -# Check for `mkdir -p'. -AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) - # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 - # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], @@ -744,7 +748,7 @@ # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ @@ -758,24 +762,82 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Check to make sure that the build environment is sane. -*- Autoconf -*- +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 -# Free Software Foundation, Inc. +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -786,32 +848,40 @@ esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$[2]" = conftest.file ) then @@ -821,31 +891,50 @@ AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -AC_MSG_RESULT(yes)]) +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) -# Copyright (C) 2009, 2011 Free Software Foundation, Inc. +# Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT -# (`yes' being less verbose, `no' or empty being verbose). +# ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], -[ --enable-silent-rules less verbose build output (undo: `make V=1') - --disable-silent-rules verbose build output (undo: `make V=0')]) -case $enable_silent_rules in -yes) AM_DEFAULT_VERBOSITY=0;; -no) AM_DEFAULT_VERBOSITY=1;; -*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl -dnl A few `make' implementations (e.g., NonStop OS and NextStep) +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} @@ -863,7 +952,7 @@ am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then - dnl Using `$V' instead of `$(V)' breaks IRIX make. + dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else @@ -880,44 +969,40 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_PROG_INSTALL_STRIP # --------------------- -# One issue with vendor `install' (even GNU) is that you can't +# One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize +# always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. +# Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 - # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. @@ -931,18 +1016,16 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. +# Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory @@ -952,76 +1035,114 @@ # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar +# AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. + +# We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR @@ -1033,6 +1154,8 @@ m4_include([m4/ax_create_pkgconfig_info.m4]) m4_include([m4/ax_create_stdint_h.m4]) m4_include([m4/ax_detect_git_head.m4]) +m4_include([m4/ax_detect_gmp.m4]) +m4_include([m4/ax_detect_imath.m4]) m4_include([m4/ax_gcc_archflag.m4]) m4_include([m4/ax_gcc_warn_unused_result.m4]) m4_include([m4/ax_gcc_x86_cpuid.m4]) diff -Nru cloog-0.18.2/isl/AUTHORS cloog-0.18.4/isl/AUTHORS --- cloog-0.18.2/isl/AUTHORS 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/AUTHORS 2015-07-24 12:23:09.000000000 +0000 @@ -16,8 +16,12 @@ 91893 Orsay France 2011-2012 consultant for Leiden Institute of Advanced Computer Science -2012 Ecole Normale Superieure - 45 rue d’Ulm, 75230 Paris +2012-2014 Ecole Normale Superieure + 45 rue d'Ulm, 75230 Paris + France +2014 INRIA Rocquencourt + Domaine de Voluceau - Rocquencourt, B.P. 105 + 78153 Le Chesnay France Contributions by @@ -25,11 +29,16 @@ Mythri Alle Riyadh Baghdadi Serge Belyshev +Ray Donnelly +Johannes Doerfert Tobias Grosser +Alexandre Isoard Andreas Kloeckner +Michael Kruse Sebastian Pop Louis-Noel Pouchet Uday Kumar Reddy +Andreas Simbuerger Sven van Haastregt The merge sort implementation was written by Jeffrey Stedfast. diff -Nru cloog-0.18.2/isl/basis_reduction_tab.c cloog-0.18.4/isl/basis_reduction_tab.c --- cloog-0.18.2/isl/basis_reduction_tab.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/basis_reduction_tab.c 2015-07-24 12:23:09.000000000 +0000 @@ -9,8 +9,10 @@ #include #include -#include +#include #include "isl_tab.h" +#include +#include struct tab_lp { struct isl_ctx *ctx; @@ -30,27 +32,49 @@ int is_fixed; }; +#ifdef USE_GMP_FOR_MP +#define GBR_type mpq_t +#define GBR_init(v) mpq_init(v) +#define GBR_clear(v) mpq_clear(v) +#define GBR_set(a,b) mpq_set(a,b) +#define GBR_set_ui(a,b) mpq_set_ui(a,b,1) +#define GBR_mul(a,b,c) mpq_mul(a,b,c) +#define GBR_lt(a,b) (mpq_cmp(a,b) < 0) +#define GBR_is_zero(a) (mpq_sgn(a) == 0) +#define GBR_numref(a) mpq_numref(a) +#define GBR_denref(a) mpq_denref(a) +#define GBR_floor(a,b) mpz_fdiv_q(a,GBR_numref(b),GBR_denref(b)) +#define GBR_ceil(a,b) mpz_cdiv_q(a,GBR_numref(b),GBR_denref(b)) +#endif /* USE_GMP_FOR_MP */ + +#ifdef USE_IMATH_FOR_MP +#include + +#define GBR_type mp_rat +#define GBR_init(v) v = mp_rat_alloc() +#define GBR_clear(v) mp_rat_free(v) +#define GBR_set(a,b) mp_rat_copy(b,a) +#define GBR_set_ui(a,b) mp_rat_set_uvalue(a,b,1) +#define GBR_mul(a,b,c) mp_rat_mul(b,c,a) +#define GBR_lt(a,b) (mp_rat_compare(a,b) < 0) +#define GBR_is_zero(a) (mp_rat_compare_zero(a) == 0) +#define GBR_numref(a) mp_rat_numer_ref(a) +#define GBR_denref(a) mp_rat_denom_ref(a) +#define GBR_floor(a,b) impz_fdiv_q(a,GBR_numref(b),GBR_denref(b)) +#define GBR_ceil(a,b) impz_cdiv_q(a,GBR_numref(b),GBR_denref(b)) +#endif /* USE_IMATH_FOR_MP */ + static struct tab_lp *init_lp(struct isl_tab *tab); static void set_lp_obj(struct tab_lp *lp, isl_int *row, int dim); static int solve_lp(struct tab_lp *lp); -static void get_obj_val(struct tab_lp* lp, mpq_t *F); +static void get_obj_val(struct tab_lp* lp, GBR_type *F); static void delete_lp(struct tab_lp *lp); static int add_lp_row(struct tab_lp *lp, isl_int *row, int dim); -static void get_alpha(struct tab_lp* lp, int row, mpq_t *alpha); +static void get_alpha(struct tab_lp* lp, int row, GBR_type *alpha); static int del_lp_row(struct tab_lp *lp) WARN_UNUSED; static int cut_lp_to_hyperplane(struct tab_lp *lp, isl_int *row); #define GBR_LP struct tab_lp -#define GBR_type mpq_t -#define GBR_init(v) mpq_init(v) -#define GBR_clear(v) mpq_clear(v) -#define GBR_set(a,b) mpq_set(a,b) -#define GBR_set_ui(a,b) mpq_set_ui(a,b,1) -#define GBR_mul(a,b,c) mpq_mul(a,b,c) -#define GBR_lt(a,b) (mpq_cmp(a,b) < 0) -#define GBR_is_zero(a) (mpq_sgn(a) == 0) -#define GBR_floor(a,b) mpz_fdiv_q(a,mpq_numref(b),mpq_denref(b)) -#define GBR_ceil(a,b) mpz_cdiv_q(a,mpq_numref(b),mpq_denref(b)) #define GBR_lp_init(P) init_lp(P) #define GBR_lp_set_obj(lp, obj, dim) set_lp_obj(lp, obj, dim) #define GBR_lp_solve(lp) solve_lp(lp) @@ -157,8 +181,11 @@ isl_vec_free(sample); } isl_int_divexact_ui(lp->opt_denom, lp->opt_denom, 2); - if (res != isl_lp_ok) + if (res < 0) return -1; + if (res != isl_lp_ok) + isl_die(lp->ctx, isl_error_internal, + "unexpected missing (bounded) solution", return -1); return 0; } @@ -193,10 +220,10 @@ return lp->tab->empty; } -static void get_obj_val(struct tab_lp* lp, mpq_t *F) +static void get_obj_val(struct tab_lp* lp, GBR_type *F) { - isl_int_neg(mpq_numref(*F), lp->opt); - isl_int_set(mpq_denref(*F), lp->opt_denom); + isl_int_neg(GBR_numref(*F), lp->opt); + isl_int_set(GBR_denref(*F), lp->opt_denom); } static void delete_lp(struct tab_lp *lp) @@ -229,11 +256,11 @@ return lp->neq++; } -static void get_alpha(struct tab_lp* lp, int row, mpq_t *alpha) +static void get_alpha(struct tab_lp* lp, int row, GBR_type *alpha) { row += lp->con_offset; - isl_int_neg(mpq_numref(*alpha), lp->tab->dual->el[1 + row]); - isl_int_set(mpq_denref(*alpha), lp->tab->dual->el[0]); + isl_int_neg(GBR_numref(*alpha), lp->tab->dual->el[1 + row]); + isl_int_set(GBR_denref(*alpha), lp->tab->dual->el[0]); } static int del_lp_row(struct tab_lp *lp) diff -Nru cloog-0.18.2/isl/basis_reduction_templ.c cloog-0.18.4/isl/basis_reduction_templ.c --- cloog-0.18.2/isl/basis_reduction_templ.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/basis_reduction_templ.c 2015-07-24 12:23:09.000000000 +0000 @@ -13,6 +13,7 @@ #include #include #include +#include #include #include "isl_basis_reduction.h" @@ -50,7 +51,6 @@ unsigned dim; struct isl_ctx *ctx; struct isl_mat *B; - int unbounded; int i; GBR_LP *lp = NULL; GBR_type F_old, alpha, F_new; @@ -132,8 +132,8 @@ GBR_lp_set_obj(lp, B->row[1+i]+1, dim); ctx->stats->gbr_solved_lps++; - unbounded = GBR_lp_solve(lp); - isl_assert(ctx, !unbounded, goto error); + if (GBR_lp_solve(lp) < 0) + goto error; GBR_lp_get_obj_val(lp, &F[i]); if (GBR_lt(F[i], one)) { @@ -150,8 +150,8 @@ if (i+1 == tab->n_zero) { GBR_lp_set_obj(lp, B->row[1+i+1]+1, dim); ctx->stats->gbr_solved_lps++; - unbounded = GBR_lp_solve(lp); - isl_assert(ctx, !unbounded, goto error); + if (GBR_lp_solve(lp) < 0) + goto error; GBR_lp_get_obj_val(lp, &F_new); fixed = GBR_lp_is_fixed(lp); GBR_set_ui(alpha, 0); @@ -165,8 +165,8 @@ row = GBR_lp_add_row(lp, B->row[1+i]+1, dim); GBR_lp_set_obj(lp, B->row[1+i+1]+1, dim); ctx->stats->gbr_solved_lps++; - unbounded = GBR_lp_solve(lp); - isl_assert(ctx, !unbounded, goto error); + if (GBR_lp_solve(lp) < 0) + goto error; GBR_lp_get_obj_val(lp, &F_new); fixed = GBR_lp_is_fixed(lp); @@ -195,8 +195,8 @@ tmp, B->row[1+i]+1, dim); GBR_lp_set_obj(lp, b_tmp->el, dim); ctx->stats->gbr_solved_lps++; - unbounded = GBR_lp_solve(lp); - isl_assert(ctx, !unbounded, goto error); + if (GBR_lp_solve(lp) < 0) + goto error; GBR_lp_get_obj_val(lp, &mu_F[j]); mu_fixed[j] = GBR_lp_is_fixed(lp); if (i > 0) diff -Nru cloog-0.18.2/isl/bound.c cloog-0.18.4/isl/bound.c --- cloog-0.18.2/isl/bound.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/bound.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,8 +1,11 @@ #include #include +#include #include #include #include +#include +#include struct bound_options { struct isl_options *isl; @@ -55,7 +58,7 @@ isl_pw_qpolynomial_fold *bound; }; -static int verify_point(__isl_take isl_point *pnt, void *user) +static isl_stat verify_point(__isl_take isl_point *pnt, void *user) { int i; unsigned nvar; @@ -64,8 +67,8 @@ isl_int t; isl_ctx *ctx; isl_pw_qpolynomial_fold *pwf; - isl_qpolynomial *bound = NULL; - isl_qpolynomial *opt = NULL; + isl_val *bound = NULL; + isl_val *opt = NULL; isl_set *dom = NULL; isl_printer *p; const char *minmax; @@ -117,13 +120,12 @@ opt = isl_pw_qpolynomial_fold_min(isl_pw_qpolynomial_fold_copy(pwf)); nvar = isl_set_dim(dom, isl_dim_set); - opt = isl_qpolynomial_project_domain_on_params(opt); if (vpb->exact && bounded) - ok = isl_qpolynomial_plain_is_equal(opt, bound); + ok = isl_val_eq(opt, bound); else if (sign > 0) - ok = isl_qpolynomial_le_cst(opt, bound); + ok = isl_val_le(opt, bound); else - ok = isl_qpolynomial_le_cst(bound, opt); + ok = isl_val_le(bound, opt); if (ok < 0) goto error; @@ -137,11 +139,11 @@ p = isl_printer_print_isl_int(p, t); } p = isl_printer_print_str(p, ") = "); - p = isl_printer_print_qpolynomial(p, bound); + p = isl_printer_print_val(p, bound); p = isl_printer_print_str(p, ", "); p = isl_printer_print_str(p, bounded ? "opt" : "sample"); p = isl_printer_print_str(p, " = "); - p = isl_printer_print_qpolynomial(p, opt); + p = isl_printer_print_val(p, opt); if (ok) p = isl_printer_print_str(p, ". OK"); else @@ -158,8 +160,8 @@ } isl_pw_qpolynomial_fold_free(pwf); - isl_qpolynomial_free(bound); - isl_qpolynomial_free(opt); + isl_val_free(bound); + isl_val_free(opt); isl_point_free(pnt); isl_set_free(dom); @@ -173,7 +175,7 @@ if (vpb->options->continue_on_error) ok = 1; - return (vpb->n >= 1 && ok) ? 0 : -1; + return (vpb->n >= 1 && ok) ? isl_stat_ok : isl_stat_error; } static int check_solution(__isl_take isl_pw_qpolynomial_fold *pwf, @@ -240,7 +242,7 @@ isl_ctx *ctx; isl_pw_qpolynomial_fold *copy; isl_pw_qpolynomial_fold *pwf; - struct isl_stream *s; + isl_stream *s; struct isl_obj obj; struct bound_options *options; int exact; diff -Nru cloog-0.18.2/isl/cat.c cloog-0.18.4/isl/cat.c --- cloog-0.18.2/isl/cat.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/cat.c 2015-07-24 12:23:09.000000000 +0000 @@ -13,15 +13,24 @@ {0} }; +struct isl_arg_choice cat_yaml_style[] = { + { "block", ISL_YAML_STYLE_BLOCK }, + { "flow", ISL_YAML_STYLE_FLOW }, + { 0 } +}; + struct cat_options { struct isl_options *isl; unsigned format; + unsigned yaml_style; }; ISL_ARGS_START(struct cat_options, cat_options_args) ISL_ARG_CHILD(struct cat_options, isl, "isl", &isl_options_args, "isl options") ISL_ARG_CHOICE(struct cat_options, format, 0, "format", \ cat_format, ISL_FORMAT_ISL, "output format") +ISL_ARG_CHOICE(struct cat_options, yaml_style, 0, "yaml-style", \ + cat_yaml_style, ISL_YAML_STYLE_BLOCK, "output YAML style") ISL_ARGS_END ISL_ARG_DEF(cat_options, struct cat_options, cat_options_args) @@ -29,7 +38,7 @@ int main(int argc, char **argv) { struct isl_ctx *ctx; - struct isl_stream *s; + isl_stream *s; struct isl_obj obj; struct cat_options *options; isl_printer *p; @@ -46,6 +55,7 @@ p = isl_printer_to_file(ctx, stdout); p = isl_printer_set_output_format(p, options->format); + p = isl_printer_set_yaml_style(p, options->yaml_style); p = obj.type->print(p, obj.v); p = isl_printer_end_line(p); isl_printer_free(p); diff -Nru cloog-0.18.2/isl/ChangeLog cloog-0.18.4/isl/ChangeLog --- cloog-0.18.2/isl/ChangeLog 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/ChangeLog 2015-07-24 12:23:09.000000000 +0000 @@ -1,3 +1,44 @@ +version: 0.15 +date: Thu Jun 11 12:45:33 CEST 2015 +changes: + - improve coalescing + - add isl_union_access_info_compute_flow + - add mark nodes in AST + - add isl_union_pw_aff and isl_multi_union_pw_aff + - add schedule trees + - deprecate band forests + - deprecate separation_class AST generation option + - introduce isl_bool and isl_stat types +--- +version: 0.14.1 +date: Thu Apr 9 12:57:23 CEST 2015 +changes: + - fix bug in affine expression normalization + - fix handling of conditional validity constraints +--- +version: 0.14 +date: Sat Oct 25 16:08:47 CEST 2014 +changes: + - support IMath as an optional replacement for GMP + - minor AST generator improvements +--- +version: 0.13 +date: Mon Apr 14 11:08:45 CEST 2014 +changes: + - deprecate isl_int + - improved support for multi piecewise quasi-affine expressions + - allow the user to impose a bound on the number of low-level operations + - add isl_id_to_ast_expr and isl_id_to_pw_aff + - add isl_schedule_constraints + - hide internal structure of isl_vec + - remove support for piplib +--- +version: 0.12.2 +date: Sun Jan 12 12:09:46 CET 2014 +changes: + - MinGW-w64 build fix + - fix simplification bug +--- version: 0.12.1 date: Wed Jul 24 12:54:46 CEST 2013 changes: diff -Nru cloog-0.18.2/isl/closure.c cloog-0.18.4/isl/closure.c --- cloog-0.18.2/isl/closure.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/closure.c 2015-07-24 12:23:09.000000000 +0000 @@ -7,6 +7,7 @@ struct isl_ctx *ctx; struct isl_map *map; struct isl_options *options; + isl_printer *p; int exact; options = isl_options_new_with_defaults(); @@ -15,19 +16,23 @@ ctx = isl_ctx_alloc_with_options(&isl_options_args, options); + p = isl_printer_to_file(ctx, stdout); + map = isl_map_read_from_file(ctx, stdin); map = isl_map_transitive_closure(map, &exact); if (!exact) - printf("# NOT exact\n"); - isl_map_print(map, stdout, 0, ISL_FORMAT_ISL); - printf("\n"); + p = isl_printer_print_str(p, "# NOT exact\n"); + p = isl_printer_print_map(p, map); + p = isl_printer_end_line(p); map = isl_map_compute_divs(map); map = isl_map_coalesce(map); - printf("# coalesced\n"); - isl_map_print(map, stdout, 0, ISL_FORMAT_ISL); - printf("\n"); + p = isl_printer_print_str(p, "# coalesced\n"); + p = isl_printer_print_map(p, map); + p = isl_printer_end_line(p); isl_map_free(map); + isl_printer_free(p); + isl_ctx_free(ctx); return 0; diff -Nru cloog-0.18.2/isl/codegen.c cloog-0.18.4/isl/codegen.c --- cloog-0.18.2/isl/codegen.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/codegen.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright 2012 Ecole Normale Superieure + * Copyright 2012,2014 Ecole Normale Superieure * * Use of this software is governed by the MIT license * @@ -8,19 +8,26 @@ */ /* This program prints an AST that scans the domain elements of - * the domain of a given schedule in the order of their image(s). + * the domain of a given schedule in the order specified by + * the schedule tree or by their image(s) in the schedule map. * - * The input consists of three sets/relations. - * - a schedule + * The input consists of either a schedule tree or + * a sequence of three sets/relations. + * - a schedule map * - a context * - a relation describing AST generation options */ #include +#include #include #include #include #include +#include +#include +#include +#include struct options { struct isl_options *isl; @@ -36,7 +43,8 @@ "globally set the separate option") ISL_ARGS_END -ISL_ARG_DEF(options, struct options, options_args) +ISL_ARG_DEF(cg_options, struct options, options_args) +ISL_ARG_CTX_DEF(cg_options, struct options, options_args) /* Return a universal, 1-dimensional set with the given name. */ @@ -100,32 +108,130 @@ return build; } -int main(int argc, char **argv) +/* Construct an AST in case the schedule is specified by a union map. + * + * We read the context and the options from "s" and construct the AST. + */ +static __isl_give isl_ast_node *construct_ast_from_union_map( + __isl_take isl_union_map *schedule, __isl_keep isl_stream *s) { - isl_ctx *ctx; isl_set *context; - isl_union_map *schedule; isl_union_map *options_map; isl_ast_build *build; isl_ast_node *tree; struct options *options; - isl_printer *p; - - options = options_new_with_defaults(); - assert(options); - argc = options_parse(options, argc, argv, ISL_ARG_ALL); - ctx = isl_ctx_alloc_with_options(&options_args, options); + options = isl_ctx_peek_cg_options(isl_stream_get_ctx(s)); - schedule = isl_union_map_read_from_file(ctx, stdin); - context = isl_set_read_from_file(ctx, stdin); - options_map = isl_union_map_read_from_file(ctx, stdin); + context = isl_stream_read_set(s); + options_map = isl_stream_read_union_map(s); build = isl_ast_build_from_context(context); build = set_options(build, options_map, options, schedule); - tree = isl_ast_build_ast_from_schedule(build, schedule); + tree = isl_ast_build_node_from_schedule_map(build, schedule); isl_ast_build_free(build); + return tree; +} + +/* If "node" is a band node, then replace the AST build options + * by "options". + */ +static __isl_give isl_schedule_node *node_set_options( + __isl_take isl_schedule_node *node, void *user) +{ + enum isl_ast_loop_type *type = user; + int i, n; + + if (isl_schedule_node_get_type(node) != isl_schedule_node_band) + return node; + + n = isl_schedule_node_band_n_member(node); + for (i = 0; i < n; ++i) + node = isl_schedule_node_band_member_set_ast_loop_type(node, + i, *type); + return node; +} + +/* Replace the AST build options on all band nodes if requested + * by the user. + */ +static __isl_give isl_schedule *schedule_set_options( + __isl_take isl_schedule *schedule, struct options *options) +{ + enum isl_ast_loop_type type; + + if (!options->separate && !options->atomic) + return schedule; + + type = options->separate ? isl_ast_loop_separate : isl_ast_loop_atomic; + schedule = isl_schedule_map_schedule_node_bottom_up(schedule, + &node_set_options, &type); + + return schedule; +} + +/* Construct an AST in case the schedule is specified by a schedule tree. + */ +static __isl_give isl_ast_node *construct_ast_from_schedule( + __isl_take isl_schedule *schedule) +{ + isl_ast_build *build; + isl_ast_node *tree; + struct options *options; + + options = isl_ctx_peek_cg_options(isl_schedule_get_ctx(schedule)); + + build = isl_ast_build_alloc(isl_schedule_get_ctx(schedule)); + schedule = schedule_set_options(schedule, options); + tree = isl_ast_build_node_from_schedule(build, schedule); + isl_ast_build_free(build); + + return tree; +} + +/* Read an object from stdin. + * If it is a (union) map, then assume an input specified by + * schedule map, context and options and construct an AST from + * those elements + * If it is a schedule object, then construct the AST from the schedule. + */ +int main(int argc, char **argv) +{ + isl_ctx *ctx; + isl_stream *s; + isl_ast_node *tree = NULL; + struct options *options; + isl_printer *p; + struct isl_obj obj; + int r = EXIT_SUCCESS; + + options = cg_options_new_with_defaults(); + assert(options); + argc = cg_options_parse(options, argc, argv, ISL_ARG_ALL); + + ctx = isl_ctx_alloc_with_options(&options_args, options); + + s = isl_stream_new_file(ctx, stdin); + obj = isl_stream_read_obj(s); + if (obj.v == NULL) { + r = EXIT_FAILURE; + } else if (obj.type == isl_obj_map) { + isl_union_map *umap; + + umap = isl_union_map_from_map(obj.v); + tree = construct_ast_from_union_map(umap, s); + } else if (obj.type == isl_obj_union_map) { + tree = construct_ast_from_union_map(obj.v, s); + } else if (obj.type == isl_obj_schedule) { + tree = construct_ast_from_schedule(obj.v); + } else { + obj.type->free(obj.v); + isl_die(ctx, isl_error_invalid, "unknown input", + r = EXIT_FAILURE); + } + isl_stream_free(s); + p = isl_printer_to_file(ctx, stdout); p = isl_printer_set_output_format(p, ISL_FORMAT_C); p = isl_printer_print_ast_node(p, tree); @@ -134,5 +240,5 @@ isl_ast_node_free(tree); isl_ctx_free(ctx); - return 0; + return r; } diff -Nru cloog-0.18.2/isl/codegen_test.sh.in cloog-0.18.4/isl/codegen_test.sh.in --- cloog-0.18.2/isl/codegen_test.sh.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/codegen_test.sh.in 2015-07-24 12:23:09.000000000 +0000 @@ -5,8 +5,17 @@ failed=0 +for i in $srcdir/test_inputs/codegen/*.st \ + $srcdir/test_inputs/codegen/cloog/*.st; do + echo $i; + base=`basename $i .st` + test=test-$base.c + dir=`dirname $i` + ref=$dir/$base.c + (./isl_codegen$EXEEXT < $i > $test && + diff -uw $ref $test && rm $test) || failed=1 +done for i in $srcdir/test_inputs/codegen/*.in \ - $srcdir/test_inputs/codegen/cloog/*.in \ $srcdir/test_inputs/codegen/omega/*.in \ $srcdir/test_inputs/codegen/pldi2012/*.in; do echo $i; diff -Nru cloog-0.18.2/isl/compile cloog-0.18.4/isl/compile --- cloog-0.18.2/isl/compile 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/compile 2014-10-02 14:14:38.000000000 +0000 @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program 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 2, or (at your option) +# any later version. +# +# This program 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 this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru cloog-0.18.2/isl/config.sub cloog-0.18.4/isl/config.sub --- cloog-0.18.2/isl/config.sub 2013-12-18 12:35:57.000000000 +0000 +++ cloog-0.18.4/isl/config.sub 2014-10-02 14:14:38.000000000 +0000 @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2013-10-01' +timestamp='2013-08-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -265,7 +265,6 @@ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ @@ -325,7 +324,7 @@ c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -382,7 +381,6 @@ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ - | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ diff -Nru cloog-0.18.2/isl/configure cloog-0.18.4/isl/configure --- cloog-0.18.2/isl/configure 2013-12-18 12:35:59.000000000 +0000 +++ cloog-0.18.4/isl/configure 2015-07-26 07:35:26.000000000 +0000 @@ -1,13 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for isl 0.12.1. +# Generated by GNU Autoconf 2.69 for isl 0.15. # # Report bugs to . # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -136,6 +134,31 @@ # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -169,7 +192,8 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -222,21 +246,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -339,6 +367,14 @@ } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -460,6 +496,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -494,16 +534,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -515,28 +555,8 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -570,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='isl' PACKAGE_TARNAME='isl' -PACKAGE_VERSION='0.12.1' -PACKAGE_STRING='isl 0.12.1' +PACKAGE_VERSION='0.15' +PACKAGE_STRING='isl 0.15' PACKAGE_BUGREPORT='isl-development@googlegroups.com' PACKAGE_URL='' @@ -628,16 +648,15 @@ CLANG_LIBS CLANG_LDFLAGS CLANG_CXXFLAGS -HAVE_PIPLIB_FALSE -HAVE_PIPLIB_TRUE -PIPLIB_LIBS -PIPLIB_LDFLAGS -PIPLIB_CPPFLAGS +GMP_FOR_MP_FALSE +GMP_FOR_MP_TRUE +IMATH_FOR_MP_FALSE +IMATH_FOR_MP_TRUE NEED_GET_MEMORY_FUNCTIONS_FALSE NEED_GET_MEMORY_FUNCTIONS_TRUE -GMP_LIBS -GMP_LDFLAGS -GMP_CPPFLAGS +MP_LIBS +MP_LDFLAGS +MP_CPPFLAGS GENERATE_DOC_FALSE GENERATE_DOC_TRUE POD2HTML @@ -778,14 +797,11 @@ with_gnu_ld with_sysroot enable_libtool_lock +with_int with_gmp with_gmp_prefix with_gmp_exec_prefix with_gmp_builddir -with_piplib -with_piplib_prefix -with_piplib_exec_prefix -with_piplib_builddir with_clang with_clang_prefix with_clang_exec_prefix @@ -1258,8 +1274,6 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1345,7 +1359,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures isl 0.12.1 to adapt to many kinds of systems. +\`configure' configures isl 0.15 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1415,7 +1429,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of isl 0.12.1:";; + short | recursive ) echo "Configuration of isl 0.15:";; esac cat <<\_ACEOF @@ -1423,10 +1437,12 @@ --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-silent-rules less verbose build output (undo: `make V=1') - --disable-silent-rules verbose build output (undo: `make V=0') - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build --enable-portable-binary disable compiler optimizations that would produce unportable binaries @@ -1444,21 +1460,15 @@ --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot[=DIR] Search for dependent libraries within DIR (or the - compiler's sysroot if not specified). + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + --with-int=gmp|imath Which package to use to represent multi-precision + integers [default=gmp] --with-gmp=system|build Which gmp to use [default=system] --with-gmp-prefix=DIR Prefix of gmp installation --with-gmp-exec-prefix=DIR Exec prefix of gmp installation --with-gmp-builddir=DIR Location of gmp builddir - --with-piplib=no|system|build - Which piplib to use [default=no] - --with-piplib-prefix=DIR - Prefix of piplib installation - --with-piplib-exec-prefix=DIR - Exec prefix of piplib installation - --with-piplib-builddir=DIR - Location of piplib builddir --with-clang=system|no Which clang to use [default=no] --with-clang-prefix=DIR Prefix of clang installation --with-clang-exec-prefix=DIR @@ -1543,10 +1553,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -isl configure 0.12.1 -generated by GNU Autoconf 2.68 +isl configure 0.15 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1702,7 +1712,7 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -1920,7 +1930,7 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -2010,7 +2020,8 @@ main () { static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2026,7 +2037,8 @@ main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2052,7 +2064,8 @@ main () { static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2068,7 +2081,8 @@ main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2102,7 +2116,8 @@ main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2308,63 +2323,6 @@ } # ac_fn_c_check_decl -# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES -# ---------------------------------------------------- -# Tries to find if the field MEMBER exists in type AGGR, after including -# INCLUDES, setting cache variable VAR accordingly. -ac_fn_c_check_member () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -$as_echo_n "checking for $2.$3... " >&6; } -if eval \${$4+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -int -main () -{ -static $2 ac_aggr; -if (ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -int -main () -{ -static $2 ac_aggr; -if (sizeof ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" -else - eval "$4=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$4 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_member - # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using @@ -2459,8 +2417,8 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by isl $as_me 0.12.1, which was -generated by GNU Autoconf 2.68. Invocation command line was +It was created by isl $as_me 0.15, which was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2837,7 +2795,7 @@ -am__api_version='1.11' +am__api_version='1.14' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2876,7 +2834,7 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2934,9 +2892,6 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -2947,32 +2902,40 @@ esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 - fi + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$2" = conftest.file ) then @@ -2984,6 +2947,16 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. @@ -3006,12 +2979,12 @@ esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then @@ -3023,10 +2996,10 @@ esac fi -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. +# will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. @@ -3045,7 +3018,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3085,7 +3058,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3136,7 +3109,7 @@ test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ @@ -3165,12 +3138,6 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -3189,7 +3156,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3253,6 +3220,45 @@ fi rmdir .tst 2>/dev/null +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." @@ -3275,7 +3281,7 @@ # Define the identity of the package. PACKAGE='isl' - VERSION='0.12.1' + VERSION='0.15' cat >>confdefs.h <<_ACEOF @@ -3303,27 +3309,79 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi -case $enable_silent_rules in -yes) AM_DEFAULT_VERBOSITY=0;; -no) AM_DEFAULT_VERBOSITY=1;; -*) AM_DEFAULT_VERBOSITY=0;; +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 @@ -3355,7 +3413,7 @@ AM_BACKSLASH='\' -versioninfo=12:1:2 +versioninfo=15:0:0 if test "x$prefix" != "xNONE"; then prefix_wd=`cd $prefix && pwd` @@ -3391,7 +3449,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3431,7 +3489,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3484,7 +3542,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3525,7 +3583,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -3583,7 +3641,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3627,7 +3685,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4073,8 +4131,7 @@ /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -4158,6 +4215,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" @@ -4177,7 +4293,7 @@ _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. +# Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include @@ -4233,8 +4349,8 @@ # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're @@ -4269,16 +4385,16 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -4287,8 +4403,8 @@ test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else @@ -4296,7 +4412,7 @@ fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -4378,7 +4494,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4422,7 +4538,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4618,8 +4734,8 @@ # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're @@ -4654,16 +4770,16 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -4672,8 +4788,8 @@ test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else @@ -4681,7 +4797,7 @@ fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -5483,7 +5599,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PRTDIAG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5758,8 +5874,8 @@ -macro_version='2.4.2.418' -macro_revision='2.4.2.418' +macro_version='2.4.2' +macro_revision='1.3337' @@ -5773,7 +5889,7 @@ -ltmain=$ac_aux_dir/ltmain.sh +ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. @@ -5822,7 +5938,7 @@ $ECHO "" } -case $ECHO in +case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 @@ -5866,7 +5982,7 @@ for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue + as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in @@ -5942,7 +6058,7 @@ for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -6008,7 +6124,7 @@ for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -6075,7 +6191,7 @@ for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue + as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in @@ -6145,19 +6261,19 @@ # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld -if test yes = "$GCC"; then +if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) - # gcc leaves a trailing carriage return, which upsets mingw + # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; @@ -6171,7 +6287,7 @@ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done - test -z "$LD" && LD=$ac_prog + test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. @@ -6182,7 +6298,7 @@ with_gnu_ld=unknown ;; esac -elif test yes = "$with_gnu_ld"; then +elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else @@ -6193,32 +6309,32 @@ $as_echo_n "(cached) " >&6 else if test -z "$LD"; then - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD=$ac_dir/$ac_prog + lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } @@ -6261,33 +6377,33 @@ else if test -n "$NM"; then # Let the user override the test. - lt_cv_path_NM=$NM + lt_cv_path_NM="$NM" else - lt_nm_to_check=${ac_tool_prefix}nm + lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/$lt_tmp_nm - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. - # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" - break 2 + break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" - break 2 + break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but @@ -6298,15 +6414,15 @@ esac fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } -if test no != "$lt_cv_path_NM"; then - NM=$lt_cv_path_NM +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : @@ -6331,7 +6447,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6375,7 +6491,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6412,9 +6528,9 @@ fi fi - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) - DUMPBIN="$DUMPBIN -symbols -headers" + DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: @@ -6422,8 +6538,8 @@ esac fi - if test : != "$DUMPBIN"; then - NM=$DUMPBIN + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm @@ -6474,7 +6590,7 @@ $as_echo_n "(cached) " >&6 else i=0 - teststring=ABCD + teststring="ABCD" case $build_os in msdosdjgpp*) @@ -6514,7 +6630,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -6565,22 +6681,22 @@ *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8; do + for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && - test 17 != "$i" # 1/2 MB should be enough + test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring @@ -6598,7 +6714,7 @@ fi -if test -n "$lt_cv_sys_max_cmd_len"; then +if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else @@ -6616,6 +6732,30 @@ : ${MV="mv -f"} : ${RM="rm -f"} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else @@ -6738,13 +6878,13 @@ reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) - if test yes != "$GCC"; then + if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) - if test yes = "$GCC"; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi @@ -6776,7 +6916,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6816,7 +6956,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6872,13 +7012,13 @@ # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. -# 'unknown' -- same as none, but documents that we really don't know. +# `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path -# that responds to the $file_magic_cmd with a given extended regex. -# If you have 'file' or equivalent on your system and you're not sure -# whether 'pass_all' will *always* work, you probably want this one. +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) @@ -6905,7 +7045,8 @@ # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else @@ -6983,7 +7124,7 @@ lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else @@ -7001,8 +7142,8 @@ lt_cv_deplibs_check_method=pass_all ;; -openbsd* | bitrig*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' @@ -7117,7 +7258,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7157,7 +7298,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7212,8 +7353,8 @@ case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh; - # decide which one to use based on capabilities of $DLLTOOL + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib @@ -7225,7 +7366,7 @@ ;; *) # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd=$ECHO + lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac @@ -7260,7 +7401,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7304,7 +7445,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7379,7 +7520,7 @@ ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - if test 0 -eq "$ac_status"; then + if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 @@ -7387,7 +7528,7 @@ ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - if test 0 -ne "$ac_status"; then + if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi @@ -7400,7 +7541,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } -if test no = "$lt_cv_ar_at_file"; then +if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file @@ -7429,7 +7570,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7469,7 +7610,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7528,7 +7669,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7568,7 +7709,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7617,7 +7758,7 @@ if test -n "$RANLIB"; then case $host_os in - bitrig* | openbsd*) + openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) @@ -7707,7 +7848,7 @@ symcode='[ABCDGISTW]' ;; hpux*) - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; @@ -7740,44 +7881,14 @@ symcode='[ABCDGIRSTW]' ;; esac -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" - # Adjust the below global symbol transforms to fixup imported variables. - lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" - lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" - lt_c_name_lib_hook="\ - -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ - -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" -else - # Disable hooks by default. - lt_cv_sys_global_symbol_to_import= - lt_cdecl_hook= - lt_c_name_hook= - lt_c_name_lib_hook= -fi - # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ -$lt_cdecl_hook\ -" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ -$lt_c_name_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" - -# Transform an extracted symbol line into symbol name with lib prefix and -# symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ -$lt_c_name_lib_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -7795,24 +7906,21 @@ # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function, - # D for any global variable and I for any imported variable. + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ -" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ -" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ -" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ -" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ -" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" @@ -7860,11 +7968,11 @@ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE -/* DATA imports from DLLs on WIN32 can't be const, because runtime +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST -#elif defined __osf__ +#elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else @@ -7890,7 +7998,7 @@ { { "@PROGRAM@", (void *) 0 }, _LT_EOF - $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; @@ -7910,13 +8018,13 @@ mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS - LIBS=conftstm.$ac_objext + LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest$ac_exeext; then + test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS @@ -7937,7 +8045,7 @@ rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. - if test yes = "$pipe_works"; then + if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= @@ -7990,16 +8098,6 @@ - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } @@ -8012,9 +8110,9 @@ lt_sysroot= -case $with_sysroot in #( +case ${with_sysroot} in #( yes) - if test yes = "$GCC"; then + if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( @@ -8024,8 +8122,8 @@ no|'') ;; #( *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 -$as_echo "$with_sysroot" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac @@ -8042,14 +8140,13 @@ enableval=$enable_libtool_lock; fi -test no = "$enable_libtool_lock" || enable_libtool_lock=yes +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) - # Find out what ABI is being produced by ac_compile, and set mode - # options accordingly. + # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -8058,25 +8155,24 @@ test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) - HPUX_IA64_MODE=32 + HPUX_IA64_MODE="32" ;; *ELF-64*) - HPUX_IA64_MODE=64 + HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. + # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - if test yes = "$lt_cv_prog_gnu_ld"; then + if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" @@ -8105,50 +8201,9 @@ rm -rf conftest* ;; -mips64*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - emul=elf - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - emul="${emul}32" - ;; - *64-bit*) - emul="${emul}64" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *MSB*) - emul="${emul}btsmip" - ;; - *LSB*) - emul="${emul}ltsmip" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *N32*) - emul="${emul}n32" - ;; - esac - LD="${LD-ld} -m $emul" - fi - rm -rf conftest* - ;; - x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. Note that the listed cases only cover the - # situations where additional linker options are needed (such as when - # doing 32-bit compilation for a host where ld defaults to 64-bit, or - # vice versa); the common cases where no linker options are needed do - # not appear in the list. + # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -8171,10 +8226,10 @@ ;; esac ;; - powerpc64le-*linux*) + powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; - powerpc64-*linux*) + powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -8193,10 +8248,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - powerpcle-*linux*) + powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; - powerpc-*linux*) + powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -8214,7 +8269,7 @@ *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS=$CFLAGS + SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } @@ -8254,14 +8309,13 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } - if test yes != "$lt_cv_cc_needs_belf"; then + if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS=$SAVE_CFLAGS + CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. + # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -8273,7 +8327,7 @@ case $lt_cv_prog_gnu_ld in yes*) case $host in - i?86-*-solaris*|x86_64-*-solaris*) + i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) @@ -8282,7 +8336,7 @@ esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD=${LD-ld}_sol2 + LD="${LD-ld}_sol2" fi ;; *) @@ -8298,7 +8352,7 @@ ;; esac -need_locks=$enable_libtool_lock +need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. @@ -8317,7 +8371,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8357,7 +8411,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8409,7 +8463,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test yes != "$lt_cv_path_mainfest_tool"; then +if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi @@ -8437,7 +8491,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8477,7 +8531,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8529,7 +8583,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8569,7 +8623,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8621,7 +8675,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8661,7 +8715,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8713,7 +8767,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8753,7 +8807,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8805,7 +8859,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8845,7 +8899,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8912,7 +8966,7 @@ $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no - if test -z "$LT_MULTI_MODULE"; then + if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the @@ -8930,7 +8984,7 @@ cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. - elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 @@ -8969,7 +9023,7 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS + LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 @@ -8998,7 +9052,7 @@ _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 - elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 @@ -9011,32 +9065,32 @@ $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac - if test yes = "$lt_cv_apple_cc_single_mod"; then + if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi - if test yes = "$lt_cv_ld_exported_symbols_list"; then - _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -9329,9 +9383,9 @@ func_stripname_cnf () { - case $2 in - .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; - *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf @@ -9358,14 +9412,14 @@ *) enable_shared=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" ;; esac else @@ -9389,14 +9443,14 @@ *) enable_static=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" ;; esac else @@ -9420,14 +9474,14 @@ *) pic_mode=default # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" ;; esac else @@ -9435,6 +9489,8 @@ fi +test -z "$pic_mode" && pic_mode=default + @@ -9450,14 +9506,14 @@ *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" ;; esac else @@ -9475,7 +9531,7 @@ # This can be used to rebuild libtool when needed -LIBTOOL_DEPS=$ltmain +LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -9524,7 +9580,7 @@ -if test -n "${ZSH_VERSION+set}"; then +if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi @@ -9563,7 +9619,7 @@ # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. - if test set != "${COLLECT_NAMES+set}"; then + if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -9574,14 +9630,14 @@ ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, +# All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a -with_gnu_ld=$lt_cv_prog_gnu_ld +with_gnu_ld="$lt_cv_prog_gnu_ld" -old_CC=$CC -old_CFLAGS=$CFLAGS +old_CC="$CC" +old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc @@ -9613,22 +9669,22 @@ else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD=$MAGIC_CMD - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/${ac_tool_prefix}file"; then - lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD=$lt_cv_path_MAGIC_CMD + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -9651,13 +9707,13 @@ break fi done - IFS=$lt_save_ifs - MAGIC_CMD=$lt_save_MAGIC_CMD + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi -MAGIC_CMD=$lt_cv_path_MAGIC_CMD +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } @@ -9679,22 +9735,22 @@ else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD=$MAGIC_CMD - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/file"; then - lt_cv_path_MAGIC_CMD=$ac_dir/"file" + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD=$lt_cv_path_MAGIC_CMD + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -9717,13 +9773,13 @@ break fi done - IFS=$lt_save_ifs - MAGIC_CMD=$lt_save_MAGIC_CMD + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi -MAGIC_CMD=$lt_cv_path_MAGIC_CMD +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } @@ -9744,7 +9800,7 @@ # Use C for the default configuration in the libtool script -lt_save_CC=$CC +lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -9806,7 +9862,7 @@ lt_prog_compiler_no_builtin_flag= -if test yes = "$GCC"; then +if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; @@ -9822,7 +9878,7 @@ lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment + lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -9852,7 +9908,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } -if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : @@ -9870,18 +9926,17 @@ lt_prog_compiler_static= - if test yes = "$GCC"; then + if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi - lt_prog_compiler_pic='-fPIC' ;; amigaos*) @@ -9892,8 +9947,8 @@ ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -9979,7 +10034,7 @@ case $host_os in aix*) lt_prog_compiler_wl='-Wl,' - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else @@ -9987,20 +10042,6 @@ fi ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - case $cc_basename in - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - esac - ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). @@ -10020,7 +10061,7 @@ ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='$wl-a ${wl}archive' + lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) @@ -10031,7 +10072,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in - # old Intel for x86_64, which still supported -KPIC. + # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' @@ -10056,12 +10097,6 @@ lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -10159,7 +10194,7 @@ ;; sysv4*MP*) - if test -d /usr/nec; then + if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi @@ -10188,7 +10223,7 @@ fi case $host_os in - # For platforms that do not support PIC, -DPIC is meaningless: + # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; @@ -10220,7 +10255,7 @@ lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -10250,7 +10285,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } -if test yes = "$lt_cv_prog_compiler_pic_works"; then +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; @@ -10282,7 +10317,7 @@ $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no - save_LDFLAGS=$LDFLAGS + save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -10301,13 +10336,13 @@ fi fi $RM -r conftest* - LDFLAGS=$save_LDFLAGS + LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } -if test yes = "$lt_cv_prog_compiler_static_works"; then +if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= @@ -10427,8 +10462,8 @@ -hard_links=nottested -if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } @@ -10440,9 +10475,9 @@ ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } - if test no = "$hard_links"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -10485,9 +10520,9 @@ # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ' (' and ')$', so one must not match beginning or - # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', - # as well as any symbol that contains 'd'. + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if @@ -10502,7 +10537,7 @@ # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. - if test yes != "$GCC"; then + if test "$GCC" != yes; then with_gnu_ld=no fi ;; @@ -10510,9 +10545,12 @@ # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; - openbsd* | bitrig*) + openbsd*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs=no + ;; esac ld_shlibs=yes @@ -10520,7 +10558,7 @@ # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no - if test yes = "$with_gnu_ld"; then + if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility @@ -10542,24 +10580,24 @@ esac fi - if test yes = "$lt_use_gnu_ld_interface"; then + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='$wl' + wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - export_dynamic_flag_spec='$wl--export-dynamic' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -10572,7 +10610,7 @@ case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken - if test ia64 != "$host_cpu"; then + if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 @@ -10591,7 +10629,7 @@ case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) @@ -10607,7 +10645,7 @@ allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi @@ -10617,7 +10655,7 @@ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='$wl--export-all-symbols' + export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes @@ -10625,61 +10663,61 @@ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='$wl-rpath,$libdir' - export_dynamic_flag_spec='$wl-E' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no - if test linux-dietlibc = "$host_os"; then + if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test no = "$tmp_diet" + && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -10690,44 +10728,42 @@ lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; - nagfor*) # NAGFOR 5.3 - tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test yes = "$supports_anon_versioning"; then + if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test yes = "$supports_anon_versioning"; then + if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -10736,13 +10772,13 @@ fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -10760,8 +10796,8 @@ _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -10773,7 +10809,7 @@ ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify @@ -10788,9 +10824,9 @@ # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -10807,15 +10843,15 @@ *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac - if test no = "$ld_shlibs"; then + if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= @@ -10831,7 +10867,7 @@ # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes - if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported @@ -10839,12 +10875,12 @@ ;; aix[4-9]*) - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag= + no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm @@ -10862,7 +10898,7 @@ # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do - if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi @@ -10885,13 +10921,13 @@ hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes - file_list_spec='$wl-f,' + file_list_spec='${wl}-f,' - if test yes = "$GCC"; then + if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` + collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -10910,35 +10946,36 @@ ;; esac shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag="$shared_flag "'$wl-G' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' fi + link_all_deplibs=no else # not using gcc - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' else - shared_flag='$wl-bM:SRE' + shared_flag='${wl}-bM:SRE' fi fi fi - export_dynamic_flag_spec='$wl-bexpall' + export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes - if test yes = "$aix_use_runtimelinking"; then + if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. - if test set = "${lt_cv_aix_libpath+set}"; then + if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : @@ -10973,7 +11010,7 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=/usr/lib:/lib + lt_cv_aix_libpath_="/usr/lib:/lib" fi fi @@ -10981,17 +11018,17 @@ aix_libpath=$lt_cv_aix_libpath_ fi - hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else - if test ia64 = "$host_cpu"; then - hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. - if test set = "${lt_cv_aix_libpath+set}"; then + if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : @@ -11026,7 +11063,7 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=/usr/lib:/lib + lt_cv_aix_libpath_="/usr/lib:/lib" fi fi @@ -11034,21 +11071,21 @@ aix_libpath=$lt_cv_aix_libpath_ fi - hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - no_undefined_flag=' $wl-bernotok' - allow_undefined_flag=' $wl-berok' - if test yes = "$with_gnu_ld"; then + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; @@ -11057,7 +11094,7 @@ case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) @@ -11087,17 +11124,16 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll + shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes @@ -11106,18 +11142,18 @@ # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # Assume MSVC wrapper @@ -11126,7 +11162,7 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll + shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. @@ -11145,24 +11181,24 @@ hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported - if test yes = "$lt_cv_ld_force_load"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes - allow_undefined_flag=$_lt_dar_allow_undefined + allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in - ifort*|nagfor*) _lt_dar_can_shared=yes ;; + ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac - if test yes = "$_lt_dar_can_shared"; then + if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no @@ -11204,33 +11240,33 @@ ;; hpux9*) - if test yes = "$GCC"; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi - hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes - export_dynamic_flag_spec='$wl-E' + export_dynamic_flag_spec='${wl}-E' ;; hpux10*) - if test yes,no = "$GCC,$with_gnu_ld"; then - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi - if test no = "$with_gnu_ld"; then - hardcode_libdir_flag_spec='$wl+b $wl$libdir' + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes - export_dynamic_flag_spec='$wl-E' + export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes @@ -11238,25 +11274,25 @@ ;; hpux11*) - if test yes,no = "$GCC,$with_gnu_ld"; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) - archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) - archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) @@ -11268,7 +11304,7 @@ $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no - save_LDFLAGS=$LDFLAGS + save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -11287,14 +11323,14 @@ fi fi $RM -r conftest* - LDFLAGS=$save_LDFLAGS + LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } -if test yes = "$lt_cv_prog_compiler__b"; then - archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi @@ -11302,8 +11338,8 @@ ;; esac fi - if test no = "$with_gnu_ld"; then - hardcode_libdir_flag_spec='$wl+b $wl$libdir' + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in @@ -11314,7 +11350,7 @@ *) hardcode_direct=yes hardcode_direct_absolute=yes - export_dynamic_flag_spec='$wl-E' + export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. @@ -11325,8 +11361,8 @@ ;; irix5* | irix6* | nonstopux*) - if test yes = "$GCC"; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + if test "$GCC" = yes; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. @@ -11336,8 +11372,8 @@ if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } @@ -11349,25 +11385,25 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS + LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test yes = "$lt_cv_irix_exported_symbol"; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -11381,7 +11417,7 @@ newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; @@ -11389,19 +11425,27 @@ *nto* | *qnx*) ;; - openbsd* | bitrig*) + openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='$wl-rpath,$libdir' - export_dynamic_flag_spec='$wl-E' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' else - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='$wl-rpath,$libdir' + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac fi else ld_shlibs=no @@ -11417,28 +11461,28 @@ ;; osf3*) - if test yes = "$GCC"; then - allow_undefined_flag=' $wl-expect_unresolved $wl\*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag - if test yes = "$GCC"; then - allow_undefined_flag=' $wl-expect_unresolved $wl\*' - archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' @@ -11449,24 +11493,24 @@ solaris*) no_undefined_flag=' -z defs' - if test yes = "$GCC"; then - wlarc='$wl' - archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' - archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) - wlarc='$wl' - archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi @@ -11476,11 +11520,11 @@ solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. GCC discards it without '$wl', + # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test yes = "$GCC"; then - whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi @@ -11490,10 +11534,10 @@ ;; sunos4*) - if test sequent = "$host_vendor"; then + if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. - archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi @@ -11542,43 +11586,43 @@ ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='$wl-z,text' + no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' - if test yes = "$GCC"; then - archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not + # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - no_undefined_flag='$wl-z,text' - allow_undefined_flag='$wl-z,nodefs' + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='$wl-R,$libdir' + hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes - export_dynamic_flag_spec='$wl-Bexport' + export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' - if test yes = "$GCC"; then - archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; @@ -11593,10 +11637,10 @@ ;; esac - if test sni = "$host_vendor"; then + if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='$wl-Blargedynsym' + export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi @@ -11604,7 +11648,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } -test no = "$ld_shlibs" && can_build_shared=no +test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -11630,7 +11674,7 @@ # Assume -lc should be added archive_cmds_need_lc=yes - if test yes,yes = "$GCC,$enable_shared"; then + if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. @@ -11845,14 +11889,14 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } -if test yes = "$GCC"; then +if test "$GCC" = yes; then case $host_os in - darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; - *) lt_awk_arg='/^libraries:/' ;; + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; - *) lt_sed_strip_eq='s|=/|/|g' ;; + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in @@ -11868,35 +11912,28 @@ ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary... + # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= - lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - # ...but if some path component already ends with the multilib dir we assume - # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). - case "$lt_multi_os_dir; $lt_search_path_spec " in - "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) - lt_multi_os_dir= - ;; - esac + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" - elif test -n "$lt_multi_os_dir"; then + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS = " "; FS = "/|\n";} { - lt_foo = ""; - lt_count = 0; +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { - lt_foo = "/" $lt_i lt_foo; + lt_foo="/" $lt_i lt_foo; } else { lt_count--; } @@ -11910,7 +11947,7 @@ # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's|/\([A-Za-z]:\)|\1|g'` ;; + $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else @@ -11919,7 +11956,7 @@ library_names_spec= libname_spec='lib$name' soname_spec= -shrext_cmds=.so +shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -11939,11 +11976,11 @@ case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='$libname$release$shared_ext$major' + soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) @@ -11951,40 +11988,40 @@ need_lib_prefix=no need_version=no hardcode_into_libs=yes - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 supports IA64 - library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with - # the line '#! .'. This would cause the generated library to - # depend on '.', always an invalid library. This was fixed in + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' - echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac - # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test yes = "$aix_use_runtimelinking"; then + if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi @@ -11995,18 +12032,18 @@ powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) - library_names_spec='$libname$shared_ext' + library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -12014,8 +12051,8 @@ bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" @@ -12027,7 +12064,7 @@ cygwin* | mingw* | pw32* | cegcc*) version_type=windows - shrext_cmds=.dll + shrext_cmds=".dll" need_version=no need_lib_prefix=no @@ -12036,8 +12073,8 @@ # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ @@ -12053,17 +12090,17 @@ case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix - soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' @@ -12072,8 +12109,8 @@ *,cl*) # Native MSVC libname_spec='$name' - soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - library_names_spec='$libname.dll.lib' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' case $build_os in mingw*) @@ -12100,7 +12137,7 @@ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) - sys_lib_search_path_spec=$LIB + sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` @@ -12113,8 +12150,8 @@ esac # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' @@ -12127,7 +12164,7 @@ *) # Assume MSVC wrapper - library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac @@ -12140,8 +12177,8 @@ version_type=darwin need_lib_prefix=no need_version=no - library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' - soname_spec='$libname$release$major$shared_ext' + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' @@ -12154,8 +12191,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -12173,12 +12210,12 @@ version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac @@ -12208,10 +12245,10 @@ need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=no + shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -12229,9 +12266,9 @@ dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - if test 32 = "$HPUX_IA64_MODE"; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" @@ -12244,8 +12281,8 @@ dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; @@ -12254,8 +12291,8 @@ dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... @@ -12268,8 +12305,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -12280,7 +12317,7 @@ case $host_os in nonstopux*) version_type=nonstopux ;; *) - if test yes = "$lt_cv_prog_gnu_ld"; then + if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix @@ -12288,8 +12325,8 @@ esac need_lib_prefix=no need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= @@ -12308,8 +12345,8 @@ esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" - sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; @@ -12318,33 +12355,13 @@ dynamic_linker=no ;; -linux*android*) - version_type=none # Android doesn't support versioned libraries. - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext' - soname_spec='$libname$release$shared_ext' - finish_cmds= - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - hardcode_libdir_flag_spec='-L$libdir' - ;; - # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -12403,17 +12420,29 @@ dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH @@ -12423,7 +12452,7 @@ newsos6) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; @@ -12432,34 +12461,45 @@ version_type=qnx need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; -openbsd* | bitrig*) +openbsd*) version_type=sunos - sys_lib_dlsearch_path_spec=/usr/lib + sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - need_version=no - else - need_version=yes - fi - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi ;; os2*) libname_spec='$name' - shrext_cmds=.dll + shrext_cmds=".dll" need_lib_prefix=no - library_names_spec='$libname$shared_ext $libname.a' + library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; @@ -12468,11 +12508,11 @@ version_type=osf need_lib_prefix=no need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) @@ -12483,8 +12523,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes @@ -12494,11 +12534,11 @@ sunos4*) version_type=sunos - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes - if test yes = "$with_gnu_ld"; then + if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes @@ -12506,8 +12546,8 @@ sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) @@ -12528,10 +12568,10 @@ ;; sysv4*MP*) - if test -d /usr/nec; then + if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' - soname_spec='$libname$shared_ext.$major' + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; @@ -12540,12 +12580,12 @@ version_type=freebsd-elf need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes - if test yes = "$with_gnu_ld"; then + if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' @@ -12563,7 +12603,7 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes @@ -12571,8 +12611,8 @@ uts4*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -12582,18 +12622,18 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } -test no = "$dynamic_linker" && can_build_shared=no +test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test yes = "$GCC"; then +if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then - sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi -if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then - sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi @@ -12692,15 +12732,15 @@ hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || - test yes = "$hardcode_automatic"; then + test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. - if test no != "$hardcode_direct" && + if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one - ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && - test no != "$hardcode_minus_L"; then + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else @@ -12715,12 +12755,12 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } -if test relink = "$hardcode_action" || - test yes = "$inherit_rpath"; then +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no -elif test yes = "$shlibpath_overrides_runpath" || - test no = "$enable_shared"; then +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi @@ -12730,7 +12770,7 @@ - if test yes != "$enable_dlopen"; then + if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown @@ -12740,23 +12780,23 @@ case $host_os in beos*) - lt_cv_dlopen=load_add_on + lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) - lt_cv_dlopen=LoadLibrary + lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) - lt_cv_dlopen=dlopen + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) - # if libdl is installed we need to link against it + # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : @@ -12794,10 +12834,10 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else - lt_cv_dlopen=dyld + lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes @@ -12805,18 +12845,10 @@ ;; - tpf*) - # Don't try to run any link tests for TPF. We know it's impossible - # because TPF is a cross-compiler, and we know how we open DSOs. - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - lt_cv_dlopen_self=no - ;; - *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : - lt_cv_dlopen=shl_load + lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } @@ -12855,11 +12887,11 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : - lt_cv_dlopen=dlopen + lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } @@ -12898,7 +12930,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } @@ -12937,7 +12969,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } @@ -12976,7 +13008,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : - lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi @@ -12997,21 +13029,21 @@ ;; esac - if test no = "$lt_cv_dlopen"; then - enable_dlopen=no - else + if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes + else + enable_dlopen=no fi case $lt_cv_dlopen in dlopen) - save_CPPFLAGS=$CPPFLAGS - test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS=$LDFLAGS + save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS=$LIBS + save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 @@ -13019,7 +13051,7 @@ if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else - if test yes = "$cross_compiling"; then : + if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -13068,7 +13100,7 @@ /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -13098,7 +13130,7 @@ (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in @@ -13118,14 +13150,14 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } - if test yes = "$lt_cv_dlopen_self"; then + if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else - if test yes = "$cross_compiling"; then : + if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -13174,7 +13206,7 @@ /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -13204,7 +13236,7 @@ (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in @@ -13225,9 +13257,9 @@ $as_echo "$lt_cv_dlopen_self_static" >&6; } fi - CPPFLAGS=$save_CPPFLAGS - LDFLAGS=$save_LDFLAGS - LIBS=$save_LIBS + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" ;; esac @@ -13271,7 +13303,7 @@ # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) - if test -n "$STRIP"; then + if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -13299,7 +13331,7 @@ - # Report what library types will actually be built + # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 @@ -13307,13 +13339,13 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } - test no = "$can_build_shared" && enable_shared=no + test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test yes = "$enable_shared" && enable_static=no + test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' @@ -13321,8 +13353,8 @@ ;; aix[4-9]*) - if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then - test yes = "$enable_shared" && enable_static=no + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no fi ;; esac @@ -13332,7 +13364,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes + test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } @@ -13346,11 +13378,11 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -CC=$lt_save_CC +CC="$lt_save_CC" - if test -n "$CXX" && ( test no != "$CXX" && - ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || - (test g++ != "$CXX"))); then + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -13529,7 +13561,7 @@ # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_caught_CXX_error"; then +if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" @@ -13604,32 +13636,32 @@ if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately - if test yes = "$GXX"; then + if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi - if test yes = "$GXX"; then + if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld -if test yes = "$GCC"; then +if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) - # gcc leaves a trailing carriage return, which upsets mingw + # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; @@ -13643,7 +13675,7 @@ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done - test -z "$LD" && LD=$ac_prog + test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. @@ -13654,7 +13686,7 @@ with_gnu_ld=unknown ;; esac -elif test yes = "$with_gnu_ld"; then +elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else @@ -13665,32 +13697,32 @@ $as_echo_n "(cached) " >&6 else if test -z "$LD"; then - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD=$ac_dir/$ac_prog + lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } @@ -13726,22 +13758,22 @@ # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. - if test yes = "$with_gnu_ld"; then - archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' - export_dynamic_flag_spec_CXX='$wl--export-dynamic' + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) - wlarc='$wl' + wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi @@ -13778,12 +13810,12 @@ ld_shlibs_CXX=no ;; aix[4-9]*) - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag= + no_entry_flag="" else aix_use_runtimelinking=no @@ -13817,13 +13849,13 @@ hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes - file_list_spec_CXX='$wl-f,' + file_list_spec_CXX='${wl}-f,' - if test yes = "$GXX"; then + if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` + collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -13841,36 +13873,36 @@ fi esac shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag=$shared_flag' $wl-G' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' else - shared_flag='$wl-bM:SRE' + shared_flag='${wl}-bM:SRE' fi fi fi - export_dynamic_flag_spec_CXX='$wl-bexpall' + export_dynamic_flag_spec_CXX='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes - if test yes = "$aix_use_runtimelinking"; then + if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. - if test set = "${lt_cv_aix_libpath+set}"; then + if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : @@ -13905,7 +13937,7 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=/usr/lib:/lib + lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi @@ -13913,18 +13945,18 @@ aix_libpath=$lt_cv_aix_libpath__CXX fi - hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else - if test ia64 = "$host_cpu"; then - hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. - if test set = "${lt_cv_aix_libpath+set}"; then + if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : @@ -13959,7 +13991,7 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=/usr/lib:/lib + lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi @@ -13967,14 +13999,14 @@ aix_libpath=$lt_cv_aix_libpath__CXX fi - hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - no_undefined_flag_CXX=' $wl-bernotok' - allow_undefined_flag_CXX=' $wl-berok' - if test yes = "$with_gnu_ld"; then + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' @@ -13982,7 +14014,7 @@ archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; @@ -13992,7 +14024,7 @@ allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi @@ -14020,58 +14052,57 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll + shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' - export_dynamic_flag_spec_CXX='$wl--export-all-symbols' + export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi @@ -14085,27 +14116,27 @@ hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported - if test yes = "$lt_cv_ld_force_load"; then - whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes - allow_undefined_flag_CXX=$_lt_dar_allow_undefined + allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in - ifort*|nagfor*) _lt_dar_can_shared=yes ;; + ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac - if test yes = "$_lt_dar_can_shared"; then + if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all - archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" - module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" - if test yes != "$lt_cv_apple_cc_single_mod"; then - archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + if test "$lt_cv_apple_cc_single_mod" != "yes"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else @@ -14149,14 +14180,14 @@ ;; haiku*) - archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) - hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='$wl-E' + export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default @@ -14168,7 +14199,7 @@ ld_shlibs_CXX=no ;; aCC*) - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -14177,11 +14208,11 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test yes = "$GXX"; then - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + if test "$GXX" = yes; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no @@ -14191,15 +14222,15 @@ ;; hpux10*|hpux11*) - if test no = "$with_gnu_ld"; then - hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) - export_dynamic_flag_spec_CXX='$wl-E' + export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi @@ -14225,13 +14256,13 @@ aCC*) case $host_cpu in hppa*64*) - archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists @@ -14242,20 +14273,20 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test yes = "$GXX"; then - if test no = "$with_gnu_ld"; then + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -14270,22 +14301,22 @@ interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' - export_dynamic_flag_spec_CXX='$wl-E' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -14294,17 +14325,17 @@ old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) - if test yes = "$GXX"; then - if test no = "$with_gnu_ld"; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac - hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; @@ -14317,8 +14348,8 @@ # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -14327,10 +14358,10 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' - export_dynamic_flag_spec_CXX='$wl--export-dynamic' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. @@ -14344,59 +14375,59 @@ # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac - archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no - hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' - export_dynamic_flag_spec_CXX='$wl--export-dynamic' - whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac - hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' - export_dynamic_flag_spec_CXX='$wl--export-dynamic' - whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' @@ -14410,18 +14441,18 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld - hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' - export_dynamic_flag_spec_CXX='$wl--export-dynamic' - archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - if test yes = "$supports_anon_versioning"; then + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) @@ -14429,10 +14460,10 @@ *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' - whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on @@ -14490,17 +14521,22 @@ ld_shlibs_CXX=yes ;; - openbsd* | bitrig*) + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + + openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='$wl-E' - whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else @@ -14516,9 +14552,9 @@ # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using @@ -14536,17 +14572,17 @@ cxx*) case $host in osf3*) - allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' - archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ - $RM $lib.exp' + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac @@ -14561,21 +14597,21 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test yes,no = "$GXX,$with_gnu_ld"; then - allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac - hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists @@ -14621,9 +14657,9 @@ # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no @@ -14631,7 +14667,7 @@ solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. + # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; @@ -14648,30 +14684,30 @@ ;; gcx*) # Green Hills C++ Compiler - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker - if test yes,no = "$GXX,$with_gnu_ld"; then - no_undefined_flag_CXX=' $wl-z ${wl}defs' + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else - # g++ 2.7 appears to require '-G' NOT '-shared' on this + # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. - archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -14679,11 +14715,11 @@ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi - hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) - whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi @@ -14692,52 +14728,52 @@ ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_CXX='$wl-z,text' + no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) - archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not + # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - no_undefined_flag_CXX='$wl-z,text' - allow_undefined_flag_CXX='$wl-z,nodefs' + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' + hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes - export_dynamic_flag_spec_CXX='$wl-Bexport' + export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) - archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ - '"$old_archive_cmds_CXX" + '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ - '"$reload_cmds_CXX" + '"$reload_cmds_CXX" ;; *) - archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; @@ -14769,10 +14805,10 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } - test no = "$ld_shlibs_CXX" && can_build_shared=no + test "$ld_shlibs_CXX" = no && can_build_shared=no - GCC_CXX=$GXX - LD_CXX=$LD + GCC_CXX="$GXX" + LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -14816,13 +14852,13 @@ pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case $prev$p in + case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. - if test x-L = "$p" || - test x-R = "$p"; then + if test $p = "-L" || + test $p = "-R"; then prev=$p continue fi @@ -14838,16 +14874,16 @@ case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac - if test no = "$pre_test_object_deps_done"; then - case $prev in + if test "$pre_test_object_deps_done" = no; then + case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX=$prev$p + compiler_lib_search_path_CXX="${prev}${p}" else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being @@ -14855,9 +14891,9 @@ esac else if test -z "$postdeps_CXX"; then - postdeps_CXX=$prev$p + postdeps_CXX="${prev}${p}" else - postdeps_CXX="${postdeps_CXX} $prev$p" + postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi prev= @@ -14872,15 +14908,15 @@ continue fi - if test no = "$pre_test_object_deps_done"; then + if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then - predep_objects_CXX=$p + predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then - postdep_objects_CXX=$p + postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi @@ -14926,7 +14962,7 @@ ;; esac - if test yes != "$solaris_use_stlport4"; then + if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; @@ -14949,7 +14985,7 @@ # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. - if test yes != "$solaris_use_stlport4"; then + if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; @@ -14963,7 +14999,7 @@ esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then - compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi @@ -15002,18 +15038,17 @@ # C++ specific cases for pic, static, wl, etc. - if test yes = "$GXX"; then + if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi - lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) @@ -15024,8 +15059,8 @@ ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -15089,7 +15124,7 @@ case $host_os in aix[4-9]*) # All AIX code is PIC. - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else @@ -15129,14 +15164,14 @@ case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='$wl-a ${wl}archive' - if test ia64 != "$host_cpu"; then + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default @@ -15173,7 +15208,7 @@ lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) - # old Intel C++ for x86_64, which still supported -KPIC. + # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' @@ -15229,7 +15264,7 @@ ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -15318,7 +15353,7 @@ fi case $host_os in - # For platforms that do not support PIC, -DPIC is meaningless: + # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; @@ -15350,7 +15385,7 @@ lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -15380,7 +15415,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } -if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then +if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; @@ -15406,7 +15441,7 @@ $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no - save_LDFLAGS=$LDFLAGS + save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -15425,13 +15460,13 @@ fi fi $RM -r conftest* - LDFLAGS=$save_LDFLAGS + LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } -if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then +if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= @@ -15545,8 +15580,8 @@ -hard_links=nottested -if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } @@ -15558,9 +15593,9 @@ ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } - if test no = "$hard_links"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -15587,7 +15622,7 @@ fi ;; pw32*) - export_symbols_cmds_CXX=$ltdll_cmds + export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in @@ -15600,6 +15635,9 @@ ;; esac ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs_CXX=no + ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -15607,7 +15645,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } -test no = "$ld_shlibs_CXX" && can_build_shared=no +test "$ld_shlibs_CXX" = no && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld @@ -15624,7 +15662,7 @@ # Assume -lc should be added archive_cmds_need_lc_CXX=yes - if test yes,yes = "$GCC,$enable_shared"; then + if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. @@ -15752,7 +15790,7 @@ library_names_spec= libname_spec='lib$name' soname_spec= -shrext_cmds=.so +shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -15772,11 +15810,11 @@ case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='$libname$release$shared_ext$major' + soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) @@ -15784,40 +15822,40 @@ need_lib_prefix=no need_version=no hardcode_into_libs=yes - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 supports IA64 - library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with - # the line '#! .'. This would cause the generated library to - # depend on '.', always an invalid library. This was fixed in + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' - echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac - # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test yes = "$aix_use_runtimelinking"; then + if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi @@ -15828,18 +15866,18 @@ powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) - library_names_spec='$libname$shared_ext' + library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -15847,8 +15885,8 @@ bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" @@ -15860,7 +15898,7 @@ cygwin* | mingw* | pw32* | cegcc*) version_type=windows - shrext_cmds=.dll + shrext_cmds=".dll" need_version=no need_lib_prefix=no @@ -15869,8 +15907,8 @@ # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ @@ -15886,16 +15924,16 @@ case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix - soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' @@ -15904,8 +15942,8 @@ *,cl*) # Native MSVC libname_spec='$name' - soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - library_names_spec='$libname.dll.lib' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' case $build_os in mingw*) @@ -15932,7 +15970,7 @@ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) - sys_lib_search_path_spec=$LIB + sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` @@ -15945,8 +15983,8 @@ esac # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' @@ -15959,7 +15997,7 @@ *) # Assume MSVC wrapper - library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac @@ -15972,8 +16010,8 @@ version_type=darwin need_lib_prefix=no need_version=no - library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' - soname_spec='$libname$release$major$shared_ext' + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' @@ -15985,8 +16023,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -16004,12 +16042,12 @@ version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac @@ -16039,10 +16077,10 @@ need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=no + shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -16060,9 +16098,9 @@ dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - if test 32 = "$HPUX_IA64_MODE"; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" @@ -16075,8 +16113,8 @@ dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; @@ -16085,8 +16123,8 @@ dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... @@ -16099,8 +16137,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -16111,7 +16149,7 @@ case $host_os in nonstopux*) version_type=nonstopux ;; *) - if test yes = "$lt_cv_prog_gnu_ld"; then + if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix @@ -16119,8 +16157,8 @@ esac need_lib_prefix=no need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= @@ -16139,8 +16177,8 @@ esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" - sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; @@ -16149,33 +16187,13 @@ dynamic_linker=no ;; -linux*android*) - version_type=none # Android doesn't support versioned libraries. - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext' - soname_spec='$libname$release$shared_ext' - finish_cmds= - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - hardcode_libdir_flag_spec_CXX='-L$libdir' - ;; - # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -16234,17 +16252,29 @@ dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH @@ -16254,7 +16284,7 @@ newsos6) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; @@ -16263,34 +16293,45 @@ version_type=qnx need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; -openbsd* | bitrig*) +openbsd*) version_type=sunos - sys_lib_dlsearch_path_spec=/usr/lib + sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - need_version=no - else - need_version=yes - fi - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi ;; os2*) libname_spec='$name' - shrext_cmds=.dll + shrext_cmds=".dll" need_lib_prefix=no - library_names_spec='$libname$shared_ext $libname.a' + library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; @@ -16299,11 +16340,11 @@ version_type=osf need_lib_prefix=no need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) @@ -16314,8 +16355,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes @@ -16325,11 +16366,11 @@ sunos4*) version_type=sunos - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes - if test yes = "$with_gnu_ld"; then + if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes @@ -16337,8 +16378,8 @@ sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) @@ -16359,10 +16400,10 @@ ;; sysv4*MP*) - if test -d /usr/nec; then + if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' - soname_spec='$libname$shared_ext.$major' + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; @@ -16371,12 +16412,12 @@ version_type=freebsd-elf need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes - if test yes = "$with_gnu_ld"; then + if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' @@ -16394,7 +16435,7 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes @@ -16402,8 +16443,8 @@ uts4*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -16413,18 +16454,18 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } -test no = "$dynamic_linker" && can_build_shared=no +test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test yes = "$GCC"; then +if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then - sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi -if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then - sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi @@ -16469,15 +16510,15 @@ hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || - test yes = "$hardcode_automatic_CXX"; then + test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existent directories. - if test no != "$hardcode_direct_CXX" && + if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one - ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && - test no != "$hardcode_minus_L_CXX"; then + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else @@ -16492,12 +16533,12 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } -if test relink = "$hardcode_action_CXX" || - test yes = "$inherit_rpath_CXX"; then +if test "$hardcode_action_CXX" = relink || + test "$inherit_rpath_CXX" = yes; then # Fast installation is not supported enable_fast_install=no -elif test yes = "$shlibpath_overrides_runpath" || - test no = "$enable_shared"; then +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi @@ -16520,7 +16561,7 @@ lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test yes != "$_lt_caught_CXX_error" +fi # test "$_lt_caught_CXX_error" != yes ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -16567,7 +16608,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PERL="perl" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -16604,7 +16645,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PDFLATEX="pdflatex" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -16641,7 +16682,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_POD2HTML="pod2html" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -17136,6 +17177,30 @@ +# Check whether --with-int was given. +if test "${with_int+set}" = set; then : + withval=$with_int; +else + with_int=gmp +fi + +case "$with_int" in +gmp|imath) + ;; +*) + as_fn_error $? "bad value ${withval} for --with-int (use gmp or imath)" "$LINENO" 5 +esac + + + + +case "$with_int" in +gmp) + + +$as_echo "#define USE_GMP_FOR_MP /**/" >>confdefs.h + + # Check whether --with-gmp was given. @@ -17223,24 +17288,20 @@ $as_echo "$with_gmp" >&6; } - - - - case "$with_gmp" in system) if test "x$with_gmp_prefix" != "x"; then isl_configure_args="$isl_configure_args --with-gmp=$with_gmp_prefix" - GMP_CPPFLAGS="-I$with_gmp_prefix/include" - GMP_LDFLAGS="-L$with_gmp_prefix/lib" + MP_CPPFLAGS="-I$with_gmp_prefix/include" + MP_LDFLAGS="-L$with_gmp_prefix/lib" fi - GMP_LIBS=-lgmp + MP_LIBS=-lgmp SAVE_CPPFLAGS="$CPPFLAGS" SAVE_LDFLAGS="$LDFLAGS" SAVE_LIBS="$LIBS" - CPPFLAGS="$GMP_CPPFLAGS $CPPFLAGS" - LDFLAGS="$GMP_LDFLAGS $LDFLAGS" - LIBS="$GMP_LIBS $LIBS" + CPPFLAGS="$MP_CPPFLAGS $CPPFLAGS" + LDFLAGS="$MP_LDFLAGS $LDFLAGS" + LIBS="$MP_LIBS $LIBS" ac_fn_c_check_header_mongrel "$LINENO" "gmp.h" "ac_cv_header_gmp_h" "$ac_includes_default" if test "x$ac_cv_header_gmp_h" = xyes; then : @@ -17317,16 +17378,16 @@ LIBS="$SAVE_LIBS" ;; build) - GMP_CPPFLAGS="-I$gmp_srcdir -I$with_gmp_builddir" - GMP_LIBS="$with_gmp_builddir/libgmp.la" + MP_CPPFLAGS="-I$gmp_srcdir -I$with_gmp_builddir" + MP_LIBS="$with_gmp_builddir/libgmp.la" ;; esac SAVE_CPPFLAGS="$CPPFLAGS" SAVE_LDFLAGS="$LDFLAGS" SAVE_LIBS="$LIBS" -CPPFLAGS="$GMP_CPPFLAGS $CPPFLAGS" -LDFLAGS="$GMP_LDFLAGS $LDFLAGS" -LIBS="$GMP_LIBS $LIBS" +CPPFLAGS="$MP_CPPFLAGS $CPPFLAGS" +LDFLAGS="$MP_LDFLAGS $LDFLAGS" +LIBS="$MP_LIBS $LIBS" need_get_memory_functions=false ac_fn_c_check_decl "$LINENO" "mp_get_memory_functions" "ac_cv_have_decl_mp_get_memory_functions" "#include " @@ -17347,43 +17408,6 @@ fi -if test "$cross_compiling" = yes; then : - need_normalized_gcdext=true -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - - mpz_t x,y,g,a,b; - mpz_init(x); - mpz_init(y); - mpz_init(g); - mpz_init(a); - mpz_init(b); - mpz_set_si(x, -1); - mpz_set_si(y, 9); - mpz_gcdext(g, a, b, x, y); - if (mpz_get_si(a) == -1 && mpz_get_si(b) == 0) - return 0; - else - return 1; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - need_normalized_gcdext=false -else - need_normalized_gcdext=true -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - CPPFLAGS="$SAVE_CPPFLAGS" LDFLAGS="$SAVE_LDFLAGS" LIBS="$SAVE_LIBS" @@ -17395,198 +17419,89 @@ NEED_GET_MEMORY_FUNCTIONS_FALSE= fi -if test $need_normalized_gcdext = true; then - -$as_echo "#define GMP_NORMALIZE_GCDEXT /**/" >>confdefs.h - -fi + ;; +imath) +$as_echo "#define USE_IMATH_FOR_MP /**/" >>confdefs.h -# Check whether --with-piplib was given. -if test "${with_piplib+set}" = set; then : - withval=$with_piplib; -fi -case "system" in -no|system|build) - -# Check whether --with-piplib_prefix was given. -if test "${with_piplib_prefix+set}" = set; then : - withval=$with_piplib_prefix; -fi +MP_CPPFLAGS="-I$srcdir/imath_wrap" +MP_LDFLAGS="" +MP_LIBS="" +SAVE_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$MP_CPPFLAGS $CPPFLAGS" +ac_fn_c_check_header_mongrel "$LINENO" "imath.h" "ac_cv_header_imath_h" "$ac_includes_default" +if test "x$ac_cv_header_imath_h" = xyes; then : -# Check whether --with-piplib_exec_prefix was given. -if test "${with_piplib_exec_prefix+set}" = set; then : - withval=$with_piplib_exec_prefix; +else + as_fn_error $? "imath.h header not found" "$LINENO" 5 fi -esac -# Check whether --with-piplib_builddir was given. -if test "${with_piplib_builddir+set}" = set; then : - withval=$with_piplib_builddir; -fi +ac_fn_c_check_header_mongrel "$LINENO" "gmp_compat.h" "ac_cv_header_gmp_compat_h" "$ac_includes_default" +if test "x$ac_cv_header_gmp_compat_h" = xyes; then : -if test "x$with_piplib_prefix" != "x" -a "x$with_piplib_exec_prefix" = "x"; then - with_piplib_exec_prefix=$with_piplib_prefix -fi -if test "x$with_piplib_prefix" != "x" -o "x$with_piplib_exec_prefix" != "x"; then - if test "x$with_piplib" != "x" -a "x$with_piplib" != "xyes" -a "x$with_piplib" != "xsystem"; then - as_fn_error $? "Setting $with_piplib_prefix implies use of system piplib" "$LINENO" 5 - fi - with_piplib="system" -fi -if test "x$with_piplib_builddir" != "x"; then - if test "x$with_piplib" != "x" -a "x$with_piplib" != "xyes" -a "x$with_piplib" != "xbuild"; then - as_fn_error $? "Setting $with_piplib_builddir implies use of build piplib" "$LINENO" 5 - fi - with_piplib="build" - piplib_srcdir=`echo @abs_srcdir@ | $with_piplib_builddir/config.status --file=-` - { $as_echo "$as_me:${as_lineno-$LINENO}: piplib sources in $piplib_srcdir" >&5 -$as_echo "$as_me: piplib sources in $piplib_srcdir" >&6;} -fi -if test "x$with_piplib_exec_prefix" != "x"; then - export PKG_CONFIG_PATH="$with_piplib_exec_prefix/lib/pkgconfig${PKG_CONFIG_PATH+:$PKG_CONFIG_PATH}" +else + as_fn_error $? "gmp_compat.h header not found" "$LINENO" 5 fi -case "$with_piplib" in -no|system|build) - ;; -*) - case "no" in - bundled) - if test -d $srcdir/.git -a \ - -d $srcdir/piplib -a \ - ! -d $srcdir/piplib/.git; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: git repo detected, but submodule piplib not initialized" >&5 -$as_echo "$as_me: WARNING: git repo detected, but submodule piplib not initialized" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You may want to run" >&5 -$as_echo "$as_me: WARNING: You may want to run" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: git submodule init" >&5 -$as_echo "$as_me: WARNING: git submodule init" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: git submodule update" >&5 -$as_echo "$as_me: WARNING: git submodule update" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: sh autogen.sh" >&5 -$as_echo "$as_me: WARNING: sh autogen.sh" >&2;} - fi - if test -f $srcdir/piplib/configure; then - with_piplib="bundled" - else - with_piplib="no" - fi - ;; - *) - with_piplib="no" - ;; - esac - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which piplib to use" >&5 -$as_echo_n "checking which piplib to use... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_piplib" >&5 -$as_echo "$with_piplib" >&6; } +CPPFLAGS="$SAVE_CPPFLAGS" -have_piplib=false - + if test x = xfalse; then + NEED_GET_MEMORY_FUNCTIONS_TRUE= + NEED_GET_MEMORY_FUNCTIONS_FALSE='#' +else + NEED_GET_MEMORY_FUNCTIONS_TRUE='#' + NEED_GET_MEMORY_FUNCTIONS_FALSE= +fi -case "$with_piplib" in - build) - PIPLIB_CPPFLAGS="-I$piplib_srcdir/include" - PIPLIB_LIBS="$with_piplib_builddir/libpiplibMP.la" ;; - system) - PIPLIB_LIBS="-lpiplibMP" - if test "x$with_piplib_prefix" != "x"; then - PIPLIB_CPPFLAGS="-I$with_piplib_prefix/include" - PIPLIB_LDFLAGS="-L$with_piplib_prefix/lib" - fi - SAVE_CPPFLAGS="$CPPFLAGS" - SAVE_LDFLAGS="$LDFLAGS" - CPPFLAGS="$PIPLIB_CPPFLAGS $CPPFLAGS" - LDFLAGS="$PIPLIB_LDFLAGS $LDFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pip_solve in -lpiplibMP" >&5 -$as_echo_n "checking for pip_solve in -lpiplibMP... " >&6; } -if ${ac_cv_lib_piplibMP_pip_solve+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpiplibMP $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +esac -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pip_solve (); -int -main () -{ -return pip_solve (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_piplibMP_pip_solve=yes + if test x$with_int = ximath; then + IMATH_FOR_MP_TRUE= + IMATH_FOR_MP_FALSE='#' else - ac_cv_lib_piplibMP_pip_solve=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + IMATH_FOR_MP_TRUE='#' + IMATH_FOR_MP_FALSE= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_piplibMP_pip_solve" >&5 -$as_echo "$ac_cv_lib_piplibMP_pip_solve" >&6; } -if test "x$ac_cv_lib_piplibMP_pip_solve" = xyes; then : - - ac_fn_c_check_member "$LINENO" "PipOptions" "Urs_parms" "ac_cv_member_PipOptions_Urs_parms" "#include -" -if test "x$ac_cv_member_PipOptions_Urs_parms" = xyes; then : + if test x$with_int = xgmp; then + GMP_FOR_MP_TRUE= + GMP_FOR_MP_FALSE='#' else - - as_fn_error $? "Piplib too old; please install version 1.3.6 or newer" "$LINENO" 5 - + GMP_FOR_MP_TRUE='#' + GMP_FOR_MP_FALSE= fi - +ac_fn_c_check_decl "$LINENO" "ffs" "ac_cv_have_decl_ffs" "#include +" +if test "x$ac_cv_have_decl_ffs" = xyes; then : + ac_have_decl=1 else - - as_fn_error $? "Piplib not found" "$LINENO" 5 - + ac_have_decl=0 fi - CPPFLAGS="$SAVE_CPPFLAGS" - LDFLAGS="$SAVE_LDFLAGS" - ;; - no) - ;; - *) - as_fn_error $? "unsupported" "$LINENO" 5 - ;; -esac -if test "$with_piplib" != "no"; then - -$as_echo "#define ISL_PIPLIB /**/" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FFS $ac_have_decl +_ACEOF - have_piplib=true -fi - if test x$have_piplib = xtrue; then - HAVE_PIPLIB_TRUE= - HAVE_PIPLIB_FALSE='#' +ac_fn_c_check_decl "$LINENO" "__builtin_ffs" "ac_cv_have_decl___builtin_ffs" "$ac_includes_default" +if test "x$ac_cv_have_decl___builtin_ffs" = xyes; then : + ac_have_decl=1 else - HAVE_PIPLIB_TRUE='#' - HAVE_PIPLIB_FALSE= + ac_have_decl=0 fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL___BUILTIN_FFS $ac_have_decl +_ACEOF + @@ -17692,7 +17607,7 @@ for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -17756,7 +17671,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_llvm_config_found="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -17795,6 +17710,10 @@ components="$components option" fi CLANG_LIBS=`$llvm_config --libs $components` + systemlibs=`$llvm_config --system-libs 2> /dev/null | tail -1` + if test $? -eq 0; then + CLANG_LIBS="$CLANG_LIBS $systemlibs" + fi CLANG_PREFIX=`$llvm_config --prefix` cat >>confdefs.h <<_ACEOF @@ -17905,6 +17824,27 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include +int +main () +{ + + using namespace clang; + DiagnosticsEngine *Diags; + new driver::Driver("", "", "", *Diags); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +$as_echo "#define DRIVER_CTOR_TAKES_DEFAULTIMAGENAME /**/" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ #include _ACEOF @@ -17942,6 +17882,28 @@ { using namespace clang; + std::shared_ptr TO; + DiagnosticsEngine *Diags; + TargetInfo::CreateTargetInfo(*Diags, TO); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +$as_echo "#define CREATETARGETINFO_TAKES_SHARED_PTR /**/" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + using namespace clang; TargetOptions *TO; DiagnosticsEngine *Diags; TargetInfo::CreateTargetInfo(*Diags, TO); @@ -18001,6 +17963,79 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "getNumParams" >/dev/null 2>&1; then : + +$as_echo "#define getNumArgs getNumParams" >>confdefs.h + + +$as_echo "#define getArgType getParamType" >>confdefs.h + +fi +rm -f conftest* + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "getReturnType" >/dev/null 2>&1; then : + +else + +$as_echo "#define getReturnType getResultType" >>confdefs.h + +fi +rm -f conftest* + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + using namespace clang; + CompilerInstance *Clang; + Clang->createPreprocessor(TU_Complete); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +$as_echo "#define CREATEPREPROCESSOR_TAKES_TUKIND /**/" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "setMainFileID" >/dev/null 2>&1; then : + +$as_echo "#define HAVE_SETMAINFILEID /**/" >>confdefs.h + +fi +rm -f conftest* + + ac_fn_cxx_check_header_mongrel "$LINENO" "llvm/ADT/OwningPtr.h" "ac_cv_header_llvm_ADT_OwningPtr_h" "$ac_includes_default" +if test "x$ac_cv_header_llvm_ADT_OwningPtr_h" = xyes; then : + +$as_echo "#define HAVE_ADT_OWNINGPTR_H /**/" >>confdefs.h + +fi + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -18103,9 +18138,9 @@ -PACKAGE_CFLAGS="$GMP_CPPFLAGS" -PACKAGE_LDFLAGS="$GMP_LDFLAGS" -PACKAGE_LIBS="-lisl -lgmp" +PACKAGE_CFLAGS="$MP_CPPFLAGS" +PACKAGE_LDFLAGS="$MP_LDFLAGS" +PACKAGE_LIBS="-lisl $MP_LIBS" # we need the expanded forms... test "x$prefix" = xNONE && prefix=$ac_default_prefix @@ -18295,10 +18330,15 @@ - if test -f $srcdir/.git/HEAD; then + if test -f $srcdir/.git; then + gitdir=`GIT_DIR=$srcdir/.git git rev-parse --git-dir` + GIT_HEAD="$gitdir/index" + GIT_REPO="$gitdir" + GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe --always` + elif test -f $srcdir/.git/HEAD; then GIT_HEAD="$srcdir/.git/index" GIT_REPO="$srcdir/.git" - GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe` + GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe --always` elif test -f $srcdir/GIT_HEAD_ID; then GIT_HEAD_ID=`cat $srcdir/GIT_HEAD_ID` else @@ -18315,7 +18355,7 @@ if test -z "$GIT_REPO" ; then GIT_HEAD_VERSION="$GIT_HEAD_ID" else - GIT_HEAD_VERSION="\`GIT_DIR=$GIT_REPO git describe\`" + GIT_HEAD_VERSION="\`GIT_DIR=$GIT_REPO git describe --always\`" fi echo '#define GIT_HEAD_ID "'$GIT_HEAD_ID'"' > gitversion.h @@ -18323,8 +18363,6 @@ ac_config_headers="$ac_config_headers isl_config.h" -ac_config_headers="$ac_config_headers include/isl/config.h" - ac_config_files="$ac_config_files Makefile" ac_config_files="$ac_config_files doc/Makefile" @@ -18449,6 +18487,14 @@ LTLIBOBJS=$ac_ltlibobjs +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -18477,8 +18523,16 @@ as_fn_error $? "conditional \"NEED_GET_MEMORY_FUNCTIONS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${HAVE_PIPLIB_TRUE}" && test -z "${HAVE_PIPLIB_FALSE}"; then - as_fn_error $? "conditional \"HAVE_PIPLIB\" was never defined. +if test -z "${NEED_GET_MEMORY_FUNCTIONS_TRUE}" && test -z "${NEED_GET_MEMORY_FUNCTIONS_FALSE}"; then + as_fn_error $? "conditional \"NEED_GET_MEMORY_FUNCTIONS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${IMATH_FOR_MP_TRUE}" && test -z "${IMATH_FOR_MP_FALSE}"; then + as_fn_error $? "conditional \"IMATH_FOR_MP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GMP_FOR_MP_TRUE}" && test -z "${GMP_FOR_MP_FALSE}"; then + as_fn_error $? "conditional \"GMP_FOR_MP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_CLANG_TRUE}" && test -z "${HAVE_CLANG_FALSE}"; then @@ -18783,16 +18837,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -18852,28 +18906,16 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -18894,8 +18936,8 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by isl $as_me 0.12.1, which was -generated by GNU Autoconf 2.68. Invocation command line was +This file was extended by isl $as_me 0.15, which was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -18960,11 +19002,11 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -isl config.status 0.12.1 -configured by $0, generated by GNU Autoconf 2.68, +isl config.status 0.15 +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -19055,7 +19097,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -19144,10 +19186,8 @@ GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' -lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' @@ -19319,10 +19359,8 @@ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ -lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -lt_cv_nm_interface \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ @@ -19389,7 +19427,7 @@ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -19430,7 +19468,7 @@ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -19439,16 +19477,19 @@ done ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' -# See if we are running on zsh, and set the options that allow our +# See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}"; then +if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' @@ -19510,7 +19551,6 @@ "$ac_stdint_h") CONFIG_COMMANDS="$CONFIG_COMMANDS $ac_stdint_h" ;; "$ax_create_pkgconfig_generate") CONFIG_COMMANDS="$CONFIG_COMMANDS $ax_create_pkgconfig_generate" ;; "isl_config.h") CONFIG_HEADERS="$CONFIG_HEADERS isl_config.h" ;; - "include/isl/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/isl/config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "interface/Makefile") CONFIG_FILES="$CONFIG_FILES interface/Makefile" ;; @@ -20113,7 +20153,7 @@ case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files + # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in @@ -20126,7 +20166,7 @@ # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but + # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. @@ -20160,21 +20200,19 @@ continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. + # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || @@ -20209,13 +20247,13 @@ ;; "libtool":C) - # See if we are running on zsh, and set the options that allow our + # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}"; then + if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi - cfgfile=${ofile}T + cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" @@ -20223,7 +20261,7 @@ #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE) $VERSION +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # @@ -20257,7 +20295,7 @@ # The names of the tagged configurations supported by this script. -available_tags='CXX ' +available_tags="CXX " # ### BEGIN LIBTOOL CONFIG @@ -20394,22 +20432,16 @@ # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -# Transform the output of nm into a list of symbols to manually relocate. -global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import - # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix -# The name lister interface. -nm_interface=$lt_lt_cv_nm_interface - # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec -# The root where to search for dependent libraries,and where our libraries should be installed. +# The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. @@ -20596,13 +20628,13 @@ # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute @@ -20674,7 +20706,7 @@ # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. -if test set != "${COLLECT_NAMES+set}"; then +if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -20683,7 +20715,7 @@ esac -ltmain=$ac_aux_dir/ltmain.sh +ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if @@ -20693,6 +20725,165 @@ sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -20779,13 +20970,13 @@ # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX diff -Nru cloog-0.18.2/isl/configure.ac cloog-0.18.4/isl/configure.ac --- cloog-0.18.2/isl/configure.ac 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/configure.ac 2015-07-24 12:23:09.000000000 +0000 @@ -1,10 +1,10 @@ -AC_INIT([isl], [0.12.1], [isl-development@googlegroups.com]) +AC_INIT([isl], [0.15], [isl-development@googlegroups.com]) AC_CONFIG_AUX_DIR([.]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign]) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) AC_SUBST(versioninfo) -versioninfo=12:1:2 +versioninfo=15:0:0 if test "x$prefix" != "xNONE"; then prefix_wd=`cd $prefix && pwd` @@ -35,118 +35,34 @@ AX_CREATE_STDINT_H(include/isl/stdint.h) -AX_SUBMODULE(gmp,system|build,system) - -AC_SUBST(GMP_CPPFLAGS) -AC_SUBST(GMP_LDFLAGS) -AC_SUBST(GMP_LIBS) -case "$with_gmp" in -system) - if test "x$with_gmp_prefix" != "x"; then - isl_configure_args="$isl_configure_args --with-gmp=$with_gmp_prefix" - GMP_CPPFLAGS="-I$with_gmp_prefix/include" - GMP_LDFLAGS="-L$with_gmp_prefix/lib" - fi - GMP_LIBS=-lgmp - SAVE_CPPFLAGS="$CPPFLAGS" - SAVE_LDFLAGS="$LDFLAGS" - SAVE_LIBS="$LIBS" - CPPFLAGS="$GMP_CPPFLAGS $CPPFLAGS" - LDFLAGS="$GMP_LDFLAGS $LDFLAGS" - LIBS="$GMP_LIBS $LIBS" - AC_CHECK_HEADER([gmp.h], [], [AC_ERROR([gmp.h header not found])]) - AC_CHECK_LIB([gmp], [main], [], [AC_ERROR([gmp library not found])]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ - mpz_t n, d; - if (mpz_divisible_p(n, d)) - mpz_divexact_ui(n, n, 4); - ]])], [], [AC_ERROR([gmp library too old])]) - CPPFLAGS="$SAVE_CPPFLAGS" - LDFLAGS="$SAVE_LDFLAGS" - LIBS="$SAVE_LIBS" - ;; -build) - GMP_CPPFLAGS="-I$gmp_srcdir -I$with_gmp_builddir" - GMP_LIBS="$with_gmp_builddir/libgmp.la" +AC_ARG_WITH([int], + [AS_HELP_STRING([--with-int=gmp|imath], + [Which package to use to represent + multi-precision integers [default=gmp]])], + [], [with_int=gmp]) +case "$with_int" in +gmp|imath) ;; +*) + AC_MSG_ERROR([bad value ${withval} for --with-int (use gmp or imath)]) esac -SAVE_CPPFLAGS="$CPPFLAGS" -SAVE_LDFLAGS="$LDFLAGS" -SAVE_LIBS="$LIBS" -CPPFLAGS="$GMP_CPPFLAGS $CPPFLAGS" -LDFLAGS="$GMP_LDFLAGS $LDFLAGS" -LIBS="$GMP_LIBS $LIBS" -need_get_memory_functions=false -AC_CHECK_DECLS(mp_get_memory_functions,[],[ - need_get_memory_functions=true -],[#include ]) -AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ - mpz_t x,y,g,a,b; - mpz_init(x); - mpz_init(y); - mpz_init(g); - mpz_init(a); - mpz_init(b); - mpz_set_si(x, -1); - mpz_set_si(y, 9); - mpz_gcdext(g, a, b, x, y); - if (mpz_get_si(a) == -1 && mpz_get_si(b) == 0) - return 0; - else - return 1; -]])], [need_normalized_gcdext=false], [need_normalized_gcdext=true], -[need_normalized_gcdext=true]) -CPPFLAGS="$SAVE_CPPFLAGS" -LDFLAGS="$SAVE_LDFLAGS" -LIBS="$SAVE_LIBS" -AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS, test x$need_get_memory_functions = xtrue) -if test $need_normalized_gcdext = true; then -AC_DEFINE([GMP_NORMALIZE_GCDEXT], [], - [result of mpz_gcdext needs to be normalized]) -fi - -AX_SUBMODULE(piplib,no|system|build,no) -have_piplib=false -AC_SUBST(PIPLIB_CPPFLAGS) -AC_SUBST(PIPLIB_LDFLAGS) -AC_SUBST(PIPLIB_LIBS) -case "$with_piplib" in - build) - PIPLIB_CPPFLAGS="-I$piplib_srcdir/include" - PIPLIB_LIBS="$with_piplib_builddir/libpiplibMP.la" - ;; - system) - PIPLIB_LIBS="-lpiplibMP" - if test "x$with_piplib_prefix" != "x"; then - PIPLIB_CPPFLAGS="-I$with_piplib_prefix/include" - PIPLIB_LDFLAGS="-L$with_piplib_prefix/lib" - fi - SAVE_CPPFLAGS="$CPPFLAGS" - SAVE_LDFLAGS="$LDFLAGS" - CPPFLAGS="$PIPLIB_CPPFLAGS $CPPFLAGS" - LDFLAGS="$PIPLIB_LDFLAGS $LDFLAGS" - AC_CHECK_LIB(piplibMP, pip_solve,[ - AC_CHECK_MEMBER(PipOptions.Urs_parms, [], [ - AC_MSG_ERROR([Piplib too old; please install version 1.3.6 or newer]) - ],[#include ]) - ],[ - AC_MSG_ERROR([Piplib not found]) - ]) - CPPFLAGS="$SAVE_CPPFLAGS" - LDFLAGS="$SAVE_LDFLAGS" - ;; - no) +AC_SUBST(MP_CPPFLAGS) +AC_SUBST(MP_LDFLAGS) +AC_SUBST(MP_LIBS) +case "$with_int" in +gmp) + AX_DETECT_GMP ;; - *) - AC_MSG_ERROR(unsupported) +imath) + AX_DETECT_IMATH ;; esac -if test "$with_piplib" != "no"; then - AC_DEFINE(ISL_PIPLIB,,piplib is available) - have_piplib=true -fi -AM_CONDITIONAL(HAVE_PIPLIB, test x$have_piplib = xtrue) + +AM_CONDITIONAL(IMATH_FOR_MP, test x$with_int = ximath) +AM_CONDITIONAL(GMP_FOR_MP, test x$with_int = xgmp) +AC_CHECK_DECLS(ffs,[],[],[#include ]) +AC_CHECK_DECLS(__builtin_ffs,[],[],[]) AC_SUBST(CLANG_CXXFLAGS) AC_SUBST(CLANG_LDFLAGS) @@ -175,6 +91,10 @@ components="$components option" fi CLANG_LIBS=`$llvm_config --libs $components` + systemlibs=`$llvm_config --system-libs 2> /dev/null | tail -1` + if test $? -eq 0; then + CLANG_LIBS="$CLANG_LIBS $systemlibs" + fi CLANG_PREFIX=`$llvm_config --prefix` AC_DEFINE_UNQUOTED(CLANG_PREFIX, ["$CLANG_PREFIX"], [Clang installation prefix]) @@ -206,6 +126,12 @@ AC_EGREP_HEADER([ IsProduction], [clang/Driver/Driver.h], [AC_DEFINE([HAVE_ISPRODUCTION], [], [Define if Driver constructor takes IsProduction argument])]) + AC_TRY_COMPILE([#include ], [ + using namespace clang; + DiagnosticsEngine *Diags; + new driver::Driver("", "", "", *Diags); + ], [AC_DEFINE([DRIVER_CTOR_TAKES_DEFAULTIMAGENAME], [], + [Define if Driver constructor takes default image name])]) AC_EGREP_HEADER([void HandleTopLevelDecl\(], [clang/AST/ASTConsumer.h], [AC_DEFINE([HandleTopLevelDeclReturn], [void], [Return type of HandleTopLevelDeclReturn]) @@ -220,6 +146,13 @@ [Define if clang/Basic/DiagnosticOptions.h exists])]) AC_TRY_COMPILE([#include ], [ using namespace clang; + std::shared_ptr TO; + DiagnosticsEngine *Diags; + TargetInfo::CreateTargetInfo(*Diags, TO); + ], [AC_DEFINE([CREATETARGETINFO_TAKES_SHARED_PTR], [], + [Define if TargetInfo::CreateTargetInfo takes shared_ptr])]) + AC_TRY_COMPILE([#include ], [ + using namespace clang; TargetOptions *TO; DiagnosticsEngine *Diags; TargetInfo::CreateTargetInfo(*Diags, TO); @@ -238,6 +171,29 @@ HSO.AddPath("", frontend::Angled, false, false); ], [AC_DEFINE([ADDPATH_TAKES_4_ARGUMENTS], [], [Define if HeaderSearchOptions::AddPath takes 4 arguments])]) + AC_EGREP_HEADER([getNumParams], + [clang/AST/CanonicalType.h], + [AC_DEFINE([getNumArgs], [getNumParams], + [Define to getNumParams for newer versions of clang]) + AC_DEFINE([getArgType], [getParamType], + [Define to getParamType for newer versions of clang])]) + AC_EGREP_HEADER([getReturnType], + [clang/AST/CanonicalType.h], [], + [AC_DEFINE([getReturnType], [getResultType], + [Define to getResultType for older versions of clang])]) + AC_TRY_COMPILE([#include ], [ + using namespace clang; + CompilerInstance *Clang; + Clang->createPreprocessor(TU_Complete); + ], [AC_DEFINE([CREATEPREPROCESSOR_TAKES_TUKIND], [], + [Define if CompilerInstance::createPreprocessor takes + TranslationUnitKind])]) + AC_EGREP_HEADER([setMainFileID], [clang/Basic/SourceManager.h], + [AC_DEFINE([HAVE_SETMAINFILEID], [], + [Define if SourceManager has a setMainFileID method])]) + AC_CHECK_HEADER([llvm/ADT/OwningPtr.h], + [AC_DEFINE([HAVE_ADT_OWNINGPTR_H], [], + [Define if llvm/ADT/OwningPtr.h exists])]) AC_LANG_POP CPPFLAGS="$SAVE_CPPFLAGS" @@ -254,9 +210,9 @@ AC_SUBST(WARNING_FLAGS) -PACKAGE_CFLAGS="$GMP_CPPFLAGS" -PACKAGE_LDFLAGS="$GMP_LDFLAGS" -PACKAGE_LIBS="-lisl -lgmp" +PACKAGE_CFLAGS="$MP_CPPFLAGS" +PACKAGE_LDFLAGS="$MP_LDFLAGS" +PACKAGE_LIBS="-lisl $MP_LIBS" AX_CREATE_PKGCONFIG_INFO AX_DETECT_GIT_HEAD @@ -264,7 +220,6 @@ AH_BOTTOM([#include ]) AC_CONFIG_HEADERS(isl_config.h) -AC_CONFIG_HEADERS(include/isl/config.h) AC_CONFIG_FILES(Makefile) AC_CONFIG_FILES(doc/Makefile) if test $with_clang = system; then diff -Nru cloog-0.18.2/isl/depcomp cloog-0.18.4/isl/depcomp --- cloog-0.18.2/isl/depcomp 2013-12-18 12:36:00.000000000 +0000 +++ cloog-0.18.4/isl/depcomp 2014-10-02 14:14:39.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2011-12-04.11; # UTC +scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,9 +27,9 @@ case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] @@ -40,8 +39,8 @@ Environment variables: depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. @@ -57,6 +56,66 @@ ;; esac +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 @@ -69,6 +128,9 @@ rm -f "$tmpdepfile" +# Avoid interferences from the environment. +gccflag= dashmflag= + # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case @@ -80,26 +142,32 @@ fi if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc fi case "$depmode" in @@ -122,8 +190,7 @@ done "$@" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -131,13 +198,17 @@ ;; gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then @@ -145,33 +216,31 @@ fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. + # The second -e expression handles DOS-style file names with drive + # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. +## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory +## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -189,8 +258,7 @@ "$@" -MDupdate "$tmpdepfile" fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -198,43 +266,41 @@ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the + # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" + make_dummy_depfile fi rm -f "$tmpdepfile" ;; +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the + # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u @@ -247,9 +313,7 @@ "$@" -M fi stat=$? - - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi @@ -258,44 +322,100 @@ do test -f "$tmpdepfile" && break done - if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : + # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -307,8 +427,8 @@ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -319,9 +439,8 @@ # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d @@ -332,8 +451,7 @@ "$@" +Maked fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi @@ -343,77 +461,61 @@ test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" else - echo "#dummy" > "$depfile" + make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mechanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; msvc7) if test "$libtool" = yes; then @@ -424,8 +526,7 @@ "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" - if test "$stat" = 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -443,14 +544,15 @@ p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g -s/\(.*\)/ \1 \\/p +s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { - s/.*/ / + s/.*/'"$tab"'/ G p }' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; @@ -478,7 +580,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -498,18 +600,18 @@ done test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' + # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -562,11 +664,12 @@ # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; @@ -583,7 +686,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -602,10 +705,10 @@ esac done - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" @@ -637,23 +740,23 @@ shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; + set fnord "$@" + shift + shift + ;; *) - set fnord "$@" "$arg" - shift - shift - ;; + set fnord "$@" "$arg" + shift + shift + ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; diff -Nru cloog-0.18.2/isl/doc/CodingStyle cloog-0.18.4/isl/doc/CodingStyle --- cloog-0.18.2/isl/doc/CodingStyle 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/doc/CodingStyle 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,42 @@ +This document describes some aspects of the coding style of isl, +which is similar to that of the linux kernel and git. + +The general rule is to use the same style as that of the surrounding code. + +More specific rules: + - every line should have at most 80 columns + - use tabs for indentation, where a tab counts for 8 characters + - use single spaces around binary operators such as '+', '-', '=', '!=' + - no space after unary operators such as '!' + - use a single space after a comma and a semicolon + (except at the end of a line) + - no space between function name and arguments + - use a single space after control keywords such as if, for and while + - use a single space between the type of a cast and the value + that is being cast + - no whitespace at the end of a line + - opening brace of a function is placed on a new line + - opening brace of other blocks stays on the same line + - the body of a control statement is placed on the next line(s) + - an else appears on the same line as the closing brace of + the then branch, if there is such a closing brace + - if either the then or the else branch of an if has braces, + then they both have braces + - no parentheses around argument of return keyword + - use only C style comments (/* ... */) + - no comments inside function bodies; + if some part of a function deserves additional comments, then + extract it out into a separate function first + - no #ifs inside function bodies + - variables are declared at the start of a block, before any + other statements + +There are some exceptions to the general rule of using +the same style as the surrounding code, most notably +when the surrounding code is very old. +In particular, an "isl_space" used to be called "isl_dim" and +some variables of this type are still called "dim" or some variant thereof. +New variables of this type should be called "space" or a more specific name. +Some old functions do not have memory management annotations yet. +All new functions should have memory management annotations, +whenever appropriate diff -Nru cloog-0.18.2/isl/doc/Makefile.in cloog-0.18.4/isl/doc/Makefile.in --- cloog-0.18.2/isl/doc/Makefile.in 2013-12-18 12:36:00.000000000 +0000 +++ cloog-0.18.4/isl/doc/Makefile.in 2015-07-24 12:29:27.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,6 +14,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -34,7 +78,7 @@ build_triplet = @build@ host_triplet = @host@ subdir = doc -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c___attribute__.m4 \ $(top_srcdir)/m4/ax_cc_maxopt.m4 \ @@ -43,6 +87,8 @@ $(top_srcdir)/m4/ax_create_pkgconfig_info.m4 \ $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/ax_detect_git_head.m4 \ + $(top_srcdir)/m4/ax_detect_gmp.m4 \ + $(top_srcdir)/m4/ax_detect_imath.m4 \ $(top_srcdir)/m4/ax_gcc_archflag.m4 \ $(top_srcdir)/m4/ax_gcc_warn_unused_result.m4 \ $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ @@ -54,18 +100,29 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/isl_config.h \ - $(top_builddir)/include/isl/config.h +CONFIG_HEADER = $(top_builddir)/isl_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -102,9 +159,6 @@ GIT_HEAD = @GIT_HEAD@ GIT_HEAD_ID = @GIT_HEAD_ID@ GIT_HEAD_VERSION = @GIT_HEAD_VERSION@ -GMP_CPPFLAGS = @GMP_CPPFLAGS@ -GMP_LDFLAGS = @GMP_LDFLAGS@ -GMP_LIBS = @GMP_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -123,6 +177,9 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ +MP_CPPFLAGS = @MP_CPPFLAGS@ +MP_LDFLAGS = @MP_LDFLAGS@ +MP_LIBS = @MP_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -139,9 +196,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PDFLATEX = @PDFLATEX@ PERL = @PERL@ -PIPLIB_CPPFLAGS = @PIPLIB_CPPFLAGS@ -PIPLIB_LDFLAGS = @PIPLIB_LDFLAGS@ -PIPLIB_LIBS = @PIPLIB_LIBS@ POD2HTML = @POD2HTML@ PRTDIAG = @PRTDIAG@ RANLIB = @RANLIB@ @@ -247,11 +301,11 @@ clean-libtool: -rm -rf .libs _libs -tags: TAGS -TAGS: +tags TAGS: + +ctags CTAGS: -ctags: CTAGS -CTAGS: +cscope cscopelist: distdir: $(DISTFILES) @@ -387,15 +441,16 @@ .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-am @GENERATE_DOC_TRUE@export TEXINPUTS := $(srcdir):$(TEXINPUTS) @GENERATE_DOC_TRUE@export BIBINPUTS := $(srcdir):$(BIBINPUTS) Binary files /tmp/8LKHgB0qpE/cloog-0.18.2/isl/doc/manual.pdf and /tmp/yy4tVJh_7V/cloog-0.18.4/isl/doc/manual.pdf differ diff -Nru cloog-0.18.2/isl/doc/SubmittingPatches cloog-0.18.4/isl/doc/SubmittingPatches --- cloog-0.18.2/isl/doc/SubmittingPatches 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/doc/SubmittingPatches 2014-10-02 15:48:18.000000000 +0000 @@ -23,6 +23,7 @@ - use "git format-patch -M" to create the patch - do not PGP sign your patch + - send a single patch per mail, e.g., using git-send-email(1) - do not attach your patch, but read in the mail body, unless you cannot teach your mailer to leave the formatting of the patch alone. @@ -39,3 +40,13 @@ (isl-development@googlegroups.com). If you use git-send-email(1), please test it first by sending email to yourself. + + Revisions: + + - add the revision number inside square brackets to + the subject line (e.g., use --subject-prefix='PATCH v2' + when creating the patch) + - recall the major issues discovered during the previous + review and explain how you addressed them or why you + disagree. Do so either in a cover letter, between the + "---" and the diffstat or in a separate message. diff -Nru cloog-0.18.2/isl/doc/user.pod cloog-0.18.4/isl/doc/user.pod --- cloog-0.18.2/isl/doc/user.pod 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/doc/user.pod 2015-07-24 12:23:09.000000000 +0000 @@ -5,7 +5,7 @@ The descriptions of the sets and relations may involve both parameters and existentially quantified variables. All computations are performed in exact integer arithmetic -using C. +using C or C. The C library offers functionality that is similar to that offered by the C and C libraries, but the underlying algorithms are in most cases completely different. @@ -17,7 +17,7 @@ scanner C and as part of an equivalence checker of static affine programs. For bug reports, feature requests and questions, -visit the the discussion group at +visit the discussion group at L. =head2 Backward Incompatible Changes @@ -181,6 +181,81 @@ =back +=head3 Changes since isl-0.12 + +=over + +=item * C has been replaced by C. +Some of the old functions are still available in C +but they will be removed in the future. + +=item * The functions C, +C, C +and C have been changed to return +an C instead of an C. + +=item * The function C +has been removed. Essentially the same functionality is available +through C, except that is requires +setting up coincidence constraints. +The option C has accordingly been +replaced by the option C. + +=item * The function C has been changed +to return an C instead of a rational C. +The function C has been changed to return +a regular basic set, rather than a rational basic set. + +=back + +=head3 Changes since isl-0.14 + +=over + +=item * Objects of type C can no longer contain +two or more C objects with the same domain space. + +=item * The function C now consistently +computes the sum on the shared definition domain. +The function C has been added +to compute the sum on the union of definition domains. +The original behavior of C was +confused and is no longer available. + +=item * Band forests have been replaced by schedule trees. + +=item * The function C has been +replaced by the function C. +Note that the may dependence relation returned by +C is the union of +the two dependence relations returned by +C. Similarly for the no source relations. +The function C is still available +for backward compatibility, but it will be removed in the future. + +=item * The function C has been +deprecated. + +=item * The function C has been +renamed to C. +The original name is still available +for backward compatibility, but it will be removed in the future. + +=item * The C AST generation option has been +deprecated. + +=item * The functions C and C +have been renamed to C and +C. The original names have been +kept for backward compatibility, but they will be removed in the future. + +=item * The C option has been replaced +by the C option. The effect +of setting the C option to C +is now obtained by turning on the C option. + +=back + =head1 License C is released under the MIT license. @@ -207,10 +282,13 @@ =back -Note that C currently requires C, which is released +Note that by default C requires C, which is released under the GNU Lesser General Public License (LGPL). This means that code linked against C is also linked against LGPL code. +When configuring with C<--with-int=imath>, C will link against C, a +library for exact integer arithmetic released under the MIT license. + =head1 Installation The source of C can be obtained either as a tarball @@ -234,6 +312,16 @@ git pull +=item 2 Optionally get C submodule + +To build C with C, you need to obtain the C +submodule by running in the git source tree of C + + git submodule init + git submodule update + +This will fetch the required version of C in a subdirectory of C. + =item 2 Generate C ./autogen.sh @@ -249,11 +337,12 @@ =item 1 Obtain C -Building C requires C, including its headers files. +By default, building C requires C, including its headers files. Your distribution may not provide these header files by default and you may need to install a package called C or something similar. Alternatively, C can be built from source, available from L. +C is not needed if you build C with C. =item 2 Configure @@ -269,22 +358,17 @@ Below we discuss some of the more common options. -C can optionally use C, but no -C functionality is currently used by default. -The C<--with-piplib> option can -be used to specify which C -library to use, either an installed version (C), -an externally built version (C) -or no version (C). The option C is mostly useful -in C scripts of larger projects that bundle both C -and C. - =over =item C<--prefix> Installation prefix for C +=item C<--with-int=[gmp|imath]> + +Select the integer library to be used by C, the default is C. +Note that C may run significantly slower if you use C. + =item C<--with-gmp-prefix> Installation prefix for C (architecture-independent files). @@ -293,35 +377,82 @@ Installation prefix for C (architecture-dependent files). -=item C<--with-piplib> +=back + +=item 3 Compile -Which copy of C to use, either C (default), C or C. + make -=item C<--with-piplib-prefix> +=item 4 Install (optional) -Installation prefix for C C (architecture-independent files). + make install -=item C<--with-piplib-exec-prefix> +=back -Installation prefix for C C (architecture-dependent files). +=head1 Integer Set Library -=item C<--with-piplib-builddir> +=head2 Memory Management -Location where C C was built. +Since a high-level operation on isl objects usually involves +several substeps and since the user is usually not interested in +the intermediate results, most functions that return a new object +will also release all the objects passed as arguments. +If the user still wants to use one or more of these arguments +after the function call, she should pass along a copy of the +object rather than the object itself. +The user is then responsible for making sure that the original +object gets used somewhere else or is explicitly freed. -=back +The arguments and return values of all documented functions are +annotated to make clear which arguments are released and which +arguments are preserved. In particular, the following annotations +are used -=item 3 Compile +=over - make +=item C<__isl_give> -=item 4 Install (optional) +C<__isl_give> means that a new object is returned. +The user should make sure that the returned pointer is +used exactly once as a value for an C<__isl_take> argument. +In between, it can be used as a value for as many +C<__isl_keep> arguments as the user likes. +There is one exception, and that is the case where the +pointer returned is C. Is this case, the user +is free to use it as an C<__isl_take> argument or not. +When applied to a C, the returned pointer needs to be +freed using C. - make install +=item C<__isl_null> -=back +C<__isl_null> means that a C value is returned. -=head1 Integer Set Library +=item C<__isl_take> + +C<__isl_take> means that the object the argument points to +is taken over by the function and may no longer be used +by the user as an argument to any other function. +The pointer value must be one returned by a function +returning an C<__isl_give> pointer. +If the user passes in a C value, then this will +be treated as an error in the sense that the function will +not perform its usual operation. However, it will still +make sure that all the other C<__isl_take> arguments +are released. + +=item C<__isl_keep> + +C<__isl_keep> means that the function will only use the object +temporarily. After the function has finished, the user +can still use it as an argument to other functions. +A C value will be treated in the same way as +a C value for an C<__isl_take> argument. +This annotation may also be used on return values of +type C, in which case the returned pointer should +not be freed by the user and is only valid until the object +from which it was derived is updated or freed. + +=back =head2 Initialization @@ -343,6 +474,130 @@ isl_ctx *isl_ctx_alloc(); void isl_ctx_free(isl_ctx *ctx); +The user can impose a bound on the number of low-level I +that can be performed by an C. This bound can be set and +retrieved using the following functions. A bound of zero means that +no bound is imposed. The number of operations performed can be +reset using C. Note that the number +of low-level operations needed to perform a high-level computation +may differ significantly across different versions +of C, but it should be the same across different platforms +for the same version of C. + +Warning: This feature is experimental. C has good support to abort and +bail out during the computation, but this feature may exercise error code paths +that are normally not used that much. Consequently, it is not unlikely that +hidden bugs will be exposed. + + void isl_ctx_set_max_operations(isl_ctx *ctx, + unsigned long max_operations); + unsigned long isl_ctx_get_max_operations(isl_ctx *ctx); + void isl_ctx_reset_operations(isl_ctx *ctx); + +In order to be able to create an object in the same context +as another object, most object types (described later in +this document) provide a function to obtain the context +in which the object was created. + + #include + isl_ctx *isl_val_get_ctx(__isl_keep isl_val *val); + isl_ctx *isl_multi_val_get_ctx( + __isl_keep isl_multi_val *mv); + + #include + isl_ctx *isl_id_get_ctx(__isl_keep isl_id *id); + + #include + isl_ctx *isl_local_space_get_ctx( + __isl_keep isl_local_space *ls); + + #include + isl_ctx *isl_set_list_get_ctx( + __isl_keep isl_set_list *list); + + #include + isl_ctx *isl_aff_get_ctx(__isl_keep isl_aff *aff); + isl_ctx *isl_multi_aff_get_ctx( + __isl_keep isl_multi_aff *maff); + isl_ctx *isl_pw_aff_get_ctx(__isl_keep isl_pw_aff *pa); + isl_ctx *isl_pw_multi_aff_get_ctx( + __isl_keep isl_pw_multi_aff *pma); + isl_ctx *isl_multi_pw_aff_get_ctx( + __isl_keep isl_multi_pw_aff *mpa); + isl_ctx *isl_union_pw_aff_get_ctx( + __isl_keep isl_union_pw_aff *upa); + isl_ctx *isl_union_pw_multi_aff_get_ctx( + __isl_keep isl_union_pw_multi_aff *upma); + isl_ctx *isl_multi_union_pw_aff_get_ctx( + __isl_keep isl_multi_union_pw_aff *mupa); + + #include + isl_ctx *isl_id_to_ast_expr_get_ctx( + __isl_keep isl_id_to_ast_expr *id2expr); + + #include + isl_ctx *isl_point_get_ctx(__isl_keep isl_point *pnt); + + #include + isl_ctx *isl_vec_get_ctx(__isl_keep isl_vec *vec); + + #include + isl_ctx *isl_mat_get_ctx(__isl_keep isl_mat *mat); + + #include + isl_ctx *isl_vertices_get_ctx( + __isl_keep isl_vertices *vertices); + isl_ctx *isl_vertex_get_ctx(__isl_keep isl_vertex *vertex); + isl_ctx *isl_cell_get_ctx(__isl_keep isl_cell *cell); + + #include + isl_ctx *isl_restriction_get_ctx( + __isl_keep isl_restriction *restr); + isl_ctx *isl_union_access_info_get_ctx( + __isl_keep isl_union_access_info *access); + isl_ctx *isl_union_flow_get_ctx( + __isl_keep isl_union_flow *flow); + + #include + isl_ctx *isl_schedule_get_ctx( + __isl_keep isl_schedule *sched); + isl_ctx *isl_schedule_constraints_get_ctx( + __isl_keep isl_schedule_constraints *sc); + + #include + isl_ctx *isl_schedule_node_get_ctx( + __isl_keep isl_schedule_node *node); + + #include + isl_ctx *isl_band_get_ctx(__isl_keep isl_band *band); + + #include + isl_ctx *isl_ast_build_get_ctx( + __isl_keep isl_ast_build *build); + + #include + isl_ctx *isl_ast_expr_get_ctx( + __isl_keep isl_ast_expr *expr); + isl_ctx *isl_ast_node_get_ctx( + __isl_keep isl_ast_node *node); + +=head2 Return Types + +C uses two special return types for functions that either return +a boolean or that in principle do not return anything. +In particular, the C type has three possible values: +C (a positive integer value), indicating I or I; +C (the integer value zero), indicating I or I; and +C (a negative integer value), indicating that something +went wrong. +The C type has two possible values: +C (the integer value zero), indicating a successful +operation; and +C (a negative integer value), indicating that something +went wrong. +See L for more information on +C and C. + =head2 Values An C represents an integer value, a rational value @@ -352,6 +607,7 @@ #include __isl_give isl_val *isl_val_zero(isl_ctx *ctx); __isl_give isl_val *isl_val_one(isl_ctx *ctx); + __isl_give isl_val *isl_val_negone(isl_ctx *ctx); __isl_give isl_val *isl_val_nan(isl_ctx *ctx); __isl_give isl_val *isl_val_infty(isl_ctx *ctx); __isl_give isl_val *isl_val_neginfty(isl_ctx *ctx); @@ -374,12 +630,11 @@ #include __isl_give isl_val *isl_val_copy(__isl_keep isl_val *v); - void *isl_val_free(__isl_take isl_val *v); + __isl_null isl_val *isl_val_free(__isl_take isl_val *v); They can be inspected using the following functions. #include - isl_ctx *isl_val_get_ctx(__isl_keep isl_val *val); long isl_val_get_num_si(__isl_keep isl_val *v); long isl_val_get_den_si(__isl_keep isl_val *v); double isl_val_get_d(__isl_keep isl_val *v); @@ -408,41 +663,46 @@ #include int isl_val_sgn(__isl_keep isl_val *v); - int isl_val_is_zero(__isl_keep isl_val *v); - int isl_val_is_one(__isl_keep isl_val *v); - int isl_val_is_negone(__isl_keep isl_val *v); - int isl_val_is_nonneg(__isl_keep isl_val *v); - int isl_val_is_nonpos(__isl_keep isl_val *v); - int isl_val_is_pos(__isl_keep isl_val *v); - int isl_val_is_neg(__isl_keep isl_val *v); - int isl_val_is_int(__isl_keep isl_val *v); - int isl_val_is_rat(__isl_keep isl_val *v); - int isl_val_is_nan(__isl_keep isl_val *v); - int isl_val_is_infty(__isl_keep isl_val *v); - int isl_val_is_neginfty(__isl_keep isl_val *v); + isl_bool isl_val_is_zero(__isl_keep isl_val *v); + isl_bool isl_val_is_one(__isl_keep isl_val *v); + isl_bool isl_val_is_negone(__isl_keep isl_val *v); + isl_bool isl_val_is_nonneg(__isl_keep isl_val *v); + isl_bool isl_val_is_nonpos(__isl_keep isl_val *v); + isl_bool isl_val_is_pos(__isl_keep isl_val *v); + isl_bool isl_val_is_neg(__isl_keep isl_val *v); + isl_bool isl_val_is_int(__isl_keep isl_val *v); + isl_bool isl_val_is_rat(__isl_keep isl_val *v); + isl_bool isl_val_is_nan(__isl_keep isl_val *v); + isl_bool isl_val_is_infty(__isl_keep isl_val *v); + isl_bool isl_val_is_neginfty(__isl_keep isl_val *v); Note that the sign of NaN is undefined. The following binary properties are defined on pairs of Cs. #include - int isl_val_lt(__isl_keep isl_val *v1, + isl_bool isl_val_lt(__isl_keep isl_val *v1, + __isl_keep isl_val *v2); + isl_bool isl_val_le(__isl_keep isl_val *v1, __isl_keep isl_val *v2); - int isl_val_le(__isl_keep isl_val *v1, + isl_bool isl_val_gt(__isl_keep isl_val *v1, __isl_keep isl_val *v2); - int isl_val_gt(__isl_keep isl_val *v1, + isl_bool isl_val_ge(__isl_keep isl_val *v1, __isl_keep isl_val *v2); - int isl_val_ge(__isl_keep isl_val *v1, + isl_bool isl_val_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2); - int isl_val_eq(__isl_keep isl_val *v1, + isl_bool isl_val_ne(__isl_keep isl_val *v1, __isl_keep isl_val *v2); - int isl_val_ne(__isl_keep isl_val *v1, + isl_bool isl_val_abs_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2); +The function C checks whether its two arguments +are equal in absolute value. + For integer Cs we additionally have the following binary property. #include - int isl_val_is_divisible_by(__isl_keep isl_val *v1, + isl_bool isl_val_is_divisible_by(__isl_keep isl_val *v1, __isl_keep isl_val *v2); An C can also be compared to an integer using the following @@ -459,16 +719,12 @@ __isl_give isl_val *isl_val_floor(__isl_take isl_val *v); __isl_give isl_val *isl_val_ceil(__isl_take isl_val *v); __isl_give isl_val *isl_val_trunc(__isl_take isl_val *v); + __isl_give isl_val *isl_val_inv(__isl_take isl_val *v); + __isl_give isl_val *isl_val_2exp(__isl_take isl_val *v); The following binary operations are available on Cs. #include - __isl_give isl_val *isl_val_abs(__isl_take isl_val *v); - __isl_give isl_val *isl_val_neg(__isl_take isl_val *v); - __isl_give isl_val *isl_val_floor(__isl_take isl_val *v); - __isl_give isl_val *isl_val_ceil(__isl_take isl_val *v); - __isl_give isl_val *isl_val_trunc(__isl_take isl_val *v); - __isl_give isl_val *isl_val_2exp(__isl_take isl_val *v); __isl_give isl_val *isl_val_min(__isl_take isl_val *v1, __isl_take isl_val *v2); __isl_give isl_val *isl_val_max(__isl_take isl_val *v1, @@ -504,18 +760,6 @@ of C and C as well as two integers C<*x> and C<*y> such that C<*x> * C + C<*y> * C = g. -A value can be read from input using - - #include - __isl_give isl_val *isl_val_read_from_str(isl_ctx *ctx, - const char *str); - -A value can be printed using - - #include - __isl_give isl_printer *isl_printer_print_val( - __isl_take isl_printer *p, __isl_keep isl_val *v); - =head3 GMP specific functions These functions are only available if C has been compiled with C @@ -537,140 +781,6 @@ int isl_val_get_num_gmp(__isl_keep isl_val *v, mpz_t z); int isl_val_get_den_gmp(__isl_keep isl_val *v, mpz_t z); -=head3 Conversion from C - -The following functions are only temporarily available to ease -the transition from C to C. They will be removed -in the next release. - - #include - __isl_give isl_val *isl_val_int_from_isl_int(isl_ctx *ctx, - isl_int n); - int isl_val_get_num_isl_int(__isl_keep isl_val *v, - isl_int *n); - -=head2 Integers (obsolescent) - -In previous versions of C, integers were represented -in the external interface using the C type. -This type has now been superseded by C. -The C type will be removed from the external interface -in future releases. New code should not use C. - -The operations below are currently available on Cs. -The meanings of these operations are essentially the same -as their C C counterparts. -As always with C types, Cs need to be -initialized with C before they can be used -and they need to be released with C -after the last use. -The user should not assume that an C is represented -as a C, but should instead explicitly convert between -Cs and Cs using C and -C whenever a C is required. - -=over - -=item isl_int_init(i) - -=item isl_int_clear(i) - -=item isl_int_set(r,i) - -=item isl_int_set_si(r,i) - -=item isl_int_set_gmp(r,g) - -=item isl_int_get_gmp(i,g) - -=item isl_int_abs(r,i) - -=item isl_int_neg(r,i) - -=item isl_int_swap(i,j) - -=item isl_int_swap_or_set(i,j) - -=item isl_int_add_ui(r,i,j) - -=item isl_int_sub_ui(r,i,j) - -=item isl_int_add(r,i,j) - -=item isl_int_sub(r,i,j) - -=item isl_int_mul(r,i,j) - -=item isl_int_mul_ui(r,i,j) - -=item isl_int_addmul(r,i,j) - -=item isl_int_submul(r,i,j) - -=item isl_int_gcd(r,i,j) - -=item isl_int_lcm(r,i,j) - -=item isl_int_divexact(r,i,j) - -=item isl_int_cdiv_q(r,i,j) - -=item isl_int_fdiv_q(r,i,j) - -=item isl_int_fdiv_r(r,i,j) - -=item isl_int_fdiv_q_ui(r,i,j) - -=item isl_int_read(r,s) - -=item isl_int_print(out,i,width) - -=item isl_int_sgn(i) - -=item isl_int_cmp(i,j) - -=item isl_int_cmp_si(i,si) - -=item isl_int_eq(i,j) - -=item isl_int_ne(i,j) - -=item isl_int_lt(i,j) - -=item isl_int_le(i,j) - -=item isl_int_gt(i,j) - -=item isl_int_ge(i,j) - -=item isl_int_abs_eq(i,j) - -=item isl_int_abs_ne(i,j) - -=item isl_int_abs_lt(i,j) - -=item isl_int_abs_gt(i,j) - -=item isl_int_abs_ge(i,j) - -=item isl_int_is_zero(i) - -=item isl_int_is_one(i) - -=item isl_int_is_negone(i) - -=item isl_int_is_pos(i) - -=item isl_int_is_neg(i) - -=item isl_int_is_nonpos(i) - -=item isl_int_is_nonneg(i) - -=item isl_int_is_divisible_by(i,j) - -=back - =head2 Sets and Relations C uses six types of objects for representing sets and relations, @@ -689,78 +799,29 @@ one set of variables, while relations have two sets of variables, input variables and output variables. -=head2 Memory Management +=head2 Error Handling -Since a high-level operation on sets and/or relations usually involves -several substeps and since the user is usually not interested in -the intermediate results, most functions that return a new object -will also release all the objects passed as arguments. -If the user still wants to use one or more of these arguments -after the function call, she should pass along a copy of the -object rather than the object itself. -The user is then responsible for making sure that the original -object gets used somewhere else or is explicitly freed. +C supports different ways to react in case a runtime error is triggered. +Runtime errors arise, e.g., if a function such as C is called +with two maps that have incompatible spaces. There are three possible ways +to react on error: to warn, to continue or to abort. -The arguments and return values of all documented functions are -annotated to make clear which arguments are released and which -arguments are preserved. In particular, the following annotations -are used +The default behavior is to warn. In this mode, C prints a warning, stores +the last error in the corresponding C and the function in which the +error was triggered returns a value indicating that some error has +occurred. In case of functions returning a pointer, this value is +C. In case of functions returning an C or an +C, this valus is C or C. +An error does not corrupt internal state, +such that isl can continue to be used. C also provides functions to +read the last error and to reset the memory that stores the last error. The +last error is only stored for information purposes. Its presence does not +change the behavior of C. Hence, resetting an error is not required to +continue to use isl, but only to observe new errors. -=over - -=item C<__isl_give> - -C<__isl_give> means that a new object is returned. -The user should make sure that the returned pointer is -used exactly once as a value for an C<__isl_take> argument. -In between, it can be used as a value for as many -C<__isl_keep> arguments as the user likes. -There is one exception, and that is the case where the -pointer returned is C. Is this case, the user -is free to use it as an C<__isl_take> argument or not. - -=item C<__isl_take> - -C<__isl_take> means that the object the argument points to -is taken over by the function and may no longer be used -by the user as an argument to any other function. -The pointer value must be one returned by a function -returning an C<__isl_give> pointer. -If the user passes in a C value, then this will -be treated as an error in the sense that the function will -not perform its usual operation. However, it will still -make sure that all the other C<__isl_take> arguments -are released. - -=item C<__isl_keep> - -C<__isl_keep> means that the function will only use the object -temporarily. After the function has finished, the user -can still use it as an argument to other functions. -A C value will be treated in the same way as -a C value for an C<__isl_take> argument. - -=back - -=head2 Error Handling - -C supports different ways to react in case a runtime error is triggered. -Runtime errors arise, e.g., if a function such as C is called -with two maps that have incompatible spaces. There are three possible ways -to react on error: to warn, to continue or to abort. - -The default behavior is to warn. In this mode, C prints a warning, stores -the last error in the corresponding C and the function in which the -error was triggered returns C. An error does not corrupt internal state, -such that isl can continue to be used. C also provides functions to -read the last error and to reset the memory that stores the last error. The -last error is only stored for information purposes. Its presence does not -change the behavior of C. Hence, resetting an error is not required to -continue to use isl, but only to observe new errors. - - #include - enum isl_error isl_ctx_last_error(isl_ctx *ctx); - void isl_ctx_reset_error(isl_ctx *ctx); + #include + enum isl_error isl_ctx_last_error(isl_ctx *ctx); + void isl_ctx_reset_error(isl_ctx *ctx); Another option is to continue on error. This is similar to warn on error mode, except that C does not print any warning. This allows a program to @@ -782,7 +843,7 @@ It is also possible to query the current error mode. #include - int isl_options_set_on_error(isl_ctx *ctx, int val); + isl_stat isl_options_set_on_error(isl_ctx *ctx, int val); int isl_options_get_on_error(isl_ctx *ctx); =head2 Identifiers @@ -807,9 +868,8 @@ __isl_take isl_id *id, __isl_give void (*free_user)(void *user)); __isl_give isl_id *isl_id_copy(isl_id *id); - void *isl_id_free(__isl_take isl_id *id); + __isl_null isl_id *isl_id_free(__isl_take isl_id *id); - isl_ctx *isl_id_get_ctx(__isl_keep isl_id *id); void *isl_id_get_user(__isl_keep isl_id *id); __isl_keep const char *isl_id_get_name(__isl_keep isl_id *id); @@ -824,7 +884,7 @@ =head2 Spaces -Whenever a new set, relation or similiar object is created from scratch, +Whenever a new set, relation or similar object is created from scratch, the space in which it lives needs to be specified using an C. Each space involves zero or more parameters and zero, one or two tuples of set or input/output dimensions. The parameters and dimensions @@ -850,9 +910,7 @@ __isl_give isl_space *isl_space_set_alloc(isl_ctx *ctx, unsigned nparam, unsigned dim); __isl_give isl_space *isl_space_copy(__isl_keep isl_space *space); - void *isl_space_free(__isl_take isl_space *space); - unsigned isl_space_dim(__isl_keep isl_space *space, - enum isl_dim_type type); + __isl_null isl_space *isl_space_free(__isl_take isl_space *space); The space used for creating a parameter domain needs to be created using C. @@ -860,41 +918,44 @@ needs to be created using C, while for a relation, the space needs to be created using C. -C can be used -to find out the number of dimensions of each type in -a space, where type may be -C, C (only for relations), -C (only for relations), C -(only for sets) or C. To check whether a given space is that of a set or a map or whether it is a parameter space, use these functions: #include - int isl_space_is_params(__isl_keep isl_space *space); - int isl_space_is_set(__isl_keep isl_space *space); - int isl_space_is_map(__isl_keep isl_space *space); + isl_bool isl_space_is_params(__isl_keep isl_space *space); + isl_bool isl_space_is_set(__isl_keep isl_space *space); + isl_bool isl_space_is_map(__isl_keep isl_space *space); Spaces can be compared using the following functions: #include - int isl_space_is_equal(__isl_keep isl_space *space1, + isl_bool isl_space_is_equal(__isl_keep isl_space *space1, __isl_keep isl_space *space2); - int isl_space_is_domain(__isl_keep isl_space *space1, + isl_bool isl_space_is_domain(__isl_keep isl_space *space1, __isl_keep isl_space *space2); - int isl_space_is_range(__isl_keep isl_space *space1, + isl_bool isl_space_is_range(__isl_keep isl_space *space1, __isl_keep isl_space *space2); + isl_bool isl_space_tuple_is_equal( + __isl_keep isl_space *space1, + enum isl_dim_type type1, + __isl_keep isl_space *space2, + enum isl_dim_type type2); C checks whether the first argument is equal to the domain of the second argument. This requires in particular that the first argument is a set space and that the second argument -is a map space. +is a map space. C checks whether the given +tuples (C, C or C) of the given +spaces are the same. That is, it checks if they have the same +identifier (if any), the same dimension and the same internal structure +(if any). It is often useful to create objects that live in the same space as some other object. This can be accomplished by creating the new objects -(see L or -L) based on the space +(see L or +L) based on the space of the original object. #include @@ -960,26 +1021,116 @@ __isl_keep isl_pw_multi_aff *pma); __isl_give isl_space *isl_pw_multi_aff_get_space( __isl_keep isl_pw_multi_aff *pma); + __isl_give isl_space *isl_union_pw_aff_get_space( + __isl_keep isl_union_pw_aff *upa); __isl_give isl_space *isl_union_pw_multi_aff_get_space( __isl_keep isl_union_pw_multi_aff *upma); __isl_give isl_space *isl_multi_pw_aff_get_domain_space( __isl_keep isl_multi_pw_aff *mpa); __isl_give isl_space *isl_multi_pw_aff_get_space( __isl_keep isl_multi_pw_aff *mpa); + __isl_give isl_space * + isl_multi_union_pw_aff_get_domain_space( + __isl_keep isl_multi_union_pw_aff *mupa); + __isl_give isl_space * + isl_multi_union_pw_aff_get_space( + __isl_keep isl_multi_union_pw_aff *mupa); #include __isl_give isl_space *isl_point_get_space( __isl_keep isl_point *pnt); -The identifiers or names of the individual dimensions may be set or read off -using the following functions. +The number of dimensions of a given type of space +may be read off from a space or an object that lives +in a space using the following functions. +In case of C, type may be +C, C (only for relations), +C (only for relations), C +(only for sets) or C. + + #include + unsigned isl_space_dim(__isl_keep isl_space *space, + enum isl_dim_type type); + + #include + int isl_local_space_dim(__isl_keep isl_local_space *ls, + enum isl_dim_type type); + + #include + unsigned isl_basic_set_dim(__isl_keep isl_basic_set *bset, + enum isl_dim_type type); + unsigned isl_set_dim(__isl_keep isl_set *set, + enum isl_dim_type type); + + #include + unsigned isl_union_set_dim(__isl_keep isl_union_set *uset, + enum isl_dim_type type); + + #include + unsigned isl_basic_map_dim(__isl_keep isl_basic_map *bmap, + enum isl_dim_type type); + unsigned isl_map_dim(__isl_keep isl_map *map, + enum isl_dim_type type); + + #include + unsigned isl_union_map_dim(__isl_keep isl_union_map *umap, + enum isl_dim_type type); + + #include + unsigned isl_multi_val_dim(__isl_keep isl_multi_val *mv, + enum isl_dim_type type); + + #include + int isl_aff_dim(__isl_keep isl_aff *aff, + enum isl_dim_type type); + unsigned isl_multi_aff_dim(__isl_keep isl_multi_aff *maff, + enum isl_dim_type type); + unsigned isl_pw_aff_dim(__isl_keep isl_pw_aff *pwaff, + enum isl_dim_type type); + unsigned isl_pw_multi_aff_dim( + __isl_keep isl_pw_multi_aff *pma, + enum isl_dim_type type); + unsigned isl_multi_pw_aff_dim( + __isl_keep isl_multi_pw_aff *mpa, + enum isl_dim_type type); + unsigned isl_union_pw_aff_dim( + __isl_keep isl_union_pw_aff *upa, + enum isl_dim_type type); + unsigned isl_union_pw_multi_aff_dim( + __isl_keep isl_union_pw_multi_aff *upma, + enum isl_dim_type type); + unsigned isl_multi_union_pw_aff_dim( + __isl_keep isl_multi_union_pw_aff *mupa, + enum isl_dim_type type); + + #include + unsigned isl_union_pw_qpolynomial_dim( + __isl_keep isl_union_pw_qpolynomial *upwqp, + enum isl_dim_type type); + unsigned isl_union_pw_qpolynomial_fold_dim( + __isl_keep isl_union_pw_qpolynomial_fold *upwf, + enum isl_dim_type type); + +Note that an C, an C, +an C, +an C and +an C +only have parameters. + +The identifiers or names of the individual dimensions of spaces +may be set or read off using the following functions on spaces +or objects that live in spaces. +These functions are mostly useful to obtain the identifiers, positions +or names of the parameters. Identifiers of individual dimensions are +essentially only useful for printing. They are ignored by all other +operations and may not be preserved across those operations. #include __isl_give isl_space *isl_space_set_dim_id( __isl_take isl_space *space, enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); - int isl_space_has_dim_id(__isl_keep isl_space *space, + isl_bool isl_space_has_dim_id(__isl_keep isl_space *space, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_space_get_dim_id( __isl_keep isl_space *space, @@ -988,384 +1139,615 @@ __isl_take isl_space *space, enum isl_dim_type type, unsigned pos, __isl_keep const char *name); - int isl_space_has_dim_name(__isl_keep isl_space *space, + isl_bool isl_space_has_dim_name(__isl_keep isl_space *space, enum isl_dim_type type, unsigned pos); __isl_keep const char *isl_space_get_dim_name( __isl_keep isl_space *space, enum isl_dim_type type, unsigned pos); -Note that C returns a pointer to some internal -data structure, so the result can only be used while the -corresponding C is alive. -Also note that every function that operates on two sets or relations -requires that both arguments have the same parameters. This also -means that if one of the arguments has named parameters, then the -other needs to have named parameters too and the names need to match. -Pairs of C, C, C and/or C -arguments may have different parameters (as long as they are named), -in which case the result will have as parameters the union of the parameters of -the arguments. - -Given the identifier or name of a dimension (typically a parameter), -its position can be obtained from the following function. - - #include - int isl_space_find_dim_by_id(__isl_keep isl_space *space, - enum isl_dim_type type, __isl_keep isl_id *id); - int isl_space_find_dim_by_name(__isl_keep isl_space *space, - enum isl_dim_type type, const char *name); - -The identifiers or names of entire spaces may be set or read off -using the following functions. - - #include - __isl_give isl_space *isl_space_set_tuple_id( - __isl_take isl_space *space, - enum isl_dim_type type, __isl_take isl_id *id); - __isl_give isl_space *isl_space_reset_tuple_id( - __isl_take isl_space *space, enum isl_dim_type type); - int isl_space_has_tuple_id(__isl_keep isl_space *space, - enum isl_dim_type type); - __isl_give isl_id *isl_space_get_tuple_id( - __isl_keep isl_space *space, enum isl_dim_type type); - __isl_give isl_space *isl_space_set_tuple_name( - __isl_take isl_space *space, - enum isl_dim_type type, const char *s); - int isl_space_has_tuple_name(__isl_keep isl_space *space, - enum isl_dim_type type); - const char *isl_space_get_tuple_name(__isl_keep isl_space *space, - enum isl_dim_type type); - -The C argument needs to be one of C, C -or C. As with C, -the C function returns a pointer to some internal -data structure. -Binary operations require the corresponding spaces of their arguments -to have the same name. - -Spaces can be nested. In particular, the domain of a set or -the domain or range of a relation can be a nested relation. -The following functions can be used to construct and deconstruct -such nested spaces. - - #include - int isl_space_is_wrapping(__isl_keep isl_space *space); - __isl_give isl_space *isl_space_wrap(__isl_take isl_space *space); - __isl_give isl_space *isl_space_unwrap(__isl_take isl_space *space); - -The input to C and C should -be the space of a set, while that of -C should be the space of a relation. -Conversely, the output of C is the space -of a relation, while that of C is the space of a set. - -Spaces can be created from other spaces -using the following functions. - - __isl_give isl_space *isl_space_domain(__isl_take isl_space *space); - __isl_give isl_space *isl_space_from_domain(__isl_take isl_space *space); - __isl_give isl_space *isl_space_range(__isl_take isl_space *space); - __isl_give isl_space *isl_space_from_range(__isl_take isl_space *space); - __isl_give isl_space *isl_space_params( - __isl_take isl_space *space); - __isl_give isl_space *isl_space_set_from_params( - __isl_take isl_space *space); - __isl_give isl_space *isl_space_reverse(__isl_take isl_space *space); - __isl_give isl_space *isl_space_join(__isl_take isl_space *left, - __isl_take isl_space *right); - __isl_give isl_space *isl_space_align_params( - __isl_take isl_space *space1, __isl_take isl_space *space2) - __isl_give isl_space *isl_space_insert_dims(__isl_take isl_space *space, - enum isl_dim_type type, unsigned pos, unsigned n); - __isl_give isl_space *isl_space_add_dims(__isl_take isl_space *space, - enum isl_dim_type type, unsigned n); - __isl_give isl_space *isl_space_drop_dims(__isl_take isl_space *space, - enum isl_dim_type type, unsigned first, unsigned n); - __isl_give isl_space *isl_space_move_dims(__isl_take isl_space *space, - enum isl_dim_type dst_type, unsigned dst_pos, - enum isl_dim_type src_type, unsigned src_pos, - unsigned n); - __isl_give isl_space *isl_space_map_from_set( - __isl_take isl_space *space); - __isl_give isl_space *isl_space_map_from_domain_and_range( - __isl_take isl_space *domain, - __isl_take isl_space *range); - __isl_give isl_space *isl_space_zip(__isl_take isl_space *space); - __isl_give isl_space *isl_space_curry( - __isl_take isl_space *space); - __isl_give isl_space *isl_space_uncurry( - __isl_take isl_space *space); - -Note that if dimensions are added or removed from a space, then -the name and the internal structure are lost. - -=head2 Local Spaces - -A local space is essentially a space with -zero or more existentially quantified variables. -The local space of a (constraint of a) basic set or relation can be obtained -using the following functions. - - #include - __isl_give isl_local_space *isl_constraint_get_local_space( - __isl_keep isl_constraint *constraint); - - #include - __isl_give isl_local_space *isl_basic_set_get_local_space( - __isl_keep isl_basic_set *bset); - - #include - __isl_give isl_local_space *isl_basic_map_get_local_space( - __isl_keep isl_basic_map *bmap); - -A new local space can be created from a space using - #include - __isl_give isl_local_space *isl_local_space_from_space( - __isl_take isl_space *space); - -They can be inspected, modified, copied and freed using the following functions. - - #include - isl_ctx *isl_local_space_get_ctx( - __isl_keep isl_local_space *ls); - int isl_local_space_is_set(__isl_keep isl_local_space *ls); - int isl_local_space_dim(__isl_keep isl_local_space *ls, - enum isl_dim_type type); - int isl_local_space_has_dim_id( + __isl_give isl_local_space *isl_local_space_set_dim_id( + __isl_take isl_local_space *ls, + enum isl_dim_type type, unsigned pos, + __isl_take isl_id *id); + isl_bool isl_local_space_has_dim_id( __isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_local_space_get_dim_id( __isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos); - int isl_local_space_has_dim_name( + __isl_give isl_local_space *isl_local_space_set_dim_name( + __isl_take isl_local_space *ls, + enum isl_dim_type type, unsigned pos, const char *s); + isl_bool isl_local_space_has_dim_name( __isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos) const char *isl_local_space_get_dim_name( __isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos); - __isl_give isl_local_space *isl_local_space_set_dim_name( - __isl_take isl_local_space *ls, - enum isl_dim_type type, unsigned pos, const char *s); - __isl_give isl_local_space *isl_local_space_set_dim_id( - __isl_take isl_local_space *ls, - enum isl_dim_type type, unsigned pos, - __isl_take isl_id *id); - __isl_give isl_space *isl_local_space_get_space( - __isl_keep isl_local_space *ls); - __isl_give isl_aff *isl_local_space_get_div( - __isl_keep isl_local_space *ls, int pos); - __isl_give isl_local_space *isl_local_space_copy( - __isl_keep isl_local_space *ls); - void *isl_local_space_free(__isl_take isl_local_space *ls); -Note that C can only be used on local spaces -of sets. + #include + const char *isl_constraint_get_dim_name( + __isl_keep isl_constraint *constraint, + enum isl_dim_type type, unsigned pos); -Two local spaces can be compared using + #include + __isl_give isl_id *isl_basic_set_get_dim_id( + __isl_keep isl_basic_set *bset, + enum isl_dim_type type, unsigned pos); + __isl_give isl_set *isl_set_set_dim_id( + __isl_take isl_set *set, enum isl_dim_type type, + unsigned pos, __isl_take isl_id *id); + isl_bool isl_set_has_dim_id(__isl_keep isl_set *set, + enum isl_dim_type type, unsigned pos); + __isl_give isl_id *isl_set_get_dim_id( + __isl_keep isl_set *set, enum isl_dim_type type, + unsigned pos); + const char *isl_basic_set_get_dim_name( + __isl_keep isl_basic_set *bset, + enum isl_dim_type type, unsigned pos); + isl_bool isl_set_has_dim_name(__isl_keep isl_set *set, + enum isl_dim_type type, unsigned pos); + const char *isl_set_get_dim_name( + __isl_keep isl_set *set, + enum isl_dim_type type, unsigned pos); - int isl_local_space_is_equal(__isl_keep isl_local_space *ls1, - __isl_keep isl_local_space *ls2); + #include + __isl_give isl_map *isl_map_set_dim_id( + __isl_take isl_map *map, enum isl_dim_type type, + unsigned pos, __isl_take isl_id *id); + isl_bool isl_basic_map_has_dim_id( + __isl_keep isl_basic_map *bmap, + enum isl_dim_type type, unsigned pos); + isl_bool isl_map_has_dim_id(__isl_keep isl_map *map, + enum isl_dim_type type, unsigned pos); + __isl_give isl_id *isl_map_get_dim_id( + __isl_keep isl_map *map, enum isl_dim_type type, + unsigned pos); + __isl_give isl_id *isl_union_map_get_dim_id( + __isl_keep isl_union_map *umap, + enum isl_dim_type type, unsigned pos); + const char *isl_basic_map_get_dim_name( + __isl_keep isl_basic_map *bmap, + enum isl_dim_type type, unsigned pos); + isl_bool isl_map_has_dim_name(__isl_keep isl_map *map, + enum isl_dim_type type, unsigned pos); + const char *isl_map_get_dim_name( + __isl_keep isl_map *map, + enum isl_dim_type type, unsigned pos); -Local spaces can be created from other local spaces -using the following functions. + #include + __isl_give isl_multi_val *isl_multi_val_set_dim_id( + __isl_take isl_multi_val *mv, + enum isl_dim_type type, unsigned pos, + __isl_take isl_id *id); + __isl_give isl_id *isl_multi_val_get_dim_id( + __isl_keep isl_multi_val *mv, + enum isl_dim_type type, unsigned pos); + __isl_give isl_multi_val *isl_multi_val_set_dim_name( + __isl_take isl_multi_val *mv, + enum isl_dim_type type, unsigned pos, const char *s); - __isl_give isl_local_space *isl_local_space_domain( - __isl_take isl_local_space *ls); - __isl_give isl_local_space *isl_local_space_range( - __isl_take isl_local_space *ls); - __isl_give isl_local_space *isl_local_space_from_domain( - __isl_take isl_local_space *ls); - __isl_give isl_local_space *isl_local_space_intersect( - __isl_take isl_local_space *ls1, - __isl_take isl_local_space *ls2); - __isl_give isl_local_space *isl_local_space_add_dims( - __isl_take isl_local_space *ls, - enum isl_dim_type type, unsigned n); - __isl_give isl_local_space *isl_local_space_insert_dims( - __isl_take isl_local_space *ls, - enum isl_dim_type type, unsigned first, unsigned n); - __isl_give isl_local_space *isl_local_space_drop_dims( - __isl_take isl_local_space *ls, - enum isl_dim_type type, unsigned first, unsigned n); + #include + __isl_give isl_aff *isl_aff_set_dim_id( + __isl_take isl_aff *aff, enum isl_dim_type type, + unsigned pos, __isl_take isl_id *id); + __isl_give isl_multi_aff *isl_multi_aff_set_dim_id( + __isl_take isl_multi_aff *maff, + enum isl_dim_type type, unsigned pos, + __isl_take isl_id *id); + __isl_give isl_pw_aff *isl_pw_aff_set_dim_id( + __isl_take isl_pw_aff *pma, + enum isl_dim_type type, unsigned pos, + __isl_take isl_id *id); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_set_dim_id( + __isl_take isl_multi_pw_aff *mpa, + enum isl_dim_type type, unsigned pos, + __isl_take isl_id *id); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_set_dim_id( + __isl_take isl_multi_union_pw_aff *mupa, + enum isl_dim_type type, unsigned pos, + __isl_take isl_id *id); + __isl_give isl_id *isl_multi_aff_get_dim_id( + __isl_keep isl_multi_aff *ma, + enum isl_dim_type type, unsigned pos); + isl_bool isl_pw_aff_has_dim_id(__isl_keep isl_pw_aff *pa, + enum isl_dim_type type, unsigned pos); + __isl_give isl_id *isl_pw_aff_get_dim_id( + __isl_keep isl_pw_aff *pa, + enum isl_dim_type type, unsigned pos); + __isl_give isl_id *isl_pw_multi_aff_get_dim_id( + __isl_keep isl_pw_multi_aff *pma, + enum isl_dim_type type, unsigned pos); + __isl_give isl_id *isl_multi_pw_aff_get_dim_id( + __isl_keep isl_multi_pw_aff *mpa, + enum isl_dim_type type, unsigned pos); + __isl_give isl_id *isl_multi_union_pw_aff_get_dim_id( + __isl_keep isl_multi_union_pw_aff *mupa, + enum isl_dim_type type, unsigned pos); + __isl_give isl_aff *isl_aff_set_dim_name( + __isl_take isl_aff *aff, enum isl_dim_type type, + unsigned pos, const char *s); + __isl_give isl_multi_aff *isl_multi_aff_set_dim_name( + __isl_take isl_multi_aff *maff, + enum isl_dim_type type, unsigned pos, const char *s); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_set_dim_name( + __isl_take isl_multi_pw_aff *mpa, + enum isl_dim_type type, unsigned pos, const char *s); + __isl_give isl_union_pw_aff * + isl_union_pw_aff_set_dim_name( + __isl_take isl_union_pw_aff *upa, + enum isl_dim_type type, unsigned pos, + const char *s); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_set_dim_name( + __isl_take isl_union_pw_multi_aff *upma, + enum isl_dim_type type, unsigned pos, + const char *s); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_set_dim_name( + __isl_take isl_multi_union_pw_aff *mupa, + enum isl_dim_type type, unsigned pos, + const char *isl_aff_get_dim_name(__isl_keep isl_aff *aff, + enum isl_dim_type type, unsigned pos); + const char *isl_pw_aff_get_dim_name( + __isl_keep isl_pw_aff *pa, + enum isl_dim_type type, unsigned pos); + const char *isl_pw_multi_aff_get_dim_name( + __isl_keep isl_pw_multi_aff *pma, + enum isl_dim_type type, unsigned pos); -=head2 Input and Output + #include + __isl_give isl_qpolynomial *isl_qpolynomial_set_dim_name( + __isl_take isl_qpolynomial *qp, + enum isl_dim_type type, unsigned pos, + const char *s); + __isl_give isl_pw_qpolynomial * + isl_pw_qpolynomial_set_dim_name( + __isl_take isl_pw_qpolynomial *pwqp, + enum isl_dim_type type, unsigned pos, + const char *s); + __isl_give isl_pw_qpolynomial_fold * + isl_pw_qpolynomial_fold_set_dim_name( + __isl_take isl_pw_qpolynomial_fold *pwf, + enum isl_dim_type type, unsigned pos, + const char *s); + __isl_give isl_union_pw_qpolynomial * + isl_union_pw_qpolynomial_set_dim_name( + __isl_take isl_union_pw_qpolynomial *upwqp, + enum isl_dim_type type, unsigned pos, + const char *s); + __isl_give isl_union_pw_qpolynomial_fold * + isl_union_pw_qpolynomial_fold_set_dim_name( + __isl_take isl_union_pw_qpolynomial_fold *upwf, + enum isl_dim_type type, unsigned pos, + const char *s); -C supports its own input/output format, which is similar -to the C format, but also supports the C format -in some cases. +Note that C returns a pointer to some internal +data structure, so the result can only be used while the +corresponding C is alive. +Also note that every function that operates on two sets or relations +requires that both arguments have the same parameters. This also +means that if one of the arguments has named parameters, then the +other needs to have named parameters too and the names need to match. +Pairs of C, C, C and/or C +arguments may have different parameters (as long as they are named), +in which case the result will have as parameters the union of the parameters of +the arguments. -=head3 C format +Given the identifier or name of a dimension (typically a parameter), +its position can be obtained from the following functions. -The C format is similar to that of C, but has a different -syntax for describing the parameters and allows for the definition -of an existentially quantified variable as the integer division -of an affine expression. -For example, the set of integers C between C<0> and C -such that C can be described as + #include + int isl_space_find_dim_by_id(__isl_keep isl_space *space, + enum isl_dim_type type, __isl_keep isl_id *id); + int isl_space_find_dim_by_name(__isl_keep isl_space *space, + enum isl_dim_type type, const char *name); - [n] -> { [i] : exists (a = [i/10] : 0 <= i and i <= n and - i - 10 a <= 6) } + #include + int isl_local_space_find_dim_by_name( + __isl_keep isl_local_space *ls, + enum isl_dim_type type, const char *name); -A set or relation can have several disjuncts, separated -by the keyword C. Each disjunct is either a conjunction -of constraints or a projection (C) of a conjunction -of constraints. The constraints are separated by the keyword -C. + #include + int isl_multi_val_find_dim_by_id( + __isl_keep isl_multi_val *mv, + enum isl_dim_type type, __isl_keep isl_id *id); + int isl_multi_val_find_dim_by_name( + __isl_keep isl_multi_val *mv, + enum isl_dim_type type, const char *name); -=head3 C format + #include + int isl_set_find_dim_by_id(__isl_keep isl_set *set, + enum isl_dim_type type, __isl_keep isl_id *id); + int isl_set_find_dim_by_name(__isl_keep isl_set *set, + enum isl_dim_type type, const char *name); -If the represented set is a union, then the first line -contains a single number representing the number of disjuncts. -Otherwise, a line containing the number C<1> is optional. + #include + int isl_map_find_dim_by_id(__isl_keep isl_map *map, + enum isl_dim_type type, __isl_keep isl_id *id); + int isl_basic_map_find_dim_by_name( + __isl_keep isl_basic_map *bmap, + enum isl_dim_type type, const char *name); + int isl_map_find_dim_by_name(__isl_keep isl_map *map, + enum isl_dim_type type, const char *name); + int isl_union_map_find_dim_by_name( + __isl_keep isl_union_map *umap, + enum isl_dim_type type, const char *name); -Each disjunct is represented by a matrix of constraints. -The first line contains two numbers representing -the number of rows and columns, -where the number of rows is equal to the number of constraints -and the number of columns is equal to two plus the number of variables. -The following lines contain the actual rows of the constraint matrix. -In each row, the first column indicates whether the constraint -is an equality (C<0>) or inequality (C<1>). The final column -corresponds to the constant term. + #include + int isl_multi_aff_find_dim_by_id( + __isl_keep isl_multi_aff *ma, + enum isl_dim_type type, __isl_keep isl_id *id); + int isl_multi_pw_aff_find_dim_by_id( + __isl_keep isl_multi_pw_aff *mpa, + enum isl_dim_type type, __isl_keep isl_id *id); + int isl_multi_union_pw_aff_find_dim_by_id( + __isl_keep isl_union_multi_pw_aff *mupa, + enum isl_dim_type type, __isl_keep isl_id *id); + int isl_aff_find_dim_by_name(__isl_keep isl_aff *aff, + enum isl_dim_type type, const char *name); + int isl_multi_aff_find_dim_by_name( + __isl_keep isl_multi_aff *ma, + enum isl_dim_type type, const char *name); + int isl_pw_aff_find_dim_by_name(__isl_keep isl_pw_aff *pa, + enum isl_dim_type type, const char *name); + int isl_multi_pw_aff_find_dim_by_name( + __isl_keep isl_multi_pw_aff *mpa, + enum isl_dim_type type, const char *name); + int isl_pw_multi_aff_find_dim_by_name( + __isl_keep isl_pw_multi_aff *pma, + enum isl_dim_type type, const char *name); + int isl_union_pw_aff_find_dim_by_name( + __isl_keep isl_union_pw_aff *upa, + enum isl_dim_type type, const char *name); + int isl_union_pw_multi_aff_find_dim_by_name( + __isl_keep isl_union_pw_multi_aff *upma, + enum isl_dim_type type, const char *name); + int isl_multi_union_pw_aff_find_dim_by_name( + __isl_keep isl_multi_union_pw_aff *mupa, + enum isl_dim_type type, const char *name); -If the set is parametric, then the coefficients of the parameters -appear in the last columns before the constant column. -The coefficients of any existentially quantified variables appear -between those of the set variables and those of the parameters. + #include + int isl_pw_qpolynomial_find_dim_by_name( + __isl_keep isl_pw_qpolynomial *pwqp, + enum isl_dim_type type, const char *name); + int isl_pw_qpolynomial_fold_find_dim_by_name( + __isl_keep isl_pw_qpolynomial_fold *pwf, + enum isl_dim_type type, const char *name); + int isl_union_pw_qpolynomial_find_dim_by_name( + __isl_keep isl_union_pw_qpolynomial *upwqp, + enum isl_dim_type type, const char *name); + int isl_union_pw_qpolynomial_fold_find_dim_by_name( + __isl_keep isl_union_pw_qpolynomial_fold *upwf, + enum isl_dim_type type, const char *name); -=head3 Extended C format +The identifiers or names of entire spaces may be set or read off +using the following functions. -The extended C format is nearly identical to the -C format. The only difference is that the line -containing the number of rows and columns of a constraint matrix -also contains four additional numbers: -the number of output dimensions, the number of input dimensions, -the number of local dimensions (i.e., the number of existentially -quantified variables) and the number of parameters. -For sets, the number of ``output'' dimensions is equal -to the number of set dimensions, while the number of ``input'' -dimensions is zero. + #include + __isl_give isl_space *isl_space_set_tuple_id( + __isl_take isl_space *space, + enum isl_dim_type type, __isl_take isl_id *id); + __isl_give isl_space *isl_space_reset_tuple_id( + __isl_take isl_space *space, enum isl_dim_type type); + isl_bool isl_space_has_tuple_id( + __isl_keep isl_space *space, + enum isl_dim_type type); + __isl_give isl_id *isl_space_get_tuple_id( + __isl_keep isl_space *space, enum isl_dim_type type); + __isl_give isl_space *isl_space_set_tuple_name( + __isl_take isl_space *space, + enum isl_dim_type type, const char *s); + isl_bool isl_space_has_tuple_name( + __isl_keep isl_space *space, + enum isl_dim_type type); + const char *isl_space_get_tuple_name(__isl_keep isl_space *space, + enum isl_dim_type type); -=head3 Input + #include + __isl_give isl_local_space *isl_local_space_set_tuple_id( + __isl_take isl_local_space *ls, + enum isl_dim_type type, __isl_take isl_id *id); #include - __isl_give isl_basic_set *isl_basic_set_read_from_file( - isl_ctx *ctx, FILE *input); - __isl_give isl_basic_set *isl_basic_set_read_from_str( - isl_ctx *ctx, const char *str); - __isl_give isl_set *isl_set_read_from_file(isl_ctx *ctx, - FILE *input); - __isl_give isl_set *isl_set_read_from_str(isl_ctx *ctx, - const char *str); + __isl_give isl_basic_set *isl_basic_set_set_tuple_id( + __isl_take isl_basic_set *bset, + __isl_take isl_id *id); + __isl_give isl_set *isl_set_set_tuple_id( + __isl_take isl_set *set, __isl_take isl_id *id); + __isl_give isl_set *isl_set_reset_tuple_id( + __isl_take isl_set *set); + isl_bool isl_set_has_tuple_id(__isl_keep isl_set *set); + __isl_give isl_id *isl_set_get_tuple_id( + __isl_keep isl_set *set); + __isl_give isl_basic_set *isl_basic_set_set_tuple_name( + __isl_take isl_basic_set *set, const char *s); + __isl_give isl_set *isl_set_set_tuple_name( + __isl_take isl_set *set, const char *s); + const char *isl_basic_set_get_tuple_name( + __isl_keep isl_basic_set *bset); + isl_bool isl_set_has_tuple_name(__isl_keep isl_set *set); + const char *isl_set_get_tuple_name( + __isl_keep isl_set *set); #include - __isl_give isl_basic_map *isl_basic_map_read_from_file( - isl_ctx *ctx, FILE *input); - __isl_give isl_basic_map *isl_basic_map_read_from_str( - isl_ctx *ctx, const char *str); - __isl_give isl_map *isl_map_read_from_file( - isl_ctx *ctx, FILE *input); - __isl_give isl_map *isl_map_read_from_str(isl_ctx *ctx, - const char *str); + __isl_give isl_basic_map *isl_basic_map_set_tuple_id( + __isl_take isl_basic_map *bmap, + enum isl_dim_type type, __isl_take isl_id *id); + __isl_give isl_map *isl_map_set_tuple_id( + __isl_take isl_map *map, enum isl_dim_type type, + __isl_take isl_id *id); + __isl_give isl_map *isl_map_reset_tuple_id( + __isl_take isl_map *map, enum isl_dim_type type); + isl_bool isl_map_has_tuple_id(__isl_keep isl_map *map, + enum isl_dim_type type); + __isl_give isl_id *isl_map_get_tuple_id( + __isl_keep isl_map *map, enum isl_dim_type type); + __isl_give isl_map *isl_map_set_tuple_name( + __isl_take isl_map *map, + enum isl_dim_type type, const char *s); + const char *isl_basic_map_get_tuple_name( + __isl_keep isl_basic_map *bmap, + enum isl_dim_type type); + __isl_give isl_basic_map *isl_basic_map_set_tuple_name( + __isl_take isl_basic_map *bmap, + enum isl_dim_type type, const char *s); + isl_bool isl_map_has_tuple_name(__isl_keep isl_map *map, + enum isl_dim_type type); + const char *isl_map_get_tuple_name( + __isl_keep isl_map *map, + enum isl_dim_type type); - #include - __isl_give isl_union_set *isl_union_set_read_from_file( - isl_ctx *ctx, FILE *input); - __isl_give isl_union_set *isl_union_set_read_from_str( - isl_ctx *ctx, const char *str); + #include + __isl_give isl_multi_val *isl_multi_val_set_tuple_id( + __isl_take isl_multi_val *mv, + enum isl_dim_type type, __isl_take isl_id *id); + __isl_give isl_multi_val *isl_multi_val_reset_tuple_id( + __isl_take isl_multi_val *mv, + enum isl_dim_type type); + isl_bool isl_multi_val_has_tuple_id( + __isl_keep isl_multi_val *mv, + enum isl_dim_type type); + __isl_give isl_id *isl_multi_val_get_tuple_id( + __isl_keep isl_multi_val *mv, + enum isl_dim_type type); + __isl_give isl_multi_val *isl_multi_val_set_tuple_name( + __isl_take isl_multi_val *mv, + enum isl_dim_type type, const char *s); + const char *isl_multi_val_get_tuple_name( + __isl_keep isl_multi_val *mv, + enum isl_dim_type type); - #include - __isl_give isl_union_map *isl_union_map_read_from_file( - isl_ctx *ctx, FILE *input); - __isl_give isl_union_map *isl_union_map_read_from_str( - isl_ctx *ctx, const char *str); + #include + __isl_give isl_aff *isl_aff_set_tuple_id( + __isl_take isl_aff *aff, + enum isl_dim_type type, __isl_take isl_id *id); + __isl_give isl_multi_aff *isl_multi_aff_set_tuple_id( + __isl_take isl_multi_aff *maff, + enum isl_dim_type type, __isl_take isl_id *id); + __isl_give isl_pw_aff *isl_pw_aff_set_tuple_id( + __isl_take isl_pw_aff *pwaff, + enum isl_dim_type type, __isl_take isl_id *id); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_set_tuple_id( + __isl_take isl_pw_multi_aff *pma, + enum isl_dim_type type, __isl_take isl_id *id); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_set_tuple_id( + __isl_take isl_multi_union_pw_aff *mupa, + enum isl_dim_type type, __isl_take isl_id *id); + __isl_give isl_multi_aff *isl_multi_aff_reset_tuple_id( + __isl_take isl_multi_aff *ma, + enum isl_dim_type type); + __isl_give isl_pw_aff *isl_pw_aff_reset_tuple_id( + __isl_take isl_pw_aff *pa, + enum isl_dim_type type); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_reset_tuple_id( + __isl_take isl_multi_pw_aff *mpa, + enum isl_dim_type type); + __isl_give isl_pw_multi_aff * + isl_pw_multi_aff_reset_tuple_id( + __isl_take isl_pw_multi_aff *pma, + enum isl_dim_type type); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_reset_tuple_id( + __isl_take isl_multi_union_pw_aff *mupa, + enum isl_dim_type type); + isl_bool isl_multi_aff_has_tuple_id( + __isl_keep isl_multi_aff *ma, + enum isl_dim_type type); + __isl_give isl_id *isl_multi_aff_get_tuple_id( + __isl_keep isl_multi_aff *ma, + enum isl_dim_type type); + isl_bool isl_pw_aff_has_tuple_id(__isl_keep isl_pw_aff *pa, + enum isl_dim_type type); + __isl_give isl_id *isl_pw_aff_get_tuple_id( + __isl_keep isl_pw_aff *pa, + enum isl_dim_type type); + isl_bool isl_pw_multi_aff_has_tuple_id( + __isl_keep isl_pw_multi_aff *pma, + enum isl_dim_type type); + __isl_give isl_id *isl_pw_multi_aff_get_tuple_id( + __isl_keep isl_pw_multi_aff *pma, + enum isl_dim_type type); + isl_bool isl_multi_pw_aff_has_tuple_id( + __isl_keep isl_multi_pw_aff *mpa, + enum isl_dim_type type); + __isl_give isl_id *isl_multi_pw_aff_get_tuple_id( + __isl_keep isl_multi_pw_aff *mpa, + enum isl_dim_type type); + isl_bool isl_multi_union_pw_aff_has_tuple_id( + __isl_keep isl_multi_union_pw_aff *mupa, + enum isl_dim_type type); + __isl_give isl_id *isl_multi_union_pw_aff_get_tuple_id( + __isl_keep isl_multi_union_pw_aff *mupa, + enum isl_dim_type type); + __isl_give isl_multi_aff *isl_multi_aff_set_tuple_name( + __isl_take isl_multi_aff *maff, + enum isl_dim_type type, const char *s); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_set_tuple_name( + __isl_take isl_multi_pw_aff *mpa, + enum isl_dim_type type, const char *s); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_set_tuple_name( + __isl_take isl_multi_union_pw_aff *mupa, + enum isl_dim_type type, const char *s); + const char *isl_multi_aff_get_tuple_name( + __isl_keep isl_multi_aff *multi, + enum isl_dim_type type); + isl_bool isl_pw_multi_aff_has_tuple_name( + __isl_keep isl_pw_multi_aff *pma, + enum isl_dim_type type); + const char *isl_pw_multi_aff_get_tuple_name( + __isl_keep isl_pw_multi_aff *pma, + enum isl_dim_type type); + const char *isl_multi_union_pw_aff_get_tuple_name( + __isl_keep isl_multi_union_pw_aff *mupa, + enum isl_dim_type type); -The input format is autodetected and may be either the C format -or the C format. +The C argument needs to be one of C, C +or C. As with C, +the C function returns a pointer to some internal +data structure. +Binary operations require the corresponding spaces of their arguments +to have the same name. -=head3 Output +To keep the names of all parameters and tuples, but reset the user pointers +of all the corresponding identifiers, use the following function. -Before anything can be printed, an C needs to -be created. + #include + __isl_give isl_space *isl_space_reset_user( + __isl_take isl_space *space); - __isl_give isl_printer *isl_printer_to_file(isl_ctx *ctx, - FILE *file); - __isl_give isl_printer *isl_printer_to_str(isl_ctx *ctx); - void *isl_printer_free(__isl_take isl_printer *printer); - __isl_give char *isl_printer_get_str( - __isl_keep isl_printer *printer); + #include + __isl_give isl_set *isl_set_reset_user( + __isl_take isl_set *set); -The printer can be inspected using the following functions. + #include + __isl_give isl_map *isl_map_reset_user( + __isl_take isl_map *map); - FILE *isl_printer_get_file( - __isl_keep isl_printer *printer); - int isl_printer_get_output_format( - __isl_keep isl_printer *p); + #include + __isl_give isl_union_set *isl_union_set_reset_user( + __isl_take isl_union_set *uset); -The behavior of the printer can be modified in various ways + #include + __isl_give isl_union_map *isl_union_map_reset_user( + __isl_take isl_union_map *umap); - __isl_give isl_printer *isl_printer_set_output_format( - __isl_take isl_printer *p, int output_format); - __isl_give isl_printer *isl_printer_set_indent( - __isl_take isl_printer *p, int indent); - __isl_give isl_printer *isl_printer_indent( - __isl_take isl_printer *p, int indent); - __isl_give isl_printer *isl_printer_set_prefix( - __isl_take isl_printer *p, const char *prefix); - __isl_give isl_printer *isl_printer_set_suffix( - __isl_take isl_printer *p, const char *suffix); + #include + __isl_give isl_multi_val *isl_multi_val_reset_user( + __isl_take isl_multi_val *mv); -The C may be either C, C, -C, C or C -and defaults to C. -Each line in the output is indented by C (set by -C) spaces -(default: 0), prefixed by C and suffixed by C. -In the C format output, -the coefficients of the existentially quantified variables -appear between those of the set variables and those -of the parameters. -The function C increases the indentation -by the specified amount (which may be negative). + #include + __isl_give isl_multi_aff *isl_multi_aff_reset_user( + __isl_take isl_multi_aff *ma); + __isl_give isl_pw_aff *isl_pw_aff_reset_user( + __isl_take isl_pw_aff *pa); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_reset_user( + __isl_take isl_multi_pw_aff *mpa); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_reset_user( + __isl_take isl_pw_multi_aff *pma); + __isl_give isl_union_pw_aff *isl_union_pw_aff_reset_user( + __isl_take isl_union_pw_aff *upa); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_reset_user( + __isl_take isl_multi_union_pw_aff *mupa); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_reset_user( + __isl_take isl_union_pw_multi_aff *upma); -To actually print something, use + #include + __isl_give isl_pw_qpolynomial * + isl_pw_qpolynomial_reset_user( + __isl_take isl_pw_qpolynomial *pwqp); + __isl_give isl_union_pw_qpolynomial * + isl_union_pw_qpolynomial_reset_user( + __isl_take isl_union_pw_qpolynomial *upwqp); + __isl_give isl_pw_qpolynomial_fold * + isl_pw_qpolynomial_fold_reset_user( + __isl_take isl_pw_qpolynomial_fold *pwf); + __isl_give isl_union_pw_qpolynomial_fold * + isl_union_pw_qpolynomial_fold_reset_user( + __isl_take isl_union_pw_qpolynomial_fold *upwf); - #include - __isl_give isl_printer *isl_printer_print_double( - __isl_take isl_printer *p, double d); +Spaces can be nested. In particular, the domain of a set or +the domain or range of a relation can be a nested relation. +This process is also called I. +The functions for detecting, constructing and deconstructing +such nested spaces can be found in the wrapping properties +of L, the wrapping operations +of L and the Cartesian product operations +of L. + +Spaces can be created from other spaces +using the functions described in L +and L. + +=head2 Local Spaces + +A local space is essentially a space with +zero or more existentially quantified variables. +The local space of various objects can be obtained +using the following functions. + + #include + __isl_give isl_local_space *isl_constraint_get_local_space( + __isl_keep isl_constraint *constraint); #include - __isl_give isl_printer *isl_printer_print_basic_set( - __isl_take isl_printer *printer, + __isl_give isl_local_space *isl_basic_set_get_local_space( __isl_keep isl_basic_set *bset); - __isl_give isl_printer *isl_printer_print_set( - __isl_take isl_printer *printer, - __isl_keep isl_set *set); #include - __isl_give isl_printer *isl_printer_print_basic_map( - __isl_take isl_printer *printer, + __isl_give isl_local_space *isl_basic_map_get_local_space( __isl_keep isl_basic_map *bmap); - __isl_give isl_printer *isl_printer_print_map( - __isl_take isl_printer *printer, - __isl_keep isl_map *map); - #include - __isl_give isl_printer *isl_printer_print_union_set( - __isl_take isl_printer *p, - __isl_keep isl_union_set *uset); + #include + __isl_give isl_local_space *isl_aff_get_domain_local_space( + __isl_keep isl_aff *aff); + __isl_give isl_local_space *isl_aff_get_local_space( + __isl_keep isl_aff *aff); - #include - __isl_give isl_printer *isl_printer_print_union_map( - __isl_take isl_printer *p, - __isl_keep isl_union_map *umap); +A new local space can be created from a space using -When called on a file printer, the following function flushes -the file. When called on a string printer, the buffer is cleared. + #include + __isl_give isl_local_space *isl_local_space_from_space( + __isl_take isl_space *space); - __isl_give isl_printer *isl_printer_flush( - __isl_take isl_printer *p); +They can be inspected, modified, copied and freed using the following functions. + + #include + isl_bool isl_local_space_is_params( + __isl_keep isl_local_space *ls); + isl_bool isl_local_space_is_set( + __isl_keep isl_local_space *ls); + __isl_give isl_space *isl_local_space_get_space( + __isl_keep isl_local_space *ls); + __isl_give isl_aff *isl_local_space_get_div( + __isl_keep isl_local_space *ls, int pos); + __isl_give isl_local_space *isl_local_space_copy( + __isl_keep isl_local_space *ls); + __isl_null isl_local_space *isl_local_space_free( + __isl_take isl_local_space *ls); + +Note that C can only be used on local spaces +of sets. + +Two local spaces can be compared using + + isl_bool isl_local_space_is_equal( + __isl_keep isl_local_space *ls1, + __isl_keep isl_local_space *ls2); + +Local spaces can be created from other local spaces +using the functions described in L +and L. =head2 Creating New Sets and Relations @@ -1492,14 +1874,6 @@ __isl_give isl_map *isl_map_from_union_map( __isl_take isl_union_map *umap); -A zero-dimensional (basic) set can be constructed on a given parameter domain -using the following function. - - __isl_give isl_basic_set *isl_basic_set_from_params( - __isl_take isl_basic_set *bset); - __isl_give isl_set *isl_set_from_params( - __isl_take isl_set *set); - Sets and relations can be copied and freed again using the following functions. @@ -1513,12 +1887,16 @@ __isl_give isl_map *isl_map_copy(__isl_keep isl_map *map); __isl_give isl_union_map *isl_union_map_copy( __isl_keep isl_union_map *umap); - void *isl_basic_set_free(__isl_take isl_basic_set *bset); - void *isl_set_free(__isl_take isl_set *set); - void *isl_union_set_free(__isl_take isl_union_set *uset); - void *isl_basic_map_free(__isl_take isl_basic_map *bmap); - void *isl_map_free(__isl_take isl_map *map); - void *isl_union_map_free(__isl_take isl_union_map *umap); + __isl_null isl_basic_set *isl_basic_set_free( + __isl_take isl_basic_set *bset); + __isl_null isl_set *isl_set_free(__isl_take isl_set *set); + __isl_null isl_union_set *isl_union_set_free( + __isl_take isl_union_set *uset); + __isl_null isl_basic_map *isl_basic_map_free( + __isl_take isl_basic_map *bmap); + __isl_null isl_map *isl_map_free(__isl_take isl_map *map); + __isl_null isl_union_map *isl_union_map_free( + __isl_take isl_union_map *umap); Other sets and relations can be constructed by starting from a universe set or relation, adding equality and/or @@ -1529,27 +1907,23 @@ using the following functions. #include - __isl_give isl_constraint *isl_equality_alloc( + __isl_give isl_constraint *isl_constraint_alloc_equality( __isl_take isl_local_space *ls); - __isl_give isl_constraint *isl_inequality_alloc( + __isl_give isl_constraint *isl_constraint_alloc_inequality( __isl_take isl_local_space *ls); - __isl_give isl_constraint *isl_constraint_set_constant( - __isl_take isl_constraint *constraint, isl_int v); __isl_give isl_constraint *isl_constraint_set_constant_si( __isl_take isl_constraint *constraint, int v); __isl_give isl_constraint *isl_constraint_set_constant_val( __isl_take isl_constraint *constraint, __isl_take isl_val *v); - __isl_give isl_constraint *isl_constraint_set_coefficient( - __isl_take isl_constraint *constraint, - enum isl_dim_type type, int pos, isl_int v); __isl_give isl_constraint *isl_constraint_set_coefficient_si( __isl_take isl_constraint *constraint, enum isl_dim_type type, int pos, int v); __isl_give isl_constraint * isl_constraint_set_coefficient_val( __isl_take isl_constraint *constraint, - enum isl_dim_type type, int pos, isl_val *v); + enum isl_dim_type type, int pos, + __isl_take isl_val *v); __isl_give isl_basic_map *isl_basic_map_add_constraint( __isl_take isl_basic_map *bmap, __isl_take isl_constraint *constraint); @@ -1562,9 +1936,6 @@ __isl_give isl_set *isl_set_add_constraint( __isl_take isl_set *set, __isl_take isl_constraint *constraint); - __isl_give isl_basic_set *isl_basic_set_drop_constraint( - __isl_take isl_basic_set *bset, - __isl_take isl_constraint *constraint); For example, to create a set containing the even integers between 10 and 42, you would use the following code. @@ -1578,17 +1949,17 @@ bset = isl_basic_set_universe(isl_space_copy(space)); ls = isl_local_space_from_space(space); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); c = isl_constraint_set_coefficient_si(c, isl_dim_set, 0, -1); c = isl_constraint_set_coefficient_si(c, isl_dim_set, 1, 2); bset = isl_basic_set_add_constraint(bset, c); - c = isl_inequality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_inequality(isl_local_space_copy(ls)); c = isl_constraint_set_constant_si(c, -10); c = isl_constraint_set_coefficient_si(c, isl_dim_set, 0, 1); bset = isl_basic_set_add_constraint(bset, c); - c = isl_inequality_alloc(ls); + c = isl_constraint_alloc_inequality(ls); c = isl_constraint_set_constant_si(c, 42); c = isl_constraint_set_coefficient_si(c, isl_dim_set, 0, -1); bset = isl_basic_set_add_constraint(bset, c); @@ -1627,8 +1998,7 @@ A (basic or union) set or relation can also be constructed from a (union) (piecewise) (multiple) affine expression or a list of affine expressions -(See L<"Piecewise Quasi Affine Expressions"> and -L<"Piecewise Multiple Quasi Affine Expressions">). +(See L). __isl_give isl_basic_map *isl_basic_map_from_aff( __isl_take isl_aff *aff); @@ -1649,13 +2019,25 @@ __isl_take isl_pw_multi_aff *pma); __isl_give isl_map *isl_map_from_pw_multi_aff( __isl_take isl_pw_multi_aff *pma); + __isl_give isl_set *isl_set_from_multi_pw_aff( + __isl_take isl_multi_pw_aff *mpa); + __isl_give isl_map *isl_map_from_multi_pw_aff( + __isl_take isl_multi_pw_aff *mpa); + __isl_give isl_union_map *isl_union_map_from_union_pw_aff( + __isl_take isl_union_pw_aff *upa); __isl_give isl_union_map * isl_union_map_from_union_pw_multi_aff( __isl_take isl_union_pw_multi_aff *upma); + __isl_give isl_union_map * + isl_union_map_from_multi_union_pw_aff( + __isl_take isl_multi_union_pw_aff *mupa); -The C argument describes the domain of the resulting +The C argument describes the domain of the resulting basic relation. It is required because the C may consist of zero affine expressions. +The C passed to C +is not allowed to be zero-dimensional. The domain of the result +is the shared domain of the union piecewise affine elements. =head2 Inspecting Sets and Relations @@ -1734,11 +2116,13 @@ To iterate over all the sets or maps in a union set or map, use - int isl_union_set_foreach_set(__isl_keep isl_union_set *uset, - int (*fn)(__isl_take isl_set *set, void *user), + isl_stat isl_union_set_foreach_set( + __isl_keep isl_union_set *uset, + isl_stat (*fn)(__isl_take isl_set *set, void *user), void *user); - int isl_union_map_foreach_map(__isl_keep isl_union_map *umap, - int (*fn)(__isl_take isl_map *map, void *user), + isl_stat isl_union_map_foreach_map( + __isl_keep isl_union_map *umap, + isl_stat (*fn)(__isl_take isl_map *map, void *user), void *user); The number of sets or maps in a union set or map can be obtained @@ -1758,11 +2142,13 @@ To iterate over all the basic sets or maps in a set or map, use - int isl_set_foreach_basic_set(__isl_keep isl_set *set, - int (*fn)(__isl_take isl_basic_set *bset, void *user), + isl_stat isl_set_foreach_basic_set(__isl_keep isl_set *set, + isl_stat (*fn)(__isl_take isl_basic_set *bset, + void *user), void *user); - int isl_map_foreach_basic_map(__isl_keep isl_map *map, - int (*fn)(__isl_take isl_basic_map *bmap, void *user), + isl_stat isl_map_foreach_basic_map(__isl_keep isl_map *map, + isl_stat (*fn)(__isl_take isl_basic_map *bmap, + void *user), void *user); The callback function C should return 0 if successful and @@ -1780,25 +2166,35 @@ __isl_take isl_map *map); The number of basic sets in a set can be obtained +or the number of basic maps in a map can be obtained from + #include int isl_set_n_basic_set(__isl_keep isl_set *set); + #include + int isl_map_n_basic_map(__isl_keep isl_map *map); + To iterate over the constraints of a basic set or map, use #include int isl_basic_set_n_constraint( __isl_keep isl_basic_set *bset); - int isl_basic_set_foreach_constraint( + isl_stat isl_basic_set_foreach_constraint( __isl_keep isl_basic_set *bset, - int (*fn)(__isl_take isl_constraint *c, void *user), + isl_stat (*fn)(__isl_take isl_constraint *c, + void *user), void *user); - int isl_basic_map_foreach_constraint( + int isl_basic_map_n_constraint( + __isl_keep isl_basic_map *bmap); + isl_stat isl_basic_map_foreach_constraint( __isl_keep isl_basic_map *bmap, - int (*fn)(__isl_take isl_constraint *c, void *user), + isl_stat (*fn)(__isl_take isl_constraint *c, + void *user), void *user); - void *isl_constraint_free(__isl_take isl_constraint *c); + __isl_null isl_constraint *isl_constraint_free( + __isl_take isl_constraint *c); Again, the callback function C should return 0 if successful and -1 if an error occurs. In the latter case, or if any other error @@ -1807,31 +2203,38 @@ Use the following function to find out whether a constraint represents an equality. If not, it represents an inequality. - int isl_constraint_is_equality( + isl_bool isl_constraint_is_equality( __isl_keep isl_constraint *constraint); +It is also possible to obtain a list of constraints from a basic +map or set + + #include + __isl_give isl_constraint_list * + isl_basic_map_get_constraint_list( + __isl_keep isl_basic_map *bmap); + __isl_give isl_constraint_list * + isl_basic_set_get_constraint_list( + __isl_keep isl_basic_set *bset); + +These functions require that all existentially quantified variables +have an explicit representation. +The returned list can be manipulated using the functions in L<"Lists">. + The coefficients of the constraints can be inspected using the following functions. - int isl_constraint_is_lower_bound( + isl_bool isl_constraint_is_lower_bound( __isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned pos); - int isl_constraint_is_upper_bound( + isl_bool isl_constraint_is_upper_bound( __isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned pos); - void isl_constraint_get_constant( - __isl_keep isl_constraint *constraint, isl_int *v); __isl_give isl_val *isl_constraint_get_constant_val( __isl_keep isl_constraint *constraint); - void isl_constraint_get_coefficient( - __isl_keep isl_constraint *constraint, - enum isl_dim_type type, int pos, isl_int *v); __isl_give isl_val *isl_constraint_get_coefficient_val( __isl_keep isl_constraint *constraint, enum isl_dim_type type, int pos); - int isl_constraint_involves_dims( - __isl_keep isl_constraint *constraint, - enum isl_dim_type type, unsigned first, unsigned n); The explicit representations of the existentially quantified variables can be inspected using the following function. @@ -1841,7 +2244,7 @@ The existentially quantified variable is equal to the floor of the returned affine expression. The affine expression itself can be inspected using the functions in -L<"Piecewise Quasi Affine Expressions">. +L. __isl_give isl_aff *isl_constraint_get_div( __isl_keep isl_constraint *constraint, int pos); @@ -1869,3387 +2272,4992 @@ enum isl_dim_type c4, enum isl_dim_type c5); The C arguments dictate the order in which -different kinds of variables appear in the resulting matrix -and should be a permutation of C, C, +different kinds of variables appear in the resulting matrix. +For set inputs, they should be a permutation of +C, C, C and C. +For map inputs, they should be a permutation of +C, C, C, C and C. -The number of parameters, input, output or set dimensions can -be obtained using the following functions. - - unsigned isl_basic_set_dim(__isl_keep isl_basic_set *bset, - enum isl_dim_type type); - unsigned isl_basic_map_dim(__isl_keep isl_basic_map *bmap, - enum isl_dim_type type); - unsigned isl_set_dim(__isl_keep isl_set *set, - enum isl_dim_type type); - unsigned isl_map_dim(__isl_keep isl_map *map, - enum isl_dim_type type); +=head2 Points -To check whether the description of a set or relation depends -on one or more given dimensions, it is not necessary to iterate over all -constraints. Instead the following functions can be used. +Points are elements of a set. They can be used to construct +simple sets (boxes) or they can be used to represent the +individual elements of a set. +The zero point (the origin) can be created using - int isl_basic_set_involves_dims( - __isl_keep isl_basic_set *bset, - enum isl_dim_type type, unsigned first, unsigned n); - int isl_set_involves_dims(__isl_keep isl_set *set, - enum isl_dim_type type, unsigned first, unsigned n); - int isl_basic_map_involves_dims( - __isl_keep isl_basic_map *bmap, - enum isl_dim_type type, unsigned first, unsigned n); - int isl_map_involves_dims(__isl_keep isl_map *map, - enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_point *isl_point_zero(__isl_take isl_space *space); -Similarly, the following functions can be used to check whether -a given dimension is involved in any lower or upper bound. +The coordinates of a point can be inspected, set and changed +using - int isl_set_dim_has_any_lower_bound(__isl_keep isl_set *set, - enum isl_dim_type type, unsigned pos); - int isl_set_dim_has_any_upper_bound(__isl_keep isl_set *set, - enum isl_dim_type type, unsigned pos); + __isl_give isl_val *isl_point_get_coordinate_val( + __isl_keep isl_point *pnt, + enum isl_dim_type type, int pos); + __isl_give isl_point *isl_point_set_coordinate_val( + __isl_take isl_point *pnt, + enum isl_dim_type type, int pos, + __isl_take isl_val *v); -Note that these functions return true even if there is a bound on -the dimension on only some of the basic sets of C. -To check if they have a bound for all of the basic sets in C, -use the following functions instead. + __isl_give isl_point *isl_point_add_ui( + __isl_take isl_point *pnt, + enum isl_dim_type type, int pos, unsigned val); + __isl_give isl_point *isl_point_sub_ui( + __isl_take isl_point *pnt, + enum isl_dim_type type, int pos, unsigned val); - int isl_set_dim_has_lower_bound(__isl_keep isl_set *set, - enum isl_dim_type type, unsigned pos); - int isl_set_dim_has_upper_bound(__isl_keep isl_set *set, - enum isl_dim_type type, unsigned pos); +Points can be copied or freed using -The identifiers or names of the domain and range spaces of a set -or relation can be read off or set using the following functions. + __isl_give isl_point *isl_point_copy( + __isl_keep isl_point *pnt); + void isl_point_free(__isl_take isl_point *pnt); - __isl_give isl_set *isl_set_set_tuple_id( - __isl_take isl_set *set, __isl_take isl_id *id); - __isl_give isl_set *isl_set_reset_tuple_id( - __isl_take isl_set *set); - int isl_set_has_tuple_id(__isl_keep isl_set *set); - __isl_give isl_id *isl_set_get_tuple_id( - __isl_keep isl_set *set); - __isl_give isl_map *isl_map_set_tuple_id( - __isl_take isl_map *map, enum isl_dim_type type, - __isl_take isl_id *id); - __isl_give isl_map *isl_map_reset_tuple_id( - __isl_take isl_map *map, enum isl_dim_type type); - int isl_map_has_tuple_id(__isl_keep isl_map *map, - enum isl_dim_type type); - __isl_give isl_id *isl_map_get_tuple_id( - __isl_keep isl_map *map, enum isl_dim_type type); +A singleton set can be created from a point using - const char *isl_basic_set_get_tuple_name( - __isl_keep isl_basic_set *bset); - __isl_give isl_basic_set *isl_basic_set_set_tuple_name( - __isl_take isl_basic_set *set, const char *s); - int isl_set_has_tuple_name(__isl_keep isl_set *set); - const char *isl_set_get_tuple_name( - __isl_keep isl_set *set); - const char *isl_basic_map_get_tuple_name( - __isl_keep isl_basic_map *bmap, - enum isl_dim_type type); - __isl_give isl_basic_map *isl_basic_map_set_tuple_name( - __isl_take isl_basic_map *bmap, - enum isl_dim_type type, const char *s); - int isl_map_has_tuple_name(__isl_keep isl_map *map, - enum isl_dim_type type); - const char *isl_map_get_tuple_name( - __isl_keep isl_map *map, - enum isl_dim_type type); + __isl_give isl_basic_set *isl_basic_set_from_point( + __isl_take isl_point *pnt); + __isl_give isl_set *isl_set_from_point( + __isl_take isl_point *pnt); -As with C, the value returned points to -an internal data structure. -The identifiers, positions or names of individual dimensions can be -read off using the following functions. +and a box can be created from two opposite extremal points using - __isl_give isl_id *isl_basic_set_get_dim_id( - __isl_keep isl_basic_set *bset, - enum isl_dim_type type, unsigned pos); - __isl_give isl_set *isl_set_set_dim_id( - __isl_take isl_set *set, enum isl_dim_type type, - unsigned pos, __isl_take isl_id *id); - int isl_set_has_dim_id(__isl_keep isl_set *set, - enum isl_dim_type type, unsigned pos); - __isl_give isl_id *isl_set_get_dim_id( - __isl_keep isl_set *set, enum isl_dim_type type, - unsigned pos); - int isl_basic_map_has_dim_id( - __isl_keep isl_basic_map *bmap, - enum isl_dim_type type, unsigned pos); - __isl_give isl_map *isl_map_set_dim_id( - __isl_take isl_map *map, enum isl_dim_type type, - unsigned pos, __isl_take isl_id *id); - int isl_map_has_dim_id(__isl_keep isl_map *map, - enum isl_dim_type type, unsigned pos); - __isl_give isl_id *isl_map_get_dim_id( - __isl_keep isl_map *map, enum isl_dim_type type, - unsigned pos); + __isl_give isl_basic_set *isl_basic_set_box_from_points( + __isl_take isl_point *pnt1, + __isl_take isl_point *pnt2); + __isl_give isl_set *isl_set_box_from_points( + __isl_take isl_point *pnt1, + __isl_take isl_point *pnt2); - int isl_set_find_dim_by_id(__isl_keep isl_set *set, - enum isl_dim_type type, __isl_keep isl_id *id); - int isl_map_find_dim_by_id(__isl_keep isl_map *map, - enum isl_dim_type type, __isl_keep isl_id *id); - int isl_set_find_dim_by_name(__isl_keep isl_set *set, - enum isl_dim_type type, const char *name); - int isl_map_find_dim_by_name(__isl_keep isl_map *map, - enum isl_dim_type type, const char *name); +All elements of a B (union) set can be enumerated using +the following functions. - const char *isl_constraint_get_dim_name( - __isl_keep isl_constraint *constraint, - enum isl_dim_type type, unsigned pos); - const char *isl_basic_set_get_dim_name( - __isl_keep isl_basic_set *bset, - enum isl_dim_type type, unsigned pos); - int isl_set_has_dim_name(__isl_keep isl_set *set, - enum isl_dim_type type, unsigned pos); - const char *isl_set_get_dim_name( - __isl_keep isl_set *set, - enum isl_dim_type type, unsigned pos); - const char *isl_basic_map_get_dim_name( - __isl_keep isl_basic_map *bmap, - enum isl_dim_type type, unsigned pos); - int isl_map_has_dim_name(__isl_keep isl_map *map, - enum isl_dim_type type, unsigned pos); - const char *isl_map_get_dim_name( - __isl_keep isl_map *map, - enum isl_dim_type type, unsigned pos); + isl_stat isl_set_foreach_point(__isl_keep isl_set *set, + isl_stat (*fn)(__isl_take isl_point *pnt, + void *user), + void *user); + isl_stat isl_union_set_foreach_point( + __isl_keep isl_union_set *uset, + isl_stat (*fn)(__isl_take isl_point *pnt, + void *user), + void *user); -These functions are mostly useful to obtain the identifiers, positions -or names of the parameters. Identifiers of individual dimensions are -essentially only useful for printing. They are ignored by all other -operations and may not be preserved across those operations. +The function C is called for each integer point in +C with as second argument the last argument of +the C call. The function C +should return C<0> on success and C<-1> on failure. +In the latter case, C will stop +enumerating and return C<-1> as well. +If the enumeration is performed successfully and to completion, +then C returns C<0>. -=head2 Properties +To obtain a single point of a (basic) set, use -=head3 Unary Properties + __isl_give isl_point *isl_basic_set_sample_point( + __isl_take isl_basic_set *bset); + __isl_give isl_point *isl_set_sample_point( + __isl_take isl_set *set); -=over +If C does not contain any (integer) points, then the +resulting point will be ``void'', a property that can be +tested using -=item * Emptiness + isl_bool isl_point_is_void(__isl_keep isl_point *pnt); -The following functions test whether the given set or relation -contains any integer points. The ``plain'' variants do not perform -any computations, but simply check if the given set or relation -is already known to be empty. +=head2 Functions - int isl_basic_set_plain_is_empty(__isl_keep isl_basic_set *bset); - int isl_basic_set_is_empty(__isl_keep isl_basic_set *bset); - int isl_set_plain_is_empty(__isl_keep isl_set *set); - int isl_set_is_empty(__isl_keep isl_set *set); - int isl_union_set_is_empty(__isl_keep isl_union_set *uset); - int isl_basic_map_plain_is_empty(__isl_keep isl_basic_map *bmap); - int isl_basic_map_is_empty(__isl_keep isl_basic_map *bmap); - int isl_map_plain_is_empty(__isl_keep isl_map *map); - int isl_map_is_empty(__isl_keep isl_map *map); - int isl_union_map_is_empty(__isl_keep isl_union_map *umap); +Besides sets and relation, C also supports various types of functions. +Each of these types is derived from the value type (see L) +or from one of two primitive function types +through the application of zero or more type constructors. +We first describe the primitive type and then we describe +the types derived from these primitive types. + +=head3 Primitive Functions + +C support two primitive function types, quasi-affine +expressions and quasipolynomials. +A quasi-affine expression is defined either over a parameter +space or over a set and is composed of integer constants, +parameters and set variables, addition, subtraction and +integer division by an integer constant. +For example, the quasi-affine expression + + [n] -> { [x] -> [2*floor((4 n + x)/9] } + +maps C to C<2*floor((4 n + x)/9>. +A quasipolynomial is a polynomial expression in quasi-affine +expression. That is, it additionally allows for multiplication. +Note, though, that it is not allowed to construct an integer +division of an expression involving multiplications. +Here is an example of a quasipolynomial that is not +quasi-affine expression + + [n] -> { [x] -> (n*floor((4 n + x)/9) } + +Note that the external representations of quasi-affine expressions +and quasipolynomials are different. Quasi-affine expressions +use a notation with square brackets just like binary relations, +while quasipolynomials do not. This might change at some point. + +If a primitive function is defined over a parameter space, +then the space of the function itself is that of a set. +If it is defined over a set, then the space of the function +is that of a relation. In both cases, the set space (or +the output space) is single-dimensional, anonymous and unstructured. +To create functions with multiple dimensions or with other kinds +of set or output spaces, use multiple expressions +(see L). -=item * Universality +=over - int isl_basic_set_is_universe(__isl_keep isl_basic_set *bset); - int isl_basic_map_is_universe(__isl_keep isl_basic_map *bmap); - int isl_set_plain_is_universe(__isl_keep isl_set *set); +=item * Quasi-affine Expressions -=item * Single-valuedness +Besides the expressions described above, a quasi-affine +expression can also be set to NaN. Such expressions +typically represent a failure to represent a result +as a quasi-affine expression. - int isl_basic_map_is_single_valued( - __isl_keep isl_basic_map *bmap); - int isl_map_plain_is_single_valued( - __isl_keep isl_map *map); - int isl_map_is_single_valued(__isl_keep isl_map *map); - int isl_union_map_is_single_valued(__isl_keep isl_union_map *umap); +The zero quasi affine expression or the quasi affine expression +that is equal to a given value or +a specified dimension on a given domain can be created using -=item * Injectivity - - int isl_map_plain_is_injective(__isl_keep isl_map *map); - int isl_map_is_injective(__isl_keep isl_map *map); - int isl_union_map_plain_is_injective( - __isl_keep isl_union_map *umap); - int isl_union_map_is_injective( - __isl_keep isl_union_map *umap); + #include + __isl_give isl_aff *isl_aff_zero_on_domain( + __isl_take isl_local_space *ls); + __isl_give isl_aff *isl_aff_val_on_domain( + __isl_take isl_local_space *ls, + __isl_take isl_val *val); + __isl_give isl_aff *isl_aff_var_on_domain( + __isl_take isl_local_space *ls, + enum isl_dim_type type, unsigned pos); + __isl_give isl_aff *isl_aff_nan_on_domain( + __isl_take isl_local_space *ls); -=item * Bijectivity +Quasi affine expressions can be copied and freed using - int isl_map_is_bijective(__isl_keep isl_map *map); - int isl_union_map_is_bijective(__isl_keep isl_union_map *umap); + #include + __isl_give isl_aff *isl_aff_copy( + __isl_keep isl_aff *aff); + __isl_null isl_aff *isl_aff_free( + __isl_take isl_aff *aff); -=item * Position +A (rational) bound on a dimension can be extracted from an C +using the following function. The constraint is required to have +a non-zero coefficient for the specified dimension. - int isl_basic_map_plain_is_fixed( - __isl_keep isl_basic_map *bmap, - enum isl_dim_type type, unsigned pos, - isl_int *val); - int isl_set_plain_is_fixed(__isl_keep isl_set *set, - enum isl_dim_type type, unsigned pos, - isl_int *val); - int isl_map_plain_is_fixed(__isl_keep isl_map *map, - enum isl_dim_type type, unsigned pos, - isl_int *val); + #include + __isl_give isl_aff *isl_constraint_get_bound( + __isl_keep isl_constraint *constraint, + enum isl_dim_type type, int pos); -Check if the relation obviously lies on a hyperplane where the given dimension -has a fixed value and if so, return that value in C<*val>. +The entire affine expression of the constraint can also be extracted +using the following function. - __isl_give isl_val * - isl_basic_map_plain_get_val_if_fixed( - __isl_keep isl_basic_map *bmap, - enum isl_dim_type type, unsigned pos); - __isl_give isl_val *isl_set_plain_get_val_if_fixed( - __isl_keep isl_set *set, - enum isl_dim_type type, unsigned pos); - __isl_give isl_val *isl_map_plain_get_val_if_fixed( - __isl_keep isl_map *map, - enum isl_dim_type type, unsigned pos); + #include + __isl_give isl_aff *isl_constraint_get_aff( + __isl_keep isl_constraint *constraint); -If the set or relation obviously lies on a hyperplane where the given dimension -has a fixed value, then return that value. -Otherwise return NaN. +Conversely, an equality constraint equating +the affine expression to zero or an inequality constraint enforcing +the affine expression to be non-negative, can be constructed using -=item * Stride + __isl_give isl_constraint *isl_equality_from_aff( + __isl_take isl_aff *aff); + __isl_give isl_constraint *isl_inequality_from_aff( + __isl_take isl_aff *aff); - int isl_set_dim_residue_class_val( - __isl_keep isl_set *set, - int pos, __isl_give isl_val **modulo, - __isl_give isl_val **residue); +The coefficients and the integer divisions of an affine expression +can be inspected using the following functions. -Check if the values of the given set dimension are equal to a fixed -value modulo some integer value. If so, assign the modulo to C<*modulo> -and the fixed value to C<*residue>. If the given dimension attains only -a single value, then assign C<0> to C<*modulo> and the fixed value to -C<*residue>. -If the dimension does not attain only a single value and if no modulo -can be found then assign C<1> to C<*modulo> and C<1> to C<*residue>. + #include + __isl_give isl_val *isl_aff_get_constant_val( + __isl_keep isl_aff *aff); + __isl_give isl_val *isl_aff_get_coefficient_val( + __isl_keep isl_aff *aff, + enum isl_dim_type type, int pos); + int isl_aff_coefficient_sgn(__isl_keep isl_aff *aff, + enum isl_dim_type type, int pos); + __isl_give isl_val *isl_aff_get_denominator_val( + __isl_keep isl_aff *aff); + __isl_give isl_aff *isl_aff_get_div( + __isl_keep isl_aff *aff, int pos); -=item * Space +They can be modified using the following functions. -To check whether a set is a parameter domain, use this function: + #include + __isl_give isl_aff *isl_aff_set_constant_si( + __isl_take isl_aff *aff, int v); + __isl_give isl_aff *isl_aff_set_constant_val( + __isl_take isl_aff *aff, __isl_take isl_val *v); + __isl_give isl_aff *isl_aff_set_coefficient_si( + __isl_take isl_aff *aff, + enum isl_dim_type type, int pos, int v); + __isl_give isl_aff *isl_aff_set_coefficient_val( + __isl_take isl_aff *aff, + enum isl_dim_type type, int pos, + __isl_take isl_val *v); - int isl_set_is_params(__isl_keep isl_set *set); - int isl_union_set_is_params( - __isl_keep isl_union_set *uset); + __isl_give isl_aff *isl_aff_add_constant_si( + __isl_take isl_aff *aff, int v); + __isl_give isl_aff *isl_aff_add_constant_val( + __isl_take isl_aff *aff, __isl_take isl_val *v); + __isl_give isl_aff *isl_aff_add_constant_num_si( + __isl_take isl_aff *aff, int v); + __isl_give isl_aff *isl_aff_add_coefficient_si( + __isl_take isl_aff *aff, + enum isl_dim_type type, int pos, int v); + __isl_give isl_aff *isl_aff_add_coefficient_val( + __isl_take isl_aff *aff, + enum isl_dim_type type, int pos, + __isl_take isl_val *v); -=item * Wrapping +Note that C and C +set the I of the constant or coefficient, while +C and C set +the constant or coefficient as a whole. +The C and C functions add an integer +or rational value to +the possibly rational constant or coefficient. +The C functions add an integer value to +the numerator. -The following functions check whether the domain of the given -(basic) set is a wrapped relation. +=item * Quasipolynomials - int isl_basic_set_is_wrapping( - __isl_keep isl_basic_set *bset); - int isl_set_is_wrapping(__isl_keep isl_set *set); +Some simple quasipolynomials can be created using the following functions. -=item * Internal Product + #include + __isl_give isl_qpolynomial *isl_qpolynomial_zero_on_domain( + __isl_take isl_space *domain); + __isl_give isl_qpolynomial *isl_qpolynomial_one_on_domain( + __isl_take isl_space *domain); + __isl_give isl_qpolynomial *isl_qpolynomial_infty_on_domain( + __isl_take isl_space *domain); + __isl_give isl_qpolynomial *isl_qpolynomial_neginfty_on_domain( + __isl_take isl_space *domain); + __isl_give isl_qpolynomial *isl_qpolynomial_nan_on_domain( + __isl_take isl_space *domain); + __isl_give isl_qpolynomial *isl_qpolynomial_val_on_domain( + __isl_take isl_space *domain, + __isl_take isl_val *val); + __isl_give isl_qpolynomial *isl_qpolynomial_var_on_domain( + __isl_take isl_space *domain, + enum isl_dim_type type, unsigned pos); + __isl_give isl_qpolynomial *isl_qpolynomial_from_aff( + __isl_take isl_aff *aff); - int isl_basic_map_can_zip( - __isl_keep isl_basic_map *bmap); - int isl_map_can_zip(__isl_keep isl_map *map); +Recall that the space in which a quasipolynomial lives is a map space +with a one-dimensional range. The C argument in some of +the functions above corresponds to the domain of this map space. -Check whether the product of domain and range of the given relation -can be computed, -i.e., whether both domain and range are nested relations. +Quasipolynomials can be copied and freed again using the following +functions. -=item * Currying + #include + __isl_give isl_qpolynomial *isl_qpolynomial_copy( + __isl_keep isl_qpolynomial *qp); + __isl_null isl_qpolynomial *isl_qpolynomial_free( + __isl_take isl_qpolynomial *qp); - int isl_basic_map_can_curry( - __isl_keep isl_basic_map *bmap); - int isl_map_can_curry(__isl_keep isl_map *map); +The constant term of a quasipolynomial can be extracted using -Check whether the domain of the (basic) relation is a wrapped relation. + __isl_give isl_val *isl_qpolynomial_get_constant_val( + __isl_keep isl_qpolynomial *qp); - int isl_basic_map_can_uncurry( - __isl_keep isl_basic_map *bmap); - int isl_map_can_uncurry(__isl_keep isl_map *map); +To iterate over all terms in a quasipolynomial, +use -Check whether the range of the (basic) relation is a wrapped relation. + isl_stat isl_qpolynomial_foreach_term( + __isl_keep isl_qpolynomial *qp, + isl_stat (*fn)(__isl_take isl_term *term, + void *user), void *user); -=back +The terms themselves can be inspected and freed using +these functions -=head3 Binary Properties + unsigned isl_term_dim(__isl_keep isl_term *term, + enum isl_dim_type type); + __isl_give isl_val *isl_term_get_coefficient_val( + __isl_keep isl_term *term); + int isl_term_get_exp(__isl_keep isl_term *term, + enum isl_dim_type type, unsigned pos); + __isl_give isl_aff *isl_term_get_div( + __isl_keep isl_term *term, unsigned pos); + void isl_term_free(__isl_take isl_term *term); -=over +Each term is a product of parameters, set variables and +integer divisions. The function C +returns the exponent of a given dimensions in the given term. -=item * Equality +=back - int isl_set_plain_is_equal(__isl_keep isl_set *set1, - __isl_keep isl_set *set2); - int isl_set_is_equal(__isl_keep isl_set *set1, - __isl_keep isl_set *set2); - int isl_union_set_is_equal( - __isl_keep isl_union_set *uset1, - __isl_keep isl_union_set *uset2); - int isl_basic_map_is_equal( - __isl_keep isl_basic_map *bmap1, - __isl_keep isl_basic_map *bmap2); - int isl_map_is_equal(__isl_keep isl_map *map1, - __isl_keep isl_map *map2); - int isl_map_plain_is_equal(__isl_keep isl_map *map1, - __isl_keep isl_map *map2); - int isl_union_map_is_equal( - __isl_keep isl_union_map *umap1, - __isl_keep isl_union_map *umap2); +=head3 Reductions -=item * Disjointness +A reduction represents a maximum or a minimum of its +base expressions. +The only reduction type defined by C is +C. + +There are currently no functions to directly create such +objects, but they do appear in the piecewise quasipolynomial +reductions returned by the C function. +See +L. - int isl_set_plain_is_disjoint(__isl_keep isl_set *set1, - __isl_keep isl_set *set2); - int isl_set_is_disjoint(__isl_keep isl_set *set1, - __isl_keep isl_set *set2); - int isl_map_is_disjoint(__isl_keep isl_map *map1, - __isl_keep isl_map *map2); +Reductions can be copied and freed using +the following functions. -=item * Subset + #include + __isl_give isl_qpolynomial_fold * + isl_qpolynomial_fold_copy( + __isl_keep isl_qpolynomial_fold *fold); + void isl_qpolynomial_fold_free( + __isl_take isl_qpolynomial_fold *fold); - int isl_basic_set_is_subset( - __isl_keep isl_basic_set *bset1, - __isl_keep isl_basic_set *bset2); - int isl_set_is_subset(__isl_keep isl_set *set1, - __isl_keep isl_set *set2); - int isl_set_is_strict_subset( - __isl_keep isl_set *set1, - __isl_keep isl_set *set2); - int isl_union_set_is_subset( - __isl_keep isl_union_set *uset1, - __isl_keep isl_union_set *uset2); - int isl_union_set_is_strict_subset( - __isl_keep isl_union_set *uset1, - __isl_keep isl_union_set *uset2); - int isl_basic_map_is_subset( - __isl_keep isl_basic_map *bmap1, - __isl_keep isl_basic_map *bmap2); - int isl_basic_map_is_strict_subset( - __isl_keep isl_basic_map *bmap1, - __isl_keep isl_basic_map *bmap2); - int isl_map_is_subset( - __isl_keep isl_map *map1, - __isl_keep isl_map *map2); - int isl_map_is_strict_subset( - __isl_keep isl_map *map1, - __isl_keep isl_map *map2); - int isl_union_map_is_subset( - __isl_keep isl_union_map *umap1, - __isl_keep isl_union_map *umap2); - int isl_union_map_is_strict_subset( - __isl_keep isl_union_map *umap1, - __isl_keep isl_union_map *umap2); +To iterate over all quasipolynomials in a reduction, use -Check whether the first argument is a (strict) subset of the -second argument. + isl_stat isl_qpolynomial_fold_foreach_qpolynomial( + __isl_keep isl_qpolynomial_fold *fold, + isl_stat (*fn)(__isl_take isl_qpolynomial *qp, + void *user), void *user); -=item * Order +=head3 Multiple Expressions - int isl_set_plain_cmp(__isl_keep isl_set *set1, - __isl_keep isl_set *set2); +A multiple expression represents a sequence of zero or +more base expressions, all defined on the same domain space. +The domain space of the multiple expression is the same +as that of the base expressions, but the range space +can be any space. In case the base expressions have +a set space, the corresponding multiple expression +also has a set space. +Objects of the value type do not have an associated space. +The space of a multiple value is therefore always a set space. +Similarly, the space of a multiple union piecewise +affine expression is always a set space. + +The multiple expression types defined by C +are C, C, C, +C. -This function is useful for sorting Cs. -The order depends on the internal representation of the inputs. -The order is fixed over different calls to the function (assuming -the internal representation of the inputs has not changed), but may -change over different versions of C. +A multiple expression with the value zero for +each output (or set) dimension can be created +using the following functions. -=back + #include + __isl_give isl_multi_val *isl_multi_val_zero( + __isl_take isl_space *space); -=head2 Unary Operations + #include + __isl_give isl_multi_aff *isl_multi_aff_zero( + __isl_take isl_space *space); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_zero( + __isl_take isl_space *space); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_zero( + __isl_take isl_space *space); -=over +Since there is no canonical way of representing a zero +value of type C, the space passed +to C needs to be zero-dimensional. + +An identity function can be created using the following +functions. The space needs to be that of a relation +with the same number of input and output dimensions. -=item * Complement + #include + __isl_give isl_multi_aff *isl_multi_aff_identity( + __isl_take isl_space *space); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_identity( + __isl_take isl_space *space); - __isl_give isl_set *isl_set_complement( - __isl_take isl_set *set); - __isl_give isl_map *isl_map_complement( - __isl_take isl_map *map); +A function that performs a projection on a universe +relation or set can be created using the following functions. +See also the corresponding +projection operations in L. -=item * Inverse map + #include + __isl_give isl_multi_aff *isl_multi_aff_domain_map( + __isl_take isl_space *space); + __isl_give isl_multi_aff *isl_multi_aff_range_map( + __isl_take isl_space *space); + __isl_give isl_multi_aff *isl_multi_aff_project_out_map( + __isl_take isl_space *space, + enum isl_dim_type type, + unsigned first, unsigned n); - __isl_give isl_basic_map *isl_basic_map_reverse( - __isl_take isl_basic_map *bmap); - __isl_give isl_map *isl_map_reverse( - __isl_take isl_map *map); - __isl_give isl_union_map *isl_union_map_reverse( - __isl_take isl_union_map *umap); +A multiple expression can be created from a single +base expression using the following functions. +The space of the created multiple expression is the same +as that of the base expression, except for +C where the input +lives in a parameter space and the output lives +in a single-dimensional set space. -=item * Projection + #include + __isl_give isl_multi_aff *isl_multi_aff_from_aff( + __isl_take isl_aff *aff); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_from_pw_aff( + __isl_take isl_pw_aff *pa); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_from_union_pw_aff( + __isl_take isl_union_pw_aff *upa); + +A multiple expression can be created from a list +of base expression in a specified space. +The domain of this space needs to be the same +as the domains of the base expressions in the list. +If the base expressions have a set space (or no associated space), +then this space also needs to be a set space. - __isl_give isl_basic_set *isl_basic_set_project_out( - __isl_take isl_basic_set *bset, - enum isl_dim_type type, unsigned first, unsigned n); - __isl_give isl_basic_map *isl_basic_map_project_out( - __isl_take isl_basic_map *bmap, - enum isl_dim_type type, unsigned first, unsigned n); - __isl_give isl_set *isl_set_project_out(__isl_take isl_set *set, - enum isl_dim_type type, unsigned first, unsigned n); - __isl_give isl_map *isl_map_project_out(__isl_take isl_map *map, - enum isl_dim_type type, unsigned first, unsigned n); - __isl_give isl_basic_set *isl_basic_set_params( - __isl_take isl_basic_set *bset); - __isl_give isl_basic_set *isl_basic_map_domain( - __isl_take isl_basic_map *bmap); - __isl_give isl_basic_set *isl_basic_map_range( - __isl_take isl_basic_map *bmap); - __isl_give isl_set *isl_set_params(__isl_take isl_set *set); - __isl_give isl_set *isl_map_params(__isl_take isl_map *map); - __isl_give isl_set *isl_map_domain( - __isl_take isl_map *bmap); - __isl_give isl_set *isl_map_range( - __isl_take isl_map *map); - __isl_give isl_set *isl_union_set_params( - __isl_take isl_union_set *uset); - __isl_give isl_set *isl_union_map_params( - __isl_take isl_union_map *umap); - __isl_give isl_union_set *isl_union_map_domain( - __isl_take isl_union_map *umap); - __isl_give isl_union_set *isl_union_map_range( - __isl_take isl_union_map *umap); + #include + __isl_give isl_multi_val *isl_multi_val_from_val_list( + __isl_take isl_space *space, + __isl_take isl_val_list *list); - __isl_give isl_basic_map *isl_basic_map_domain_map( - __isl_take isl_basic_map *bmap); - __isl_give isl_basic_map *isl_basic_map_range_map( - __isl_take isl_basic_map *bmap); - __isl_give isl_map *isl_map_domain_map(__isl_take isl_map *map); - __isl_give isl_map *isl_map_range_map(__isl_take isl_map *map); - __isl_give isl_union_map *isl_union_map_domain_map( - __isl_take isl_union_map *umap); - __isl_give isl_union_map *isl_union_map_range_map( - __isl_take isl_union_map *umap); + #include + __isl_give isl_multi_aff *isl_multi_aff_from_aff_list( + __isl_take isl_space *space, + __isl_take isl_aff_list *list); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_from_union_pw_aff_list( + __isl_take isl_space *space, + __isl_take isl_union_pw_aff_list *list); -The functions above construct a (basic, regular or union) relation -that maps (a wrapped version of) the input relation to its domain or range. +As a convenience, a multiple piecewise expression can +also be created from a multiple expression. +Each piecewise expression in the result has a single +universe cell. -=item * Elimination + #include + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_from_multi_aff( + __isl_take isl_multi_aff *ma); - __isl_give isl_basic_set *isl_basic_set_eliminate( - __isl_take isl_basic_set *bset, - enum isl_dim_type type, - unsigned first, unsigned n); - __isl_give isl_set *isl_set_eliminate( - __isl_take isl_set *set, enum isl_dim_type type, - unsigned first, unsigned n); - __isl_give isl_basic_map *isl_basic_map_eliminate( - __isl_take isl_basic_map *bmap, - enum isl_dim_type type, - unsigned first, unsigned n); - __isl_give isl_map *isl_map_eliminate( - __isl_take isl_map *map, enum isl_dim_type type, - unsigned first, unsigned n); +Similarly, a multiple union expression can be +created from a multiple expression. -Eliminate the coefficients for the given dimensions from the constraints, -without removing the dimensions. + #include + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_from_multi_aff( + __isl_take isl_multi_aff *ma); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_from_multi_pw_aff( + __isl_take isl_multi_pw_aff *mpa); -=item * Slicing +A multiple quasi-affine expression can be created from +a multiple value with a given domain space using the following +function. - __isl_give isl_basic_set *isl_basic_set_fix( - __isl_take isl_basic_set *bset, - enum isl_dim_type type, unsigned pos, - isl_int value); - __isl_give isl_basic_set *isl_basic_set_fix_si( - __isl_take isl_basic_set *bset, - enum isl_dim_type type, unsigned pos, int value); - __isl_give isl_basic_set *isl_basic_set_fix_val( - __isl_take isl_basic_set *bset, - enum isl_dim_type type, unsigned pos, - __isl_take isl_val *v); - __isl_give isl_set *isl_set_fix(__isl_take isl_set *set, - enum isl_dim_type type, unsigned pos, - isl_int value); - __isl_give isl_set *isl_set_fix_si(__isl_take isl_set *set, - enum isl_dim_type type, unsigned pos, int value); - __isl_give isl_set *isl_set_fix_val( - __isl_take isl_set *set, - enum isl_dim_type type, unsigned pos, - __isl_take isl_val *v); - __isl_give isl_basic_map *isl_basic_map_fix_si( - __isl_take isl_basic_map *bmap, - enum isl_dim_type type, unsigned pos, int value); - __isl_give isl_basic_map *isl_basic_map_fix_val( - __isl_take isl_basic_map *bmap, - enum isl_dim_type type, unsigned pos, - __isl_take isl_val *v); - __isl_give isl_map *isl_map_fix(__isl_take isl_map *map, - enum isl_dim_type type, unsigned pos, - isl_int value); - __isl_give isl_map *isl_map_fix_si(__isl_take isl_map *map, - enum isl_dim_type type, unsigned pos, int value); - __isl_give isl_map *isl_map_fix_val( - __isl_take isl_map *map, - enum isl_dim_type type, unsigned pos, - __isl_take isl_val *v); + #include + __isl_give isl_multi_aff * + isl_multi_aff_multi_val_on_space( + __isl_take isl_space *space, + __isl_take isl_multi_val *mv); -Intersect the set or relation with the hyperplane where the given -dimension has the fixed given value. +Similarly, +a multiple union piecewise affine expression can be created from +a multiple value with a given domain or +a multiple affine expression with a given domain +using the following functions. - __isl_give isl_basic_map *isl_basic_map_lower_bound_si( - __isl_take isl_basic_map *bmap, - enum isl_dim_type type, unsigned pos, int value); - __isl_give isl_basic_map *isl_basic_map_upper_bound_si( - __isl_take isl_basic_map *bmap, - enum isl_dim_type type, unsigned pos, int value); - __isl_give isl_set *isl_set_lower_bound( - __isl_take isl_set *set, - enum isl_dim_type type, unsigned pos, - isl_int value); - __isl_give isl_set *isl_set_lower_bound_si( - __isl_take isl_set *set, - enum isl_dim_type type, unsigned pos, int value); - __isl_give isl_set *isl_set_lower_bound_val( - __isl_take isl_set *set, - enum isl_dim_type type, unsigned pos, - __isl_take isl_val *value); - __isl_give isl_map *isl_map_lower_bound_si( - __isl_take isl_map *map, - enum isl_dim_type type, unsigned pos, int value); - __isl_give isl_set *isl_set_upper_bound( - __isl_take isl_set *set, - enum isl_dim_type type, unsigned pos, - isl_int value); - __isl_give isl_set *isl_set_upper_bound_si( - __isl_take isl_set *set, - enum isl_dim_type type, unsigned pos, int value); - __isl_give isl_set *isl_set_upper_bound_val( - __isl_take isl_set *set, - enum isl_dim_type type, unsigned pos, - __isl_take isl_val *value); - __isl_give isl_map *isl_map_upper_bound_si( - __isl_take isl_map *map, - enum isl_dim_type type, unsigned pos, int value); + #include + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_multi_val_on_domain( + __isl_take isl_union_set *domain, + __isl_take isl_multi_val *mv); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_multi_aff_on_domain( + __isl_take isl_union_set *domain, + __isl_take isl_multi_aff *ma); -Intersect the set or relation with the half-space where the given -dimension has a value bounded by the fixed given integer value. +Multiple expressions can be copied and freed using +the following functions. - __isl_give isl_set *isl_set_equate(__isl_take isl_set *set, - enum isl_dim_type type1, int pos1, - enum isl_dim_type type2, int pos2); - __isl_give isl_basic_map *isl_basic_map_equate( - __isl_take isl_basic_map *bmap, - enum isl_dim_type type1, int pos1, - enum isl_dim_type type2, int pos2); - __isl_give isl_map *isl_map_equate(__isl_take isl_map *map, - enum isl_dim_type type1, int pos1, - enum isl_dim_type type2, int pos2); + #include + __isl_give isl_multi_val *isl_multi_val_copy( + __isl_keep isl_multi_val *mv); + __isl_null isl_multi_val *isl_multi_val_free( + __isl_take isl_multi_val *mv); -Intersect the set or relation with the hyperplane where the given -dimensions are equal to each other. + #include + __isl_give isl_multi_aff *isl_multi_aff_copy( + __isl_keep isl_multi_aff *maff); + __isl_null isl_multi_aff *isl_multi_aff_free( + __isl_take isl_multi_aff *maff); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_copy( + __isl_keep isl_multi_pw_aff *mpa); + __isl_null isl_multi_pw_aff *isl_multi_pw_aff_free( + __isl_take isl_multi_pw_aff *mpa); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_copy( + __isl_keep isl_multi_union_pw_aff *mupa); + __isl_null isl_multi_union_pw_aff * + isl_multi_union_pw_aff_free( + __isl_take isl_multi_union_pw_aff *mupa); - __isl_give isl_map *isl_map_oppose(__isl_take isl_map *map, - enum isl_dim_type type1, int pos1, - enum isl_dim_type type2, int pos2); +The base expression at a given position of a multiple +expression can be extracted using the following functions. -Intersect the relation with the hyperplane where the given -dimensions have opposite values. + #include + __isl_give isl_val *isl_multi_val_get_val( + __isl_keep isl_multi_val *mv, int pos); - __isl_give isl_basic_map *isl_basic_map_order_ge( - __isl_take isl_basic_map *bmap, - enum isl_dim_type type1, int pos1, - enum isl_dim_type type2, int pos2); - __isl_give isl_map *isl_map_order_lt(__isl_take isl_map *map, - enum isl_dim_type type1, int pos1, - enum isl_dim_type type2, int pos2); - __isl_give isl_basic_map *isl_basic_map_order_gt( - __isl_take isl_basic_map *bmap, - enum isl_dim_type type1, int pos1, - enum isl_dim_type type2, int pos2); - __isl_give isl_map *isl_map_order_gt(__isl_take isl_map *map, - enum isl_dim_type type1, int pos1, - enum isl_dim_type type2, int pos2); + #include + __isl_give isl_aff *isl_multi_aff_get_aff( + __isl_keep isl_multi_aff *multi, int pos); + __isl_give isl_pw_aff *isl_multi_pw_aff_get_pw_aff( + __isl_keep isl_multi_pw_aff *mpa, int pos); + __isl_give isl_union_pw_aff * + isl_multi_union_pw_aff_get_union_pw_aff( + __isl_keep isl_multi_union_pw_aff *mupa, int pos); -Intersect the relation with the half-space where the given -dimensions satisfy the given ordering. +It can be replaced using the following functions. -=item * Identity + #include + __isl_give isl_multi_val *isl_multi_val_set_val( + __isl_take isl_multi_val *mv, int pos, + __isl_take isl_val *val); - __isl_give isl_map *isl_set_identity( - __isl_take isl_set *set); - __isl_give isl_union_map *isl_union_set_identity( - __isl_take isl_union_set *uset); + #include + __isl_give isl_multi_aff *isl_multi_aff_set_aff( + __isl_take isl_multi_aff *multi, int pos, + __isl_take isl_aff *aff); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_set_union_pw_aff( + __isl_take isl_multi_union_pw_aff *mupa, int pos, + __isl_take isl_union_pw_aff *upa); + +As a convenience, a sequence of base expressions that have +their domains in a given space can be extracted from a sequence +of union expressions using the following function. -Construct an identity relation on the given (union) set. + #include + __isl_give isl_multi_pw_aff * + isl_multi_union_pw_aff_extract_multi_pw_aff( + __isl_keep isl_multi_union_pw_aff *mupa, + __isl_take isl_space *space); -=item * Deltas +Note that there is a difference between C +and C objects. The first is a sequence +of unions of piecewise expressions, while the second is a union +of piecewise sequences. In particular, multiple affine expressions +in an C may live in different spaces, +while there is only a single multiple expression in +an C, which can therefore only live +in a single space. This means that not every +C can be converted to +an C. Conversely, a zero-dimensional +C carries no information +about any possible domain and therefore cannot be converted +to an C. Moreover, the elements +of an C may be defined over different domains, +while each multiple expression inside an C +has a single domain. The conversion of an C +of dimension greater than one may therefore not be exact. +The following functions can +be used to perform these conversions when they are possible. - __isl_give isl_basic_set *isl_basic_map_deltas( - __isl_take isl_basic_map *bmap); - __isl_give isl_set *isl_map_deltas(__isl_take isl_map *map); - __isl_give isl_union_set *isl_union_map_deltas( - __isl_take isl_union_map *umap); + #include + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_from_union_pw_multi_aff( + __isl_take isl_union_pw_multi_aff *upma); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_from_multi_union_pw_aff( + __isl_take isl_multi_union_pw_aff *mupa); -These functions return a (basic) set containing the differences -between image elements and corresponding domain elements in the input. +=head3 Piecewise Expressions - __isl_give isl_basic_map *isl_basic_map_deltas_map( - __isl_take isl_basic_map *bmap); - __isl_give isl_map *isl_map_deltas_map( - __isl_take isl_map *map); - __isl_give isl_union_map *isl_union_map_deltas_map( - __isl_take isl_union_map *umap); +A piecewise expression is an expression that is described +using zero or more base expression defined over the same +number of cells in the domain space of the base expressions. +All base expressions are defined over the same +domain space and the cells are disjoint. +The space of a piecewise expression is the same as +that of the base expressions. +If the union of the cells is a strict subset of the domain +space, then the value of the piecewise expression outside +this union is different for types derived from quasi-affine +expressions and those derived from quasipolynomials. +Piecewise expressions derived from quasi-affine expressions +are considered to be undefined outside the union of their cells. +Piecewise expressions derived from quasipolynomials +are considered to be zero outside the union of their cells. -The functions above construct a (basic, regular or union) relation -that maps (a wrapped version of) the input relation to its delta set. +Piecewise quasipolynomials are mainly used by the C +library for representing the number of elements in a parametric set or map. +For example, the piecewise quasipolynomial -=item * Coalescing + [n] -> { [x] -> ((1 + n) - x) : x <= n and x >= 0 } -Simplify the representation of a set or relation by trying -to combine pairs of basic sets or relations into a single -basic set or relation. +represents the number of points in the map - __isl_give isl_set *isl_set_coalesce(__isl_take isl_set *set); - __isl_give isl_map *isl_map_coalesce(__isl_take isl_map *map); - __isl_give isl_union_set *isl_union_set_coalesce( - __isl_take isl_union_set *uset); - __isl_give isl_union_map *isl_union_map_coalesce( - __isl_take isl_union_map *umap); + [n] -> { [x] -> [y] : x,y >= 0 and 0 <= x + y <= n } -One of the methods for combining pairs of basic sets or relations -can result in coefficients that are much larger than those that appear -in the constraints of the input. By default, the coefficients are -not allowed to grow larger, but this can be changed by unsetting -the following option. +The piecewise expression types defined by C +are C, C, +C and C. - int isl_options_set_coalesce_bounded_wrapping( - isl_ctx *ctx, int val); - int isl_options_get_coalesce_bounded_wrapping( - isl_ctx *ctx); +A piecewise expression with no cells can be created using +the following functions. -=item * Detecting equalities + #include + __isl_give isl_pw_aff *isl_pw_aff_empty( + __isl_take isl_space *space); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_empty( + __isl_take isl_space *space); - __isl_give isl_basic_set *isl_basic_set_detect_equalities( - __isl_take isl_basic_set *bset); - __isl_give isl_basic_map *isl_basic_map_detect_equalities( - __isl_take isl_basic_map *bmap); - __isl_give isl_set *isl_set_detect_equalities( - __isl_take isl_set *set); - __isl_give isl_map *isl_map_detect_equalities( - __isl_take isl_map *map); - __isl_give isl_union_set *isl_union_set_detect_equalities( - __isl_take isl_union_set *uset); - __isl_give isl_union_map *isl_union_map_detect_equalities( - __isl_take isl_union_map *umap); +A piecewise expression with a single universe cell can be +created using the following functions. -Simplify the representation of a set or relation by detecting implicit -equalities. + #include + __isl_give isl_pw_aff *isl_pw_aff_from_aff( + __isl_take isl_aff *aff); + __isl_give isl_pw_multi_aff * + isl_pw_multi_aff_from_multi_aff( + __isl_take isl_multi_aff *ma); -=item * Removing redundant constraints + #include + __isl_give isl_pw_qpolynomial * + isl_pw_qpolynomial_from_qpolynomial( + __isl_take isl_qpolynomial *qp); - __isl_give isl_basic_set *isl_basic_set_remove_redundancies( - __isl_take isl_basic_set *bset); - __isl_give isl_set *isl_set_remove_redundancies( - __isl_take isl_set *set); - __isl_give isl_basic_map *isl_basic_map_remove_redundancies( - __isl_take isl_basic_map *bmap); - __isl_give isl_map *isl_map_remove_redundancies( - __isl_take isl_map *map); +A piecewise expression with a single specified cell can be +created using the following functions. -=item * Convex hull + #include + __isl_give isl_pw_aff *isl_pw_aff_alloc( + __isl_take isl_set *set, __isl_take isl_aff *aff); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_alloc( + __isl_take isl_set *set, + __isl_take isl_multi_aff *maff); - __isl_give isl_basic_set *isl_set_convex_hull( - __isl_take isl_set *set); - __isl_give isl_basic_map *isl_map_convex_hull( - __isl_take isl_map *map); + #include + __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_alloc( + __isl_take isl_set *set, + __isl_take isl_qpolynomial *qp); -If the input set or relation has any existentially quantified -variables, then the result of these operations is currently undefined. +The following convenience functions first create a base expression and +then create a piecewise expression over a universe domain. -=item * Simple hull + #include + __isl_give isl_pw_aff *isl_pw_aff_zero_on_domain( + __isl_take isl_local_space *ls); + __isl_give isl_pw_aff *isl_pw_aff_var_on_domain( + __isl_take isl_local_space *ls, + enum isl_dim_type type, unsigned pos); + __isl_give isl_pw_aff *isl_pw_aff_nan_on_domain( + __isl_take isl_local_space *ls); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_zero( + __isl_take isl_space *space); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_identity( + __isl_take isl_space *space); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_range_map( + __isl_take isl_space *space); + __isl_give isl_pw_multi_aff * + isl_pw_multi_aff_project_out_map( + __isl_take isl_space *space, + enum isl_dim_type type, + unsigned first, unsigned n); - __isl_give isl_basic_set * - isl_set_unshifted_simple_hull( - __isl_take isl_set *set); - __isl_give isl_basic_map * - isl_map_unshifted_simple_hull( - __isl_take isl_map *map); - __isl_give isl_basic_set *isl_set_simple_hull( - __isl_take isl_set *set); - __isl_give isl_basic_map *isl_map_simple_hull( - __isl_take isl_map *map); - __isl_give isl_union_map *isl_union_map_simple_hull( - __isl_take isl_union_map *umap); + #include + __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_zero( + __isl_take isl_space *space); -These functions compute a single basic set or relation -that contains the whole input set or relation. -In particular, the output is described by translates -of the constraints describing the basic sets or relations in the input. -In case of C, only the original -constraints are used, without any translation. +The following convenience functions first create a base expression and +then create a piecewise expression over a given domain. -=begin latex + #include + __isl_give isl_pw_aff *isl_pw_aff_val_on_domain( + __isl_take isl_set *domain, + __isl_take isl_val *v); + __isl_give isl_pw_multi_aff * + isl_pw_multi_aff_multi_val_on_domain( + __isl_take isl_set *domain, + __isl_take isl_multi_val *mv); -(See \autoref{s:simple hull}.) +As a convenience, a piecewise multiple expression can +also be created from a piecewise expression. +Each multiple expression in the result is derived +from the corresponding base expression. -=end latex + #include + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_pw_aff( + __isl_take isl_pw_aff *pa); -=item * Affine hull +Similarly, a piecewise quasipolynomial can be +created from a piecewise quasi-affine expression using +the following function. - __isl_give isl_basic_set *isl_basic_set_affine_hull( - __isl_take isl_basic_set *bset); - __isl_give isl_basic_set *isl_set_affine_hull( - __isl_take isl_set *set); - __isl_give isl_union_set *isl_union_set_affine_hull( - __isl_take isl_union_set *uset); - __isl_give isl_basic_map *isl_basic_map_affine_hull( - __isl_take isl_basic_map *bmap); - __isl_give isl_basic_map *isl_map_affine_hull( - __isl_take isl_map *map); - __isl_give isl_union_map *isl_union_map_affine_hull( - __isl_take isl_union_map *umap); + #include + __isl_give isl_pw_qpolynomial * + isl_pw_qpolynomial_from_pw_aff( + __isl_take isl_pw_aff *pwaff); -In case of union sets and relations, the affine hull is computed -per space. +Piecewise expressions can be copied and freed using the following functions. -=item * Polyhedral hull + #include + __isl_give isl_pw_aff *isl_pw_aff_copy( + __isl_keep isl_pw_aff *pwaff); + __isl_null isl_pw_aff *isl_pw_aff_free( + __isl_take isl_pw_aff *pwaff); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_copy( + __isl_keep isl_pw_multi_aff *pma); + __isl_null isl_pw_multi_aff *isl_pw_multi_aff_free( + __isl_take isl_pw_multi_aff *pma); - __isl_give isl_basic_set *isl_set_polyhedral_hull( - __isl_take isl_set *set); - __isl_give isl_basic_map *isl_map_polyhedral_hull( - __isl_take isl_map *map); - __isl_give isl_union_set *isl_union_set_polyhedral_hull( - __isl_take isl_union_set *uset); - __isl_give isl_union_map *isl_union_map_polyhedral_hull( - __isl_take isl_union_map *umap); + #include + __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_copy( + __isl_keep isl_pw_qpolynomial *pwqp); + __isl_null isl_pw_qpolynomial *isl_pw_qpolynomial_free( + __isl_take isl_pw_qpolynomial *pwqp); + __isl_give isl_pw_qpolynomial_fold * + isl_pw_qpolynomial_fold_copy( + __isl_keep isl_pw_qpolynomial_fold *pwf); + __isl_null isl_pw_qpolynomial_fold * + isl_pw_qpolynomial_fold_free( + __isl_take isl_pw_qpolynomial_fold *pwf); -These functions compute a single basic set or relation -not involving any existentially quantified variables -that contains the whole input set or relation. -In case of union sets and relations, the polyhedral hull is computed -per space. +To iterate over the different cells of a piecewise expression, +use the following functions. -=item * Other approximations + #include + isl_bool isl_pw_aff_is_empty(__isl_keep isl_pw_aff *pwaff); + int isl_pw_aff_n_piece(__isl_keep isl_pw_aff *pwaff); + isl_stat isl_pw_aff_foreach_piece( + __isl_keep isl_pw_aff *pwaff, + isl_stat (*fn)(__isl_take isl_set *set, + __isl_take isl_aff *aff, + void *user), void *user); + isl_stat isl_pw_multi_aff_foreach_piece( + __isl_keep isl_pw_multi_aff *pma, + isl_stat (*fn)(__isl_take isl_set *set, + __isl_take isl_multi_aff *maff, + void *user), void *user); - __isl_give isl_basic_set * - isl_basic_set_drop_constraints_involving_dims( - __isl_take isl_basic_set *bset, - enum isl_dim_type type, - unsigned first, unsigned n); - __isl_give isl_basic_map * - isl_basic_map_drop_constraints_involving_dims( - __isl_take isl_basic_map *bmap, - enum isl_dim_type type, - unsigned first, unsigned n); - __isl_give isl_basic_set * - isl_basic_set_drop_constraints_not_involving_dims( - __isl_take isl_basic_set *bset, - enum isl_dim_type type, - unsigned first, unsigned n); - __isl_give isl_set * - isl_set_drop_constraints_involving_dims( - __isl_take isl_set *set, - enum isl_dim_type type, - unsigned first, unsigned n); - __isl_give isl_map * - isl_map_drop_constraints_involving_dims( - __isl_take isl_map *map, - enum isl_dim_type type, - unsigned first, unsigned n); + #include + isl_stat isl_pw_qpolynomial_foreach_piece( + __isl_keep isl_pw_qpolynomial *pwqp, + isl_stat (*fn)(__isl_take isl_set *set, + __isl_take isl_qpolynomial *qp, + void *user), void *user); + isl_stat isl_pw_qpolynomial_foreach_lifted_piece( + __isl_keep isl_pw_qpolynomial *pwqp, + isl_stat (*fn)(__isl_take isl_set *set, + __isl_take isl_qpolynomial *qp, + void *user), void *user); + isl_stat isl_pw_qpolynomial_fold_foreach_piece( + __isl_keep isl_pw_qpolynomial_fold *pwf, + isl_stat (*fn)(__isl_take isl_set *set, + __isl_take isl_qpolynomial_fold *fold, + void *user), void *user); + isl_stat isl_pw_qpolynomial_fold_foreach_lifted_piece( + __isl_keep isl_pw_qpolynomial_fold *pwf, + isl_stat (*fn)(__isl_take isl_set *set, + __isl_take isl_qpolynomial_fold *fold, + void *user), void *user); -These functions drop any constraints (not) involving the specified dimensions. -Note that the result depends on the representation of the input. +As usual, the function C should return C<0> on success +and C<-1> on failure. The difference between +C and +C is that +C will first +compute unique representations for all existentially quantified +variables and then turn these existentially quantified variables +into extra set variables, adapting the associated quasipolynomial +accordingly. This means that the C passed to C +will not have any existentially quantified variables, but that +the dimensions of the sets may be different for different +invocations of C. +Similarly for C +and C. -=item * Feasibility +A piecewise expression consisting of the expressions at a given +position of a piecewise multiple expression can be extracted +using the following function. - __isl_give isl_basic_set *isl_basic_set_sample( - __isl_take isl_basic_set *bset); - __isl_give isl_basic_set *isl_set_sample( - __isl_take isl_set *set); - __isl_give isl_basic_map *isl_basic_map_sample( - __isl_take isl_basic_map *bmap); - __isl_give isl_basic_map *isl_map_sample( - __isl_take isl_map *map); + #include + __isl_give isl_pw_aff *isl_pw_multi_aff_get_pw_aff( + __isl_keep isl_pw_multi_aff *pma, int pos); -If the input (basic) set or relation is non-empty, then return -a singleton subset of the input. Otherwise, return an empty set. +These expressions can be replaced using the following function. -=item * Optimization + #include + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_set_pw_aff( + __isl_take isl_pw_multi_aff *pma, unsigned pos, + __isl_take isl_pw_aff *pa); - #include - enum isl_lp_result isl_basic_set_max( - __isl_keep isl_basic_set *bset, - __isl_keep isl_aff *obj, isl_int *opt) - __isl_give isl_val *isl_basic_set_max_val( - __isl_keep isl_basic_set *bset, - __isl_keep isl_aff *obj); - enum isl_lp_result isl_set_min(__isl_keep isl_set *set, - __isl_keep isl_aff *obj, isl_int *opt); - __isl_give isl_val *isl_set_min_val( - __isl_keep isl_set *set, - __isl_keep isl_aff *obj); - enum isl_lp_result isl_set_max(__isl_keep isl_set *set, - __isl_keep isl_aff *obj, isl_int *opt); - __isl_give isl_val *isl_set_max_val( - __isl_keep isl_set *set, - __isl_keep isl_aff *obj); - -Compute the minimum or maximum of the integer affine expression C -over the points in C, returning the result in C. -The return value may be one of C, -C, C or C, in case of -an C. If the result is an C then -the result is C in case of an error, the optimal value in case -there is one, negative infinity or infinity if the problem is unbounded and -NaN if the problem is empty. +Note that there is a difference between C and +C objects. The first is a sequence of piecewise +affine expressions, while the second is a piecewise sequence +of affine expressions. In particular, each of the piecewise +affine expressions in an C may have a different +domain, while all multiple expressions associated to a cell +in an C have the same domain. +It is possible to convert between the two, but when converting +an C to an C, the domain +of the result is the intersection of the domains of the input. +The reverse conversion is exact. -=item * Parametric optimization + #include + __isl_give isl_pw_multi_aff * + isl_pw_multi_aff_from_multi_pw_aff( + __isl_take isl_multi_pw_aff *mpa); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_from_pw_multi_aff( + __isl_take isl_pw_multi_aff *pma); - __isl_give isl_pw_aff *isl_set_dim_min( - __isl_take isl_set *set, int pos); - __isl_give isl_pw_aff *isl_set_dim_max( - __isl_take isl_set *set, int pos); - __isl_give isl_pw_aff *isl_map_dim_max( - __isl_take isl_map *map, int pos); +=head3 Union Expressions -Compute the minimum or maximum of the given set or output dimension -as a function of the parameters (and input dimensions), but independently -of the other set or output dimensions. -For lexicographic optimization, see L<"Lexicographic Optimization">. +A union expression collects base expressions defined +over different domains. The space of a union expression +is that of the shared parameter space. -=item * Dual +The union expression types defined by C +are C, C, +C and C. -The following functions compute either the set of (rational) coefficient -values of valid constraints for the given set or the set of (rational) -values satisfying the constraints with coefficients from the given set. -Internally, these two sets of functions perform essentially the -same operations, except that the set of coefficients is assumed to -be a cone, while the set of values may be any polyhedron. -The current implementation is based on the Farkas lemma and -Fourier-Motzkin elimination, but this may change or be made optional -in future. In particular, future implementations may use different -dualization algorithms or skip the elimination step. +An empty union expression can be created using the following functions. - __isl_give isl_basic_set *isl_basic_set_coefficients( - __isl_take isl_basic_set *bset); - __isl_give isl_basic_set *isl_set_coefficients( - __isl_take isl_set *set); - __isl_give isl_union_set *isl_union_set_coefficients( - __isl_take isl_union_set *bset); - __isl_give isl_basic_set *isl_basic_set_solutions( - __isl_take isl_basic_set *bset); - __isl_give isl_basic_set *isl_set_solutions( - __isl_take isl_set *set); - __isl_give isl_union_set *isl_union_set_solutions( - __isl_take isl_union_set *bset); + #include + __isl_give isl_union_pw_aff *isl_union_pw_aff_empty( + __isl_take isl_space *space); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_empty( + __isl_take isl_space *space); -=item * Power + #include + __isl_give isl_union_pw_qpolynomial * + isl_union_pw_qpolynomial_zero( + __isl_take isl_space *space); - __isl_give isl_map *isl_map_fixed_power( - __isl_take isl_map *map, isl_int exp); - __isl_give isl_map *isl_map_fixed_power_val( - __isl_take isl_map *map, - __isl_take isl_val *exp); - __isl_give isl_union_map *isl_union_map_fixed_power( - __isl_take isl_union_map *umap, isl_int exp); - __isl_give isl_union_map * - isl_union_map_fixed_power_val( - __isl_take isl_union_map *umap, - __isl_take isl_val *exp); +A union expression containing a single base expression +can be created using the following functions. -Compute the given power of C, where C is assumed to be non-zero. -If the exponent C is negative, then the -C th power of the inverse -of C is computed. + #include + __isl_give isl_union_pw_aff * + isl_union_pw_aff_from_pw_aff( + __isl_take isl_pw_aff *pa); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_from_aff( + __isl_take isl_aff *aff); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_from_pw_multi_aff( + __isl_take isl_pw_multi_aff *pma); - __isl_give isl_map *isl_map_power(__isl_take isl_map *map, - int *exact); - __isl_give isl_union_map *isl_union_map_power( - __isl_take isl_union_map *umap, int *exact); + #include + __isl_give isl_union_pw_qpolynomial * + isl_union_pw_qpolynomial_from_pw_qpolynomial( + __isl_take isl_pw_qpolynomial *pwqp); -Compute a parametric representation for all positive powers I of C. -The result maps I to a nested relation corresponding to the -Ith power of C. -The result may be an overapproximation. If the result is known to be exact, -then C<*exact> is set to C<1>. +The following functions create a base expression on each +of the sets in the union set and collect the results. -=item * Transitive closure + #include + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_from_union_pw_aff( + __isl_take isl_union_pw_aff *upa); + __isl_give isl_union_pw_aff * + isl_union_pw_multi_aff_get_union_pw_aff( + __isl_keep isl_union_pw_multi_aff *upma, int pos); + __isl_give isl_union_pw_aff * + isl_union_pw_aff_val_on_domain( + __isl_take isl_union_set *domain, + __isl_take isl_val *v); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_multi_val_on_domain( + __isl_take isl_union_set *domain, + __isl_take isl_multi_val *mv); - __isl_give isl_map *isl_map_transitive_closure( - __isl_take isl_map *map, int *exact); - __isl_give isl_union_map *isl_union_map_transitive_closure( - __isl_take isl_union_map *umap, int *exact); +An C that is equal to a (parametric) affine +expression on a given domain can be created using the following +function. -Compute the transitive closure of C. -The result may be an overapproximation. If the result is known to be exact, -then C<*exact> is set to C<1>. + #include + __isl_give isl_union_pw_aff * + isl_union_pw_aff_aff_on_domain( + __isl_take isl_union_set *domain, + __isl_take isl_aff *aff); -=item * Reaching path lengths +A base expression can be added to a union expression using +the following functions. - __isl_give isl_map *isl_map_reaching_path_lengths( - __isl_take isl_map *map, int *exact); + #include + __isl_give isl_union_pw_aff * + isl_union_pw_aff_add_pw_aff( + __isl_take isl_union_pw_aff *upa, + __isl_take isl_pw_aff *pa); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_add_pw_multi_aff( + __isl_take isl_union_pw_multi_aff *upma, + __isl_take isl_pw_multi_aff *pma); -Compute a relation that maps each element in the range of C -to the lengths of all paths composed of edges in C that -end up in the given element. -The result may be an overapproximation. If the result is known to be exact, -then C<*exact> is set to C<1>. -To compute the I path length, the resulting relation -should be postprocessed by C. -In particular, if the input relation is a dependence relation -(mapping sources to sinks), then the maximal path length corresponds -to the free schedule. -Note, however, that C expects the maximum to be -finite, so if the path lengths are unbounded (possibly due to -the overapproximation), then you will get an error message. + #include + __isl_give isl_union_pw_qpolynomial * + isl_union_pw_qpolynomial_add_pw_qpolynomial( + __isl_take isl_union_pw_qpolynomial *upwqp, + __isl_take isl_pw_qpolynomial *pwqp); -=item * Wrapping +Union expressions can be copied and freed using +the following functions. - __isl_give isl_basic_set *isl_basic_map_wrap( - __isl_take isl_basic_map *bmap); - __isl_give isl_set *isl_map_wrap( - __isl_take isl_map *map); - __isl_give isl_union_set *isl_union_map_wrap( - __isl_take isl_union_map *umap); - __isl_give isl_basic_map *isl_basic_set_unwrap( - __isl_take isl_basic_set *bset); - __isl_give isl_map *isl_set_unwrap( - __isl_take isl_set *set); - __isl_give isl_union_map *isl_union_set_unwrap( - __isl_take isl_union_set *uset); + #include + __isl_give isl_union_pw_aff *isl_union_pw_aff_copy( + __isl_keep isl_union_pw_aff *upa); + __isl_null isl_union_pw_aff *isl_union_pw_aff_free( + __isl_take isl_union_pw_aff *upa); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_copy( + __isl_keep isl_union_pw_multi_aff *upma); + __isl_null isl_union_pw_multi_aff * + isl_union_pw_multi_aff_free( + __isl_take isl_union_pw_multi_aff *upma); -=item * Flattening + #include + __isl_give isl_union_pw_qpolynomial * + isl_union_pw_qpolynomial_copy( + __isl_keep isl_union_pw_qpolynomial *upwqp); + __isl_null isl_union_pw_qpolynomial * + isl_union_pw_qpolynomial_free( + __isl_take isl_union_pw_qpolynomial *upwqp); + __isl_give isl_union_pw_qpolynomial_fold * + isl_union_pw_qpolynomial_fold_copy( + __isl_keep isl_union_pw_qpolynomial_fold *upwf); + __isl_null isl_union_pw_qpolynomial_fold * + isl_union_pw_qpolynomial_fold_free( + __isl_take isl_union_pw_qpolynomial_fold *upwf); -Remove any internal structure of domain (and range) of the given -set or relation. If there is any such internal structure in the input, -then the name of the space is also removed. +To iterate over the base expressions in a union expression, +use the following functions. - __isl_give isl_basic_set *isl_basic_set_flatten( - __isl_take isl_basic_set *bset); - __isl_give isl_set *isl_set_flatten( - __isl_take isl_set *set); - __isl_give isl_basic_map *isl_basic_map_flatten_domain( - __isl_take isl_basic_map *bmap); - __isl_give isl_basic_map *isl_basic_map_flatten_range( - __isl_take isl_basic_map *bmap); - __isl_give isl_map *isl_map_flatten_range( - __isl_take isl_map *map); - __isl_give isl_map *isl_map_flatten_domain( - __isl_take isl_map *map); - __isl_give isl_basic_map *isl_basic_map_flatten( - __isl_take isl_basic_map *bmap); - __isl_give isl_map *isl_map_flatten( - __isl_take isl_map *map); + #include + int isl_union_pw_aff_n_pw_aff( + __isl_keep isl_union_pw_aff *upa); + isl_stat isl_union_pw_aff_foreach_pw_aff( + __isl_keep isl_union_pw_aff *upa, + isl_stat (*fn)(__isl_take isl_pw_aff *ma, + void *user), void *user); + int isl_union_pw_multi_aff_n_pw_multi_aff( + __isl_keep isl_union_pw_multi_aff *upma); + isl_stat isl_union_pw_multi_aff_foreach_pw_multi_aff( + __isl_keep isl_union_pw_multi_aff *upma, + isl_stat (*fn)(__isl_take isl_pw_multi_aff *pma, + void *user), void *user); - __isl_give isl_map *isl_set_flatten_map( - __isl_take isl_set *set); + #include + int isl_union_pw_qpolynomial_n_pw_qpolynomial( + __isl_keep isl_union_pw_qpolynomial *upwqp); + isl_stat isl_union_pw_qpolynomial_foreach_pw_qpolynomial( + __isl_keep isl_union_pw_qpolynomial *upwqp, + isl_stat (*fn)(__isl_take isl_pw_qpolynomial *pwqp, + void *user), void *user); + int isl_union_pw_qpolynomial_fold_n_pw_qpolynomial_fold( + __isl_keep isl_union_pw_qpolynomial_fold *upwf); + isl_stat isl_union_pw_qpolynomial_fold_foreach_pw_qpolynomial_fold( + __isl_keep isl_union_pw_qpolynomial_fold *upwf, + isl_stat (*fn)(__isl_take isl_pw_qpolynomial_fold *pwf, + void *user), void *user); -The function above constructs a relation -that maps the input set to a flattened version of the set. +To extract the base expression in a given space from a union, use +the following functions. -=item * Lifting + #include + __isl_give isl_pw_aff *isl_union_pw_aff_extract_pw_aff( + __isl_keep isl_union_pw_aff *upa, + __isl_take isl_space *space); + __isl_give isl_pw_multi_aff * + isl_union_pw_multi_aff_extract_pw_multi_aff( + __isl_keep isl_union_pw_multi_aff *upma, + __isl_take isl_space *space); -Lift the input set to a space with extra dimensions corresponding -to the existentially quantified variables in the input. -In particular, the result lives in a wrapped map where the domain -is the original space and the range corresponds to the original -existentially quantified variables. + #include + __isl_give isl_pw_qpolynomial * + isl_union_pw_qpolynomial_extract_pw_qpolynomial( + __isl_keep isl_union_pw_qpolynomial *upwqp, + __isl_take isl_space *space); - __isl_give isl_basic_set *isl_basic_set_lift( - __isl_take isl_basic_set *bset); - __isl_give isl_set *isl_set_lift( - __isl_take isl_set *set); - __isl_give isl_union_set *isl_union_set_lift( - __isl_take isl_union_set *uset); +=head2 Input and Output -Given a local space that contains the existentially quantified -variables of a set, a basic relation that, when applied to -a basic set, has essentially the same effect as C, -can be constructed using the following function. +For set and relation, +C supports its own input/output format, which is similar +to the C format, but also supports the C format +in some cases. +For other object types, typically only an C format is supported. - #include - __isl_give isl_basic_map *isl_local_space_lifting( - __isl_take isl_local_space *ls); +=head3 C format -=item * Internal Product +The C format is similar to that of C, but has a different +syntax for describing the parameters and allows for the definition +of an existentially quantified variable as the integer division +of an affine expression. +For example, the set of integers C between C<0> and C +such that C can be described as - __isl_give isl_basic_map *isl_basic_map_zip( - __isl_take isl_basic_map *bmap); - __isl_give isl_map *isl_map_zip( - __isl_take isl_map *map); - __isl_give isl_union_map *isl_union_map_zip( - __isl_take isl_union_map *umap); + [n] -> { [i] : exists (a = [i/10] : 0 <= i and i <= n and + i - 10 a <= 6) } -Given a relation with nested relations for domain and range, -interchange the range of the domain with the domain of the range. +A set or relation can have several disjuncts, separated +by the keyword C. Each disjunct is either a conjunction +of constraints or a projection (C) of a conjunction +of constraints. The constraints are separated by the keyword +C. -=item * Currying +=head3 C format - __isl_give isl_basic_map *isl_basic_map_curry( - __isl_take isl_basic_map *bmap); - __isl_give isl_basic_map *isl_basic_map_uncurry( - __isl_take isl_basic_map *bmap); - __isl_give isl_map *isl_map_curry( - __isl_take isl_map *map); - __isl_give isl_map *isl_map_uncurry( - __isl_take isl_map *map); - __isl_give isl_union_map *isl_union_map_curry( - __isl_take isl_union_map *umap); - __isl_give isl_union_map *isl_union_map_uncurry( - __isl_take isl_union_map *umap); +If the represented set is a union, then the first line +contains a single number representing the number of disjuncts. +Otherwise, a line containing the number C<1> is optional. -Given a relation with a nested relation for domain, -the C functions -move the range of the nested relation out of the domain -and use it as the domain of a nested relation in the range, -with the original range as range of this nested relation. -The C functions perform the inverse operation. +Each disjunct is represented by a matrix of constraints. +The first line contains two numbers representing +the number of rows and columns, +where the number of rows is equal to the number of constraints +and the number of columns is equal to two plus the number of variables. +The following lines contain the actual rows of the constraint matrix. +In each row, the first column indicates whether the constraint +is an equality (C<0>) or inequality (C<1>). The final column +corresponds to the constant term. -=item * Aligning parameters +If the set is parametric, then the coefficients of the parameters +appear in the last columns before the constant column. +The coefficients of any existentially quantified variables appear +between those of the set variables and those of the parameters. - __isl_give isl_basic_set *isl_basic_set_align_params( - __isl_take isl_basic_set *bset, - __isl_take isl_space *model); - __isl_give isl_set *isl_set_align_params( - __isl_take isl_set *set, - __isl_take isl_space *model); - __isl_give isl_basic_map *isl_basic_map_align_params( - __isl_take isl_basic_map *bmap, - __isl_take isl_space *model); - __isl_give isl_map *isl_map_align_params( - __isl_take isl_map *map, - __isl_take isl_space *model); +=head3 Extended C format -Change the order of the parameters of the given set or relation -such that the first parameters match those of C. -This may involve the introduction of extra parameters. -All parameters need to be named. +The extended C format is nearly identical to the +C format. The only difference is that the line +containing the number of rows and columns of a constraint matrix +also contains four additional numbers: +the number of output dimensions, the number of input dimensions, +the number of local dimensions (i.e., the number of existentially +quantified variables) and the number of parameters. +For sets, the number of ``output'' dimensions is equal +to the number of set dimensions, while the number of ``input'' +dimensions is zero. -=item * Dimension manipulation +=head3 Input - __isl_give isl_basic_set *isl_basic_set_add_dims( - __isl_take isl_basic_set *bset, - enum isl_dim_type type, unsigned n); - __isl_give isl_set *isl_set_add_dims( - __isl_take isl_set *set, - enum isl_dim_type type, unsigned n); - __isl_give isl_map *isl_map_add_dims( - __isl_take isl_map *map, - enum isl_dim_type type, unsigned n); - __isl_give isl_basic_set *isl_basic_set_insert_dims( - __isl_take isl_basic_set *bset, - enum isl_dim_type type, unsigned pos, - unsigned n); - __isl_give isl_basic_map *isl_basic_map_insert_dims( - __isl_take isl_basic_map *bmap, - enum isl_dim_type type, unsigned pos, - unsigned n); - __isl_give isl_set *isl_set_insert_dims( - __isl_take isl_set *set, - enum isl_dim_type type, unsigned pos, unsigned n); - __isl_give isl_map *isl_map_insert_dims( - __isl_take isl_map *map, - enum isl_dim_type type, unsigned pos, unsigned n); - __isl_give isl_basic_set *isl_basic_set_move_dims( - __isl_take isl_basic_set *bset, - enum isl_dim_type dst_type, unsigned dst_pos, - enum isl_dim_type src_type, unsigned src_pos, - unsigned n); - __isl_give isl_basic_map *isl_basic_map_move_dims( - __isl_take isl_basic_map *bmap, - enum isl_dim_type dst_type, unsigned dst_pos, - enum isl_dim_type src_type, unsigned src_pos, - unsigned n); - __isl_give isl_set *isl_set_move_dims( - __isl_take isl_set *set, - enum isl_dim_type dst_type, unsigned dst_pos, - enum isl_dim_type src_type, unsigned src_pos, - unsigned n); - __isl_give isl_map *isl_map_move_dims( - __isl_take isl_map *map, - enum isl_dim_type dst_type, unsigned dst_pos, - enum isl_dim_type src_type, unsigned src_pos, - unsigned n); +Objects can be read from input using the following functions. -It is usually not advisable to directly change the (input or output) -space of a set or a relation as this removes the name and the internal -structure of the space. However, the above functions can be useful -to add new parameters, assuming -C and C -are not sufficient. + #include + __isl_give isl_val *isl_val_read_from_str(isl_ctx *ctx, + const char *str); + __isl_give isl_multi_val *isl_multi_val_read_from_str( + isl_ctx *ctx, const char *str); -=back + #include + __isl_give isl_basic_set *isl_basic_set_read_from_file( + isl_ctx *ctx, FILE *input); + __isl_give isl_basic_set *isl_basic_set_read_from_str( + isl_ctx *ctx, const char *str); + __isl_give isl_set *isl_set_read_from_file(isl_ctx *ctx, + FILE *input); + __isl_give isl_set *isl_set_read_from_str(isl_ctx *ctx, + const char *str); -=head2 Binary Operations + #include + __isl_give isl_basic_map *isl_basic_map_read_from_file( + isl_ctx *ctx, FILE *input); + __isl_give isl_basic_map *isl_basic_map_read_from_str( + isl_ctx *ctx, const char *str); + __isl_give isl_map *isl_map_read_from_file( + isl_ctx *ctx, FILE *input); + __isl_give isl_map *isl_map_read_from_str(isl_ctx *ctx, + const char *str); -The two arguments of a binary operation not only need to live -in the same C, they currently also need to have -the same (number of) parameters. + #include + __isl_give isl_union_set *isl_union_set_read_from_file( + isl_ctx *ctx, FILE *input); + __isl_give isl_union_set *isl_union_set_read_from_str( + isl_ctx *ctx, const char *str); -=head3 Basic Operations + #include + __isl_give isl_union_map *isl_union_map_read_from_file( + isl_ctx *ctx, FILE *input); + __isl_give isl_union_map *isl_union_map_read_from_str( + isl_ctx *ctx, const char *str); -=over + #include + __isl_give isl_aff *isl_aff_read_from_str( + isl_ctx *ctx, const char *str); + __isl_give isl_multi_aff *isl_multi_aff_read_from_str( + isl_ctx *ctx, const char *str); + __isl_give isl_pw_aff *isl_pw_aff_read_from_str( + isl_ctx *ctx, const char *str); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_read_from_str( + isl_ctx *ctx, const char *str); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_read_from_str( + isl_ctx *ctx, const char *str); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_read_from_str( + isl_ctx *ctx, const char *str); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_read_from_str( + isl_ctx *ctx, const char *str); -=item * Intersection + #include + __isl_give isl_union_pw_qpolynomial * + isl_union_pw_qpolynomial_read_from_str( + isl_ctx *ctx, const char *str); - __isl_give isl_basic_set *isl_basic_set_intersect_params( - __isl_take isl_basic_set *bset1, - __isl_take isl_basic_set *bset2); - __isl_give isl_basic_set *isl_basic_set_intersect( - __isl_take isl_basic_set *bset1, - __isl_take isl_basic_set *bset2); - __isl_give isl_set *isl_set_intersect_params( - __isl_take isl_set *set, - __isl_take isl_set *params); - __isl_give isl_set *isl_set_intersect( - __isl_take isl_set *set1, - __isl_take isl_set *set2); - __isl_give isl_union_set *isl_union_set_intersect_params( - __isl_take isl_union_set *uset, - __isl_take isl_set *set); - __isl_give isl_union_map *isl_union_map_intersect_params( - __isl_take isl_union_map *umap, - __isl_take isl_set *set); - __isl_give isl_union_set *isl_union_set_intersect( - __isl_take isl_union_set *uset1, - __isl_take isl_union_set *uset2); - __isl_give isl_basic_map *isl_basic_map_intersect_domain( - __isl_take isl_basic_map *bmap, - __isl_take isl_basic_set *bset); - __isl_give isl_basic_map *isl_basic_map_intersect_range( - __isl_take isl_basic_map *bmap, - __isl_take isl_basic_set *bset); - __isl_give isl_basic_map *isl_basic_map_intersect( - __isl_take isl_basic_map *bmap1, - __isl_take isl_basic_map *bmap2); - __isl_give isl_map *isl_map_intersect_params( - __isl_take isl_map *map, - __isl_take isl_set *params); - __isl_give isl_map *isl_map_intersect_domain( - __isl_take isl_map *map, - __isl_take isl_set *set); - __isl_give isl_map *isl_map_intersect_range( - __isl_take isl_map *map, - __isl_take isl_set *set); - __isl_give isl_map *isl_map_intersect( - __isl_take isl_map *map1, - __isl_take isl_map *map2); - __isl_give isl_union_map *isl_union_map_intersect_domain( - __isl_take isl_union_map *umap, - __isl_take isl_union_set *uset); - __isl_give isl_union_map *isl_union_map_intersect_range( - __isl_take isl_union_map *umap, - __isl_take isl_union_set *uset); - __isl_give isl_union_map *isl_union_map_intersect( - __isl_take isl_union_map *umap1, - __isl_take isl_union_map *umap2); +For sets and relations, +the input format is autodetected and may be either the C format +or the C format. -The second argument to the C<_params> functions needs to be -a parametric (basic) set. For the other functions, a parametric set -for either argument is only allowed if the other argument is -a parametric set as well. +=head3 Output -=item * Union +Before anything can be printed, an C needs to +be created. - __isl_give isl_set *isl_basic_set_union( - __isl_take isl_basic_set *bset1, - __isl_take isl_basic_set *bset2); - __isl_give isl_map *isl_basic_map_union( - __isl_take isl_basic_map *bmap1, - __isl_take isl_basic_map *bmap2); - __isl_give isl_set *isl_set_union( - __isl_take isl_set *set1, - __isl_take isl_set *set2); - __isl_give isl_map *isl_map_union( - __isl_take isl_map *map1, - __isl_take isl_map *map2); - __isl_give isl_union_set *isl_union_set_union( - __isl_take isl_union_set *uset1, - __isl_take isl_union_set *uset2); - __isl_give isl_union_map *isl_union_map_union( - __isl_take isl_union_map *umap1, - __isl_take isl_union_map *umap2); + __isl_give isl_printer *isl_printer_to_file(isl_ctx *ctx, + FILE *file); + __isl_give isl_printer *isl_printer_to_str(isl_ctx *ctx); + __isl_null isl_printer *isl_printer_free( + __isl_take isl_printer *printer); + __isl_give char *isl_printer_get_str( + __isl_keep isl_printer *printer); -=item * Set difference +The printer can be inspected using the following functions. - __isl_give isl_set *isl_set_subtract( - __isl_take isl_set *set1, - __isl_take isl_set *set2); - __isl_give isl_map *isl_map_subtract( - __isl_take isl_map *map1, - __isl_take isl_map *map2); - __isl_give isl_map *isl_map_subtract_domain( - __isl_take isl_map *map, - __isl_take isl_set *dom); - __isl_give isl_map *isl_map_subtract_range( - __isl_take isl_map *map, - __isl_take isl_set *dom); - __isl_give isl_union_set *isl_union_set_subtract( - __isl_take isl_union_set *uset1, - __isl_take isl_union_set *uset2); - __isl_give isl_union_map *isl_union_map_subtract( - __isl_take isl_union_map *umap1, - __isl_take isl_union_map *umap2); - __isl_give isl_union_map *isl_union_map_subtract_domain( - __isl_take isl_union_map *umap, - __isl_take isl_union_set *dom); - __isl_give isl_union_map *isl_union_map_subtract_range( - __isl_take isl_union_map *umap, - __isl_take isl_union_set *dom); - -=item * Application + FILE *isl_printer_get_file( + __isl_keep isl_printer *printer); + int isl_printer_get_output_format( + __isl_keep isl_printer *p); + int isl_printer_get_yaml_style(__isl_keep isl_printer *p); - __isl_give isl_basic_set *isl_basic_set_apply( - __isl_take isl_basic_set *bset, - __isl_take isl_basic_map *bmap); - __isl_give isl_set *isl_set_apply( - __isl_take isl_set *set, - __isl_take isl_map *map); - __isl_give isl_union_set *isl_union_set_apply( - __isl_take isl_union_set *uset, - __isl_take isl_union_map *umap); - __isl_give isl_basic_map *isl_basic_map_apply_domain( - __isl_take isl_basic_map *bmap1, - __isl_take isl_basic_map *bmap2); - __isl_give isl_basic_map *isl_basic_map_apply_range( - __isl_take isl_basic_map *bmap1, - __isl_take isl_basic_map *bmap2); - __isl_give isl_map *isl_map_apply_domain( - __isl_take isl_map *map1, - __isl_take isl_map *map2); - __isl_give isl_union_map *isl_union_map_apply_domain( - __isl_take isl_union_map *umap1, - __isl_take isl_union_map *umap2); - __isl_give isl_map *isl_map_apply_range( - __isl_take isl_map *map1, - __isl_take isl_map *map2); - __isl_give isl_union_map *isl_union_map_apply_range( - __isl_take isl_union_map *umap1, - __isl_take isl_union_map *umap2); +The behavior of the printer can be modified in various ways -=item * Preimage + __isl_give isl_printer *isl_printer_set_output_format( + __isl_take isl_printer *p, int output_format); + __isl_give isl_printer *isl_printer_set_indent( + __isl_take isl_printer *p, int indent); + __isl_give isl_printer *isl_printer_set_indent_prefix( + __isl_take isl_printer *p, const char *prefix); + __isl_give isl_printer *isl_printer_indent( + __isl_take isl_printer *p, int indent); + __isl_give isl_printer *isl_printer_set_prefix( + __isl_take isl_printer *p, const char *prefix); + __isl_give isl_printer *isl_printer_set_suffix( + __isl_take isl_printer *p, const char *suffix); + __isl_give isl_printer *isl_printer_set_yaml_style( + __isl_take isl_printer *p, int yaml_style); - __isl_give isl_basic_set * - isl_basic_set_preimage_multi_aff( - __isl_take isl_basic_set *bset, - __isl_take isl_multi_aff *ma); - __isl_give isl_set *isl_set_preimage_multi_aff( - __isl_take isl_set *set, - __isl_take isl_multi_aff *ma); - __isl_give isl_set *isl_set_preimage_pw_multi_aff( - __isl_take isl_set *set, - __isl_take isl_pw_multi_aff *pma); - __isl_give isl_map *isl_map_preimage_domain_multi_aff( - __isl_take isl_map *map, - __isl_take isl_multi_aff *ma); - __isl_give isl_union_map * - isl_union_map_preimage_domain_multi_aff( - __isl_take isl_union_map *umap, - __isl_take isl_multi_aff *ma); +The C may be either C, C, +C, C or C +and defaults to C. +Each line in the output is prefixed by C, +indented by C (set by C) spaces +(default: 0), prefixed by C and suffixed by C. +In the C format output, +the coefficients of the existentially quantified variables +appear between those of the set variables and those +of the parameters. +The function C increases the indentation +by the specified amount (which may be negative). +The YAML style may be either C or +C and when we are printing something +in YAML format. -These functions compute the preimage of the given set or map domain under -the given function. In other words, the expression is plugged -into the set description or into the domain of the map. -Objects of types C and C are described in -L. +To actually print something, use -=item * Cartesian Product + #include + __isl_give isl_printer *isl_printer_print_double( + __isl_take isl_printer *p, double d); - __isl_give isl_set *isl_set_product( - __isl_take isl_set *set1, - __isl_take isl_set *set2); - __isl_give isl_union_set *isl_union_set_product( - __isl_take isl_union_set *uset1, - __isl_take isl_union_set *uset2); - __isl_give isl_basic_map *isl_basic_map_domain_product( - __isl_take isl_basic_map *bmap1, - __isl_take isl_basic_map *bmap2); - __isl_give isl_basic_map *isl_basic_map_range_product( - __isl_take isl_basic_map *bmap1, - __isl_take isl_basic_map *bmap2); - __isl_give isl_basic_map *isl_basic_map_product( - __isl_take isl_basic_map *bmap1, - __isl_take isl_basic_map *bmap2); - __isl_give isl_map *isl_map_domain_product( - __isl_take isl_map *map1, - __isl_take isl_map *map2); - __isl_give isl_map *isl_map_range_product( - __isl_take isl_map *map1, - __isl_take isl_map *map2); - __isl_give isl_union_map *isl_union_map_domain_product( - __isl_take isl_union_map *umap1, - __isl_take isl_union_map *umap2); - __isl_give isl_union_map *isl_union_map_range_product( - __isl_take isl_union_map *umap1, - __isl_take isl_union_map *umap2); - __isl_give isl_map *isl_map_product( - __isl_take isl_map *map1, - __isl_take isl_map *map2); - __isl_give isl_union_map *isl_union_map_product( - __isl_take isl_union_map *umap1, - __isl_take isl_union_map *umap2); + #include + __isl_give isl_printer *isl_printer_print_val( + __isl_take isl_printer *p, __isl_keep isl_val *v); -The above functions compute the cross product of the given -sets or relations. The domains and ranges of the results -are wrapped maps between domains and ranges of the inputs. -To obtain a ``flat'' product, use the following functions -instead. + #include + __isl_give isl_printer *isl_printer_print_basic_set( + __isl_take isl_printer *printer, + __isl_keep isl_basic_set *bset); + __isl_give isl_printer *isl_printer_print_set( + __isl_take isl_printer *printer, + __isl_keep isl_set *set); - __isl_give isl_basic_set *isl_basic_set_flat_product( - __isl_take isl_basic_set *bset1, - __isl_take isl_basic_set *bset2); - __isl_give isl_set *isl_set_flat_product( - __isl_take isl_set *set1, - __isl_take isl_set *set2); - __isl_give isl_basic_map *isl_basic_map_flat_range_product( - __isl_take isl_basic_map *bmap1, - __isl_take isl_basic_map *bmap2); - __isl_give isl_map *isl_map_flat_domain_product( - __isl_take isl_map *map1, - __isl_take isl_map *map2); - __isl_give isl_map *isl_map_flat_range_product( - __isl_take isl_map *map1, - __isl_take isl_map *map2); - __isl_give isl_union_map *isl_union_map_flat_range_product( - __isl_take isl_union_map *umap1, - __isl_take isl_union_map *umap2); - __isl_give isl_basic_map *isl_basic_map_flat_product( - __isl_take isl_basic_map *bmap1, - __isl_take isl_basic_map *bmap2); - __isl_give isl_map *isl_map_flat_product( - __isl_take isl_map *map1, - __isl_take isl_map *map2); + #include + __isl_give isl_printer *isl_printer_print_basic_map( + __isl_take isl_printer *printer, + __isl_keep isl_basic_map *bmap); + __isl_give isl_printer *isl_printer_print_map( + __isl_take isl_printer *printer, + __isl_keep isl_map *map); -=item * Simplification + #include + __isl_give isl_printer *isl_printer_print_union_set( + __isl_take isl_printer *p, + __isl_keep isl_union_set *uset); - __isl_give isl_basic_set *isl_basic_set_gist( - __isl_take isl_basic_set *bset, - __isl_take isl_basic_set *context); - __isl_give isl_set *isl_set_gist(__isl_take isl_set *set, - __isl_take isl_set *context); - __isl_give isl_set *isl_set_gist_params( - __isl_take isl_set *set, - __isl_take isl_set *context); - __isl_give isl_union_set *isl_union_set_gist( - __isl_take isl_union_set *uset, - __isl_take isl_union_set *context); - __isl_give isl_union_set *isl_union_set_gist_params( - __isl_take isl_union_set *uset, - __isl_take isl_set *set); - __isl_give isl_basic_map *isl_basic_map_gist( - __isl_take isl_basic_map *bmap, - __isl_take isl_basic_map *context); - __isl_give isl_map *isl_map_gist(__isl_take isl_map *map, - __isl_take isl_map *context); - __isl_give isl_map *isl_map_gist_params( - __isl_take isl_map *map, - __isl_take isl_set *context); - __isl_give isl_map *isl_map_gist_domain( - __isl_take isl_map *map, - __isl_take isl_set *context); - __isl_give isl_map *isl_map_gist_range( - __isl_take isl_map *map, - __isl_take isl_set *context); - __isl_give isl_union_map *isl_union_map_gist( - __isl_take isl_union_map *umap, - __isl_take isl_union_map *context); - __isl_give isl_union_map *isl_union_map_gist_params( - __isl_take isl_union_map *umap, - __isl_take isl_set *set); - __isl_give isl_union_map *isl_union_map_gist_domain( - __isl_take isl_union_map *umap, - __isl_take isl_union_set *uset); - __isl_give isl_union_map *isl_union_map_gist_range( - __isl_take isl_union_map *umap, - __isl_take isl_union_set *uset); + #include + __isl_give isl_printer *isl_printer_print_union_map( + __isl_take isl_printer *p, + __isl_keep isl_union_map *umap); -The gist operation returns a set or relation that has the -same intersection with the context as the input set or relation. -Any implicit equality in the intersection is made explicit in the result, -while all inequalities that are redundant with respect to the intersection -are removed. -In case of union sets and relations, the gist operation is performed -per space. + #include + __isl_give isl_printer *isl_printer_print_multi_val( + __isl_take isl_printer *p, + __isl_keep isl_multi_val *mv); -=back + #include + __isl_give isl_printer *isl_printer_print_aff( + __isl_take isl_printer *p, __isl_keep isl_aff *aff); + __isl_give isl_printer *isl_printer_print_multi_aff( + __isl_take isl_printer *p, + __isl_keep isl_multi_aff *maff); + __isl_give isl_printer *isl_printer_print_pw_aff( + __isl_take isl_printer *p, + __isl_keep isl_pw_aff *pwaff); + __isl_give isl_printer *isl_printer_print_pw_multi_aff( + __isl_take isl_printer *p, + __isl_keep isl_pw_multi_aff *pma); + __isl_give isl_printer *isl_printer_print_multi_pw_aff( + __isl_take isl_printer *p, + __isl_keep isl_multi_pw_aff *mpa); + __isl_give isl_printer *isl_printer_print_union_pw_aff( + __isl_take isl_printer *p, + __isl_keep isl_union_pw_aff *upa); + __isl_give isl_printer *isl_printer_print_union_pw_multi_aff( + __isl_take isl_printer *p, + __isl_keep isl_union_pw_multi_aff *upma); + __isl_give isl_printer * + isl_printer_print_multi_union_pw_aff( + __isl_take isl_printer *p, + __isl_keep isl_multi_union_pw_aff *mupa); -=head3 Lexicographic Optimization - -Given a (basic) set C (or C) and a zero-dimensional domain C, -the following functions -compute a set that contains the lexicographic minimum or maximum -of the elements in C (or C) for those values of the parameters -that satisfy C. -If C is not C, then C<*empty> is assigned a set -that contains the parameter values in C for which C (or C) -has no elements. -In other words, the union of the parameter values -for which the result is non-empty and of C<*empty> -is equal to C. - - __isl_give isl_set *isl_basic_set_partial_lexmin( - __isl_take isl_basic_set *bset, - __isl_take isl_basic_set *dom, - __isl_give isl_set **empty); - __isl_give isl_set *isl_basic_set_partial_lexmax( - __isl_take isl_basic_set *bset, - __isl_take isl_basic_set *dom, - __isl_give isl_set **empty); - __isl_give isl_set *isl_set_partial_lexmin( - __isl_take isl_set *set, __isl_take isl_set *dom, - __isl_give isl_set **empty); - __isl_give isl_set *isl_set_partial_lexmax( - __isl_take isl_set *set, __isl_take isl_set *dom, - __isl_give isl_set **empty); + #include + __isl_give isl_printer *isl_printer_print_qpolynomial( + __isl_take isl_printer *p, + __isl_keep isl_qpolynomial *qp); + __isl_give isl_printer *isl_printer_print_pw_qpolynomial( + __isl_take isl_printer *p, + __isl_keep isl_pw_qpolynomial *pwqp); + __isl_give isl_printer *isl_printer_print_union_pw_qpolynomial( + __isl_take isl_printer *p, + __isl_keep isl_union_pw_qpolynomial *upwqp); -Given a (basic) set C (or C), the following functions simply -return a set containing the lexicographic minimum or maximum -of the elements in C (or C). -In case of union sets, the optimum is computed per space. + __isl_give isl_printer * + isl_printer_print_pw_qpolynomial_fold( + __isl_take isl_printer *p, + __isl_keep isl_pw_qpolynomial_fold *pwf); + __isl_give isl_printer * + isl_printer_print_union_pw_qpolynomial_fold( + __isl_take isl_printer *p, + __isl_keep isl_union_pw_qpolynomial_fold *upwf); - __isl_give isl_set *isl_basic_set_lexmin( - __isl_take isl_basic_set *bset); - __isl_give isl_set *isl_basic_set_lexmax( - __isl_take isl_basic_set *bset); - __isl_give isl_set *isl_set_lexmin( - __isl_take isl_set *set); - __isl_give isl_set *isl_set_lexmax( - __isl_take isl_set *set); - __isl_give isl_union_set *isl_union_set_lexmin( - __isl_take isl_union_set *uset); - __isl_give isl_union_set *isl_union_set_lexmax( - __isl_take isl_union_set *uset); +For C, +C and +C, +the output format of the printer +needs to be set to either C or C. +For C and +C, only C +is supported. +In case of printing in C, the user may want +to set the names of all dimensions first. -Given a (basic) relation C (or C) and a domain C, -the following functions -compute a relation that maps each element of C -to the single lexicographic minimum or maximum -of the elements that are associated to that same -element in C (or C). -If C is not C, then C<*empty> is assigned a set -that contains the elements in C that do not map -to any elements in C (or C). -In other words, the union of the domain of the result and of C<*empty> -is equal to C. +C also provides limited support for printing YAML documents, +just enough for the internal use for printing such documents. - __isl_give isl_map *isl_basic_map_partial_lexmax( - __isl_take isl_basic_map *bmap, - __isl_take isl_basic_set *dom, - __isl_give isl_set **empty); - __isl_give isl_map *isl_basic_map_partial_lexmin( - __isl_take isl_basic_map *bmap, - __isl_take isl_basic_set *dom, - __isl_give isl_set **empty); - __isl_give isl_map *isl_map_partial_lexmax( - __isl_take isl_map *map, __isl_take isl_set *dom, - __isl_give isl_set **empty); - __isl_give isl_map *isl_map_partial_lexmin( - __isl_take isl_map *map, __isl_take isl_set *dom, - __isl_give isl_set **empty); + #include + __isl_give isl_printer *isl_printer_yaml_start_mapping( + __isl_take isl_printer *p); + __isl_give isl_printer *isl_printer_yaml_end_mapping( + __isl_take isl_printer *p); + __isl_give isl_printer *isl_printer_yaml_start_sequence( + __isl_take isl_printer *p); + __isl_give isl_printer *isl_printer_yaml_end_sequence( + __isl_take isl_printer *p); + __isl_give isl_printer *isl_printer_yaml_next( + __isl_take isl_printer *p); -Given a (basic) map C (or C), the following functions simply -return a map mapping each element in the domain of -C (or C) to the lexicographic minimum or maximum -of all elements associated to that element. -In case of union relations, the optimum is computed per space. +A document is started by a call to either +C or C. +Anything printed to the printer after such a call belong to the +first key of the mapping or the first element in the sequence. +The function C moves to the value if +we are currently printing a mapping key, the next key if we +are printing a value or the next element if we are printing +an element in a sequence. +Nested mappings and sequences are initiated by the same +C or C. +Each call to these functions needs to have a corresponding call to +C or C. - __isl_give isl_map *isl_basic_map_lexmin( - __isl_take isl_basic_map *bmap); - __isl_give isl_map *isl_basic_map_lexmax( - __isl_take isl_basic_map *bmap); - __isl_give isl_map *isl_map_lexmin( - __isl_take isl_map *map); - __isl_give isl_map *isl_map_lexmax( - __isl_take isl_map *map); - __isl_give isl_union_map *isl_union_map_lexmin( - __isl_take isl_union_map *umap); - __isl_give isl_union_map *isl_union_map_lexmax( - __isl_take isl_union_map *umap); +When called on a file printer, the following function flushes +the file. When called on a string printer, the buffer is cleared. -The following functions return their result in the form of -a piecewise multi-affine expression -(See L<"Piecewise Multiple Quasi Affine Expressions">), -but are otherwise equivalent to the corresponding functions -returning a basic set or relation. + __isl_give isl_printer *isl_printer_flush( + __isl_take isl_printer *p); - __isl_give isl_pw_multi_aff * - isl_basic_map_lexmin_pw_multi_aff( - __isl_take isl_basic_map *bmap); - __isl_give isl_pw_multi_aff * - isl_basic_set_partial_lexmin_pw_multi_aff( - __isl_take isl_basic_set *bset, - __isl_take isl_basic_set *dom, - __isl_give isl_set **empty); - __isl_give isl_pw_multi_aff * - isl_basic_set_partial_lexmax_pw_multi_aff( - __isl_take isl_basic_set *bset, - __isl_take isl_basic_set *dom, - __isl_give isl_set **empty); - __isl_give isl_pw_multi_aff * - isl_basic_map_partial_lexmin_pw_multi_aff( - __isl_take isl_basic_map *bmap, - __isl_take isl_basic_set *dom, - __isl_give isl_set **empty); - __isl_give isl_pw_multi_aff * - isl_basic_map_partial_lexmax_pw_multi_aff( - __isl_take isl_basic_map *bmap, - __isl_take isl_basic_set *dom, - __isl_give isl_set **empty); - __isl_give isl_pw_multi_aff *isl_set_lexmin_pw_multi_aff( - __isl_take isl_set *set); - __isl_give isl_pw_multi_aff *isl_set_lexmax_pw_multi_aff( - __isl_take isl_set *set); - __isl_give isl_pw_multi_aff *isl_map_lexmin_pw_multi_aff( - __isl_take isl_map *map); - __isl_give isl_pw_multi_aff *isl_map_lexmax_pw_multi_aff( - __isl_take isl_map *map); +Alternatively, a string representation can be obtained +directly using the following functions, which always print +in isl format. -=head2 Lists + #include + __isl_give char *isl_space_to_str( + __isl_keep isl_space *space); -Lists are defined over several element types, including -C, C, C, C, C, -C, C, C and C. -Here we take lists of Cs as an example. -Lists can be created, copied, modified and freed using the following functions. + #include + __isl_give char *isl_val_to_str(__isl_keep isl_val *v); + __isl_give char *isl_multi_val_to_str( + __isl_keep isl_multi_val *mv); - #include - __isl_give isl_set_list *isl_set_list_from_set( - __isl_take isl_set *el); - __isl_give isl_set_list *isl_set_list_alloc( - isl_ctx *ctx, int n); - __isl_give isl_set_list *isl_set_list_copy( - __isl_keep isl_set_list *list); - __isl_give isl_set_list *isl_set_list_insert( - __isl_take isl_set_list *list, unsigned pos, - __isl_take isl_set *el); - __isl_give isl_set_list *isl_set_list_add( - __isl_take isl_set_list *list, - __isl_take isl_set *el); - __isl_give isl_set_list *isl_set_list_drop( - __isl_take isl_set_list *list, - unsigned first, unsigned n); - __isl_give isl_set_list *isl_set_list_set_set( - __isl_take isl_set_list *list, int index, - __isl_take isl_set *set); - __isl_give isl_set_list *isl_set_list_concat( - __isl_take isl_set_list *list1, - __isl_take isl_set_list *list2); - __isl_give isl_set_list *isl_set_list_sort( - __isl_take isl_set_list *list, - int (*cmp)(__isl_keep isl_set *a, - __isl_keep isl_set *b, void *user), - void *user); - void *isl_set_list_free(__isl_take isl_set_list *list); + #include + __isl_give char *isl_set_to_str( + __isl_keep isl_set *set); -C creates an empty list with a capacity for -C elements. C creates a list with a single -element. + #include + __isl_give char *isl_union_set_to_str( + __isl_keep isl_union_set *uset); -Lists can be inspected using the following functions. + #include + __isl_give char *isl_map_to_str( + __isl_keep isl_map *map); - #include - isl_ctx *isl_set_list_get_ctx(__isl_keep isl_set_list *list); - int isl_set_list_n_set(__isl_keep isl_set_list *list); - __isl_give isl_set *isl_set_list_get_set( - __isl_keep isl_set_list *list, int index); - int isl_set_list_foreach(__isl_keep isl_set_list *list, - int (*fn)(__isl_take isl_set *el, void *user), - void *user); - int isl_set_list_foreach_scc(__isl_keep isl_set_list *list, - int (*follows)(__isl_keep isl_set *a, - __isl_keep isl_set *b, void *user), - void *follows_user - int (*fn)(__isl_take isl_set *el, void *user), - void *fn_user); + #include + __isl_give char *isl_union_map_to_str( + __isl_keep isl_union_map *umap); -The function C calls C on each of the -strongly connected components of the graph with as vertices the elements -of C and a directed edge from vertex C to vertex C -iff C returns C<1>. The callbacks C and C -should return C<-1> on error. + #include + __isl_give char *isl_multi_aff_to_str( + __isl_keep isl_multi_aff *aff); + __isl_give char *isl_union_pw_aff_to_str( + __isl_keep isl_union_pw_aff *upa); + __isl_give char *isl_union_pw_multi_aff_to_str( + __isl_keep isl_union_pw_multi_aff *upma); + __isl_give char *isl_multi_union_pw_aff_to_str( + __isl_keep isl_multi_union_pw_aff *mupa); -Lists can be printed using +=head2 Properties - #include - __isl_give isl_printer *isl_printer_print_set_list( - __isl_take isl_printer *p, - __isl_keep isl_set_list *list); +=head3 Unary Properties -=head2 Multiple Values +=over -An C object represents a sequence of zero or more values, -living in a set space. +=item * Emptiness -An C can be constructed from an C -using the following function +The following functions test whether the given set or relation +contains any integer points. The ``plain'' variants do not perform +any computations, but simply check if the given set or relation +is already known to be empty. - #include - __isl_give isl_multi_val *isl_multi_val_from_val_list( - __isl_take isl_space *space, - __isl_take isl_val_list *list); + isl_bool isl_basic_set_plain_is_empty( + __isl_keep isl_basic_set *bset); + isl_bool isl_basic_set_is_empty( + __isl_keep isl_basic_set *bset); + isl_bool isl_set_plain_is_empty( + __isl_keep isl_set *set); + isl_bool isl_set_is_empty(__isl_keep isl_set *set); + isl_bool isl_union_set_is_empty( + __isl_keep isl_union_set *uset); + isl_bool isl_basic_map_plain_is_empty( + __isl_keep isl_basic_map *bmap); + isl_bool isl_basic_map_is_empty( + __isl_keep isl_basic_map *bmap); + isl_bool isl_map_plain_is_empty( + __isl_keep isl_map *map); + isl_bool isl_map_is_empty(__isl_keep isl_map *map); + isl_bool isl_union_map_is_empty( + __isl_keep isl_union_map *umap); -The zero multiple value (with value zero for each set dimension) -can be created using the following function. +=item * Universality - #include - __isl_give isl_multi_val *isl_multi_val_zero( - __isl_take isl_space *space); + isl_bool isl_basic_set_is_universe( + __isl_keep isl_basic_set *bset); + isl_bool isl_basic_map_is_universe( + __isl_keep isl_basic_map *bmap); + isl_bool isl_set_plain_is_universe( + __isl_keep isl_set *set); + isl_bool isl_map_plain_is_universe( + __isl_keep isl_map *map); -Multiple values can be copied and freed using +=item * Single-valuedness - #include - __isl_give isl_multi_val *isl_multi_val_copy( - __isl_keep isl_multi_val *mv); - void *isl_multi_val_free(__isl_take isl_multi_val *mv); + #include + isl_bool isl_set_is_singleton(__isl_keep isl_set *set); -They can be inspected using + #include + isl_bool isl_basic_map_is_single_valued( + __isl_keep isl_basic_map *bmap); + isl_bool isl_map_plain_is_single_valued( + __isl_keep isl_map *map); + isl_bool isl_map_is_single_valued(__isl_keep isl_map *map); - #include - isl_ctx *isl_multi_val_get_ctx( - __isl_keep isl_multi_val *mv); - unsigned isl_multi_val_dim(__isl_keep isl_multi_val *mv, - enum isl_dim_type type); - __isl_give isl_val *isl_multi_val_get_val( - __isl_keep isl_multi_val *mv, int pos); - const char *isl_multi_val_get_tuple_name( - __isl_keep isl_multi_val *mv, - enum isl_dim_type type); + #include + isl_bool isl_union_map_is_single_valued( + __isl_keep isl_union_map *umap); -They can be modified using +=item * Injectivity - #include - __isl_give isl_multi_val *isl_multi_val_set_val( - __isl_take isl_multi_val *mv, int pos, - __isl_take isl_val *val); - __isl_give isl_multi_val *isl_multi_val_set_dim_name( - __isl_take isl_multi_val *mv, - enum isl_dim_type type, unsigned pos, const char *s); - __isl_give isl_multi_val *isl_multi_val_set_tuple_name( - __isl_take isl_multi_val *mv, - enum isl_dim_type type, const char *s); - __isl_give isl_multi_val *isl_multi_val_set_tuple_id( - __isl_take isl_multi_val *mv, - enum isl_dim_type type, __isl_take isl_id *id); + isl_bool isl_map_plain_is_injective( + __isl_keep isl_map *map); + isl_bool isl_map_is_injective( + __isl_keep isl_map *map); + isl_bool isl_union_map_plain_is_injective( + __isl_keep isl_union_map *umap); + isl_bool isl_union_map_is_injective( + __isl_keep isl_union_map *umap); - __isl_give isl_multi_val *isl_multi_val_insert_dims( - __isl_take isl_multi_val *mv, - enum isl_dim_type type, unsigned first, unsigned n); - __isl_give isl_multi_val *isl_multi_val_add_dims( - __isl_take isl_multi_val *mv, - enum isl_dim_type type, unsigned n); - __isl_give isl_multi_val *isl_multi_val_drop_dims( - __isl_take isl_multi_val *mv, - enum isl_dim_type type, unsigned first, unsigned n); +=item * Bijectivity -Operations include + isl_bool isl_map_is_bijective( + __isl_keep isl_map *map); + isl_bool isl_union_map_is_bijective( + __isl_keep isl_union_map *umap); - #include - __isl_give isl_multi_val *isl_multi_val_align_params( - __isl_take isl_multi_val *mv, - __isl_take isl_space *model); - __isl_give isl_multi_val *isl_multi_val_range_splice( - __isl_take isl_multi_val *mv1, unsigned pos, - __isl_take isl_multi_val *mv2); - __isl_give isl_multi_val *isl_multi_val_range_product( - __isl_take isl_multi_val *mv1, - __isl_take isl_multi_val *mv2); - __isl_give isl_multi_val *isl_multi_val_flat_range_product( - __isl_take isl_multi_val *mv1, - __isl_take isl_multi_aff *mv2); - __isl_give isl_multi_val *isl_multi_val_add_val( - __isl_take isl_multi_val *mv, - __isl_take isl_val *v); - __isl_give isl_multi_val *isl_multi_val_mod_val( - __isl_take isl_multi_val *mv, - __isl_take isl_val *v); - __isl_give isl_multi_val *isl_multi_val_scale_val( - __isl_take isl_multi_val *mv, - __isl_take isl_val *v); - __isl_give isl_multi_val *isl_multi_val_scale_multi_val( - __isl_take isl_multi_val *mv1, - __isl_take isl_multi_val *mv2); +=item * Position -=head2 Vectors + __isl_give isl_val * + isl_basic_map_plain_get_val_if_fixed( + __isl_keep isl_basic_map *bmap, + enum isl_dim_type type, unsigned pos); + __isl_give isl_val *isl_set_plain_get_val_if_fixed( + __isl_keep isl_set *set, + enum isl_dim_type type, unsigned pos); + __isl_give isl_val *isl_map_plain_get_val_if_fixed( + __isl_keep isl_map *map, + enum isl_dim_type type, unsigned pos); -Vectors can be created, copied and freed using the following functions. +If the set or relation obviously lies on a hyperplane where the given dimension +has a fixed value, then return that value. +Otherwise return NaN. - #include - __isl_give isl_vec *isl_vec_alloc(isl_ctx *ctx, - unsigned size); - __isl_give isl_vec *isl_vec_copy(__isl_keep isl_vec *vec); - void *isl_vec_free(__isl_take isl_vec *vec); +=item * Stride -Note that the elements of a newly created vector may have arbitrary values. -The elements can be changed and inspected using the following functions. + isl_stat isl_set_dim_residue_class_val( + __isl_keep isl_set *set, + int pos, __isl_give isl_val **modulo, + __isl_give isl_val **residue); - isl_ctx *isl_vec_get_ctx(__isl_keep isl_vec *vec); - int isl_vec_size(__isl_keep isl_vec *vec); - int isl_vec_get_element(__isl_keep isl_vec *vec, - int pos, isl_int *v); - __isl_give isl_val *isl_vec_get_element_val( - __isl_keep isl_vec *vec, int pos); - __isl_give isl_vec *isl_vec_set_element( - __isl_take isl_vec *vec, int pos, isl_int v); - __isl_give isl_vec *isl_vec_set_element_si( - __isl_take isl_vec *vec, int pos, int v); - __isl_give isl_vec *isl_vec_set_element_val( - __isl_take isl_vec *vec, int pos, - __isl_take isl_val *v); - __isl_give isl_vec *isl_vec_set(__isl_take isl_vec *vec, - isl_int v); - __isl_give isl_vec *isl_vec_set_si(__isl_take isl_vec *vec, - int v); - __isl_give isl_vec *isl_vec_set_val( - __isl_take isl_vec *vec, __isl_take isl_val *v); - int isl_vec_cmp_element(__isl_keep isl_vec *vec1, - __isl_keep isl_vec *vec2, int pos); - __isl_give isl_vec *isl_vec_fdiv_r(__isl_take isl_vec *vec, - isl_int m); +Check if the values of the given set dimension are equal to a fixed +value modulo some integer value. If so, assign the modulo to C<*modulo> +and the fixed value to C<*residue>. If the given dimension attains only +a single value, then assign C<0> to C<*modulo> and the fixed value to +C<*residue>. +If the dimension does not attain only a single value and if no modulo +can be found then assign C<1> to C<*modulo> and C<1> to C<*residue>. -C will return a negative value if anything went wrong. -In that case, the value of C<*v> is undefined. +=item * Dependence -The following function can be used to concatenate two vectors. +To check whether the description of a set, relation or function depends +on one or more given dimensions, +the following functions can be used. - __isl_give isl_vec *isl_vec_concat(__isl_take isl_vec *vec1, - __isl_take isl_vec *vec2); + #include + isl_bool isl_constraint_involves_dims( + __isl_keep isl_constraint *constraint, + enum isl_dim_type type, unsigned first, unsigned n); -=head2 Matrices + #include + isl_bool isl_basic_set_involves_dims( + __isl_keep isl_basic_set *bset, + enum isl_dim_type type, unsigned first, unsigned n); + isl_bool isl_set_involves_dims(__isl_keep isl_set *set, + enum isl_dim_type type, unsigned first, unsigned n); -Matrices can be created, copied and freed using the following functions. + #include + isl_bool isl_basic_map_involves_dims( + __isl_keep isl_basic_map *bmap, + enum isl_dim_type type, unsigned first, unsigned n); + isl_bool isl_map_involves_dims(__isl_keep isl_map *map, + enum isl_dim_type type, unsigned first, unsigned n); - #include - __isl_give isl_mat *isl_mat_alloc(isl_ctx *ctx, - unsigned n_row, unsigned n_col); - __isl_give isl_mat *isl_mat_copy(__isl_keep isl_mat *mat); - void *isl_mat_free(__isl_take isl_mat *mat); + #include + isl_bool isl_union_map_involves_dims( + __isl_keep isl_union_map *umap, + enum isl_dim_type type, unsigned first, unsigned n); -Note that the elements of a newly created matrix may have arbitrary values. -The elements can be changed and inspected using the following functions. + #include + isl_bool isl_aff_involves_dims(__isl_keep isl_aff *aff, + enum isl_dim_type type, unsigned first, unsigned n); + isl_bool isl_pw_aff_involves_dims( + __isl_keep isl_pw_aff *pwaff, + enum isl_dim_type type, unsigned first, unsigned n); + isl_bool isl_multi_aff_involves_dims( + __isl_keep isl_multi_aff *ma, + enum isl_dim_type type, unsigned first, unsigned n); + isl_bool isl_multi_pw_aff_involves_dims( + __isl_keep isl_multi_pw_aff *mpa, + enum isl_dim_type type, unsigned first, unsigned n); - isl_ctx *isl_mat_get_ctx(__isl_keep isl_mat *mat); - int isl_mat_rows(__isl_keep isl_mat *mat); - int isl_mat_cols(__isl_keep isl_mat *mat); - int isl_mat_get_element(__isl_keep isl_mat *mat, - int row, int col, isl_int *v); - __isl_give isl_val *isl_mat_get_element_val( - __isl_keep isl_mat *mat, int row, int col); - __isl_give isl_mat *isl_mat_set_element(__isl_take isl_mat *mat, - int row, int col, isl_int v); - __isl_give isl_mat *isl_mat_set_element_si(__isl_take isl_mat *mat, - int row, int col, int v); - __isl_give isl_mat *isl_mat_set_element_val( - __isl_take isl_mat *mat, int row, int col, - __isl_take isl_val *v); + #include + isl_bool isl_qpolynomial_involves_dims( + __isl_keep isl_qpolynomial *qp, + enum isl_dim_type type, unsigned first, unsigned n); -C will return a negative value if anything went wrong. -In that case, the value of C<*v> is undefined. +Similarly, the following functions can be used to check whether +a given dimension is involved in any lower or upper bound. -The following function can be used to compute the (right) inverse -of a matrix, i.e., a matrix such that the product of the original -and the inverse (in that order) is a multiple of the identity matrix. -The input matrix is assumed to be of full row-rank. + #include + isl_bool isl_set_dim_has_any_lower_bound( + __isl_keep isl_set *set, + enum isl_dim_type type, unsigned pos); + isl_bool isl_set_dim_has_any_upper_bound( + __isl_keep isl_set *set, + enum isl_dim_type type, unsigned pos); - __isl_give isl_mat *isl_mat_right_inverse(__isl_take isl_mat *mat); +Note that these functions return true even if there is a bound on +the dimension on only some of the basic sets of C. +To check if they have a bound for all of the basic sets in C, +use the following functions instead. -The following function can be used to compute the (right) kernel -(or null space) of a matrix, i.e., a matrix such that the product of -the original and the kernel (in that order) is the zero matrix. + #include + isl_bool isl_set_dim_has_lower_bound( + __isl_keep isl_set *set, + enum isl_dim_type type, unsigned pos); + isl_bool isl_set_dim_has_upper_bound( + __isl_keep isl_set *set, + enum isl_dim_type type, unsigned pos); - __isl_give isl_mat *isl_mat_right_kernel(__isl_take isl_mat *mat); +=item * Space -=head2 Piecewise Quasi Affine Expressions +To check whether a set is a parameter domain, use this function: -The zero quasi affine expression or the quasi affine expression -that is equal to a specified dimension on a given domain can be created using + isl_bool isl_set_is_params(__isl_keep isl_set *set); + isl_bool isl_union_set_is_params( + __isl_keep isl_union_set *uset); - __isl_give isl_aff *isl_aff_zero_on_domain( - __isl_take isl_local_space *ls); - __isl_give isl_pw_aff *isl_pw_aff_zero_on_domain( - __isl_take isl_local_space *ls); - __isl_give isl_aff *isl_aff_var_on_domain( - __isl_take isl_local_space *ls, - enum isl_dim_type type, unsigned pos); - __isl_give isl_pw_aff *isl_pw_aff_var_on_domain( - __isl_take isl_local_space *ls, - enum isl_dim_type type, unsigned pos); +=item * Wrapping -Note that the space in which the resulting objects live is a map space -with the given space as domain and a one-dimensional range. +The following functions check whether the space of the given +(basic) set or relation range is a wrapped relation. -An empty piecewise quasi affine expression (one with no cells) -or a piecewise quasi affine expression with a single cell can -be created using the following functions. + #include + isl_bool isl_space_is_wrapping( + __isl_keep isl_space *space); + isl_bool isl_space_domain_is_wrapping( + __isl_keep isl_space *space); + isl_bool isl_space_range_is_wrapping( + __isl_keep isl_space *space); - #include - __isl_give isl_pw_aff *isl_pw_aff_empty( - __isl_take isl_space *space); - __isl_give isl_pw_aff *isl_pw_aff_alloc( - __isl_take isl_set *set, __isl_take isl_aff *aff); - __isl_give isl_pw_aff *isl_pw_aff_from_aff( - __isl_take isl_aff *aff); + #include + isl_bool isl_basic_set_is_wrapping( + __isl_keep isl_basic_set *bset); + isl_bool isl_set_is_wrapping(__isl_keep isl_set *set); -A piecewise quasi affine expression that is equal to 1 on a set -and 0 outside the set can be created using the following function. + #include + isl_bool isl_map_domain_is_wrapping( + __isl_keep isl_map *map); + isl_bool isl_map_range_is_wrapping( + __isl_keep isl_map *map); + + #include + isl_bool isl_multi_val_range_is_wrapping( + __isl_keep isl_multi_val *mv); #include - __isl_give isl_pw_aff *isl_set_indicator_function( - __isl_take isl_set *set); + isl_bool isl_multi_aff_range_is_wrapping( + __isl_keep isl_multi_aff *ma); + isl_bool isl_multi_pw_aff_range_is_wrapping( + __isl_keep isl_multi_pw_aff *mpa); + isl_bool isl_multi_union_pw_aff_range_is_wrapping( + __isl_keep isl_multi_union_pw_aff *mupa); -Quasi affine expressions can be copied and freed using +The input to C should +be the space of a set, while that of +C and +C should be the space of a relation. - #include - __isl_give isl_aff *isl_aff_copy(__isl_keep isl_aff *aff); - void *isl_aff_free(__isl_take isl_aff *aff); +=item * Internal Product - __isl_give isl_pw_aff *isl_pw_aff_copy( - __isl_keep isl_pw_aff *pwaff); - void *isl_pw_aff_free(__isl_take isl_pw_aff *pwaff); + isl_bool isl_basic_map_can_zip( + __isl_keep isl_basic_map *bmap); + isl_bool isl_map_can_zip(__isl_keep isl_map *map); -A (rational) bound on a dimension can be extracted from an C -using the following function. The constraint is required to have -a non-zero coefficient for the specified dimension. +Check whether the product of domain and range of the given relation +can be computed, +i.e., whether both domain and range are nested relations. - #include - __isl_give isl_aff *isl_constraint_get_bound( - __isl_keep isl_constraint *constraint, - enum isl_dim_type type, int pos); +=item * Currying -The entire affine expression of the constraint can also be extracted -using the following function. + isl_bool isl_basic_map_can_curry( + __isl_keep isl_basic_map *bmap); + isl_bool isl_map_can_curry(__isl_keep isl_map *map); - #include - __isl_give isl_aff *isl_constraint_get_aff( - __isl_keep isl_constraint *constraint); +Check whether the domain of the (basic) relation is a wrapped relation. -Conversely, an equality constraint equating -the affine expression to zero or an inequality constraint enforcing -the affine expression to be non-negative, can be constructed using + isl_bool isl_basic_map_can_uncurry( + __isl_keep isl_basic_map *bmap); + isl_bool isl_map_can_uncurry(__isl_keep isl_map *map); - __isl_give isl_constraint *isl_equality_from_aff( - __isl_take isl_aff *aff); - __isl_give isl_constraint *isl_inequality_from_aff( - __isl_take isl_aff *aff); +Check whether the range of the (basic) relation is a wrapped relation. -The expression can be inspected using +=item * Special Values #include - isl_ctx *isl_aff_get_ctx(__isl_keep isl_aff *aff); - int isl_aff_dim(__isl_keep isl_aff *aff, - enum isl_dim_type type); - __isl_give isl_local_space *isl_aff_get_domain_local_space( - __isl_keep isl_aff *aff); - __isl_give isl_local_space *isl_aff_get_local_space( - __isl_keep isl_aff *aff); - const char *isl_aff_get_dim_name(__isl_keep isl_aff *aff, - enum isl_dim_type type, unsigned pos); - const char *isl_pw_aff_get_dim_name( - __isl_keep isl_pw_aff *pa, - enum isl_dim_type type, unsigned pos); - int isl_pw_aff_has_dim_id(__isl_keep isl_pw_aff *pa, - enum isl_dim_type type, unsigned pos); - __isl_give isl_id *isl_pw_aff_get_dim_id( - __isl_keep isl_pw_aff *pa, - enum isl_dim_type type, unsigned pos); - __isl_give isl_id *isl_pw_aff_get_tuple_id( - __isl_keep isl_pw_aff *pa, - enum isl_dim_type type); - int isl_aff_get_constant(__isl_keep isl_aff *aff, - isl_int *v); - __isl_give isl_val *isl_aff_get_constant_val( - __isl_keep isl_aff *aff); - int isl_aff_get_coefficient(__isl_keep isl_aff *aff, - enum isl_dim_type type, int pos, isl_int *v); - __isl_give isl_val *isl_aff_get_coefficient_val( - __isl_keep isl_aff *aff, - enum isl_dim_type type, int pos); - int isl_aff_get_denominator(__isl_keep isl_aff *aff, - isl_int *v); - __isl_give isl_val *isl_aff_get_denominator_val( + isl_bool isl_aff_is_cst(__isl_keep isl_aff *aff); + isl_bool isl_pw_aff_is_cst(__isl_keep isl_pw_aff *pwaff); + +Check whether the given expression is a constant. + + #include + isl_bool isl_aff_is_nan(__isl_keep isl_aff *aff); + isl_bool isl_pw_aff_involves_nan( + __isl_keep isl_pw_aff *pa); + + #include + isl_bool isl_qpolynomial_fold_is_nan( + __isl_keep isl_qpolynomial_fold *fold); + +Check whether the given expression is equal to or involves NaN. + + #include + isl_bool isl_aff_plain_is_zero( __isl_keep isl_aff *aff); - __isl_give isl_aff *isl_aff_get_div( - __isl_keep isl_aff *aff, int pos); - int isl_pw_aff_n_piece(__isl_keep isl_pw_aff *pwaff); - int isl_pw_aff_foreach_piece(__isl_keep isl_pw_aff *pwaff, - int (*fn)(__isl_take isl_set *set, - __isl_take isl_aff *aff, - void *user), void *user); +Check whether the affine expression is obviously zero. - int isl_aff_is_cst(__isl_keep isl_aff *aff); - int isl_pw_aff_is_cst(__isl_keep isl_pw_aff *pwaff); +=back - int isl_aff_involves_dims(__isl_keep isl_aff *aff, - enum isl_dim_type type, unsigned first, unsigned n); - int isl_pw_aff_involves_dims(__isl_keep isl_pw_aff *pwaff, - enum isl_dim_type type, unsigned first, unsigned n); +=head3 Binary Properties - isl_ctx *isl_pw_aff_get_ctx(__isl_keep isl_pw_aff *pwaff); - unsigned isl_pw_aff_dim(__isl_keep isl_pw_aff *pwaff, - enum isl_dim_type type); - int isl_pw_aff_is_empty(__isl_keep isl_pw_aff *pwaff); +=over -It can be modified using +=item * Equality - #include - __isl_give isl_pw_aff *isl_pw_aff_set_tuple_id( - __isl_take isl_pw_aff *pwaff, - enum isl_dim_type type, __isl_take isl_id *id); - __isl_give isl_aff *isl_aff_set_dim_name( - __isl_take isl_aff *aff, enum isl_dim_type type, - unsigned pos, const char *s); - __isl_give isl_aff *isl_aff_set_dim_id( - __isl_take isl_aff *aff, enum isl_dim_type type, - unsigned pos, __isl_take isl_id *id); - __isl_give isl_pw_aff *isl_pw_aff_set_dim_id( - __isl_take isl_pw_aff *pma, - enum isl_dim_type type, unsigned pos, - __isl_take isl_id *id); - __isl_give isl_aff *isl_aff_set_constant( - __isl_take isl_aff *aff, isl_int v); - __isl_give isl_aff *isl_aff_set_constant_si( - __isl_take isl_aff *aff, int v); - __isl_give isl_aff *isl_aff_set_constant_val( - __isl_take isl_aff *aff, __isl_take isl_val *v); - __isl_give isl_aff *isl_aff_set_coefficient( - __isl_take isl_aff *aff, - enum isl_dim_type type, int pos, isl_int v); - __isl_give isl_aff *isl_aff_set_coefficient_si( - __isl_take isl_aff *aff, - enum isl_dim_type type, int pos, int v); - __isl_give isl_aff *isl_aff_set_coefficient_val( - __isl_take isl_aff *aff, - enum isl_dim_type type, int pos, - __isl_take isl_val *v); - __isl_give isl_aff *isl_aff_set_denominator( - __isl_take isl_aff *aff, isl_int v); +The following functions check whether two objects +represent the same set, relation or function. +The C variants only return true if the objects +are obviously the same. That is, they may return false +even if the objects are the same, but they will never +return true if the objects are not the same. - __isl_give isl_aff *isl_aff_add_constant( - __isl_take isl_aff *aff, isl_int v); - __isl_give isl_aff *isl_aff_add_constant_si( - __isl_take isl_aff *aff, int v); - __isl_give isl_aff *isl_aff_add_constant_val( - __isl_take isl_aff *aff, __isl_take isl_val *v); - __isl_give isl_aff *isl_aff_add_constant_num( - __isl_take isl_aff *aff, isl_int v); - __isl_give isl_aff *isl_aff_add_constant_num_si( - __isl_take isl_aff *aff, int v); - __isl_give isl_aff *isl_aff_add_coefficient( - __isl_take isl_aff *aff, - enum isl_dim_type type, int pos, isl_int v); - __isl_give isl_aff *isl_aff_add_coefficient_si( - __isl_take isl_aff *aff, - enum isl_dim_type type, int pos, int v); - __isl_give isl_aff *isl_aff_add_coefficient_val( - __isl_take isl_aff *aff, - enum isl_dim_type type, int pos, - __isl_take isl_val *v); + #include + isl_bool isl_basic_set_plain_is_equal( + __isl_keep isl_basic_set *bset1, + __isl_keep isl_basic_set *bset2); + isl_bool isl_basic_set_is_equal( + __isl_keep isl_basic_set *bset1, + __isl_keep isl_basic_set *bset2); + isl_bool isl_set_plain_is_equal( + __isl_keep isl_set *set1, + __isl_keep isl_set *set2); + isl_bool isl_set_is_equal(__isl_keep isl_set *set1, + __isl_keep isl_set *set2); - __isl_give isl_aff *isl_aff_insert_dims( - __isl_take isl_aff *aff, - enum isl_dim_type type, unsigned first, unsigned n); - __isl_give isl_pw_aff *isl_pw_aff_insert_dims( - __isl_take isl_pw_aff *pwaff, - enum isl_dim_type type, unsigned first, unsigned n); - __isl_give isl_aff *isl_aff_add_dims( - __isl_take isl_aff *aff, - enum isl_dim_type type, unsigned n); - __isl_give isl_pw_aff *isl_pw_aff_add_dims( - __isl_take isl_pw_aff *pwaff, - enum isl_dim_type type, unsigned n); - __isl_give isl_aff *isl_aff_drop_dims( - __isl_take isl_aff *aff, - enum isl_dim_type type, unsigned first, unsigned n); - __isl_give isl_pw_aff *isl_pw_aff_drop_dims( - __isl_take isl_pw_aff *pwaff, - enum isl_dim_type type, unsigned first, unsigned n); + #include + isl_bool isl_basic_map_is_equal( + __isl_keep isl_basic_map *bmap1, + __isl_keep isl_basic_map *bmap2); + isl_bool isl_map_is_equal(__isl_keep isl_map *map1, + __isl_keep isl_map *map2); + isl_bool isl_map_plain_is_equal( + __isl_keep isl_map *map1, + __isl_keep isl_map *map2); -Note that C, C, -C and C -set the I of the constant or coefficient, while -C and C set -the constant or coefficient as a whole. -The C and C functions add an integer -or rational value to -the possibly rational constant or coefficient. -The C functions add an integer value to -the numerator. + #include + isl_bool isl_union_set_is_equal( + __isl_keep isl_union_set *uset1, + __isl_keep isl_union_set *uset2); -To check whether an affine expressions is obviously zero -or obviously equal to some other affine expression, use + #include + isl_bool isl_union_map_is_equal( + __isl_keep isl_union_map *umap1, + __isl_keep isl_union_map *umap2); #include - int isl_aff_plain_is_zero(__isl_keep isl_aff *aff); - int isl_aff_plain_is_equal(__isl_keep isl_aff *aff1, + isl_bool isl_aff_plain_is_equal( + __isl_keep isl_aff *aff1, __isl_keep isl_aff *aff2); - int isl_pw_aff_plain_is_equal( + isl_bool isl_multi_aff_plain_is_equal( + __isl_keep isl_multi_aff *maff1, + __isl_keep isl_multi_aff *maff2); + isl_bool isl_pw_aff_plain_is_equal( __isl_keep isl_pw_aff *pwaff1, __isl_keep isl_pw_aff *pwaff2); + isl_bool isl_pw_multi_aff_plain_is_equal( + __isl_keep isl_pw_multi_aff *pma1, + __isl_keep isl_pw_multi_aff *pma2); + isl_bool isl_multi_pw_aff_plain_is_equal( + __isl_keep isl_multi_pw_aff *mpa1, + __isl_keep isl_multi_pw_aff *mpa2); + isl_bool isl_multi_pw_aff_is_equal( + __isl_keep isl_multi_pw_aff *mpa1, + __isl_keep isl_multi_pw_aff *mpa2); + isl_bool isl_union_pw_aff_plain_is_equal( + __isl_keep isl_union_pw_aff *upa1, + __isl_keep isl_union_pw_aff *upa2); + isl_bool isl_union_pw_multi_aff_plain_is_equal( + __isl_keep isl_union_pw_multi_aff *upma1, + __isl_keep isl_union_pw_multi_aff *upma2); + isl_bool isl_multi_union_pw_aff_plain_is_equal( + __isl_keep isl_multi_union_pw_aff *mupa1, + __isl_keep isl_multi_union_pw_aff *mupa2); -Operations include + #include + isl_bool isl_union_pw_qpolynomial_plain_is_equal( + __isl_keep isl_union_pw_qpolynomial *upwqp1, + __isl_keep isl_union_pw_qpolynomial *upwqp2); + isl_bool isl_union_pw_qpolynomial_fold_plain_is_equal( + __isl_keep isl_union_pw_qpolynomial_fold *upwf1, + __isl_keep isl_union_pw_qpolynomial_fold *upwf2); - #include - __isl_give isl_aff *isl_aff_add(__isl_take isl_aff *aff1, - __isl_take isl_aff *aff2); - __isl_give isl_pw_aff *isl_pw_aff_add( - __isl_take isl_pw_aff *pwaff1, - __isl_take isl_pw_aff *pwaff2); - __isl_give isl_pw_aff *isl_pw_aff_min( - __isl_take isl_pw_aff *pwaff1, - __isl_take isl_pw_aff *pwaff2); - __isl_give isl_pw_aff *isl_pw_aff_max( - __isl_take isl_pw_aff *pwaff1, - __isl_take isl_pw_aff *pwaff2); - __isl_give isl_aff *isl_aff_sub(__isl_take isl_aff *aff1, - __isl_take isl_aff *aff2); - __isl_give isl_pw_aff *isl_pw_aff_sub( - __isl_take isl_pw_aff *pwaff1, - __isl_take isl_pw_aff *pwaff2); - __isl_give isl_aff *isl_aff_neg(__isl_take isl_aff *aff); - __isl_give isl_pw_aff *isl_pw_aff_neg( - __isl_take isl_pw_aff *pwaff); - __isl_give isl_aff *isl_aff_ceil(__isl_take isl_aff *aff); - __isl_give isl_pw_aff *isl_pw_aff_ceil( - __isl_take isl_pw_aff *pwaff); - __isl_give isl_aff *isl_aff_floor(__isl_take isl_aff *aff); - __isl_give isl_pw_aff *isl_pw_aff_floor( - __isl_take isl_pw_aff *pwaff); - __isl_give isl_aff *isl_aff_mod(__isl_take isl_aff *aff, - isl_int mod); - __isl_give isl_aff *isl_aff_mod_val(__isl_take isl_aff *aff, - __isl_take isl_val *mod); - __isl_give isl_pw_aff *isl_pw_aff_mod( - __isl_take isl_pw_aff *pwaff, isl_int mod); - __isl_give isl_pw_aff *isl_pw_aff_mod_val( - __isl_take isl_pw_aff *pa, - __isl_take isl_val *mod); - __isl_give isl_aff *isl_aff_scale(__isl_take isl_aff *aff, - isl_int f); - __isl_give isl_aff *isl_aff_scale_val(__isl_take isl_aff *aff, - __isl_take isl_val *v); - __isl_give isl_pw_aff *isl_pw_aff_scale( - __isl_take isl_pw_aff *pwaff, isl_int f); - __isl_give isl_pw_aff *isl_pw_aff_scale_val( - __isl_take isl_pw_aff *pa, __isl_take isl_val *v); - __isl_give isl_aff *isl_aff_scale_down(__isl_take isl_aff *aff, - isl_int f); - __isl_give isl_aff *isl_aff_scale_down_ui( - __isl_take isl_aff *aff, unsigned f); - __isl_give isl_aff *isl_aff_scale_down_val( - __isl_take isl_aff *aff, __isl_take isl_val *v); - __isl_give isl_pw_aff *isl_pw_aff_scale_down( - __isl_take isl_pw_aff *pwaff, isl_int f); - __isl_give isl_pw_aff *isl_pw_aff_scale_down_val( - __isl_take isl_pw_aff *pa, - __isl_take isl_val *f); +=item * Disjointness - __isl_give isl_pw_aff *isl_pw_aff_list_min( - __isl_take isl_pw_aff_list *list); - __isl_give isl_pw_aff *isl_pw_aff_list_max( - __isl_take isl_pw_aff_list *list); + #include + isl_bool isl_basic_set_is_disjoint( + __isl_keep isl_basic_set *bset1, + __isl_keep isl_basic_set *bset2); + isl_bool isl_set_plain_is_disjoint( + __isl_keep isl_set *set1, + __isl_keep isl_set *set2); + isl_bool isl_set_is_disjoint(__isl_keep isl_set *set1, + __isl_keep isl_set *set2); - __isl_give isl_pw_aff *isl_pw_aff_coalesce( - __isl_take isl_pw_aff *pwqp); + #include + isl_bool isl_basic_map_is_disjoint( + __isl_keep isl_basic_map *bmap1, + __isl_keep isl_basic_map *bmap2); + isl_bool isl_map_is_disjoint(__isl_keep isl_map *map1, + __isl_keep isl_map *map2); - __isl_give isl_aff *isl_aff_align_params( - __isl_take isl_aff *aff, - __isl_take isl_space *model); - __isl_give isl_pw_aff *isl_pw_aff_align_params( - __isl_take isl_pw_aff *pwaff, - __isl_take isl_space *model); + #include + isl_bool isl_union_set_is_disjoint( + __isl_keep isl_union_set *uset1, + __isl_keep isl_union_set *uset2); - __isl_give isl_aff *isl_aff_project_domain_on_params( - __isl_take isl_aff *aff); + #include + isl_bool isl_union_map_is_disjoint( + __isl_keep isl_union_map *umap1, + __isl_keep isl_union_map *umap2); - __isl_give isl_aff *isl_aff_gist_params( - __isl_take isl_aff *aff, - __isl_take isl_set *context); - __isl_give isl_aff *isl_aff_gist(__isl_take isl_aff *aff, - __isl_take isl_set *context); - __isl_give isl_pw_aff *isl_pw_aff_gist_params( - __isl_take isl_pw_aff *pwaff, - __isl_take isl_set *context); - __isl_give isl_pw_aff *isl_pw_aff_gist( - __isl_take isl_pw_aff *pwaff, - __isl_take isl_set *context); +=item * Subset - __isl_give isl_set *isl_pw_aff_domain( - __isl_take isl_pw_aff *pwaff); - __isl_give isl_pw_aff *isl_pw_aff_intersect_domain( - __isl_take isl_pw_aff *pa, - __isl_take isl_set *set); - __isl_give isl_pw_aff *isl_pw_aff_intersect_params( - __isl_take isl_pw_aff *pa, - __isl_take isl_set *set); + isl_bool isl_basic_set_is_subset( + __isl_keep isl_basic_set *bset1, + __isl_keep isl_basic_set *bset2); + isl_bool isl_set_is_subset(__isl_keep isl_set *set1, + __isl_keep isl_set *set2); + isl_bool isl_set_is_strict_subset( + __isl_keep isl_set *set1, + __isl_keep isl_set *set2); + isl_bool isl_union_set_is_subset( + __isl_keep isl_union_set *uset1, + __isl_keep isl_union_set *uset2); + isl_bool isl_union_set_is_strict_subset( + __isl_keep isl_union_set *uset1, + __isl_keep isl_union_set *uset2); + isl_bool isl_basic_map_is_subset( + __isl_keep isl_basic_map *bmap1, + __isl_keep isl_basic_map *bmap2); + isl_bool isl_basic_map_is_strict_subset( + __isl_keep isl_basic_map *bmap1, + __isl_keep isl_basic_map *bmap2); + isl_bool isl_map_is_subset( + __isl_keep isl_map *map1, + __isl_keep isl_map *map2); + isl_bool isl_map_is_strict_subset( + __isl_keep isl_map *map1, + __isl_keep isl_map *map2); + isl_bool isl_union_map_is_subset( + __isl_keep isl_union_map *umap1, + __isl_keep isl_union_map *umap2); + isl_bool isl_union_map_is_strict_subset( + __isl_keep isl_union_map *umap1, + __isl_keep isl_union_map *umap2); - __isl_give isl_aff *isl_aff_mul(__isl_take isl_aff *aff1, - __isl_take isl_aff *aff2); - __isl_give isl_aff *isl_aff_div(__isl_take isl_aff *aff1, - __isl_take isl_aff *aff2); - __isl_give isl_pw_aff *isl_pw_aff_mul( - __isl_take isl_pw_aff *pwaff1, - __isl_take isl_pw_aff *pwaff2); - __isl_give isl_pw_aff *isl_pw_aff_div( - __isl_take isl_pw_aff *pa1, - __isl_take isl_pw_aff *pa2); - __isl_give isl_pw_aff *isl_pw_aff_tdiv_q( - __isl_take isl_pw_aff *pa1, - __isl_take isl_pw_aff *pa2); - __isl_give isl_pw_aff *isl_pw_aff_tdiv_r( - __isl_take isl_pw_aff *pa1, - __isl_take isl_pw_aff *pa2); +Check whether the first argument is a (strict) subset of the +second argument. -When multiplying two affine expressions, at least one of the two needs -to be a constant. Similarly, when dividing an affine expression by another, -the second expression needs to be a constant. -C computes the quotient of an integer division with -rounding towards zero. C computes the corresponding -remainder. - - #include - __isl_give isl_aff *isl_aff_pullback_multi_aff( - __isl_take isl_aff *aff, - __isl_take isl_multi_aff *ma); - __isl_give isl_pw_aff *isl_pw_aff_pullback_multi_aff( - __isl_take isl_pw_aff *pa, - __isl_take isl_multi_aff *ma); - __isl_give isl_pw_aff *isl_pw_aff_pullback_pw_multi_aff( - __isl_take isl_pw_aff *pa, - __isl_take isl_pw_multi_aff *pma); +=item * Order -These functions precompose the input expression by the given -C or C. In other words, -the C or C is plugged -into the (piecewise) affine expression. -Objects of type C are described in -L. +Every comparison function returns a negative value if the first +argument is considered smaller than the second, a positive value +if the first argument is considered greater and zero if the two +constraints are considered the same by the comparison criterion. - #include - __isl_give isl_basic_set *isl_aff_zero_basic_set( - __isl_take isl_aff *aff); - __isl_give isl_basic_set *isl_aff_neg_basic_set( - __isl_take isl_aff *aff); - __isl_give isl_basic_set *isl_aff_le_basic_set( - __isl_take isl_aff *aff1, __isl_take isl_aff *aff2); - __isl_give isl_basic_set *isl_aff_ge_basic_set( - __isl_take isl_aff *aff1, __isl_take isl_aff *aff2); - __isl_give isl_set *isl_pw_aff_eq_set( - __isl_take isl_pw_aff *pwaff1, - __isl_take isl_pw_aff *pwaff2); - __isl_give isl_set *isl_pw_aff_ne_set( - __isl_take isl_pw_aff *pwaff1, - __isl_take isl_pw_aff *pwaff2); - __isl_give isl_set *isl_pw_aff_le_set( - __isl_take isl_pw_aff *pwaff1, - __isl_take isl_pw_aff *pwaff2); - __isl_give isl_set *isl_pw_aff_lt_set( - __isl_take isl_pw_aff *pwaff1, - __isl_take isl_pw_aff *pwaff2); - __isl_give isl_set *isl_pw_aff_ge_set( - __isl_take isl_pw_aff *pwaff1, - __isl_take isl_pw_aff *pwaff2); - __isl_give isl_set *isl_pw_aff_gt_set( - __isl_take isl_pw_aff *pwaff1, - __isl_take isl_pw_aff *pwaff2); + #include + int isl_constraint_plain_cmp( + __isl_keep isl_constraint *c1, + __isl_keep isl_constraint *c2); - __isl_give isl_set *isl_pw_aff_list_eq_set( - __isl_take isl_pw_aff_list *list1, - __isl_take isl_pw_aff_list *list2); - __isl_give isl_set *isl_pw_aff_list_ne_set( - __isl_take isl_pw_aff_list *list1, - __isl_take isl_pw_aff_list *list2); - __isl_give isl_set *isl_pw_aff_list_le_set( - __isl_take isl_pw_aff_list *list1, - __isl_take isl_pw_aff_list *list2); - __isl_give isl_set *isl_pw_aff_list_lt_set( - __isl_take isl_pw_aff_list *list1, - __isl_take isl_pw_aff_list *list2); - __isl_give isl_set *isl_pw_aff_list_ge_set( - __isl_take isl_pw_aff_list *list1, - __isl_take isl_pw_aff_list *list2); - __isl_give isl_set *isl_pw_aff_list_gt_set( - __isl_take isl_pw_aff_list *list1, - __isl_take isl_pw_aff_list *list2); +This function is useful for sorting Cs. +The order depends on the internal representation of the inputs. +The order is fixed over different calls to the function (assuming +the internal representation of the inputs has not changed), but may +change over different versions of C. -The function C returns a basic set -containing those elements in the domain space -of C where C is negative. -The function C returns a basic set -containing those elements in the shared space -of C and C where C is greater than or equal to C. -The function C returns a set -containing those elements in the shared domain -of C and C where C is greater than or equal to C. -The functions operating on C apply the corresponding -C function to each pair of elements in the two lists. + #include + int isl_constraint_cmp_last_non_zero( + __isl_keep isl_constraint *c1, + __isl_keep isl_constraint *c2); + +This function can be used to sort constraints that live in the same +local space. Constraints that involve ``earlier'' dimensions or +that have a smaller coefficient for the shared latest dimension +are considered smaller than other constraints. +This function only defines a B order. - #include - __isl_give isl_set *isl_pw_aff_nonneg_set( - __isl_take isl_pw_aff *pwaff); - __isl_give isl_set *isl_pw_aff_zero_set( - __isl_take isl_pw_aff *pwaff); - __isl_give isl_set *isl_pw_aff_non_zero_set( - __isl_take isl_pw_aff *pwaff); + #include + int isl_set_plain_cmp(__isl_keep isl_set *set1, + __isl_keep isl_set *set2); -The function C returns a set -containing those elements in the domain -of C where C is non-negative. +This function is useful for sorting Cs. +The order depends on the internal representation of the inputs. +The order is fixed over different calls to the function (assuming +the internal representation of the inputs has not changed), but may +change over different versions of C. #include - __isl_give isl_pw_aff *isl_pw_aff_cond( - __isl_take isl_pw_aff *cond, - __isl_take isl_pw_aff *pwaff_true, - __isl_take isl_pw_aff *pwaff_false); - -The function C performs a conditional operator -and returns an expression that is equal to C -for elements where C is non-zero and equal to C for elements -where C is zero. + int isl_pw_aff_plain_cmp(__isl_keep isl_pw_aff *pa1, + __isl_keep isl_pw_aff *pa2); - #include - __isl_give isl_pw_aff *isl_pw_aff_union_min( - __isl_take isl_pw_aff *pwaff1, - __isl_take isl_pw_aff *pwaff2); - __isl_give isl_pw_aff *isl_pw_aff_union_max( - __isl_take isl_pw_aff *pwaff1, - __isl_take isl_pw_aff *pwaff2); - __isl_give isl_pw_aff *isl_pw_aff_union_add( - __isl_take isl_pw_aff *pwaff1, - __isl_take isl_pw_aff *pwaff2); +The function C can be used to sort +Cs. The order is not strictly defined. +The current order sorts expressions that only involve +earlier dimensions before those that involve later dimensions. -The function C computes a piecewise quasi-affine -expression with a domain that is the union of those of C and -C and such that on each cell, the quasi-affine expression is -the maximum of those of C and C. If only one of -C or C is defined on a given cell, then the -associated expression is the defined one. +=back -An expression can be read from input using +=head2 Unary Operations - #include - __isl_give isl_aff *isl_aff_read_from_str( - isl_ctx *ctx, const char *str); - __isl_give isl_pw_aff *isl_pw_aff_read_from_str( - isl_ctx *ctx, const char *str); +=over -An expression can be printed using +=item * Complement - #include - __isl_give isl_printer *isl_printer_print_aff( - __isl_take isl_printer *p, __isl_keep isl_aff *aff); + __isl_give isl_set *isl_set_complement( + __isl_take isl_set *set); + __isl_give isl_map *isl_map_complement( + __isl_take isl_map *map); - __isl_give isl_printer *isl_printer_print_pw_aff( - __isl_take isl_printer *p, - __isl_keep isl_pw_aff *pwaff); +=item * Inverse map -=head2 Piecewise Multiple Quasi Affine Expressions + #include + __isl_give isl_space *isl_space_reverse( + __isl_take isl_space *space); -An C object represents a sequence of -zero or more affine expressions, all defined on the same domain space. -Similarly, an C object represents a sequence of -zero or more piecewise affine expressions. - -An C can be constructed from a single -C or an C using the -following functions. Similarly for C. + #include + __isl_give isl_basic_map *isl_basic_map_reverse( + __isl_take isl_basic_map *bmap); + __isl_give isl_map *isl_map_reverse( + __isl_take isl_map *map); - #include - __isl_give isl_multi_aff *isl_multi_aff_from_aff( - __isl_take isl_aff *aff); - __isl_give isl_multi_pw_aff *isl_multi_pw_aff_from_pw_aff( - __isl_take isl_pw_aff *pa); - __isl_give isl_multi_aff *isl_multi_aff_from_aff_list( - __isl_take isl_space *space, - __isl_take isl_aff_list *list); + #include + __isl_give isl_union_map *isl_union_map_reverse( + __isl_take isl_union_map *umap); -An empty piecewise multiple quasi affine expression (one with no cells), -the zero piecewise multiple quasi affine expression (with value zero -for each output dimension), -a piecewise multiple quasi affine expression with a single cell (with -either a universe or a specified domain) or -a zero-dimensional piecewise multiple quasi affine expression -on a given domain -can be created using the following functions. +=item * Projection - #include - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_empty( - __isl_take isl_space *space); - __isl_give isl_multi_aff *isl_multi_aff_zero( - __isl_take isl_space *space); - __isl_give isl_multi_pw_aff *isl_multi_pw_aff_zero( - __isl_take isl_space *space); - __isl_give isl_multi_aff *isl_multi_aff_identity( + #include + __isl_give isl_space *isl_space_domain( __isl_take isl_space *space); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_identity( + __isl_give isl_space *isl_space_range( __isl_take isl_space *space); - __isl_give isl_multi_pw_aff *isl_multi_pw_aff_identity( + __isl_give isl_space *isl_space_params( __isl_take isl_space *space); - __isl_give isl_pw_multi_aff * - isl_pw_multi_aff_from_multi_aff( - __isl_take isl_multi_aff *ma); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_alloc( - __isl_take isl_set *set, - __isl_take isl_multi_aff *maff); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_domain( - __isl_take isl_set *set); - __isl_give isl_union_pw_multi_aff * - isl_union_pw_multi_aff_empty( - __isl_take isl_space *space); - __isl_give isl_union_pw_multi_aff * - isl_union_pw_multi_aff_add_pw_multi_aff( - __isl_take isl_union_pw_multi_aff *upma, - __isl_take isl_pw_multi_aff *pma); - __isl_give isl_union_pw_multi_aff * - isl_union_pw_multi_aff_from_domain( - __isl_take isl_union_set *uset); + #include + __isl_give isl_local_space *isl_local_space_domain( + __isl_take isl_local_space *ls); + __isl_give isl_local_space *isl_local_space_range( + __isl_take isl_local_space *ls); -A piecewise multiple quasi affine expression can also be initialized -from an C or C, provided the C is a singleton -and the C is single-valued. -In case of a conversion from an C or an C -to an C, these properties need to hold in each space. + #include + __isl_give isl_basic_set *isl_basic_set_project_out( + __isl_take isl_basic_set *bset, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_set *isl_set_project_out(__isl_take isl_set *set, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_basic_set *isl_basic_set_params( + __isl_take isl_basic_set *bset); + __isl_give isl_set *isl_set_params(__isl_take isl_set *set); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_set( - __isl_take isl_set *set); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_map( + #include + __isl_give isl_basic_map *isl_basic_map_project_out( + __isl_take isl_basic_map *bmap, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_map *isl_map_project_out(__isl_take isl_map *map, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_basic_set *isl_basic_map_domain( + __isl_take isl_basic_map *bmap); + __isl_give isl_basic_set *isl_basic_map_range( + __isl_take isl_basic_map *bmap); + __isl_give isl_set *isl_map_params(__isl_take isl_map *map); + __isl_give isl_set *isl_map_domain( + __isl_take isl_map *bmap); + __isl_give isl_set *isl_map_range( __isl_take isl_map *map); - __isl_give isl_union_pw_multi_aff * - isl_union_pw_multi_aff_from_union_set( + #include + __isl_give isl_union_set *isl_union_set_project_out( + __isl_take isl_union_set *uset, + enum isl_dim_type type, + unsigned first, unsigned n); + __isl_give isl_set *isl_union_set_params( __isl_take isl_union_set *uset); - __isl_give isl_union_pw_multi_aff * - isl_union_pw_multi_aff_from_union_map( + +The function C can only project out +parameters. + + #include + __isl_give isl_union_map *isl_union_map_project_out( + __isl_take isl_union_map *umap, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_set *isl_union_map_params( + __isl_take isl_union_map *umap); + __isl_give isl_union_set *isl_union_map_domain( + __isl_take isl_union_map *umap); + __isl_give isl_union_set *isl_union_map_range( __isl_take isl_union_map *umap); -Multiple quasi affine expressions can be copied and freed using +The function C can only project out +parameters. #include - __isl_give isl_multi_aff *isl_multi_aff_copy( - __isl_keep isl_multi_aff *maff); - void *isl_multi_aff_free(__isl_take isl_multi_aff *maff); - - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_copy( - __isl_keep isl_pw_multi_aff *pma); - void *isl_pw_multi_aff_free( + __isl_give isl_aff *isl_aff_project_domain_on_params( + __isl_take isl_aff *aff); + __isl_give isl_pw_multi_aff * + isl_pw_multi_aff_project_domain_on_params( __isl_take isl_pw_multi_aff *pma); - - __isl_give isl_union_pw_multi_aff * - isl_union_pw_multi_aff_copy( - __isl_keep isl_union_pw_multi_aff *upma); - void *isl_union_pw_multi_aff_free( - __isl_take isl_union_pw_multi_aff *upma); - - __isl_give isl_multi_pw_aff *isl_multi_pw_aff_copy( - __isl_keep isl_multi_pw_aff *mpa); - void *isl_multi_pw_aff_free( + __isl_give isl_set *isl_pw_aff_domain( + __isl_take isl_pw_aff *pwaff); + __isl_give isl_set *isl_pw_multi_aff_domain( + __isl_take isl_pw_multi_aff *pma); + __isl_give isl_set *isl_multi_pw_aff_domain( __isl_take isl_multi_pw_aff *mpa); + __isl_give isl_union_set *isl_union_pw_aff_domain( + __isl_take isl_union_pw_aff *upa); + __isl_give isl_union_set *isl_union_pw_multi_aff_domain( + __isl_take isl_union_pw_multi_aff *upma); + __isl_give isl_union_set * + isl_multi_union_pw_aff_domain( + __isl_take isl_multi_union_pw_aff *mupa); + __isl_give isl_set *isl_pw_aff_params( + __isl_take isl_pw_aff *pwa); -The expression can be inspected using +The function C requires its +input to have at least one set dimension. - #include - isl_ctx *isl_multi_aff_get_ctx( - __isl_keep isl_multi_aff *maff); - isl_ctx *isl_pw_multi_aff_get_ctx( - __isl_keep isl_pw_multi_aff *pma); - isl_ctx *isl_union_pw_multi_aff_get_ctx( - __isl_keep isl_union_pw_multi_aff *upma); - isl_ctx *isl_multi_pw_aff_get_ctx( - __isl_keep isl_multi_pw_aff *mpa); - unsigned isl_multi_aff_dim(__isl_keep isl_multi_aff *maff, - enum isl_dim_type type); - unsigned isl_pw_multi_aff_dim( - __isl_keep isl_pw_multi_aff *pma, - enum isl_dim_type type); - unsigned isl_multi_pw_aff_dim( - __isl_keep isl_multi_pw_aff *mpa, - enum isl_dim_type type); - __isl_give isl_aff *isl_multi_aff_get_aff( - __isl_keep isl_multi_aff *multi, int pos); - __isl_give isl_pw_aff *isl_pw_multi_aff_get_pw_aff( - __isl_keep isl_pw_multi_aff *pma, int pos); - __isl_give isl_pw_aff *isl_multi_pw_aff_get_pw_aff( - __isl_keep isl_multi_pw_aff *mpa, int pos); - const char *isl_pw_multi_aff_get_dim_name( - __isl_keep isl_pw_multi_aff *pma, - enum isl_dim_type type, unsigned pos); - __isl_give isl_id *isl_pw_multi_aff_get_dim_id( - __isl_keep isl_pw_multi_aff *pma, - enum isl_dim_type type, unsigned pos); - const char *isl_multi_aff_get_tuple_name( - __isl_keep isl_multi_aff *multi, - enum isl_dim_type type); - int isl_pw_multi_aff_has_tuple_name( - __isl_keep isl_pw_multi_aff *pma, - enum isl_dim_type type); - const char *isl_pw_multi_aff_get_tuple_name( - __isl_keep isl_pw_multi_aff *pma, - enum isl_dim_type type); - int isl_pw_multi_aff_has_tuple_id( - __isl_keep isl_pw_multi_aff *pma, - enum isl_dim_type type); - __isl_give isl_id *isl_pw_multi_aff_get_tuple_id( - __isl_keep isl_pw_multi_aff *pma, - enum isl_dim_type type); + #include + __isl_give isl_qpolynomial * + isl_qpolynomial_project_domain_on_params( + __isl_take isl_qpolynomial *qp); + __isl_give isl_pw_qpolynomial * + isl_pw_qpolynomial_project_domain_on_params( + __isl_take isl_pw_qpolynomial *pwqp); + __isl_give isl_pw_qpolynomial_fold * + isl_pw_qpolynomial_fold_project_domain_on_params( + __isl_take isl_pw_qpolynomial_fold *pwf); + __isl_give isl_set *isl_pw_qpolynomial_domain( + __isl_take isl_pw_qpolynomial *pwqp); + __isl_give isl_union_set *isl_union_pw_qpolynomial_fold_domain( + __isl_take isl_union_pw_qpolynomial_fold *upwf); + __isl_give isl_union_set *isl_union_pw_qpolynomial_domain( + __isl_take isl_union_pw_qpolynomial *upwqp); - int isl_pw_multi_aff_foreach_piece( - __isl_keep isl_pw_multi_aff *pma, - int (*fn)(__isl_take isl_set *set, - __isl_take isl_multi_aff *maff, - void *user), void *user); + #include + __isl_give isl_space *isl_space_domain_map( + __isl_take isl_space *space); + __isl_give isl_space *isl_space_range_map( + __isl_take isl_space *space); - int isl_union_pw_multi_aff_foreach_pw_multi_aff( - __isl_keep isl_union_pw_multi_aff *upma, - int (*fn)(__isl_take isl_pw_multi_aff *pma, - void *user), void *user); + #include + __isl_give isl_map *isl_set_wrapped_domain_map( + __isl_take isl_set *set); + __isl_give isl_basic_map *isl_basic_map_domain_map( + __isl_take isl_basic_map *bmap); + __isl_give isl_basic_map *isl_basic_map_range_map( + __isl_take isl_basic_map *bmap); + __isl_give isl_map *isl_map_domain_map(__isl_take isl_map *map); + __isl_give isl_map *isl_map_range_map(__isl_take isl_map *map); -It can be modified using + #include + __isl_give isl_union_map *isl_union_map_domain_map( + __isl_take isl_union_map *umap); + __isl_give isl_union_pw_multi_aff * + isl_union_map_domain_map_union_pw_multi_aff( + __isl_take isl_union_map *umap); + __isl_give isl_union_map *isl_union_map_range_map( + __isl_take isl_union_map *umap); + __isl_give isl_union_map * + isl_union_set_wrapped_domain_map( + __isl_take isl_union_set *uset); - #include - __isl_give isl_multi_aff *isl_multi_aff_set_aff( - __isl_take isl_multi_aff *multi, int pos, - __isl_take isl_aff *aff); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_set_pw_aff( - __isl_take isl_pw_multi_aff *pma, unsigned pos, - __isl_take isl_pw_aff *pa); - __isl_give isl_multi_aff *isl_multi_aff_set_dim_name( - __isl_take isl_multi_aff *maff, - enum isl_dim_type type, unsigned pos, const char *s); - __isl_give isl_multi_aff *isl_multi_aff_set_tuple_name( - __isl_take isl_multi_aff *maff, - enum isl_dim_type type, const char *s); - __isl_give isl_multi_aff *isl_multi_aff_set_tuple_id( - __isl_take isl_multi_aff *maff, - enum isl_dim_type type, __isl_take isl_id *id); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_set_tuple_id( - __isl_take isl_pw_multi_aff *pma, - enum isl_dim_type type, __isl_take isl_id *id); +The functions above construct a (basic, regular or union) relation +that maps (a wrapped version of) the input relation to its domain or range. +C maps the input set to the domain +of its wrapped relation. - __isl_give isl_multi_pw_aff * - isl_multi_pw_aff_set_dim_name( - __isl_take isl_multi_pw_aff *mpa, - enum isl_dim_type type, unsigned pos, const char *s); - __isl_give isl_multi_pw_aff * - isl_multi_pw_aff_set_tuple_name( - __isl_take isl_multi_pw_aff *mpa, - enum isl_dim_type type, const char *s); +=item * Elimination - __isl_give isl_multi_aff *isl_multi_aff_insert_dims( - __isl_take isl_multi_aff *ma, - enum isl_dim_type type, unsigned first, unsigned n); - __isl_give isl_multi_aff *isl_multi_aff_add_dims( - __isl_take isl_multi_aff *ma, - enum isl_dim_type type, unsigned n); - __isl_give isl_multi_aff *isl_multi_aff_drop_dims( - __isl_take isl_multi_aff *maff, - enum isl_dim_type type, unsigned first, unsigned n); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_drop_dims( - __isl_take isl_pw_multi_aff *pma, - enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_basic_set *isl_basic_set_eliminate( + __isl_take isl_basic_set *bset, + enum isl_dim_type type, + unsigned first, unsigned n); + __isl_give isl_set *isl_set_eliminate( + __isl_take isl_set *set, enum isl_dim_type type, + unsigned first, unsigned n); + __isl_give isl_basic_map *isl_basic_map_eliminate( + __isl_take isl_basic_map *bmap, + enum isl_dim_type type, + unsigned first, unsigned n); + __isl_give isl_map *isl_map_eliminate( + __isl_take isl_map *map, enum isl_dim_type type, + unsigned first, unsigned n); - __isl_give isl_multi_pw_aff *isl_multi_pw_aff_insert_dims( - __isl_take isl_multi_pw_aff *mpa, - enum isl_dim_type type, unsigned first, unsigned n); - __isl_give isl_multi_pw_aff *isl_multi_pw_aff_add_dims( - __isl_take isl_multi_pw_aff *mpa, - enum isl_dim_type type, unsigned n); +Eliminate the coefficients for the given dimensions from the constraints, +without removing the dimensions. -To check whether two multiple affine expressions are -obviously equal to each other, use +=item * Constructing a set from a parameter domain - int isl_multi_aff_plain_is_equal(__isl_keep isl_multi_aff *maff1, - __isl_keep isl_multi_aff *maff2); - int isl_pw_multi_aff_plain_is_equal( - __isl_keep isl_pw_multi_aff *pma1, - __isl_keep isl_pw_multi_aff *pma2); +A zero-dimensional space or (basic) set can be constructed +on a given parameter domain using the following functions. -Operations include + #include + __isl_give isl_space *isl_space_set_from_params( + __isl_take isl_space *space); - #include - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_union_lexmin( - __isl_take isl_pw_multi_aff *pma1, - __isl_take isl_pw_multi_aff *pma2); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_union_lexmax( - __isl_take isl_pw_multi_aff *pma1, - __isl_take isl_pw_multi_aff *pma2); - __isl_give isl_multi_aff *isl_multi_aff_add( - __isl_take isl_multi_aff *maff1, - __isl_take isl_multi_aff *maff2); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_add( - __isl_take isl_pw_multi_aff *pma1, - __isl_take isl_pw_multi_aff *pma2); - __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_add( - __isl_take isl_union_pw_multi_aff *upma1, - __isl_take isl_union_pw_multi_aff *upma2); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_union_add( - __isl_take isl_pw_multi_aff *pma1, - __isl_take isl_pw_multi_aff *pma2); - __isl_give isl_multi_aff *isl_multi_aff_sub( - __isl_take isl_multi_aff *ma1, - __isl_take isl_multi_aff *ma2); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_sub( - __isl_take isl_pw_multi_aff *pma1, - __isl_take isl_pw_multi_aff *pma2); - __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_sub( - __isl_take isl_union_pw_multi_aff *upma1, - __isl_take isl_union_pw_multi_aff *upma2); + #include + __isl_give isl_basic_set *isl_basic_set_from_params( + __isl_take isl_basic_set *bset); + __isl_give isl_set *isl_set_from_params( + __isl_take isl_set *set); -C subtracts the second argument from the first. +=item * Constructing a relation from a set - __isl_give isl_multi_aff *isl_multi_aff_scale( - __isl_take isl_multi_aff *maff, - isl_int f); - __isl_give isl_multi_aff *isl_multi_aff_scale_val( - __isl_take isl_multi_aff *ma, - __isl_take isl_val *v); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_val( - __isl_take isl_pw_multi_aff *pma, - __isl_take isl_val *v); - __isl_give isl_multi_pw_aff *isl_multi_pw_aff_scale_val( - __isl_take isl_multi_pw_aff *mpa, - __isl_take isl_val *v); - __isl_give isl_multi_aff *isl_multi_aff_scale_multi_val( - __isl_take isl_multi_aff *ma, - __isl_take isl_multi_val *mv); - __isl_give isl_pw_multi_aff * - isl_pw_multi_aff_scale_multi_val( - __isl_take isl_pw_multi_aff *pma, - __isl_take isl_multi_val *mv); - __isl_give isl_multi_pw_aff * - isl_multi_pw_aff_scale_multi_val( - __isl_take isl_multi_pw_aff *mpa, - __isl_take isl_multi_val *mv); - __isl_give isl_union_pw_multi_aff * - isl_union_pw_multi_aff_scale_multi_val( - __isl_take isl_union_pw_multi_aff *upma, - __isl_take isl_multi_val *mv); +Create a relation with the given set as domain or range. +The range or domain of the created relation is a zero-dimensional +flat anonymous space. -C scales the elements of C -by the corresponding elements of C. + #include + __isl_give isl_space *isl_space_from_domain( + __isl_take isl_space *space); + __isl_give isl_space *isl_space_from_range( + __isl_take isl_space *space); + __isl_give isl_space *isl_space_map_from_set( + __isl_take isl_space *space); + __isl_give isl_space *isl_space_map_from_domain_and_range( + __isl_take isl_space *domain, + __isl_take isl_space *range); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_params( - __isl_take isl_pw_multi_aff *pma, + #include + __isl_give isl_local_space *isl_local_space_from_domain( + __isl_take isl_local_space *ls); + + #include + __isl_give isl_map *isl_map_from_domain( __isl_take isl_set *set); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_domain( - __isl_take isl_pw_multi_aff *pma, + __isl_give isl_map *isl_map_from_range( + __isl_take isl_set *set); + + #include + __isl_give isl_multi_val *isl_multi_val_from_range( + __isl_take isl_multi_val *mv); + + #include + __isl_give isl_multi_aff *isl_multi_aff_from_range( + __isl_take isl_multi_aff *ma); + __isl_give isl_pw_aff *isl_pw_aff_from_range( + __isl_take isl_pw_aff *pwa); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_from_range( + __isl_take isl_multi_pw_aff *mpa); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_from_range( + __isl_take isl_multi_union_pw_aff *mupa); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_domain( __isl_take isl_set *set); __isl_give isl_union_pw_multi_aff * - isl_union_pw_multi_aff_intersect_domain( - __isl_take isl_union_pw_multi_aff *upma, + isl_union_pw_multi_aff_from_domain( __isl_take isl_union_set *uset); - __isl_give isl_multi_aff *isl_multi_aff_lift( - __isl_take isl_multi_aff *maff, - __isl_give isl_local_space **ls); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_coalesce( - __isl_take isl_pw_multi_aff *pma); - __isl_give isl_multi_aff *isl_multi_aff_align_params( - __isl_take isl_multi_aff *multi, - __isl_take isl_space *model); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_align_params( - __isl_take isl_pw_multi_aff *pma, - __isl_take isl_space *model); - __isl_give isl_pw_multi_aff * - isl_pw_multi_aff_project_domain_on_params( - __isl_take isl_pw_multi_aff *pma); - __isl_give isl_multi_aff *isl_multi_aff_gist_params( - __isl_take isl_multi_aff *maff, - __isl_take isl_set *context); - __isl_give isl_multi_aff *isl_multi_aff_gist( - __isl_take isl_multi_aff *maff, - __isl_take isl_set *context); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_gist_params( - __isl_take isl_pw_multi_aff *pma, - __isl_take isl_set *set); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_gist( - __isl_take isl_pw_multi_aff *pma, - __isl_take isl_set *set); - __isl_give isl_set *isl_pw_multi_aff_domain( - __isl_take isl_pw_multi_aff *pma); - __isl_give isl_union_set *isl_union_pw_multi_aff_domain( - __isl_take isl_union_pw_multi_aff *upma); - __isl_give isl_multi_aff *isl_multi_aff_range_splice( - __isl_take isl_multi_aff *ma1, unsigned pos, - __isl_take isl_multi_aff *ma2); - __isl_give isl_multi_aff *isl_multi_aff_splice( - __isl_take isl_multi_aff *ma1, - unsigned in_pos, unsigned out_pos, - __isl_take isl_multi_aff *ma2); - __isl_give isl_multi_aff *isl_multi_aff_range_product( - __isl_take isl_multi_aff *ma1, - __isl_take isl_multi_aff *ma2); - __isl_give isl_multi_aff *isl_multi_aff_flat_range_product( - __isl_take isl_multi_aff *ma1, - __isl_take isl_multi_aff *ma2); - __isl_give isl_multi_aff *isl_multi_aff_product( - __isl_take isl_multi_aff *ma1, - __isl_take isl_multi_aff *ma2); - __isl_give isl_pw_multi_aff * - isl_pw_multi_aff_range_product( - __isl_take isl_pw_multi_aff *pma1, - __isl_take isl_pw_multi_aff *pma2); - __isl_give isl_pw_multi_aff * - isl_pw_multi_aff_flat_range_product( - __isl_take isl_pw_multi_aff *pma1, - __isl_take isl_pw_multi_aff *pma2); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_product( - __isl_take isl_pw_multi_aff *pma1, - __isl_take isl_pw_multi_aff *pma2); - __isl_give isl_union_pw_multi_aff * - isl_union_pw_multi_aff_flat_range_product( - __isl_take isl_union_pw_multi_aff *upma1, - __isl_take isl_union_pw_multi_aff *upma2); - __isl_give isl_multi_pw_aff * - isl_multi_pw_aff_range_splice( - __isl_take isl_multi_pw_aff *mpa1, unsigned pos, - __isl_take isl_multi_pw_aff *mpa2); - __isl_give isl_multi_pw_aff *isl_multi_pw_aff_splice( - __isl_take isl_multi_pw_aff *mpa1, - unsigned in_pos, unsigned out_pos, - __isl_take isl_multi_pw_aff *mpa2); - __isl_give isl_multi_pw_aff * - isl_multi_pw_aff_range_product( - __isl_take isl_multi_pw_aff *mpa1, - __isl_take isl_multi_pw_aff *mpa2); - __isl_give isl_multi_pw_aff * - isl_multi_pw_aff_flat_range_product( - __isl_take isl_multi_pw_aff *mpa1, - __isl_take isl_multi_pw_aff *mpa2); -If the C argument of C is not C, -then it is assigned the local space that lies at the basis of -the lifting applied. +=item * Slicing + + #include + __isl_give isl_basic_set *isl_basic_set_fix_si( + __isl_take isl_basic_set *bset, + enum isl_dim_type type, unsigned pos, int value); + __isl_give isl_basic_set *isl_basic_set_fix_val( + __isl_take isl_basic_set *bset, + enum isl_dim_type type, unsigned pos, + __isl_take isl_val *v); + __isl_give isl_set *isl_set_fix_si(__isl_take isl_set *set, + enum isl_dim_type type, unsigned pos, int value); + __isl_give isl_set *isl_set_fix_val( + __isl_take isl_set *set, + enum isl_dim_type type, unsigned pos, + __isl_take isl_val *v); + + #include + __isl_give isl_basic_map *isl_basic_map_fix_si( + __isl_take isl_basic_map *bmap, + enum isl_dim_type type, unsigned pos, int value); + __isl_give isl_basic_map *isl_basic_map_fix_val( + __isl_take isl_basic_map *bmap, + enum isl_dim_type type, unsigned pos, + __isl_take isl_val *v); + __isl_give isl_map *isl_map_fix_si(__isl_take isl_map *map, + enum isl_dim_type type, unsigned pos, int value); + __isl_give isl_map *isl_map_fix_val( + __isl_take isl_map *map, + enum isl_dim_type type, unsigned pos, + __isl_take isl_val *v); #include - __isl_give isl_multi_aff *isl_multi_aff_pullback_multi_aff( - __isl_take isl_multi_aff *ma1, - __isl_take isl_multi_aff *ma2); - __isl_give isl_pw_multi_aff * - isl_pw_multi_aff_pullback_multi_aff( + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_fix_si( __isl_take isl_pw_multi_aff *pma, - __isl_take isl_multi_aff *ma); - __isl_give isl_pw_multi_aff * - isl_pw_multi_aff_pullback_pw_multi_aff( - __isl_take isl_pw_multi_aff *pma1, - __isl_take isl_pw_multi_aff *pma2); + enum isl_dim_type type, unsigned pos, int value); -The function C precomposes C by C. -In other words, C is plugged -into C. + #include + __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_fix_val( + __isl_take isl_pw_qpolynomial *pwqp, + enum isl_dim_type type, unsigned n, + __isl_take isl_val *v); - __isl_give isl_set *isl_multi_aff_lex_le_set( - __isl_take isl_multi_aff *ma1, - __isl_take isl_multi_aff *ma2); - __isl_give isl_set *isl_multi_aff_lex_ge_set( - __isl_take isl_multi_aff *ma1, - __isl_take isl_multi_aff *ma2); +Intersect the set, relation or function domain +with the hyperplane where the given +dimension has the fixed given value. -The function C returns a set -containing those elements in the shared domain space -where C is lexicographically smaller than or -equal to C. + __isl_give isl_basic_map *isl_basic_map_lower_bound_si( + __isl_take isl_basic_map *bmap, + enum isl_dim_type type, unsigned pos, int value); + __isl_give isl_basic_map *isl_basic_map_upper_bound_si( + __isl_take isl_basic_map *bmap, + enum isl_dim_type type, unsigned pos, int value); + __isl_give isl_set *isl_set_lower_bound_si( + __isl_take isl_set *set, + enum isl_dim_type type, unsigned pos, int value); + __isl_give isl_set *isl_set_lower_bound_val( + __isl_take isl_set *set, + enum isl_dim_type type, unsigned pos, + __isl_take isl_val *value); + __isl_give isl_map *isl_map_lower_bound_si( + __isl_take isl_map *map, + enum isl_dim_type type, unsigned pos, int value); + __isl_give isl_set *isl_set_upper_bound_si( + __isl_take isl_set *set, + enum isl_dim_type type, unsigned pos, int value); + __isl_give isl_set *isl_set_upper_bound_val( + __isl_take isl_set *set, + enum isl_dim_type type, unsigned pos, + __isl_take isl_val *value); + __isl_give isl_map *isl_map_upper_bound_si( + __isl_take isl_map *map, + enum isl_dim_type type, unsigned pos, int value); -An expression can be read from input using +Intersect the set or relation with the half-space where the given +dimension has a value bounded by the fixed given integer value. - #include - __isl_give isl_multi_aff *isl_multi_aff_read_from_str( - isl_ctx *ctx, const char *str); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_read_from_str( - isl_ctx *ctx, const char *str); - __isl_give isl_union_pw_multi_aff * - isl_union_pw_multi_aff_read_from_str( - isl_ctx *ctx, const char *str); + __isl_give isl_set *isl_set_equate(__isl_take isl_set *set, + enum isl_dim_type type1, int pos1, + enum isl_dim_type type2, int pos2); + __isl_give isl_basic_map *isl_basic_map_equate( + __isl_take isl_basic_map *bmap, + enum isl_dim_type type1, int pos1, + enum isl_dim_type type2, int pos2); + __isl_give isl_map *isl_map_equate(__isl_take isl_map *map, + enum isl_dim_type type1, int pos1, + enum isl_dim_type type2, int pos2); -An expression can be printed using +Intersect the set or relation with the hyperplane where the given +dimensions are equal to each other. - #include - __isl_give isl_printer *isl_printer_print_multi_aff( - __isl_take isl_printer *p, - __isl_keep isl_multi_aff *maff); - __isl_give isl_printer *isl_printer_print_pw_multi_aff( - __isl_take isl_printer *p, - __isl_keep isl_pw_multi_aff *pma); - __isl_give isl_printer *isl_printer_print_union_pw_multi_aff( - __isl_take isl_printer *p, - __isl_keep isl_union_pw_multi_aff *upma); - __isl_give isl_printer *isl_printer_print_multi_pw_aff( - __isl_take isl_printer *p, - __isl_keep isl_multi_pw_aff *mpa); + __isl_give isl_map *isl_map_oppose(__isl_take isl_map *map, + enum isl_dim_type type1, int pos1, + enum isl_dim_type type2, int pos2); -=head2 Points +Intersect the relation with the hyperplane where the given +dimensions have opposite values. -Points are elements of a set. They can be used to construct -simple sets (boxes) or they can be used to represent the -individual elements of a set. -The zero point (the origin) can be created using + __isl_give isl_map *isl_map_order_le( + __isl_take isl_map *map, + enum isl_dim_type type1, int pos1, + enum isl_dim_type type2, int pos2); + __isl_give isl_basic_map *isl_basic_map_order_ge( + __isl_take isl_basic_map *bmap, + enum isl_dim_type type1, int pos1, + enum isl_dim_type type2, int pos2); + __isl_give isl_map *isl_map_order_ge( + __isl_take isl_map *map, + enum isl_dim_type type1, int pos1, + enum isl_dim_type type2, int pos2); + __isl_give isl_map *isl_map_order_lt(__isl_take isl_map *map, + enum isl_dim_type type1, int pos1, + enum isl_dim_type type2, int pos2); + __isl_give isl_basic_map *isl_basic_map_order_gt( + __isl_take isl_basic_map *bmap, + enum isl_dim_type type1, int pos1, + enum isl_dim_type type2, int pos2); + __isl_give isl_map *isl_map_order_gt(__isl_take isl_map *map, + enum isl_dim_type type1, int pos1, + enum isl_dim_type type2, int pos2); - __isl_give isl_point *isl_point_zero(__isl_take isl_space *space); +Intersect the relation with the half-space where the given +dimensions satisfy the given ordering. -The coordinates of a point can be inspected, set and changed -using +=item * Locus - int isl_point_get_coordinate(__isl_keep isl_point *pnt, - enum isl_dim_type type, int pos, isl_int *v); - __isl_give isl_val *isl_point_get_coordinate_val( - __isl_keep isl_point *pnt, - enum isl_dim_type type, int pos); - __isl_give isl_point *isl_point_set_coordinate( - __isl_take isl_point *pnt, - enum isl_dim_type type, int pos, isl_int v); - __isl_give isl_point *isl_point_set_coordinate_val( - __isl_take isl_point *pnt, - enum isl_dim_type type, int pos, - __isl_take isl_val *v); + #include + __isl_give isl_basic_set *isl_aff_zero_basic_set( + __isl_take isl_aff *aff); + __isl_give isl_basic_set *isl_aff_neg_basic_set( + __isl_take isl_aff *aff); + __isl_give isl_set *isl_pw_aff_pos_set( + __isl_take isl_pw_aff *pa); + __isl_give isl_set *isl_pw_aff_nonneg_set( + __isl_take isl_pw_aff *pwaff); + __isl_give isl_set *isl_pw_aff_zero_set( + __isl_take isl_pw_aff *pwaff); + __isl_give isl_set *isl_pw_aff_non_zero_set( + __isl_take isl_pw_aff *pwaff); + __isl_give isl_union_set * + isl_union_pw_aff_zero_union_set( + __isl_take isl_union_pw_aff *upa); + __isl_give isl_union_set * + isl_multi_union_pw_aff_zero_union_set( + __isl_take isl_multi_union_pw_aff *mupa); - __isl_give isl_point *isl_point_add_ui( - __isl_take isl_point *pnt, - enum isl_dim_type type, int pos, unsigned val); - __isl_give isl_point *isl_point_sub_ui( - __isl_take isl_point *pnt, - enum isl_dim_type type, int pos, unsigned val); +The function C returns a basic set +containing those elements in the domain space +of C where C is negative. +The function C returns a set +containing those elements in the domain +of C where C is non-negative. +The function C +returns a union set containing those elements +in the domains of its elements where they are all zero. -Other properties can be obtained using +=item * Identity - isl_ctx *isl_point_get_ctx(__isl_keep isl_point *pnt); + __isl_give isl_map *isl_set_identity( + __isl_take isl_set *set); + __isl_give isl_union_map *isl_union_set_identity( + __isl_take isl_union_set *uset); + __isl_give isl_union_pw_multi_aff * + isl_union_set_identity_union_pw_multi_aff( + __isl_take isl_union_set *uset); -Points can be copied or freed using +Construct an identity relation on the given (union) set. - __isl_give isl_point *isl_point_copy( - __isl_keep isl_point *pnt); - void isl_point_free(__isl_take isl_point *pnt); +=item * Function Extraction -A singleton set can be created from a point using +A piecewise quasi affine expression that is equal to 1 on a set +and 0 outside the set can be created using the following function. - __isl_give isl_basic_set *isl_basic_set_from_point( - __isl_take isl_point *pnt); - __isl_give isl_set *isl_set_from_point( - __isl_take isl_point *pnt); + #include + __isl_give isl_pw_aff *isl_set_indicator_function( + __isl_take isl_set *set); -and a box can be created from two opposite extremal points using +A piecewise multiple quasi affine expression can be extracted +from an C or C, provided the C is a singleton +and the C is single-valued. +In case of a conversion from an C +to an C, these properties need to hold +in each domain space. +A conversion to a C additionally +requires that the input is non-empty and involves only a single +range space. - __isl_give isl_basic_set *isl_basic_set_box_from_points( - __isl_take isl_point *pnt1, - __isl_take isl_point *pnt2); - __isl_give isl_set *isl_set_box_from_points( - __isl_take isl_point *pnt1, - __isl_take isl_point *pnt2); + #include + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_set( + __isl_take isl_set *set); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_map( + __isl_take isl_map *map); -All elements of a B (union) set can be enumerated using -the following functions. + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_from_union_set( + __isl_take isl_union_set *uset); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_from_union_map( + __isl_take isl_union_map *umap); - int isl_set_foreach_point(__isl_keep isl_set *set, - int (*fn)(__isl_take isl_point *pnt, void *user), - void *user); - int isl_union_set_foreach_point(__isl_keep isl_union_set *uset, - int (*fn)(__isl_take isl_point *pnt, void *user), - void *user); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_from_union_map( + __isl_take isl_union_map *umap); -The function C is called for each integer point in -C with as second argument the last argument of -the C call. The function C -should return C<0> on success and C<-1> on failure. -In the latter case, C will stop -enumerating and return C<-1> as well. -If the enumeration is performed successfully and to completion, -then C returns C<0>. +=item * Deltas -To obtain a single point of a (basic) set, use + __isl_give isl_basic_set *isl_basic_map_deltas( + __isl_take isl_basic_map *bmap); + __isl_give isl_set *isl_map_deltas(__isl_take isl_map *map); + __isl_give isl_union_set *isl_union_map_deltas( + __isl_take isl_union_map *umap); - __isl_give isl_point *isl_basic_set_sample_point( - __isl_take isl_basic_set *bset); - __isl_give isl_point *isl_set_sample_point( - __isl_take isl_set *set); +These functions return a (basic) set containing the differences +between image elements and corresponding domain elements in the input. -If C does not contain any (integer) points, then the -resulting point will be ``void'', a property that can be -tested using + __isl_give isl_basic_map *isl_basic_map_deltas_map( + __isl_take isl_basic_map *bmap); + __isl_give isl_map *isl_map_deltas_map( + __isl_take isl_map *map); + __isl_give isl_union_map *isl_union_map_deltas_map( + __isl_take isl_union_map *umap); - int isl_point_is_void(__isl_keep isl_point *pnt); +The functions above construct a (basic, regular or union) relation +that maps (a wrapped version of) the input relation to its delta set. -=head2 Piecewise Quasipolynomials +=item * Coalescing -A piecewise quasipolynomial is a particular kind of function that maps -a parametric point to a rational value. -More specifically, a quasipolynomial is a polynomial expression in greatest -integer parts of affine expressions of parameters and variables. -A piecewise quasipolynomial is a subdivision of a given parametric -domain into disjoint cells with a quasipolynomial associated to -each cell. The value of the piecewise quasipolynomial at a given -point is the value of the quasipolynomial associated to the cell -that contains the point. Outside of the union of cells, -the value is assumed to be zero. -For example, the piecewise quasipolynomial +Simplify the representation of a set, relation or functions by trying +to combine pairs of basic sets or relations into a single +basic set or relation. - [n] -> { [x] -> ((1 + n) - x) : x <= n and x >= 0 } + #include + __isl_give isl_set *isl_set_coalesce(__isl_take isl_set *set); -maps C to C<1 + n - x> for values of C between C<0> and C. -A given piecewise quasipolynomial has a fixed domain dimension. -Union piecewise quasipolynomials are used to contain piecewise quasipolynomials -defined over different domains. -Piecewise quasipolynomials are mainly used by the C -library for representing the number of elements in a parametric set or map. -For example, the piecewise quasipolynomial above represents -the number of points in the map + #include + __isl_give isl_map *isl_map_coalesce(__isl_take isl_map *map); - [n] -> { [x] -> [y] : x,y >= 0 and 0 <= x + y <= n } + #include + __isl_give isl_union_set *isl_union_set_coalesce( + __isl_take isl_union_set *uset); -=head3 Input and Output + #include + __isl_give isl_union_map *isl_union_map_coalesce( + __isl_take isl_union_map *umap); -Piecewise quasipolynomials can be read from input using + #include + __isl_give isl_pw_aff *isl_pw_aff_coalesce( + __isl_take isl_pw_aff *pwqp); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_coalesce( + __isl_take isl_pw_multi_aff *pma); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_coalesce( + __isl_take isl_multi_pw_aff *mpa); + __isl_give isl_union_pw_aff *isl_union_pw_aff_coalesce( + __isl_take isl_union_pw_aff *upa); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_coalesce( + __isl_take isl_union_pw_multi_aff *upma); + #include + __isl_give isl_pw_qpolynomial_fold * + isl_pw_qpolynomial_fold_coalesce( + __isl_take isl_pw_qpolynomial_fold *pwf); __isl_give isl_union_pw_qpolynomial * - isl_union_pw_qpolynomial_read_from_str( - isl_ctx *ctx, const char *str); + isl_union_pw_qpolynomial_coalesce( + __isl_take isl_union_pw_qpolynomial *upwqp); + __isl_give isl_union_pw_qpolynomial_fold * + isl_union_pw_qpolynomial_fold_coalesce( + __isl_take isl_union_pw_qpolynomial_fold *upwf); -Quasipolynomials and piecewise quasipolynomials can be printed -using the following functions. +One of the methods for combining pairs of basic sets or relations +can result in coefficients that are much larger than those that appear +in the constraints of the input. By default, the coefficients are +not allowed to grow larger, but this can be changed by unsetting +the following option. - __isl_give isl_printer *isl_printer_print_qpolynomial( - __isl_take isl_printer *p, - __isl_keep isl_qpolynomial *qp); + isl_stat isl_options_set_coalesce_bounded_wrapping( + isl_ctx *ctx, int val); + int isl_options_get_coalesce_bounded_wrapping( + isl_ctx *ctx); - __isl_give isl_printer *isl_printer_print_pw_qpolynomial( - __isl_take isl_printer *p, - __isl_keep isl_pw_qpolynomial *pwqp); +=item * Detecting equalities - __isl_give isl_printer *isl_printer_print_union_pw_qpolynomial( - __isl_take isl_printer *p, - __isl_keep isl_union_pw_qpolynomial *upwqp); + __isl_give isl_basic_set *isl_basic_set_detect_equalities( + __isl_take isl_basic_set *bset); + __isl_give isl_basic_map *isl_basic_map_detect_equalities( + __isl_take isl_basic_map *bmap); + __isl_give isl_set *isl_set_detect_equalities( + __isl_take isl_set *set); + __isl_give isl_map *isl_map_detect_equalities( + __isl_take isl_map *map); + __isl_give isl_union_set *isl_union_set_detect_equalities( + __isl_take isl_union_set *uset); + __isl_give isl_union_map *isl_union_map_detect_equalities( + __isl_take isl_union_map *umap); -The output format of the printer -needs to be set to either C or C. -For C, only C -is supported. -In case of printing in C, the user may want -to set the names of all dimensions +Simplify the representation of a set or relation by detecting implicit +equalities. - __isl_give isl_qpolynomial *isl_qpolynomial_set_dim_name( - __isl_take isl_qpolynomial *qp, - enum isl_dim_type type, unsigned pos, - const char *s); - __isl_give isl_pw_qpolynomial * - isl_pw_qpolynomial_set_dim_name( - __isl_take isl_pw_qpolynomial *pwqp, - enum isl_dim_type type, unsigned pos, - const char *s); +=item * Removing redundant constraints -=head3 Creating New (Piecewise) Quasipolynomials + #include + __isl_give isl_basic_set *isl_basic_set_remove_redundancies( + __isl_take isl_basic_set *bset); + __isl_give isl_set *isl_set_remove_redundancies( + __isl_take isl_set *set); -Some simple quasipolynomials can be created using the following functions. -More complicated quasipolynomials can be created by applying -operations such as addition and multiplication -on the resulting quasipolynomials + #include + __isl_give isl_union_set * + isl_union_set_remove_redundancies( + __isl_take isl_union_set *uset); - __isl_give isl_qpolynomial *isl_qpolynomial_zero_on_domain( - __isl_take isl_space *domain); - __isl_give isl_qpolynomial *isl_qpolynomial_one_on_domain( - __isl_take isl_space *domain); - __isl_give isl_qpolynomial *isl_qpolynomial_infty_on_domain( - __isl_take isl_space *domain); - __isl_give isl_qpolynomial *isl_qpolynomial_neginfty_on_domain( - __isl_take isl_space *domain); - __isl_give isl_qpolynomial *isl_qpolynomial_nan_on_domain( - __isl_take isl_space *domain); - __isl_give isl_qpolynomial *isl_qpolynomial_rat_cst_on_domain( - __isl_take isl_space *domain, - const isl_int n, const isl_int d); - __isl_give isl_qpolynomial *isl_qpolynomial_val_on_domain( - __isl_take isl_space *domain, - __isl_take isl_val *val); - __isl_give isl_qpolynomial *isl_qpolynomial_var_on_domain( - __isl_take isl_space *domain, - enum isl_dim_type type, unsigned pos); - __isl_give isl_qpolynomial *isl_qpolynomial_from_aff( - __isl_take isl_aff *aff); + #include + __isl_give isl_basic_map *isl_basic_map_remove_redundancies( + __isl_take isl_basic_map *bmap); + __isl_give isl_map *isl_map_remove_redundancies( + __isl_take isl_map *map); -Note that the space in which a quasipolynomial lives is a map space -with a one-dimensional range. The C argument in some of -the functions above corresponds to the domain of this map space. + #include + __isl_give isl_union_map * + isl_union_map_remove_redundancies( + __isl_take isl_union_map *umap); -The zero piecewise quasipolynomial or a piecewise quasipolynomial -with a single cell can be created using the following functions. -Multiple of these single cell piecewise quasipolynomials can -be combined to create more complicated piecewise quasipolynomials. +=item * Convex hull - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_zero( - __isl_take isl_space *space); - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_alloc( - __isl_take isl_set *set, - __isl_take isl_qpolynomial *qp); - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_from_qpolynomial( - __isl_take isl_qpolynomial *qp); - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_from_pw_aff( - __isl_take isl_pw_aff *pwaff); + __isl_give isl_basic_set *isl_set_convex_hull( + __isl_take isl_set *set); + __isl_give isl_basic_map *isl_map_convex_hull( + __isl_take isl_map *map); - __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_zero( - __isl_take isl_space *space); - __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_from_pw_qpolynomial( - __isl_take isl_pw_qpolynomial *pwqp); - __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_add_pw_qpolynomial( - __isl_take isl_union_pw_qpolynomial *upwqp, - __isl_take isl_pw_qpolynomial *pwqp); +If the input set or relation has any existentially quantified +variables, then the result of these operations is currently undefined. -Quasipolynomials can be copied and freed again using the following -functions. +=item * Simple hull - __isl_give isl_qpolynomial *isl_qpolynomial_copy( - __isl_keep isl_qpolynomial *qp); - void *isl_qpolynomial_free(__isl_take isl_qpolynomial *qp); + #include + __isl_give isl_basic_set * + isl_set_unshifted_simple_hull( + __isl_take isl_set *set); + __isl_give isl_basic_set *isl_set_simple_hull( + __isl_take isl_set *set); + __isl_give isl_basic_set * + isl_set_unshifted_simple_hull_from_set_list( + __isl_take isl_set *set, + __isl_take isl_set_list *list); - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_copy( - __isl_keep isl_pw_qpolynomial *pwqp); - void *isl_pw_qpolynomial_free( - __isl_take isl_pw_qpolynomial *pwqp); + #include + __isl_give isl_basic_map * + isl_map_unshifted_simple_hull( + __isl_take isl_map *map); + __isl_give isl_basic_map *isl_map_simple_hull( + __isl_take isl_map *map); + __isl_give isl_basic_map * + isl_map_unshifted_simple_hull_from_map_list( + __isl_take isl_map *map, + __isl_take isl_map_list *list); - __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_copy( - __isl_keep isl_union_pw_qpolynomial *upwqp); - void *isl_union_pw_qpolynomial_free( - __isl_take isl_union_pw_qpolynomial *upwqp); + #include + __isl_give isl_union_map *isl_union_map_simple_hull( + __isl_take isl_union_map *umap); -=head3 Inspecting (Piecewise) Quasipolynomials +These functions compute a single basic set or relation +that contains the whole input set or relation. +In particular, the output is described by translates +of the constraints describing the basic sets or relations in the input. +In case of C, only the original +constraints are used, without any translation. +In case of C and +C, the +constraints are taken from the elements of the second argument. -To iterate over all piecewise quasipolynomials in a union -piecewise quasipolynomial, use the following function +=begin latex - int isl_union_pw_qpolynomial_foreach_pw_qpolynomial( - __isl_keep isl_union_pw_qpolynomial *upwqp, - int (*fn)(__isl_take isl_pw_qpolynomial *pwqp, void *user), - void *user); +(See \autoref{s:simple hull}.) -To extract the piecewise quasipolynomial in a given space from a union, use +=end latex - __isl_give isl_pw_qpolynomial * - isl_union_pw_qpolynomial_extract_pw_qpolynomial( - __isl_keep isl_union_pw_qpolynomial *upwqp, - __isl_take isl_space *space); +=item * Affine hull -To iterate over the cells in a piecewise quasipolynomial, -use either of the following two functions + __isl_give isl_basic_set *isl_basic_set_affine_hull( + __isl_take isl_basic_set *bset); + __isl_give isl_basic_set *isl_set_affine_hull( + __isl_take isl_set *set); + __isl_give isl_union_set *isl_union_set_affine_hull( + __isl_take isl_union_set *uset); + __isl_give isl_basic_map *isl_basic_map_affine_hull( + __isl_take isl_basic_map *bmap); + __isl_give isl_basic_map *isl_map_affine_hull( + __isl_take isl_map *map); + __isl_give isl_union_map *isl_union_map_affine_hull( + __isl_take isl_union_map *umap); - int isl_pw_qpolynomial_foreach_piece( - __isl_keep isl_pw_qpolynomial *pwqp, - int (*fn)(__isl_take isl_set *set, - __isl_take isl_qpolynomial *qp, - void *user), void *user); - int isl_pw_qpolynomial_foreach_lifted_piece( - __isl_keep isl_pw_qpolynomial *pwqp, - int (*fn)(__isl_take isl_set *set, - __isl_take isl_qpolynomial *qp, - void *user), void *user); +In case of union sets and relations, the affine hull is computed +per space. -As usual, the function C should return C<0> on success -and C<-1> on failure. The difference between -C and -C is that -C will first -compute unique representations for all existentially quantified -variables and then turn these existentially quantified variables -into extra set variables, adapting the associated quasipolynomial -accordingly. This means that the C passed to C -will not have any existentially quantified variables, but that -the dimensions of the sets may be different for different -invocations of C. +=item * Polyhedral hull -The constant term of a quasipolynomial can be extracted using + __isl_give isl_basic_set *isl_set_polyhedral_hull( + __isl_take isl_set *set); + __isl_give isl_basic_map *isl_map_polyhedral_hull( + __isl_take isl_map *map); + __isl_give isl_union_set *isl_union_set_polyhedral_hull( + __isl_take isl_union_set *uset); + __isl_give isl_union_map *isl_union_map_polyhedral_hull( + __isl_take isl_union_map *umap); - __isl_give isl_val *isl_qpolynomial_get_constant_val( - __isl_keep isl_qpolynomial *qp); +These functions compute a single basic set or relation +not involving any existentially quantified variables +that contains the whole input set or relation. +In case of union sets and relations, the polyhedral hull is computed +per space. -To iterate over all terms in a quasipolynomial, -use +=item * Other approximations - int isl_qpolynomial_foreach_term( - __isl_keep isl_qpolynomial *qp, - int (*fn)(__isl_take isl_term *term, - void *user), void *user); + #include + __isl_give isl_basic_set * + isl_basic_set_drop_constraints_involving_dims( + __isl_take isl_basic_set *bset, + enum isl_dim_type type, + unsigned first, unsigned n); + __isl_give isl_basic_set * + isl_basic_set_drop_constraints_not_involving_dims( + __isl_take isl_basic_set *bset, + enum isl_dim_type type, + unsigned first, unsigned n); + __isl_give isl_set * + isl_set_drop_constraints_involving_dims( + __isl_take isl_set *set, + enum isl_dim_type type, + unsigned first, unsigned n); -The terms themselves can be inspected and freed using -these functions + #include + __isl_give isl_basic_map * + isl_basic_map_drop_constraints_involving_dims( + __isl_take isl_basic_map *bmap, + enum isl_dim_type type, + unsigned first, unsigned n); + __isl_give isl_map * + isl_map_drop_constraints_involving_dims( + __isl_take isl_map *map, + enum isl_dim_type type, + unsigned first, unsigned n); - unsigned isl_term_dim(__isl_keep isl_term *term, - enum isl_dim_type type); - void isl_term_get_num(__isl_keep isl_term *term, - isl_int *n); - void isl_term_get_den(__isl_keep isl_term *term, - isl_int *d); - __isl_give isl_val *isl_term_get_coefficient_val( - __isl_keep isl_term *term); - int isl_term_get_exp(__isl_keep isl_term *term, - enum isl_dim_type type, unsigned pos); - __isl_give isl_aff *isl_term_get_div( - __isl_keep isl_term *term, unsigned pos); - void isl_term_free(__isl_take isl_term *term); +These functions drop any constraints (not) involving the specified dimensions. +Note that the result depends on the representation of the input. -Each term is a product of parameters, set variables and -integer divisions. The function C -returns the exponent of a given dimensions in the given term. -The Cs in the arguments of C -and C need to have been initialized -using C before calling these functions. + #include + __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_to_polynomial( + __isl_take isl_pw_qpolynomial *pwqp, int sign); + __isl_give isl_union_pw_qpolynomial * + isl_union_pw_qpolynomial_to_polynomial( + __isl_take isl_union_pw_qpolynomial *upwqp, int sign); -=head3 Properties of (Piecewise) Quasipolynomials +Approximate each quasipolynomial by a polynomial. If C is positive, +the polynomial will be an overapproximation. If C is negative, +it will be an underapproximation. If C is zero, the approximation +will lie somewhere in between. -To check whether a quasipolynomial is actually a constant, -use the following function. +=item * Feasibility - int isl_qpolynomial_is_cst(__isl_keep isl_qpolynomial *qp, - isl_int *n, isl_int *d); + __isl_give isl_basic_set *isl_basic_set_sample( + __isl_take isl_basic_set *bset); + __isl_give isl_basic_set *isl_set_sample( + __isl_take isl_set *set); + __isl_give isl_basic_map *isl_basic_map_sample( + __isl_take isl_basic_map *bmap); + __isl_give isl_basic_map *isl_map_sample( + __isl_take isl_map *map); -If C is a constant and if C and C are not C -then the numerator and denominator of the constant -are returned in C<*n> and C<*d>, respectively. +If the input (basic) set or relation is non-empty, then return +a singleton subset of the input. Otherwise, return an empty set. -To check whether two union piecewise quasipolynomials are -obviously equal, use +=item * Optimization - int isl_union_pw_qpolynomial_plain_is_equal( - __isl_keep isl_union_pw_qpolynomial *upwqp1, - __isl_keep isl_union_pw_qpolynomial *upwqp2); + #include + __isl_give isl_val *isl_basic_set_max_val( + __isl_keep isl_basic_set *bset, + __isl_keep isl_aff *obj); + __isl_give isl_val *isl_set_min_val( + __isl_keep isl_set *set, + __isl_keep isl_aff *obj); + __isl_give isl_val *isl_set_max_val( + __isl_keep isl_set *set, + __isl_keep isl_aff *obj); + +Compute the minimum or maximum of the integer affine expression C +over the points in C, returning the result in C. +The result is C in case of an error, the optimal value in case +there is one, negative infinity or infinity if the problem is unbounded and +NaN if the problem is empty. + +=item * Parametric optimization + + __isl_give isl_pw_aff *isl_set_dim_min( + __isl_take isl_set *set, int pos); + __isl_give isl_pw_aff *isl_set_dim_max( + __isl_take isl_set *set, int pos); + __isl_give isl_pw_aff *isl_map_dim_max( + __isl_take isl_map *map, int pos); + +Compute the minimum or maximum of the given set or output dimension +as a function of the parameters (and input dimensions), but independently +of the other set or output dimensions. +For lexicographic optimization, see L<"Lexicographic Optimization">. + +=item * Dual + +The following functions compute either the set of (rational) coefficient +values of valid constraints for the given set or the set of (rational) +values satisfying the constraints with coefficients from the given set. +Internally, these two sets of functions perform essentially the +same operations, except that the set of coefficients is assumed to +be a cone, while the set of values may be any polyhedron. +The current implementation is based on the Farkas lemma and +Fourier-Motzkin elimination, but this may change or be made optional +in future. In particular, future implementations may use different +dualization algorithms or skip the elimination step. + + __isl_give isl_basic_set *isl_basic_set_coefficients( + __isl_take isl_basic_set *bset); + __isl_give isl_basic_set *isl_set_coefficients( + __isl_take isl_set *set); + __isl_give isl_union_set *isl_union_set_coefficients( + __isl_take isl_union_set *bset); + __isl_give isl_basic_set *isl_basic_set_solutions( + __isl_take isl_basic_set *bset); + __isl_give isl_basic_set *isl_set_solutions( + __isl_take isl_set *set); + __isl_give isl_union_set *isl_union_set_solutions( + __isl_take isl_union_set *bset); + +=item * Power + + __isl_give isl_map *isl_map_fixed_power_val( + __isl_take isl_map *map, + __isl_take isl_val *exp); + __isl_give isl_union_map * + isl_union_map_fixed_power_val( + __isl_take isl_union_map *umap, + __isl_take isl_val *exp); + +Compute the given power of C, where C is assumed to be non-zero. +If the exponent C is negative, then the -C th power of the inverse +of C is computed. + + __isl_give isl_map *isl_map_power(__isl_take isl_map *map, + int *exact); + __isl_give isl_union_map *isl_union_map_power( + __isl_take isl_union_map *umap, int *exact); + +Compute a parametric representation for all positive powers I of C. +The result maps I to a nested relation corresponding to the +Ith power of C. +The result may be an overapproximation. If the result is known to be exact, +then C<*exact> is set to C<1>. + +=item * Transitive closure + + __isl_give isl_map *isl_map_transitive_closure( + __isl_take isl_map *map, int *exact); + __isl_give isl_union_map *isl_union_map_transitive_closure( + __isl_take isl_union_map *umap, int *exact); + +Compute the transitive closure of C. +The result may be an overapproximation. If the result is known to be exact, +then C<*exact> is set to C<1>. + +=item * Reaching path lengths + + __isl_give isl_map *isl_map_reaching_path_lengths( + __isl_take isl_map *map, int *exact); + +Compute a relation that maps each element in the range of C +to the lengths of all paths composed of edges in C that +end up in the given element. +The result may be an overapproximation. If the result is known to be exact, +then C<*exact> is set to C<1>. +To compute the I path length, the resulting relation +should be postprocessed by C. +In particular, if the input relation is a dependence relation +(mapping sources to sinks), then the maximal path length corresponds +to the free schedule. +Note, however, that C expects the maximum to be +finite, so if the path lengths are unbounded (possibly due to +the overapproximation), then you will get an error message. + +=item * Wrapping + + #include + __isl_give isl_space *isl_space_wrap( + __isl_take isl_space *space); + __isl_give isl_space *isl_space_unwrap( + __isl_take isl_space *space); + + #include + __isl_give isl_local_space *isl_local_space_wrap( + __isl_take isl_local_space *ls); + + #include + __isl_give isl_basic_map *isl_basic_set_unwrap( + __isl_take isl_basic_set *bset); + __isl_give isl_map *isl_set_unwrap( + __isl_take isl_set *set); + + #include + __isl_give isl_basic_set *isl_basic_map_wrap( + __isl_take isl_basic_map *bmap); + __isl_give isl_set *isl_map_wrap( + __isl_take isl_map *map); -=head3 Operations on (Piecewise) Quasipolynomials + #include + __isl_give isl_union_map *isl_union_set_unwrap( + __isl_take isl_union_set *uset); + + #include + __isl_give isl_union_set *isl_union_map_wrap( + __isl_take isl_union_map *umap); + +The input to C should +be the space of a set, while that of +C should be the space of a relation. +Conversely, the output of C is the space +of a relation, while that of C is the space of a set. + +=item * Flattening + +Remove any internal structure of domain (and range) of the given +set or relation. If there is any such internal structure in the input, +then the name of the space is also removed. + + #include + __isl_give isl_local_space * + isl_local_space_flatten_domain( + __isl_take isl_local_space *ls); + __isl_give isl_local_space * + isl_local_space_flatten_range( + __isl_take isl_local_space *ls); + + #include + __isl_give isl_basic_set *isl_basic_set_flatten( + __isl_take isl_basic_set *bset); + __isl_give isl_set *isl_set_flatten( + __isl_take isl_set *set); + + #include + __isl_give isl_basic_map *isl_basic_map_flatten_domain( + __isl_take isl_basic_map *bmap); + __isl_give isl_basic_map *isl_basic_map_flatten_range( + __isl_take isl_basic_map *bmap); + __isl_give isl_map *isl_map_flatten_range( + __isl_take isl_map *map); + __isl_give isl_map *isl_map_flatten_domain( + __isl_take isl_map *map); + __isl_give isl_basic_map *isl_basic_map_flatten( + __isl_take isl_basic_map *bmap); + __isl_give isl_map *isl_map_flatten( + __isl_take isl_map *map); + + #include + __isl_give isl_multi_val *isl_multi_val_flatten_range( + __isl_take isl_multi_val *mv); + + #include + __isl_give isl_multi_aff *isl_multi_aff_flatten_domain( + __isl_take isl_multi_aff *ma); + __isl_give isl_multi_aff *isl_multi_aff_flatten_range( + __isl_take isl_multi_aff *ma); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_flatten_range( + __isl_take isl_multi_pw_aff *mpa); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_flatten_range( + __isl_take isl_multi_union_pw_aff *mupa); + + #include + __isl_give isl_map *isl_set_flatten_map( + __isl_take isl_set *set); + +The function above constructs a relation +that maps the input set to a flattened version of the set. + +=item * Lifting + +Lift the input set to a space with extra dimensions corresponding +to the existentially quantified variables in the input. +In particular, the result lives in a wrapped map where the domain +is the original space and the range corresponds to the original +existentially quantified variables. + + #include + __isl_give isl_basic_set *isl_basic_set_lift( + __isl_take isl_basic_set *bset); + __isl_give isl_set *isl_set_lift( + __isl_take isl_set *set); + __isl_give isl_union_set *isl_union_set_lift( + __isl_take isl_union_set *uset); + +Given a local space that contains the existentially quantified +variables of a set, a basic relation that, when applied to +a basic set, has essentially the same effect as C, +can be constructed using the following function. + + #include + __isl_give isl_basic_map *isl_local_space_lifting( + __isl_take isl_local_space *ls); + + #include + __isl_give isl_multi_aff *isl_multi_aff_lift( + __isl_take isl_multi_aff *maff, + __isl_give isl_local_space **ls); + +If the C argument of C is not C, +then it is assigned the local space that lies at the basis of +the lifting applied. + +=item * Internal Product + + #include + __isl_give isl_space *isl_space_zip( + __isl_take isl_space *space); + + #include + __isl_give isl_basic_map *isl_basic_map_zip( + __isl_take isl_basic_map *bmap); + __isl_give isl_map *isl_map_zip( + __isl_take isl_map *map); + + #include + __isl_give isl_union_map *isl_union_map_zip( + __isl_take isl_union_map *umap); + +Given a relation with nested relations for domain and range, +interchange the range of the domain with the domain of the range. + +=item * Currying + + #include + __isl_give isl_space *isl_space_curry( + __isl_take isl_space *space); + __isl_give isl_space *isl_space_uncurry( + __isl_take isl_space *space); + + #include + __isl_give isl_basic_map *isl_basic_map_curry( + __isl_take isl_basic_map *bmap); + __isl_give isl_basic_map *isl_basic_map_uncurry( + __isl_take isl_basic_map *bmap); + __isl_give isl_map *isl_map_curry( + __isl_take isl_map *map); + __isl_give isl_map *isl_map_uncurry( + __isl_take isl_map *map); + + #include + __isl_give isl_union_map *isl_union_map_curry( + __isl_take isl_union_map *umap); + __isl_give isl_union_map *isl_union_map_uncurry( + __isl_take isl_union_map *umap); + +Given a relation with a nested relation for domain, +the C functions +move the range of the nested relation out of the domain +and use it as the domain of a nested relation in the range, +with the original range as range of this nested relation. +The C functions perform the inverse operation. + +=item * Aligning parameters + +Change the order of the parameters of the given set, relation +or function +such that the first parameters match those of C. +This may involve the introduction of extra parameters. +All parameters need to be named. + + #include + __isl_give isl_space *isl_space_align_params( + __isl_take isl_space *space1, + __isl_take isl_space *space2) + + #include + __isl_give isl_basic_set *isl_basic_set_align_params( + __isl_take isl_basic_set *bset, + __isl_take isl_space *model); + __isl_give isl_set *isl_set_align_params( + __isl_take isl_set *set, + __isl_take isl_space *model); + + #include + __isl_give isl_basic_map *isl_basic_map_align_params( + __isl_take isl_basic_map *bmap, + __isl_take isl_space *model); + __isl_give isl_map *isl_map_align_params( + __isl_take isl_map *map, + __isl_take isl_space *model); + + #include + __isl_give isl_multi_val *isl_multi_val_align_params( + __isl_take isl_multi_val *mv, + __isl_take isl_space *model); + + #include + __isl_give isl_aff *isl_aff_align_params( + __isl_take isl_aff *aff, + __isl_take isl_space *model); + __isl_give isl_multi_aff *isl_multi_aff_align_params( + __isl_take isl_multi_aff *multi, + __isl_take isl_space *model); + __isl_give isl_pw_aff *isl_pw_aff_align_params( + __isl_take isl_pw_aff *pwaff, + __isl_take isl_space *model); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_align_params( + __isl_take isl_pw_multi_aff *pma, + __isl_take isl_space *model); + __isl_give isl_union_pw_aff * + isl_union_pw_aff_align_params( + __isl_take isl_union_pw_aff *upa, + __isl_take isl_space *model); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_align_params( + __isl_take isl_union_pw_multi_aff *upma, + __isl_take isl_space *model); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_align_params( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_space *model); + + #include + __isl_give isl_qpolynomial *isl_qpolynomial_align_params( + __isl_take isl_qpolynomial *qp, + __isl_take isl_space *model); + +=item * Unary Arithmethic Operations + + #include + __isl_give isl_multi_val *isl_multi_val_neg( + __isl_take isl_multi_val *mv); + + #include + __isl_give isl_aff *isl_aff_neg( + __isl_take isl_aff *aff); + __isl_give isl_multi_aff *isl_multi_aff_neg( + __isl_take isl_multi_aff *ma); + __isl_give isl_pw_aff *isl_pw_aff_neg( + __isl_take isl_pw_aff *pwaff); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_neg( + __isl_take isl_pw_multi_aff *pma); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_neg( + __isl_take isl_multi_pw_aff *mpa); + __isl_give isl_union_pw_aff *isl_union_pw_aff_neg( + __isl_take isl_union_pw_aff *upa); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_neg( + __isl_take isl_union_pw_multi_aff *upma); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_neg( + __isl_take isl_multi_union_pw_aff *mupa); + __isl_give isl_aff *isl_aff_ceil( + __isl_take isl_aff *aff); + __isl_give isl_pw_aff *isl_pw_aff_ceil( + __isl_take isl_pw_aff *pwaff); + __isl_give isl_aff *isl_aff_floor( + __isl_take isl_aff *aff); + __isl_give isl_multi_aff *isl_multi_aff_floor( + __isl_take isl_multi_aff *ma); + __isl_give isl_pw_aff *isl_pw_aff_floor( + __isl_take isl_pw_aff *pwaff); + __isl_give isl_union_pw_aff *isl_union_pw_aff_floor( + __isl_take isl_union_pw_aff *upa); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_floor( + __isl_take isl_multi_union_pw_aff *mupa); + + #include + __isl_give isl_pw_aff *isl_pw_aff_list_min( + __isl_take isl_pw_aff_list *list); + __isl_give isl_pw_aff *isl_pw_aff_list_max( + __isl_take isl_pw_aff_list *list); + + #include + __isl_give isl_qpolynomial *isl_qpolynomial_neg( + __isl_take isl_qpolynomial *qp); + __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_neg( + __isl_take isl_pw_qpolynomial *pwqp); + __isl_give isl_union_pw_qpolynomial * + isl_union_pw_qpolynomial_neg( + __isl_take isl_union_pw_qpolynomial *upwqp); + __isl_give isl_qpolynomial *isl_qpolynomial_pow( + __isl_take isl_qpolynomial *qp, + unsigned exponent); + __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_pow( + __isl_take isl_pw_qpolynomial *pwqp, + unsigned exponent); + +=item * Evaluation + +The following functions evaluate a function in a point. + + #include + __isl_give isl_val *isl_pw_qpolynomial_eval( + __isl_take isl_pw_qpolynomial *pwqp, + __isl_take isl_point *pnt); + __isl_give isl_val *isl_pw_qpolynomial_fold_eval( + __isl_take isl_pw_qpolynomial_fold *pwf, + __isl_take isl_point *pnt); + __isl_give isl_val *isl_union_pw_qpolynomial_eval( + __isl_take isl_union_pw_qpolynomial *upwqp, + __isl_take isl_point *pnt); + __isl_give isl_val *isl_union_pw_qpolynomial_fold_eval( + __isl_take isl_union_pw_qpolynomial_fold *upwf, + __isl_take isl_point *pnt); + +=item * Dimension manipulation + +It is usually not advisable to directly change the (input or output) +space of a set or a relation as this removes the name and the internal +structure of the space. However, the functions below can be useful +to add new parameters, assuming +C and C +are not sufficient. + + #include + __isl_give isl_space *isl_space_add_dims( + __isl_take isl_space *space, + enum isl_dim_type type, unsigned n); + __isl_give isl_space *isl_space_insert_dims( + __isl_take isl_space *space, + enum isl_dim_type type, unsigned pos, unsigned n); + __isl_give isl_space *isl_space_drop_dims( + __isl_take isl_space *space, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_space *isl_space_move_dims( + __isl_take isl_space *space, + enum isl_dim_type dst_type, unsigned dst_pos, + enum isl_dim_type src_type, unsigned src_pos, + unsigned n); + + #include + __isl_give isl_local_space *isl_local_space_add_dims( + __isl_take isl_local_space *ls, + enum isl_dim_type type, unsigned n); + __isl_give isl_local_space *isl_local_space_insert_dims( + __isl_take isl_local_space *ls, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_local_space *isl_local_space_drop_dims( + __isl_take isl_local_space *ls, + enum isl_dim_type type, unsigned first, unsigned n); + + #include + __isl_give isl_basic_set *isl_basic_set_add_dims( + __isl_take isl_basic_set *bset, + enum isl_dim_type type, unsigned n); + __isl_give isl_set *isl_set_add_dims( + __isl_take isl_set *set, + enum isl_dim_type type, unsigned n); + __isl_give isl_basic_set *isl_basic_set_insert_dims( + __isl_take isl_basic_set *bset, + enum isl_dim_type type, unsigned pos, + unsigned n); + __isl_give isl_set *isl_set_insert_dims( + __isl_take isl_set *set, + enum isl_dim_type type, unsigned pos, unsigned n); + __isl_give isl_basic_set *isl_basic_set_move_dims( + __isl_take isl_basic_set *bset, + enum isl_dim_type dst_type, unsigned dst_pos, + enum isl_dim_type src_type, unsigned src_pos, + unsigned n); + __isl_give isl_set *isl_set_move_dims( + __isl_take isl_set *set, + enum isl_dim_type dst_type, unsigned dst_pos, + enum isl_dim_type src_type, unsigned src_pos, + unsigned n); + + #include + __isl_give isl_basic_map *isl_basic_map_add_dims( + __isl_take isl_basic_map *bmap, + enum isl_dim_type type, unsigned n); + __isl_give isl_map *isl_map_add_dims( + __isl_take isl_map *map, + enum isl_dim_type type, unsigned n); + __isl_give isl_basic_map *isl_basic_map_insert_dims( + __isl_take isl_basic_map *bmap, + enum isl_dim_type type, unsigned pos, + unsigned n); + __isl_give isl_map *isl_map_insert_dims( + __isl_take isl_map *map, + enum isl_dim_type type, unsigned pos, unsigned n); + __isl_give isl_basic_map *isl_basic_map_move_dims( + __isl_take isl_basic_map *bmap, + enum isl_dim_type dst_type, unsigned dst_pos, + enum isl_dim_type src_type, unsigned src_pos, + unsigned n); + __isl_give isl_map *isl_map_move_dims( + __isl_take isl_map *map, + enum isl_dim_type dst_type, unsigned dst_pos, + enum isl_dim_type src_type, unsigned src_pos, + unsigned n); + + #include + __isl_give isl_multi_val *isl_multi_val_insert_dims( + __isl_take isl_multi_val *mv, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_multi_val *isl_multi_val_add_dims( + __isl_take isl_multi_val *mv, + enum isl_dim_type type, unsigned n); + __isl_give isl_multi_val *isl_multi_val_drop_dims( + __isl_take isl_multi_val *mv, + enum isl_dim_type type, unsigned first, unsigned n); + + #include + __isl_give isl_aff *isl_aff_insert_dims( + __isl_take isl_aff *aff, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_multi_aff *isl_multi_aff_insert_dims( + __isl_take isl_multi_aff *ma, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_pw_aff *isl_pw_aff_insert_dims( + __isl_take isl_pw_aff *pwaff, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_insert_dims( + __isl_take isl_multi_pw_aff *mpa, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_aff *isl_aff_add_dims( + __isl_take isl_aff *aff, + enum isl_dim_type type, unsigned n); + __isl_give isl_multi_aff *isl_multi_aff_add_dims( + __isl_take isl_multi_aff *ma, + enum isl_dim_type type, unsigned n); + __isl_give isl_pw_aff *isl_pw_aff_add_dims( + __isl_take isl_pw_aff *pwaff, + enum isl_dim_type type, unsigned n); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_add_dims( + __isl_take isl_multi_pw_aff *mpa, + enum isl_dim_type type, unsigned n); + __isl_give isl_aff *isl_aff_drop_dims( + __isl_take isl_aff *aff, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_multi_aff *isl_multi_aff_drop_dims( + __isl_take isl_multi_aff *maff, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_pw_aff *isl_pw_aff_drop_dims( + __isl_take isl_pw_aff *pwaff, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_drop_dims( + __isl_take isl_pw_multi_aff *pma, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_union_pw_aff *isl_union_pw_aff_drop_dims( + __isl_take isl_union_pw_aff *upa, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_drop_dims( + __isl_take isl_union_pw_multi_aff *upma, + enum isl_dim_type type, + unsigned first, unsigned n); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_drop_dims( + __isl_take isl_multi_union_pw_aff *mupa, + enum isl_dim_type type, unsigned first, + unsigned n); + __isl_give isl_aff *isl_aff_move_dims( + __isl_take isl_aff *aff, + enum isl_dim_type dst_type, unsigned dst_pos, + enum isl_dim_type src_type, unsigned src_pos, + unsigned n); + __isl_give isl_multi_aff *isl_multi_aff_move_dims( + __isl_take isl_multi_aff *ma, + enum isl_dim_type dst_type, unsigned dst_pos, + enum isl_dim_type src_type, unsigned src_pos, + unsigned n); + __isl_give isl_pw_aff *isl_pw_aff_move_dims( + __isl_take isl_pw_aff *pa, + enum isl_dim_type dst_type, unsigned dst_pos, + enum isl_dim_type src_type, unsigned src_pos, + unsigned n); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_move_dims( + __isl_take isl_multi_pw_aff *pma, + enum isl_dim_type dst_type, unsigned dst_pos, + enum isl_dim_type src_type, unsigned src_pos, + unsigned n); + + #include + __isl_give isl_union_pw_qpolynomial * + isl_union_pw_qpolynomial_drop_dims( + __isl_take isl_union_pw_qpolynomial *upwqp, + enum isl_dim_type type, + unsigned first, unsigned n); + __isl_give isl_union_pw_qpolynomial_fold * + isl_union_pw_qpolynomial_fold_drop_dims( + __isl_take isl_union_pw_qpolynomial_fold *upwf, + enum isl_dim_type type, + unsigned first, unsigned n); + +The operations on union expressions can only manipulate parameters. + +=back + +=head2 Binary Operations + +The two arguments of a binary operation not only need to live +in the same C, they currently also need to have +the same (number of) parameters. + +=head3 Basic Operations + +=over + +=item * Intersection + + #include + __isl_give isl_local_space *isl_local_space_intersect( + __isl_take isl_local_space *ls1, + __isl_take isl_local_space *ls2); + + #include + __isl_give isl_basic_set *isl_basic_set_intersect_params( + __isl_take isl_basic_set *bset1, + __isl_take isl_basic_set *bset2); + __isl_give isl_basic_set *isl_basic_set_intersect( + __isl_take isl_basic_set *bset1, + __isl_take isl_basic_set *bset2); + __isl_give isl_basic_set *isl_basic_set_list_intersect( + __isl_take struct isl_basic_set_list *list); + __isl_give isl_set *isl_set_intersect_params( + __isl_take isl_set *set, + __isl_take isl_set *params); + __isl_give isl_set *isl_set_intersect( + __isl_take isl_set *set1, + __isl_take isl_set *set2); + + #include + __isl_give isl_basic_map *isl_basic_map_intersect_domain( + __isl_take isl_basic_map *bmap, + __isl_take isl_basic_set *bset); + __isl_give isl_basic_map *isl_basic_map_intersect_range( + __isl_take isl_basic_map *bmap, + __isl_take isl_basic_set *bset); + __isl_give isl_basic_map *isl_basic_map_intersect( + __isl_take isl_basic_map *bmap1, + __isl_take isl_basic_map *bmap2); + __isl_give isl_basic_map *isl_basic_map_list_intersect( + __isl_take isl_basic_map_list *list); + __isl_give isl_map *isl_map_intersect_params( + __isl_take isl_map *map, + __isl_take isl_set *params); + __isl_give isl_map *isl_map_intersect_domain( + __isl_take isl_map *map, + __isl_take isl_set *set); + __isl_give isl_map *isl_map_intersect_range( + __isl_take isl_map *map, + __isl_take isl_set *set); + __isl_give isl_map *isl_map_intersect( + __isl_take isl_map *map1, + __isl_take isl_map *map2); + + #include + __isl_give isl_union_set *isl_union_set_intersect_params( + __isl_take isl_union_set *uset, + __isl_take isl_set *set); + __isl_give isl_union_set *isl_union_set_intersect( + __isl_take isl_union_set *uset1, + __isl_take isl_union_set *uset2); + + #include + __isl_give isl_union_map *isl_union_map_intersect_params( + __isl_take isl_union_map *umap, + __isl_take isl_set *set); + __isl_give isl_union_map *isl_union_map_intersect_domain( + __isl_take isl_union_map *umap, + __isl_take isl_union_set *uset); + __isl_give isl_union_map *isl_union_map_intersect_range( + __isl_take isl_union_map *umap, + __isl_take isl_union_set *uset); + __isl_give isl_union_map *isl_union_map_intersect( + __isl_take isl_union_map *umap1, + __isl_take isl_union_map *umap2); + + #include + __isl_give isl_pw_aff *isl_pw_aff_intersect_domain( + __isl_take isl_pw_aff *pa, + __isl_take isl_set *set); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_intersect_domain( + __isl_take isl_multi_pw_aff *mpa, + __isl_take isl_set *domain); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_domain( + __isl_take isl_pw_multi_aff *pma, + __isl_take isl_set *set); + __isl_give isl_union_pw_aff *isl_union_pw_aff_intersect_domain( + __isl_take isl_union_pw_aff *upa, + __isl_take isl_union_set *uset); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_intersect_domain( + __isl_take isl_union_pw_multi_aff *upma, + __isl_take isl_union_set *uset); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_intersect_domain( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_union_set *uset); + __isl_give isl_pw_aff *isl_pw_aff_intersect_params( + __isl_take isl_pw_aff *pa, + __isl_take isl_set *set); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_intersect_params( + __isl_take isl_multi_pw_aff *mpa, + __isl_take isl_set *set); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_params( + __isl_take isl_pw_multi_aff *pma, + __isl_take isl_set *set); + __isl_give isl_union_pw_aff * + isl_union_pw_aff_intersect_params( + __isl_take isl_union_pw_aff *upa, + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_intersect_params( + __isl_take isl_union_pw_multi_aff *upma, + __isl_take isl_set *set); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_intersect_params( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_set *params); + isl_multi_union_pw_aff_intersect_range( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_set *set); + + #include + __isl_give isl_pw_qpolynomial * + isl_pw_qpolynomial_intersect_domain( + __isl_take isl_pw_qpolynomial *pwpq, + __isl_take isl_set *set); + __isl_give isl_union_pw_qpolynomial * + isl_union_pw_qpolynomial_intersect_domain( + __isl_take isl_union_pw_qpolynomial *upwpq, + __isl_take isl_union_set *uset); + __isl_give isl_union_pw_qpolynomial_fold * + isl_union_pw_qpolynomial_fold_intersect_domain( + __isl_take isl_union_pw_qpolynomial_fold *upwf, + __isl_take isl_union_set *uset); + __isl_give isl_pw_qpolynomial * + isl_pw_qpolynomial_intersect_params( + __isl_take isl_pw_qpolynomial *pwpq, + __isl_take isl_set *set); + __isl_give isl_pw_qpolynomial_fold * + isl_pw_qpolynomial_fold_intersect_params( + __isl_take isl_pw_qpolynomial_fold *pwf, + __isl_take isl_set *set); + __isl_give isl_union_pw_qpolynomial * + isl_union_pw_qpolynomial_intersect_params( + __isl_take isl_union_pw_qpolynomial *upwpq, + __isl_take isl_set *set); + __isl_give isl_union_pw_qpolynomial_fold * + isl_union_pw_qpolynomial_fold_intersect_params( + __isl_take isl_union_pw_qpolynomial_fold *upwf, + __isl_take isl_set *set); + +The second argument to the C<_params> functions needs to be +a parametric (basic) set. For the other functions, a parametric set +for either argument is only allowed if the other argument is +a parametric set as well. +The list passed to C needs to have +at least one element and all elements need to live in the same space. +The function C +restricts the input function to those shared domain elements +that map to the specified range. + +=item * Union + + #include + __isl_give isl_set *isl_basic_set_union( + __isl_take isl_basic_set *bset1, + __isl_take isl_basic_set *bset2); + __isl_give isl_set *isl_set_union( + __isl_take isl_set *set1, + __isl_take isl_set *set2); + + #include + __isl_give isl_map *isl_basic_map_union( + __isl_take isl_basic_map *bmap1, + __isl_take isl_basic_map *bmap2); + __isl_give isl_map *isl_map_union( + __isl_take isl_map *map1, + __isl_take isl_map *map2); + + #include + __isl_give isl_union_set *isl_union_set_union( + __isl_take isl_union_set *uset1, + __isl_take isl_union_set *uset2); + __isl_give isl_union_set *isl_union_set_list_union( + __isl_take isl_union_set_list *list); + + #include + __isl_give isl_union_map *isl_union_map_union( + __isl_take isl_union_map *umap1, + __isl_take isl_union_map *umap2); + +=item * Set difference + + #include + __isl_give isl_set *isl_set_subtract( + __isl_take isl_set *set1, + __isl_take isl_set *set2); + + #include + __isl_give isl_map *isl_map_subtract( + __isl_take isl_map *map1, + __isl_take isl_map *map2); + __isl_give isl_map *isl_map_subtract_domain( + __isl_take isl_map *map, + __isl_take isl_set *dom); + __isl_give isl_map *isl_map_subtract_range( + __isl_take isl_map *map, + __isl_take isl_set *dom); + + #include + __isl_give isl_union_set *isl_union_set_subtract( + __isl_take isl_union_set *uset1, + __isl_take isl_union_set *uset2); + + #include + __isl_give isl_union_map *isl_union_map_subtract( + __isl_take isl_union_map *umap1, + __isl_take isl_union_map *umap2); + __isl_give isl_union_map *isl_union_map_subtract_domain( + __isl_take isl_union_map *umap, + __isl_take isl_union_set *dom); + __isl_give isl_union_map *isl_union_map_subtract_range( + __isl_take isl_union_map *umap, + __isl_take isl_union_set *dom); + + #include + __isl_give isl_pw_aff *isl_pw_aff_subtract_domain( + __isl_take isl_pw_aff *pa, + __isl_take isl_set *set); + __isl_give isl_pw_multi_aff * + isl_pw_multi_aff_subtract_domain( + __isl_take isl_pw_multi_aff *pma, + __isl_take isl_set *set); + __isl_give isl_union_pw_aff * + isl_union_pw_aff_subtract_domain( + __isl_take isl_union_pw_aff *upa, + __isl_take isl_union_set *uset); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_subtract_domain( + __isl_take isl_union_pw_multi_aff *upma, + __isl_take isl_set *set); + + #include + __isl_give isl_pw_qpolynomial * + isl_pw_qpolynomial_subtract_domain( + __isl_take isl_pw_qpolynomial *pwpq, + __isl_take isl_set *set); + __isl_give isl_pw_qpolynomial_fold * + isl_pw_qpolynomial_fold_subtract_domain( + __isl_take isl_pw_qpolynomial_fold *pwf, + __isl_take isl_set *set); + __isl_give isl_union_pw_qpolynomial * + isl_union_pw_qpolynomial_subtract_domain( + __isl_take isl_union_pw_qpolynomial *upwpq, + __isl_take isl_union_set *uset); + __isl_give isl_union_pw_qpolynomial_fold * + isl_union_pw_qpolynomial_fold_subtract_domain( + __isl_take isl_union_pw_qpolynomial_fold *upwf, + __isl_take isl_union_set *uset); + +=item * Application + + #include + __isl_give isl_space *isl_space_join( + __isl_take isl_space *left, + __isl_take isl_space *right); + + #include + __isl_give isl_basic_set *isl_basic_set_apply( + __isl_take isl_basic_set *bset, + __isl_take isl_basic_map *bmap); + __isl_give isl_set *isl_set_apply( + __isl_take isl_set *set, + __isl_take isl_map *map); + __isl_give isl_union_set *isl_union_set_apply( + __isl_take isl_union_set *uset, + __isl_take isl_union_map *umap); + __isl_give isl_basic_map *isl_basic_map_apply_domain( + __isl_take isl_basic_map *bmap1, + __isl_take isl_basic_map *bmap2); + __isl_give isl_basic_map *isl_basic_map_apply_range( + __isl_take isl_basic_map *bmap1, + __isl_take isl_basic_map *bmap2); + __isl_give isl_map *isl_map_apply_domain( + __isl_take isl_map *map1, + __isl_take isl_map *map2); + __isl_give isl_map *isl_map_apply_range( + __isl_take isl_map *map1, + __isl_take isl_map *map2); + + #include + __isl_give isl_union_map *isl_union_map_apply_domain( + __isl_take isl_union_map *umap1, + __isl_take isl_union_map *umap2); + __isl_give isl_union_map *isl_union_map_apply_range( + __isl_take isl_union_map *umap1, + __isl_take isl_union_map *umap2); + + #include + __isl_give isl_union_pw_aff * + isl_multi_union_pw_aff_apply_aff( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_aff *aff); + __isl_give isl_union_pw_aff * + isl_multi_union_pw_aff_apply_pw_aff( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_pw_aff *pa); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_apply_multi_aff( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_multi_aff *ma); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_apply_pw_multi_aff( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_pw_multi_aff *pma); + +The result of C is defined +over the shared domain of the elements of the input. The dimension is +required to be greater than zero. +The C argument of +C is allowed to be zero-dimensional, +but only if the range of the C argument +is also zero-dimensional. +Similarly for C. + + #include + __isl_give isl_pw_qpolynomial_fold * + isl_set_apply_pw_qpolynomial_fold( + __isl_take isl_set *set, + __isl_take isl_pw_qpolynomial_fold *pwf, + int *tight); + __isl_give isl_pw_qpolynomial_fold * + isl_map_apply_pw_qpolynomial_fold( + __isl_take isl_map *map, + __isl_take isl_pw_qpolynomial_fold *pwf, + int *tight); + __isl_give isl_union_pw_qpolynomial_fold * + isl_union_set_apply_union_pw_qpolynomial_fold( + __isl_take isl_union_set *uset, + __isl_take isl_union_pw_qpolynomial_fold *upwf, + int *tight); + __isl_give isl_union_pw_qpolynomial_fold * + isl_union_map_apply_union_pw_qpolynomial_fold( + __isl_take isl_union_map *umap, + __isl_take isl_union_pw_qpolynomial_fold *upwf, + int *tight); + +The functions taking a map +compose the given map with the given piecewise quasipolynomial reduction. +That is, compute a bound (of the same type as C or C itself) +over all elements in the intersection of the range of the map +and the domain of the piecewise quasipolynomial reduction +as a function of an element in the domain of the map. +The functions taking a set compute a bound over all elements in the +intersection of the set and the domain of the +piecewise quasipolynomial reduction. + +=item * Preimage + + #include + __isl_give isl_basic_set * + isl_basic_set_preimage_multi_aff( + __isl_take isl_basic_set *bset, + __isl_take isl_multi_aff *ma); + __isl_give isl_set *isl_set_preimage_multi_aff( + __isl_take isl_set *set, + __isl_take isl_multi_aff *ma); + __isl_give isl_set *isl_set_preimage_pw_multi_aff( + __isl_take isl_set *set, + __isl_take isl_pw_multi_aff *pma); + __isl_give isl_set *isl_set_preimage_multi_pw_aff( + __isl_take isl_set *set, + __isl_take isl_multi_pw_aff *mpa); + + #include + __isl_give isl_union_set * + isl_union_set_preimage_multi_aff( + __isl_take isl_union_set *uset, + __isl_take isl_multi_aff *ma); + __isl_give isl_union_set * + isl_union_set_preimage_pw_multi_aff( + __isl_take isl_union_set *uset, + __isl_take isl_pw_multi_aff *pma); + __isl_give isl_union_set * + isl_union_set_preimage_union_pw_multi_aff( + __isl_take isl_union_set *uset, + __isl_take isl_union_pw_multi_aff *upma); + + #include + __isl_give isl_basic_map * + isl_basic_map_preimage_domain_multi_aff( + __isl_take isl_basic_map *bmap, + __isl_take isl_multi_aff *ma); + __isl_give isl_map *isl_map_preimage_domain_multi_aff( + __isl_take isl_map *map, + __isl_take isl_multi_aff *ma); + __isl_give isl_map *isl_map_preimage_range_multi_aff( + __isl_take isl_map *map, + __isl_take isl_multi_aff *ma); + __isl_give isl_map * + isl_map_preimage_domain_pw_multi_aff( + __isl_take isl_map *map, + __isl_take isl_pw_multi_aff *pma); + __isl_give isl_map * + isl_map_preimage_range_pw_multi_aff( + __isl_take isl_map *map, + __isl_take isl_pw_multi_aff *pma); + __isl_give isl_map * + isl_map_preimage_domain_multi_pw_aff( + __isl_take isl_map *map, + __isl_take isl_multi_pw_aff *mpa); + __isl_give isl_basic_map * + isl_basic_map_preimage_range_multi_aff( + __isl_take isl_basic_map *bmap, + __isl_take isl_multi_aff *ma); + + #include + __isl_give isl_union_map * + isl_union_map_preimage_domain_multi_aff( + __isl_take isl_union_map *umap, + __isl_take isl_multi_aff *ma); + __isl_give isl_union_map * + isl_union_map_preimage_range_multi_aff( + __isl_take isl_union_map *umap, + __isl_take isl_multi_aff *ma); + __isl_give isl_union_map * + isl_union_map_preimage_domain_pw_multi_aff( + __isl_take isl_union_map *umap, + __isl_take isl_pw_multi_aff *pma); + __isl_give isl_union_map * + isl_union_map_preimage_range_pw_multi_aff( + __isl_take isl_union_map *umap, + __isl_take isl_pw_multi_aff *pma); + __isl_give isl_union_map * + isl_union_map_preimage_domain_union_pw_multi_aff( + __isl_take isl_union_map *umap, + __isl_take isl_union_pw_multi_aff *upma); + __isl_give isl_union_map * + isl_union_map_preimage_range_union_pw_multi_aff( + __isl_take isl_union_map *umap, + __isl_take isl_union_pw_multi_aff *upma); + +These functions compute the preimage of the given set or map domain/range under +the given function. In other words, the expression is plugged +into the set description or into the domain/range of the map. + +=item * Pullback + + #include + __isl_give isl_aff *isl_aff_pullback_aff( + __isl_take isl_aff *aff1, + __isl_take isl_aff *aff2); + __isl_give isl_aff *isl_aff_pullback_multi_aff( + __isl_take isl_aff *aff, + __isl_take isl_multi_aff *ma); + __isl_give isl_pw_aff *isl_pw_aff_pullback_multi_aff( + __isl_take isl_pw_aff *pa, + __isl_take isl_multi_aff *ma); + __isl_give isl_pw_aff *isl_pw_aff_pullback_pw_multi_aff( + __isl_take isl_pw_aff *pa, + __isl_take isl_pw_multi_aff *pma); + __isl_give isl_pw_aff *isl_pw_aff_pullback_multi_pw_aff( + __isl_take isl_pw_aff *pa, + __isl_take isl_multi_pw_aff *mpa); + __isl_give isl_multi_aff *isl_multi_aff_pullback_multi_aff( + __isl_take isl_multi_aff *ma1, + __isl_take isl_multi_aff *ma2); + __isl_give isl_pw_multi_aff * + isl_pw_multi_aff_pullback_multi_aff( + __isl_take isl_pw_multi_aff *pma, + __isl_take isl_multi_aff *ma); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_pullback_multi_aff( + __isl_take isl_multi_pw_aff *mpa, + __isl_take isl_multi_aff *ma); + __isl_give isl_pw_multi_aff * + isl_pw_multi_aff_pullback_pw_multi_aff( + __isl_take isl_pw_multi_aff *pma1, + __isl_take isl_pw_multi_aff *pma2); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_pullback_pw_multi_aff( + __isl_take isl_multi_pw_aff *mpa, + __isl_take isl_pw_multi_aff *pma); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_pullback_multi_pw_aff( + __isl_take isl_multi_pw_aff *mpa1, + __isl_take isl_multi_pw_aff *mpa2); + __isl_give isl_union_pw_aff * + isl_union_pw_aff_pullback_union_pw_multi_aff( + __isl_take isl_union_pw_aff *upa, + __isl_take isl_union_pw_multi_aff *upma); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_pullback_union_pw_multi_aff( + __isl_take isl_union_pw_multi_aff *upma1, + __isl_take isl_union_pw_multi_aff *upma2); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_pullback_union_pw_multi_aff( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_union_pw_multi_aff *upma); + +These functions precompose the first expression by the second function. +In other words, the second function is plugged +into the first expression. + +=item * Locus + + #include + __isl_give isl_basic_set *isl_aff_le_basic_set( + __isl_take isl_aff *aff1, + __isl_take isl_aff *aff2); + __isl_give isl_basic_set *isl_aff_ge_basic_set( + __isl_take isl_aff *aff1, + __isl_take isl_aff *aff2); + __isl_give isl_set *isl_pw_aff_eq_set( + __isl_take isl_pw_aff *pwaff1, + __isl_take isl_pw_aff *pwaff2); + __isl_give isl_set *isl_pw_aff_ne_set( + __isl_take isl_pw_aff *pwaff1, + __isl_take isl_pw_aff *pwaff2); + __isl_give isl_set *isl_pw_aff_le_set( + __isl_take isl_pw_aff *pwaff1, + __isl_take isl_pw_aff *pwaff2); + __isl_give isl_set *isl_pw_aff_lt_set( + __isl_take isl_pw_aff *pwaff1, + __isl_take isl_pw_aff *pwaff2); + __isl_give isl_set *isl_pw_aff_ge_set( + __isl_take isl_pw_aff *pwaff1, + __isl_take isl_pw_aff *pwaff2); + __isl_give isl_set *isl_pw_aff_gt_set( + __isl_take isl_pw_aff *pwaff1, + __isl_take isl_pw_aff *pwaff2); + + __isl_give isl_set *isl_multi_aff_lex_le_set( + __isl_take isl_multi_aff *ma1, + __isl_take isl_multi_aff *ma2); + __isl_give isl_set *isl_multi_aff_lex_ge_set( + __isl_take isl_multi_aff *ma1, + __isl_take isl_multi_aff *ma2); + + __isl_give isl_set *isl_pw_aff_list_eq_set( + __isl_take isl_pw_aff_list *list1, + __isl_take isl_pw_aff_list *list2); + __isl_give isl_set *isl_pw_aff_list_ne_set( + __isl_take isl_pw_aff_list *list1, + __isl_take isl_pw_aff_list *list2); + __isl_give isl_set *isl_pw_aff_list_le_set( + __isl_take isl_pw_aff_list *list1, + __isl_take isl_pw_aff_list *list2); + __isl_give isl_set *isl_pw_aff_list_lt_set( + __isl_take isl_pw_aff_list *list1, + __isl_take isl_pw_aff_list *list2); + __isl_give isl_set *isl_pw_aff_list_ge_set( + __isl_take isl_pw_aff_list *list1, + __isl_take isl_pw_aff_list *list2); + __isl_give isl_set *isl_pw_aff_list_gt_set( + __isl_take isl_pw_aff_list *list1, + __isl_take isl_pw_aff_list *list2); + +The function C returns a basic set +containing those elements in the shared space +of C and C where C is greater than or equal to C. +The function C returns a set +containing those elements in the shared domain +of C and C where C is +greater than or equal to C. +The function C returns a set +containing those elements in the shared domain space +where C is lexicographically smaller than or +equal to C. +The functions operating on C apply the corresponding +C function to each pair of elements in the two lists. + + #include + __isl_give isl_map *isl_pw_aff_eq_map( + __isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2); + __isl_give isl_map *isl_pw_aff_lt_map( + __isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2); + __isl_give isl_map *isl_pw_aff_gt_map( + __isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2); + + __isl_give isl_map *isl_multi_pw_aff_eq_map( + __isl_take isl_multi_pw_aff *mpa1, + __isl_take isl_multi_pw_aff *mpa2); + __isl_give isl_map *isl_multi_pw_aff_lex_lt_map( + __isl_take isl_multi_pw_aff *mpa1, + __isl_take isl_multi_pw_aff *mpa2); + __isl_give isl_map *isl_multi_pw_aff_lex_gt_map( + __isl_take isl_multi_pw_aff *mpa1, + __isl_take isl_multi_pw_aff *mpa2); + +These functions return a map between domain elements of the arguments +where the function values satisfy the given relation. + + #include + __isl_give isl_union_map * + isl_union_map_eq_at_multi_union_pw_aff( + __isl_take isl_union_map *umap, + __isl_take isl_multi_union_pw_aff *mupa); + __isl_give isl_union_map * + isl_union_map_lex_lt_at_multi_union_pw_aff( + __isl_take isl_union_map *umap, + __isl_take isl_multi_union_pw_aff *mupa); + __isl_give isl_union_map * + isl_union_map_lex_gt_at_multi_union_pw_aff( + __isl_take isl_union_map *umap, + __isl_take isl_multi_union_pw_aff *mupa); + +These functions select the subset of elements in the union map +that have an equal or lexicographically smaller function value. + +=item * Cartesian Product + + #include + __isl_give isl_space *isl_space_product( + __isl_take isl_space *space1, + __isl_take isl_space *space2); + __isl_give isl_space *isl_space_domain_product( + __isl_take isl_space *space1, + __isl_take isl_space *space2); + __isl_give isl_space *isl_space_range_product( + __isl_take isl_space *space1, + __isl_take isl_space *space2); + +The functions +C, C +and C take pairs or relation spaces and +produce a single relations space, where either the domain, the range +or both domain and range are wrapped spaces of relations between +the domains and/or ranges of the input spaces. +If the product is only constructed over the domain or the range +then the ranges or the domains of the inputs should be the same. +The function C also accepts a pair of set spaces, +in which case it returns a wrapped space of a relation between the +two input spaces. + + #include + __isl_give isl_set *isl_set_product( + __isl_take isl_set *set1, + __isl_take isl_set *set2); + + #include + __isl_give isl_basic_map *isl_basic_map_domain_product( + __isl_take isl_basic_map *bmap1, + __isl_take isl_basic_map *bmap2); + __isl_give isl_basic_map *isl_basic_map_range_product( + __isl_take isl_basic_map *bmap1, + __isl_take isl_basic_map *bmap2); + __isl_give isl_basic_map *isl_basic_map_product( + __isl_take isl_basic_map *bmap1, + __isl_take isl_basic_map *bmap2); + __isl_give isl_map *isl_map_domain_product( + __isl_take isl_map *map1, + __isl_take isl_map *map2); + __isl_give isl_map *isl_map_range_product( + __isl_take isl_map *map1, + __isl_take isl_map *map2); + __isl_give isl_map *isl_map_product( + __isl_take isl_map *map1, + __isl_take isl_map *map2); + + #include + __isl_give isl_union_set *isl_union_set_product( + __isl_take isl_union_set *uset1, + __isl_take isl_union_set *uset2); + + #include + __isl_give isl_union_map *isl_union_map_domain_product( + __isl_take isl_union_map *umap1, + __isl_take isl_union_map *umap2); + __isl_give isl_union_map *isl_union_map_range_product( + __isl_take isl_union_map *umap1, + __isl_take isl_union_map *umap2); + __isl_give isl_union_map *isl_union_map_product( + __isl_take isl_union_map *umap1, + __isl_take isl_union_map *umap2); + + #include + __isl_give isl_multi_val *isl_multi_val_range_product( + __isl_take isl_multi_val *mv1, + __isl_take isl_multi_val *mv2); + __isl_give isl_multi_val *isl_multi_val_product( + __isl_take isl_multi_val *mv1, + __isl_take isl_multi_val *mv2); + + #include + __isl_give isl_multi_aff *isl_multi_aff_range_product( + __isl_take isl_multi_aff *ma1, + __isl_take isl_multi_aff *ma2); + __isl_give isl_multi_aff *isl_multi_aff_product( + __isl_take isl_multi_aff *ma1, + __isl_take isl_multi_aff *ma2); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_range_product( + __isl_take isl_multi_pw_aff *mpa1, + __isl_take isl_multi_pw_aff *mpa2); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_product( + __isl_take isl_multi_pw_aff *mpa1, + __isl_take isl_multi_pw_aff *mpa2); + __isl_give isl_pw_multi_aff * + isl_pw_multi_aff_range_product( + __isl_take isl_pw_multi_aff *pma1, + __isl_take isl_pw_multi_aff *pma2); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_product( + __isl_take isl_pw_multi_aff *pma1, + __isl_take isl_pw_multi_aff *pma2); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_range_product( + __isl_take isl_multi_union_pw_aff *mupa1, + __isl_take isl_multi_union_pw_aff *mupa2); + +The above functions compute the cross product of the given +sets, relations or functions. The domains and ranges of the results +are wrapped maps between domains and ranges of the inputs. +To obtain a ``flat'' product, use the following functions +instead. + + #include + __isl_give isl_basic_set *isl_basic_set_flat_product( + __isl_take isl_basic_set *bset1, + __isl_take isl_basic_set *bset2); + __isl_give isl_set *isl_set_flat_product( + __isl_take isl_set *set1, + __isl_take isl_set *set2); + + #include + __isl_give isl_basic_map *isl_basic_map_flat_range_product( + __isl_take isl_basic_map *bmap1, + __isl_take isl_basic_map *bmap2); + __isl_give isl_map *isl_map_flat_domain_product( + __isl_take isl_map *map1, + __isl_take isl_map *map2); + __isl_give isl_map *isl_map_flat_range_product( + __isl_take isl_map *map1, + __isl_take isl_map *map2); + __isl_give isl_basic_map *isl_basic_map_flat_product( + __isl_take isl_basic_map *bmap1, + __isl_take isl_basic_map *bmap2); + __isl_give isl_map *isl_map_flat_product( + __isl_take isl_map *map1, + __isl_take isl_map *map2); + + #include + __isl_give isl_union_map * + isl_union_map_flat_domain_product( + __isl_take isl_union_map *umap1, + __isl_take isl_union_map *umap2); + __isl_give isl_union_map * + isl_union_map_flat_range_product( + __isl_take isl_union_map *umap1, + __isl_take isl_union_map *umap2); + + #include + __isl_give isl_multi_val *isl_multi_val_flat_range_product( + __isl_take isl_multi_val *mv1, + __isl_take isl_multi_aff *mv2); + + #include + __isl_give isl_multi_aff *isl_multi_aff_flat_range_product( + __isl_take isl_multi_aff *ma1, + __isl_take isl_multi_aff *ma2); + __isl_give isl_pw_multi_aff * + isl_pw_multi_aff_flat_range_product( + __isl_take isl_pw_multi_aff *pma1, + __isl_take isl_pw_multi_aff *pma2); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_flat_range_product( + __isl_take isl_multi_pw_aff *mpa1, + __isl_take isl_multi_pw_aff *mpa2); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_flat_range_product( + __isl_take isl_union_pw_multi_aff *upma1, + __isl_take isl_union_pw_multi_aff *upma2); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_flat_range_product( + __isl_take isl_multi_union_pw_aff *mupa1, + __isl_take isl_multi_union_pw_aff *mupa2); + + #include + __isl_give isl_space *isl_space_factor_domain( + __isl_take isl_space *space); + __isl_give isl_space *isl_space_factor_range( + __isl_take isl_space *space); + __isl_give isl_space *isl_space_domain_factor_domain( + __isl_take isl_space *space); + __isl_give isl_space *isl_space_domain_factor_range( + __isl_take isl_space *space); + __isl_give isl_space *isl_space_range_factor_domain( + __isl_take isl_space *space); + __isl_give isl_space *isl_space_range_factor_range( + __isl_take isl_space *space); + +The functions C and +C extract the two arguments from +the result of a call to C. + +The arguments of a call to C can be extracted +from the result using the following functions. + + #include + __isl_give isl_map *isl_map_factor_domain( + __isl_take isl_map *map); + __isl_give isl_map *isl_map_factor_range( + __isl_take isl_map *map); + __isl_give isl_map *isl_map_domain_factor_domain( + __isl_take isl_map *map); + __isl_give isl_map *isl_map_domain_factor_range( + __isl_take isl_map *map); + __isl_give isl_map *isl_map_range_factor_domain( + __isl_take isl_map *map); + __isl_give isl_map *isl_map_range_factor_range( + __isl_take isl_map *map); + + #include + __isl_give isl_union_map *isl_union_map_factor_domain( + __isl_take isl_union_map *umap); + __isl_give isl_union_map *isl_union_map_factor_range( + __isl_take isl_union_map *umap); + __isl_give isl_union_map * + isl_union_map_domain_factor_domain( + __isl_take isl_union_map *umap); + __isl_give isl_union_map * + isl_union_map_domain_factor_range( + __isl_take isl_union_map *umap); + __isl_give isl_union_map * + isl_union_map_range_factor_range( + __isl_take isl_union_map *umap); + + #include + __isl_give isl_multi_val * + isl_multi_val_range_factor_domain( + __isl_take isl_multi_val *mv); + __isl_give isl_multi_val * + isl_multi_val_range_factor_range( + __isl_take isl_multi_val *mv); + + #include + __isl_give isl_multi_aff * + isl_multi_aff_range_factor_domain( + __isl_take isl_multi_aff *ma); + __isl_give isl_multi_aff * + isl_multi_aff_range_factor_range( + __isl_take isl_multi_aff *ma); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_range_factor_domain( + __isl_take isl_multi_pw_aff *mpa); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_range_factor_range( + __isl_take isl_multi_pw_aff *mpa); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_range_factor_domain( + __isl_take isl_multi_union_pw_aff *mupa); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_range_factor_range( + __isl_take isl_multi_union_pw_aff *mupa); + +The splice functions are a generalization of the flat product functions, +where the second argument may be inserted at any position inside +the first argument rather than being placed at the end. + + #include + __isl_give isl_multi_val *isl_multi_val_range_splice( + __isl_take isl_multi_val *mv1, unsigned pos, + __isl_take isl_multi_val *mv2); + + #include + __isl_give isl_multi_aff *isl_multi_aff_range_splice( + __isl_take isl_multi_aff *ma1, unsigned pos, + __isl_take isl_multi_aff *ma2); + __isl_give isl_multi_aff *isl_multi_aff_splice( + __isl_take isl_multi_aff *ma1, + unsigned in_pos, unsigned out_pos, + __isl_take isl_multi_aff *ma2); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_range_splice( + __isl_take isl_multi_pw_aff *mpa1, unsigned pos, + __isl_take isl_multi_pw_aff *mpa2); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_splice( + __isl_take isl_multi_pw_aff *mpa1, + unsigned in_pos, unsigned out_pos, + __isl_take isl_multi_pw_aff *mpa2); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_range_splice( + __isl_take isl_multi_union_pw_aff *mupa1, + unsigned pos, + __isl_take isl_multi_union_pw_aff *mupa2); + +=item * Simplification + +When applied to a set or relation, +the gist operation returns a set or relation that has the +same intersection with the context as the input set or relation. +Any implicit equality in the intersection is made explicit in the result, +while all inequalities that are redundant with respect to the intersection +are removed. +In case of union sets and relations, the gist operation is performed +per space. + +When applied to a function, +the gist operation applies the set gist operation to each of +the cells in the domain of the input piecewise expression. +The context is also exploited +to simplify the expression associated to each cell. + + #include + __isl_give isl_basic_set *isl_basic_set_gist( + __isl_take isl_basic_set *bset, + __isl_take isl_basic_set *context); + __isl_give isl_set *isl_set_gist(__isl_take isl_set *set, + __isl_take isl_set *context); + __isl_give isl_set *isl_set_gist_params( + __isl_take isl_set *set, + __isl_take isl_set *context); + + #include + __isl_give isl_basic_map *isl_basic_map_gist( + __isl_take isl_basic_map *bmap, + __isl_take isl_basic_map *context); + __isl_give isl_basic_map *isl_basic_map_gist_domain( + __isl_take isl_basic_map *bmap, + __isl_take isl_basic_set *context); + __isl_give isl_map *isl_map_gist(__isl_take isl_map *map, + __isl_take isl_map *context); + __isl_give isl_map *isl_map_gist_params( + __isl_take isl_map *map, + __isl_take isl_set *context); + __isl_give isl_map *isl_map_gist_domain( + __isl_take isl_map *map, + __isl_take isl_set *context); + __isl_give isl_map *isl_map_gist_range( + __isl_take isl_map *map, + __isl_take isl_set *context); + + #include + __isl_give isl_union_set *isl_union_set_gist( + __isl_take isl_union_set *uset, + __isl_take isl_union_set *context); + __isl_give isl_union_set *isl_union_set_gist_params( + __isl_take isl_union_set *uset, + __isl_take isl_set *set); + + #include + __isl_give isl_union_map *isl_union_map_gist( + __isl_take isl_union_map *umap, + __isl_take isl_union_map *context); + __isl_give isl_union_map *isl_union_map_gist_params( + __isl_take isl_union_map *umap, + __isl_take isl_set *set); + __isl_give isl_union_map *isl_union_map_gist_domain( + __isl_take isl_union_map *umap, + __isl_take isl_union_set *uset); + __isl_give isl_union_map *isl_union_map_gist_range( + __isl_take isl_union_map *umap, + __isl_take isl_union_set *uset); + + #include + __isl_give isl_aff *isl_aff_gist_params( + __isl_take isl_aff *aff, + __isl_take isl_set *context); + __isl_give isl_aff *isl_aff_gist(__isl_take isl_aff *aff, + __isl_take isl_set *context); + __isl_give isl_multi_aff *isl_multi_aff_gist_params( + __isl_take isl_multi_aff *maff, + __isl_take isl_set *context); + __isl_give isl_multi_aff *isl_multi_aff_gist( + __isl_take isl_multi_aff *maff, + __isl_take isl_set *context); + __isl_give isl_pw_aff *isl_pw_aff_gist_params( + __isl_take isl_pw_aff *pwaff, + __isl_take isl_set *context); + __isl_give isl_pw_aff *isl_pw_aff_gist( + __isl_take isl_pw_aff *pwaff, + __isl_take isl_set *context); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_gist_params( + __isl_take isl_pw_multi_aff *pma, + __isl_take isl_set *set); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_gist( + __isl_take isl_pw_multi_aff *pma, + __isl_take isl_set *set); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_gist_params( + __isl_take isl_multi_pw_aff *mpa, + __isl_take isl_set *set); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_gist( + __isl_take isl_multi_pw_aff *mpa, + __isl_take isl_set *set); + __isl_give isl_union_pw_aff *isl_union_pw_aff_gist( + __isl_take isl_union_pw_aff *upa, + __isl_take isl_union_set *context); + __isl_give isl_union_pw_aff *isl_union_pw_aff_gist_params( + __isl_take isl_union_pw_aff *upa, + __isl_take isl_set *context); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_gist_params( + __isl_take isl_union_pw_multi_aff *upma, + __isl_take isl_set *context); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_gist( + __isl_take isl_union_pw_multi_aff *upma, + __isl_take isl_union_set *context); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_gist_params( + __isl_take isl_multi_union_pw_aff *aff, + __isl_take isl_set *context); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_gist( + __isl_take isl_multi_union_pw_aff *aff, + __isl_take isl_union_set *context); + + #include + __isl_give isl_qpolynomial *isl_qpolynomial_gist_params( + __isl_take isl_qpolynomial *qp, + __isl_take isl_set *context); + __isl_give isl_qpolynomial *isl_qpolynomial_gist( + __isl_take isl_qpolynomial *qp, + __isl_take isl_set *context); + __isl_give isl_qpolynomial_fold * + isl_qpolynomial_fold_gist_params( + __isl_take isl_qpolynomial_fold *fold, + __isl_take isl_set *context); + __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_gist( + __isl_take isl_qpolynomial_fold *fold, + __isl_take isl_set *context); + __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_gist_params( + __isl_take isl_pw_qpolynomial *pwqp, + __isl_take isl_set *context); + __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_gist( + __isl_take isl_pw_qpolynomial *pwqp, + __isl_take isl_set *context); + __isl_give isl_pw_qpolynomial_fold * + isl_pw_qpolynomial_fold_gist( + __isl_take isl_pw_qpolynomial_fold *pwf, + __isl_take isl_set *context); + __isl_give isl_pw_qpolynomial_fold * + isl_pw_qpolynomial_fold_gist_params( + __isl_take isl_pw_qpolynomial_fold *pwf, + __isl_take isl_set *context); + __isl_give isl_union_pw_qpolynomial * + isl_union_pw_qpolynomial_gist_params( + __isl_take isl_union_pw_qpolynomial *upwqp, + __isl_take isl_set *context); + __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_gist( + __isl_take isl_union_pw_qpolynomial *upwqp, + __isl_take isl_union_set *context); + __isl_give isl_union_pw_qpolynomial_fold * + isl_union_pw_qpolynomial_fold_gist( + __isl_take isl_union_pw_qpolynomial_fold *upwf, + __isl_take isl_union_set *context); + __isl_give isl_union_pw_qpolynomial_fold * + isl_union_pw_qpolynomial_fold_gist_params( + __isl_take isl_union_pw_qpolynomial_fold *upwf, + __isl_take isl_set *context); + +=item * Binary Arithmethic Operations + + #include + __isl_give isl_multi_val *isl_multi_val_sub( + __isl_take isl_multi_val *mv1, + __isl_take isl_multi_val *mv2); + + #include + __isl_give isl_aff *isl_aff_add( + __isl_take isl_aff *aff1, + __isl_take isl_aff *aff2); + __isl_give isl_multi_aff *isl_multi_aff_add( + __isl_take isl_multi_aff *maff1, + __isl_take isl_multi_aff *maff2); + __isl_give isl_pw_aff *isl_pw_aff_add( + __isl_take isl_pw_aff *pwaff1, + __isl_take isl_pw_aff *pwaff2); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_add( + __isl_take isl_pw_multi_aff *pma1, + __isl_take isl_pw_multi_aff *pma2); + __isl_give isl_union_pw_aff *isl_union_pw_aff_add( + __isl_take isl_union_pw_aff *upa1, + __isl_take isl_union_pw_aff *upa2); + __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_add( + __isl_take isl_union_pw_multi_aff *upma1, + __isl_take isl_union_pw_multi_aff *upma2); + __isl_give isl_pw_aff *isl_pw_aff_min( + __isl_take isl_pw_aff *pwaff1, + __isl_take isl_pw_aff *pwaff2); + __isl_give isl_pw_aff *isl_pw_aff_max( + __isl_take isl_pw_aff *pwaff1, + __isl_take isl_pw_aff *pwaff2); + __isl_give isl_aff *isl_aff_sub( + __isl_take isl_aff *aff1, + __isl_take isl_aff *aff2); + __isl_give isl_multi_aff *isl_multi_aff_sub( + __isl_take isl_multi_aff *ma1, + __isl_take isl_multi_aff *ma2); + __isl_give isl_pw_aff *isl_pw_aff_sub( + __isl_take isl_pw_aff *pwaff1, + __isl_take isl_pw_aff *pwaff2); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_sub( + __isl_take isl_multi_pw_aff *mpa1, + __isl_take isl_multi_pw_aff *mpa2); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_sub( + __isl_take isl_pw_multi_aff *pma1, + __isl_take isl_pw_multi_aff *pma2); + __isl_give isl_union_pw_aff *isl_union_pw_aff_sub( + __isl_take isl_union_pw_aff *upa1, + __isl_take isl_union_pw_aff *upa2); + __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_sub( + __isl_take isl_union_pw_multi_aff *upma1, + __isl_take isl_union_pw_multi_aff *upma2); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_sub( + __isl_take isl_multi_union_pw_aff *mupa1, + __isl_take isl_multi_union_pw_aff *mupa2); + +C subtracts the second argument from the first. + + #include + __isl_give isl_qpolynomial *isl_qpolynomial_add( + __isl_take isl_qpolynomial *qp1, + __isl_take isl_qpolynomial *qp2); + __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add( + __isl_take isl_pw_qpolynomial *pwqp1, + __isl_take isl_pw_qpolynomial *pwqp2); + __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add_disjoint( + __isl_take isl_pw_qpolynomial *pwqp1, + __isl_take isl_pw_qpolynomial *pwqp2); + __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_add( + __isl_take isl_pw_qpolynomial_fold *pwf1, + __isl_take isl_pw_qpolynomial_fold *pwf2); + __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_add( + __isl_take isl_union_pw_qpolynomial *upwqp1, + __isl_take isl_union_pw_qpolynomial *upwqp2); + __isl_give isl_qpolynomial *isl_qpolynomial_sub( + __isl_take isl_qpolynomial *qp1, + __isl_take isl_qpolynomial *qp2); + __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_sub( + __isl_take isl_pw_qpolynomial *pwqp1, + __isl_take isl_pw_qpolynomial *pwqp2); + __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_sub( + __isl_take isl_union_pw_qpolynomial *upwqp1, + __isl_take isl_union_pw_qpolynomial *upwqp2); + __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_fold( + __isl_take isl_pw_qpolynomial_fold *pwf1, + __isl_take isl_pw_qpolynomial_fold *pwf2); + __isl_give isl_union_pw_qpolynomial_fold * + isl_union_pw_qpolynomial_fold_fold( + __isl_take isl_union_pw_qpolynomial_fold *upwf1, + __isl_take isl_union_pw_qpolynomial_fold *upwf2); + + #include + __isl_give isl_pw_aff *isl_pw_aff_union_add( + __isl_take isl_pw_aff *pwaff1, + __isl_take isl_pw_aff *pwaff2); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_union_add( + __isl_take isl_pw_multi_aff *pma1, + __isl_take isl_pw_multi_aff *pma2); + __isl_give isl_union_pw_aff *isl_union_pw_aff_union_add( + __isl_take isl_union_pw_aff *upa1, + __isl_take isl_union_pw_aff *upa2); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_union_add( + __isl_take isl_union_pw_multi_aff *upma1, + __isl_take isl_union_pw_multi_aff *upma2); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_union_add( + __isl_take isl_multi_union_pw_aff *mupa1, + __isl_take isl_multi_union_pw_aff *mupa2); + __isl_give isl_pw_aff *isl_pw_aff_union_min( + __isl_take isl_pw_aff *pwaff1, + __isl_take isl_pw_aff *pwaff2); + __isl_give isl_pw_aff *isl_pw_aff_union_max( + __isl_take isl_pw_aff *pwaff1, + __isl_take isl_pw_aff *pwaff2); + +The function C computes a piecewise quasi-affine +expression with a domain that is the union of those of C and +C and such that on each cell, the quasi-affine expression is +the maximum of those of C and C. If only one of +C or C is defined on a given cell, then the +associated expression is the defined one. +This in contrast to the C function, which is +only defined on the shared definition domain of the arguments. + + #include + __isl_give isl_multi_val *isl_multi_val_add_val( + __isl_take isl_multi_val *mv, + __isl_take isl_val *v); + __isl_give isl_multi_val *isl_multi_val_mod_val( + __isl_take isl_multi_val *mv, + __isl_take isl_val *v); + __isl_give isl_multi_val *isl_multi_val_scale_val( + __isl_take isl_multi_val *mv, + __isl_take isl_val *v); + __isl_give isl_multi_val *isl_multi_val_scale_down_val( + __isl_take isl_multi_val *mv, + __isl_take isl_val *v); + + #include + __isl_give isl_aff *isl_aff_mod_val(__isl_take isl_aff *aff, + __isl_take isl_val *mod); + __isl_give isl_pw_aff *isl_pw_aff_mod_val( + __isl_take isl_pw_aff *pa, + __isl_take isl_val *mod); + __isl_give isl_union_pw_aff *isl_union_pw_aff_mod_val( + __isl_take isl_union_pw_aff *upa, + __isl_take isl_val *f); + __isl_give isl_aff *isl_aff_scale_val(__isl_take isl_aff *aff, + __isl_take isl_val *v); + __isl_give isl_multi_aff *isl_multi_aff_scale_val( + __isl_take isl_multi_aff *ma, + __isl_take isl_val *v); + __isl_give isl_pw_aff *isl_pw_aff_scale_val( + __isl_take isl_pw_aff *pa, __isl_take isl_val *v); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_scale_val( + __isl_take isl_multi_pw_aff *mpa, + __isl_take isl_val *v); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_val( + __isl_take isl_pw_multi_aff *pma, + __isl_take isl_val *v); + __isl_give isl_union_pw_multi_aff * + __isl_give isl_union_pw_aff *isl_union_pw_aff_scale_val( + __isl_take isl_union_pw_aff *upa, + __isl_take isl_val *f); + isl_union_pw_multi_aff_scale_val( + __isl_take isl_union_pw_multi_aff *upma, + __isl_take isl_val *val); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_scale_val( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_val *v); + __isl_give isl_aff *isl_aff_scale_down_ui( + __isl_take isl_aff *aff, unsigned f); + __isl_give isl_aff *isl_aff_scale_down_val( + __isl_take isl_aff *aff, __isl_take isl_val *v); + __isl_give isl_multi_aff *isl_multi_aff_scale_down_val( + __isl_take isl_multi_aff *ma, + __isl_take isl_val *v); + __isl_give isl_pw_aff *isl_pw_aff_scale_down_val( + __isl_take isl_pw_aff *pa, + __isl_take isl_val *f); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_scale_down_val( + __isl_take isl_multi_pw_aff *mpa, + __isl_take isl_val *v); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_down_val( + __isl_take isl_pw_multi_aff *pma, + __isl_take isl_val *v); + __isl_give isl_union_pw_aff *isl_union_pw_aff_scale_down_val( + __isl_take isl_union_pw_aff *upa, + __isl_take isl_val *v); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_scale_down_val( + __isl_take isl_union_pw_multi_aff *upma, + __isl_take isl_val *val); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_scale_down_val( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_val *v); - __isl_give isl_qpolynomial *isl_qpolynomial_scale( - __isl_take isl_qpolynomial *qp, isl_int v); + #include __isl_give isl_qpolynomial *isl_qpolynomial_scale_val( __isl_take isl_qpolynomial *qp, __isl_take isl_val *v); - __isl_give isl_qpolynomial *isl_qpolynomial_neg( - __isl_take isl_qpolynomial *qp); - __isl_give isl_qpolynomial *isl_qpolynomial_add( - __isl_take isl_qpolynomial *qp1, - __isl_take isl_qpolynomial *qp2); - __isl_give isl_qpolynomial *isl_qpolynomial_sub( - __isl_take isl_qpolynomial *qp1, - __isl_take isl_qpolynomial *qp2); - __isl_give isl_qpolynomial *isl_qpolynomial_mul( - __isl_take isl_qpolynomial *qp1, - __isl_take isl_qpolynomial *qp2); - __isl_give isl_qpolynomial *isl_qpolynomial_pow( - __isl_take isl_qpolynomial *qp, unsigned exponent); - - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_fix_val( - __isl_take isl_pw_qpolynomial *pwqp, - enum isl_dim_type type, unsigned n, + __isl_give isl_qpolynomial_fold * + isl_qpolynomial_fold_scale_val( + __isl_take isl_qpolynomial_fold *fold, __isl_take isl_val *v); __isl_give isl_pw_qpolynomial * isl_pw_qpolynomial_scale_val( __isl_take isl_pw_qpolynomial *pwqp, __isl_take isl_val *v); - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add( - __isl_take isl_pw_qpolynomial *pwqp1, - __isl_take isl_pw_qpolynomial *pwqp2); - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_sub( - __isl_take isl_pw_qpolynomial *pwqp1, - __isl_take isl_pw_qpolynomial *pwqp2); - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add_disjoint( - __isl_take isl_pw_qpolynomial *pwqp1, - __isl_take isl_pw_qpolynomial *pwqp2); - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_neg( - __isl_take isl_pw_qpolynomial *pwqp); - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_mul( - __isl_take isl_pw_qpolynomial *pwqp1, - __isl_take isl_pw_qpolynomial *pwqp2); - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_pow( - __isl_take isl_pw_qpolynomial *pwqp, unsigned exponent); - + __isl_give isl_pw_qpolynomial_fold * + isl_pw_qpolynomial_fold_scale_val( + __isl_take isl_pw_qpolynomial_fold *pwf, + __isl_take isl_val *v); __isl_give isl_union_pw_qpolynomial * isl_union_pw_qpolynomial_scale_val( __isl_take isl_union_pw_qpolynomial *upwqp, __isl_take isl_val *v); - __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_add( - __isl_take isl_union_pw_qpolynomial *upwqp1, - __isl_take isl_union_pw_qpolynomial *upwqp2); - __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_sub( - __isl_take isl_union_pw_qpolynomial *upwqp1, - __isl_take isl_union_pw_qpolynomial *upwqp2); + __isl_give isl_union_pw_qpolynomial_fold * + isl_union_pw_qpolynomial_fold_scale_val( + __isl_take isl_union_pw_qpolynomial_fold *upwf, + __isl_take isl_val *v); + __isl_give isl_qpolynomial * + isl_qpolynomial_scale_down_val( + __isl_take isl_qpolynomial *qp, + __isl_take isl_val *v); + __isl_give isl_qpolynomial_fold * + isl_qpolynomial_fold_scale_down_val( + __isl_take isl_qpolynomial_fold *fold, + __isl_take isl_val *v); + __isl_give isl_pw_qpolynomial * + isl_pw_qpolynomial_scale_down_val( + __isl_take isl_pw_qpolynomial *pwqp, + __isl_take isl_val *v); + __isl_give isl_pw_qpolynomial_fold * + isl_pw_qpolynomial_fold_scale_down_val( + __isl_take isl_pw_qpolynomial_fold *pwf, + __isl_take isl_val *v); + __isl_give isl_union_pw_qpolynomial * + isl_union_pw_qpolynomial_scale_down_val( + __isl_take isl_union_pw_qpolynomial *upwqp, + __isl_take isl_val *v); + __isl_give isl_union_pw_qpolynomial_fold * + isl_union_pw_qpolynomial_fold_scale_down_val( + __isl_take isl_union_pw_qpolynomial_fold *upwf, + __isl_take isl_val *v); + + #include + __isl_give isl_multi_val *isl_multi_val_mod_multi_val( + __isl_take isl_multi_val *mv1, + __isl_take isl_multi_val *mv2); + __isl_give isl_multi_val *isl_multi_val_scale_multi_val( + __isl_take isl_multi_val *mv1, + __isl_take isl_multi_val *mv2); + __isl_give isl_multi_val * + isl_multi_val_scale_down_multi_val( + __isl_take isl_multi_val *mv1, + __isl_take isl_multi_val *mv2); + + #include + __isl_give isl_multi_aff *isl_multi_aff_mod_multi_val( + __isl_take isl_multi_aff *ma, + __isl_take isl_multi_val *mv); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_mod_multi_val( + __isl_take isl_multi_union_pw_aff *upma, + __isl_take isl_multi_val *mv); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_mod_multi_val( + __isl_take isl_multi_pw_aff *mpa, + __isl_take isl_multi_val *mv); + __isl_give isl_multi_aff *isl_multi_aff_scale_multi_val( + __isl_take isl_multi_aff *ma, + __isl_take isl_multi_val *mv); + __isl_give isl_pw_multi_aff * + isl_pw_multi_aff_scale_multi_val( + __isl_take isl_pw_multi_aff *pma, + __isl_take isl_multi_val *mv); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_scale_multi_val( + __isl_take isl_multi_pw_aff *mpa, + __isl_take isl_multi_val *mv); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_scale_multi_val( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_multi_val *mv); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_scale_multi_val( + __isl_take isl_union_pw_multi_aff *upma, + __isl_take isl_multi_val *mv); + __isl_give isl_multi_aff * + isl_multi_aff_scale_down_multi_val( + __isl_take isl_multi_aff *ma, + __isl_take isl_multi_val *mv); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_scale_down_multi_val( + __isl_take isl_multi_pw_aff *mpa, + __isl_take isl_multi_val *mv); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_scale_down_multi_val( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_multi_val *mv); + +C scales the elements of C +by the corresponding elements of C. + + #include + __isl_give isl_aff *isl_aff_mul( + __isl_take isl_aff *aff1, + __isl_take isl_aff *aff2); + __isl_give isl_aff *isl_aff_div( + __isl_take isl_aff *aff1, + __isl_take isl_aff *aff2); + __isl_give isl_pw_aff *isl_pw_aff_mul( + __isl_take isl_pw_aff *pwaff1, + __isl_take isl_pw_aff *pwaff2); + __isl_give isl_pw_aff *isl_pw_aff_div( + __isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2); + __isl_give isl_pw_aff *isl_pw_aff_tdiv_q( + __isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2); + __isl_give isl_pw_aff *isl_pw_aff_tdiv_r( + __isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2); + +When multiplying two affine expressions, at least one of the two needs +to be a constant. Similarly, when dividing an affine expression by another, +the second expression needs to be a constant. +C computes the quotient of an integer division with +rounding towards zero. C computes the corresponding +remainder. + + #include + __isl_give isl_qpolynomial *isl_qpolynomial_mul( + __isl_take isl_qpolynomial *qp1, + __isl_take isl_qpolynomial *qp2); + __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_mul( + __isl_take isl_pw_qpolynomial *pwqp1, + __isl_take isl_pw_qpolynomial *pwqp2); __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_mul( __isl_take isl_union_pw_qpolynomial *upwqp1, __isl_take isl_union_pw_qpolynomial *upwqp2); - __isl_give isl_qpolynomial *isl_pw_qpolynomial_eval( - __isl_take isl_pw_qpolynomial *pwqp, - __isl_take isl_point *pnt); +=back - __isl_give isl_qpolynomial *isl_union_pw_qpolynomial_eval( - __isl_take isl_union_pw_qpolynomial *upwqp, - __isl_take isl_point *pnt); +=head3 Lexicographic Optimization - __isl_give isl_set *isl_pw_qpolynomial_domain( - __isl_take isl_pw_qpolynomial *pwqp); - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_intersect_domain( - __isl_take isl_pw_qpolynomial *pwpq, +Given a (basic) set C (or C) and a zero-dimensional domain C, +the following functions +compute a set that contains the lexicographic minimum or maximum +of the elements in C (or C) for those values of the parameters +that satisfy C. +If C is not C, then C<*empty> is assigned a set +that contains the parameter values in C for which C (or C) +has no elements. +In other words, the union of the parameter values +for which the result is non-empty and of C<*empty> +is equal to C. + + #include + __isl_give isl_set *isl_basic_set_partial_lexmin( + __isl_take isl_basic_set *bset, + __isl_take isl_basic_set *dom, + __isl_give isl_set **empty); + __isl_give isl_set *isl_basic_set_partial_lexmax( + __isl_take isl_basic_set *bset, + __isl_take isl_basic_set *dom, + __isl_give isl_set **empty); + __isl_give isl_set *isl_set_partial_lexmin( + __isl_take isl_set *set, __isl_take isl_set *dom, + __isl_give isl_set **empty); + __isl_give isl_set *isl_set_partial_lexmax( + __isl_take isl_set *set, __isl_take isl_set *dom, + __isl_give isl_set **empty); + +Given a (basic) set C (or C), the following functions simply +return a set containing the lexicographic minimum or maximum +of the elements in C (or C). +In case of union sets, the optimum is computed per space. + + #include + __isl_give isl_set *isl_basic_set_lexmin( + __isl_take isl_basic_set *bset); + __isl_give isl_set *isl_basic_set_lexmax( + __isl_take isl_basic_set *bset); + __isl_give isl_set *isl_set_lexmin( __isl_take isl_set *set); - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_intersect_params( - __isl_take isl_pw_qpolynomial *pwpq, + __isl_give isl_set *isl_set_lexmax( __isl_take isl_set *set); - - __isl_give isl_union_set *isl_union_pw_qpolynomial_domain( - __isl_take isl_union_pw_qpolynomial *upwqp); - __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_intersect_domain( - __isl_take isl_union_pw_qpolynomial *upwpq, + __isl_give isl_union_set *isl_union_set_lexmin( + __isl_take isl_union_set *uset); + __isl_give isl_union_set *isl_union_set_lexmax( __isl_take isl_union_set *uset); - __isl_give isl_union_pw_qpolynomial * - isl_union_pw_qpolynomial_intersect_params( - __isl_take isl_union_pw_qpolynomial *upwpq, - __isl_take isl_set *set); - __isl_give isl_qpolynomial *isl_qpolynomial_align_params( - __isl_take isl_qpolynomial *qp, - __isl_take isl_space *model); +Given a (basic) relation C (or C) and a domain C, +the following functions +compute a relation that maps each element of C +to the single lexicographic minimum or maximum +of the elements that are associated to that same +element in C (or C). +If C is not C, then C<*empty> is assigned a set +that contains the elements in C that do not map +to any elements in C (or C). +In other words, the union of the domain of the result and of C<*empty> +is equal to C. - __isl_give isl_qpolynomial *isl_qpolynomial_project_domain_on_params( - __isl_take isl_qpolynomial *qp); - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_project_domain_on_params( - __isl_take isl_pw_qpolynomial *pwqp); + #include + __isl_give isl_map *isl_basic_map_partial_lexmax( + __isl_take isl_basic_map *bmap, + __isl_take isl_basic_set *dom, + __isl_give isl_set **empty); + __isl_give isl_map *isl_basic_map_partial_lexmin( + __isl_take isl_basic_map *bmap, + __isl_take isl_basic_set *dom, + __isl_give isl_set **empty); + __isl_give isl_map *isl_map_partial_lexmax( + __isl_take isl_map *map, __isl_take isl_set *dom, + __isl_give isl_set **empty); + __isl_give isl_map *isl_map_partial_lexmin( + __isl_take isl_map *map, __isl_take isl_set *dom, + __isl_give isl_set **empty); - __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_coalesce( - __isl_take isl_union_pw_qpolynomial *upwqp); +Given a (basic) map C (or C), the following functions simply +return a map mapping each element in the domain of +C (or C) to the lexicographic minimum or maximum +of all elements associated to that element. +In case of union relations, the optimum is computed per space. - __isl_give isl_qpolynomial *isl_qpolynomial_gist_params( - __isl_take isl_qpolynomial *qp, - __isl_take isl_set *context); - __isl_give isl_qpolynomial *isl_qpolynomial_gist( - __isl_take isl_qpolynomial *qp, - __isl_take isl_set *context); + #include + __isl_give isl_map *isl_basic_map_lexmin( + __isl_take isl_basic_map *bmap); + __isl_give isl_map *isl_basic_map_lexmax( + __isl_take isl_basic_map *bmap); + __isl_give isl_map *isl_map_lexmin( + __isl_take isl_map *map); + __isl_give isl_map *isl_map_lexmax( + __isl_take isl_map *map); + __isl_give isl_union_map *isl_union_map_lexmin( + __isl_take isl_union_map *umap); + __isl_give isl_union_map *isl_union_map_lexmax( + __isl_take isl_union_map *umap); - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_gist_params( - __isl_take isl_pw_qpolynomial *pwqp, - __isl_take isl_set *context); - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_gist( - __isl_take isl_pw_qpolynomial *pwqp, - __isl_take isl_set *context); +The following functions return their result in the form of +a piecewise multi-affine expression, +but are otherwise equivalent to the corresponding functions +returning a basic set or relation. - __isl_give isl_union_pw_qpolynomial * - isl_union_pw_qpolynomial_gist_params( - __isl_take isl_union_pw_qpolynomial *upwqp, - __isl_take isl_set *context); - __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_gist( - __isl_take isl_union_pw_qpolynomial *upwqp, - __isl_take isl_union_set *context); + #include + __isl_give isl_pw_multi_aff * + isl_basic_set_partial_lexmin_pw_multi_aff( + __isl_take isl_basic_set *bset, + __isl_take isl_basic_set *dom, + __isl_give isl_set **empty); + __isl_give isl_pw_multi_aff * + isl_basic_set_partial_lexmax_pw_multi_aff( + __isl_take isl_basic_set *bset, + __isl_take isl_basic_set *dom, + __isl_give isl_set **empty); + __isl_give isl_pw_multi_aff *isl_set_lexmin_pw_multi_aff( + __isl_take isl_set *set); + __isl_give isl_pw_multi_aff *isl_set_lexmax_pw_multi_aff( + __isl_take isl_set *set); -The gist operation applies the gist operation to each of -the cells in the domain of the input piecewise quasipolynomial. -The context is also exploited -to simplify the quasipolynomials associated to each cell. + #include + __isl_give isl_pw_multi_aff * + isl_basic_map_lexmin_pw_multi_aff( + __isl_take isl_basic_map *bmap); + __isl_give isl_pw_multi_aff * + isl_basic_map_partial_lexmin_pw_multi_aff( + __isl_take isl_basic_map *bmap, + __isl_take isl_basic_set *dom, + __isl_give isl_set **empty); + __isl_give isl_pw_multi_aff * + isl_basic_map_partial_lexmax_pw_multi_aff( + __isl_take isl_basic_map *bmap, + __isl_take isl_basic_set *dom, + __isl_give isl_set **empty); + __isl_give isl_pw_multi_aff *isl_map_lexmin_pw_multi_aff( + __isl_take isl_map *map); + __isl_give isl_pw_multi_aff *isl_map_lexmax_pw_multi_aff( + __isl_take isl_map *map); - __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_to_polynomial( - __isl_take isl_pw_qpolynomial *pwqp, int sign); - __isl_give isl_union_pw_qpolynomial * - isl_union_pw_qpolynomial_to_polynomial( - __isl_take isl_union_pw_qpolynomial *upwqp, int sign); +The following functions return the lexicographic minimum or maximum +on the shared domain of the inputs and the single defined function +on those parts of the domain where only a single function is defined. -Approximate each quasipolynomial by a polynomial. If C is positive, -the polynomial will be an overapproximation. If C is negative, -it will be an underapproximation. If C is zero, the approximation -will lie somewhere in between. + #include + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_union_lexmin( + __isl_take isl_pw_multi_aff *pma1, + __isl_take isl_pw_multi_aff *pma2); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_union_lexmax( + __isl_take isl_pw_multi_aff *pma1, + __isl_take isl_pw_multi_aff *pma2); -=head2 Bounds on Piecewise Quasipolynomials and Piecewise Quasipolynomial Reductions +=head2 Ternary Operations -A piecewise quasipolynomial reduction is a piecewise -reduction (or fold) of quasipolynomials. -In particular, the reduction can be maximum or a minimum. -The objects are mainly used to represent the result of -an upper or lower bound on a quasipolynomial over its domain, -i.e., as the result of the following function. + #include + __isl_give isl_pw_aff *isl_pw_aff_cond( + __isl_take isl_pw_aff *cond, + __isl_take isl_pw_aff *pwaff_true, + __isl_take isl_pw_aff *pwaff_false); - __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_bound( - __isl_take isl_pw_qpolynomial *pwqp, - enum isl_fold type, int *tight); +The function C performs a conditional operator +and returns an expression that is equal to C +for elements where C is non-zero and equal to C for elements +where C is zero. - __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_bound( - __isl_take isl_union_pw_qpolynomial *upwqp, - enum isl_fold type, int *tight); +=head2 Lists -The C argument may be either C or C. -If C is not C, then C<*tight> is set to C<1> -is the returned bound is known be tight, i.e., for each value -of the parameters there is at least -one element in the domain that reaches the bound. -If the domain of C is not wrapping, then the bound is computed -over all elements in that domain and the result has a purely parametric -domain. If the domain of C is wrapping, then the bound is -computed over the range of the wrapped relation. The domain of the -wrapped relation becomes the domain of the result. +Lists are defined over several element types, including +C, C, C, C, C, +C, C, +C, C, C, C, C, +C, C and C. +Here we take lists of Cs as an example. +Lists can be created, copied, modified and freed using the following functions. -A (piecewise) quasipolynomial reduction can be copied or freed using the -following functions. + #include + __isl_give isl_set_list *isl_set_list_from_set( + __isl_take isl_set *el); + __isl_give isl_set_list *isl_set_list_alloc( + isl_ctx *ctx, int n); + __isl_give isl_set_list *isl_set_list_copy( + __isl_keep isl_set_list *list); + __isl_give isl_set_list *isl_set_list_insert( + __isl_take isl_set_list *list, unsigned pos, + __isl_take isl_set *el); + __isl_give isl_set_list *isl_set_list_add( + __isl_take isl_set_list *list, + __isl_take isl_set *el); + __isl_give isl_set_list *isl_set_list_drop( + __isl_take isl_set_list *list, + unsigned first, unsigned n); + __isl_give isl_set_list *isl_set_list_set_set( + __isl_take isl_set_list *list, int index, + __isl_take isl_set *set); + __isl_give isl_set_list *isl_set_list_concat( + __isl_take isl_set_list *list1, + __isl_take isl_set_list *list2); + __isl_give isl_set_list *isl_set_list_sort( + __isl_take isl_set_list *list, + int (*cmp)(__isl_keep isl_set *a, + __isl_keep isl_set *b, void *user), + void *user); + __isl_null isl_set_list *isl_set_list_free( + __isl_take isl_set_list *list); - __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_copy( - __isl_keep isl_qpolynomial_fold *fold); - __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_copy( - __isl_keep isl_pw_qpolynomial_fold *pwf); - __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_copy( - __isl_keep isl_union_pw_qpolynomial_fold *upwf); - void isl_qpolynomial_fold_free( - __isl_take isl_qpolynomial_fold *fold); - void *isl_pw_qpolynomial_fold_free( - __isl_take isl_pw_qpolynomial_fold *pwf); - void *isl_union_pw_qpolynomial_fold_free( - __isl_take isl_union_pw_qpolynomial_fold *upwf); +C creates an empty list with an initial capacity +for C elements. C and C +add elements to a list, increasing its capacity as needed. +C creates a list with a single element. -=head3 Printing Piecewise Quasipolynomial Reductions +Lists can be inspected using the following functions. -Piecewise quasipolynomial reductions can be printed -using the following function. + #include + int isl_set_list_n_set(__isl_keep isl_set_list *list); + __isl_give isl_set *isl_set_list_get_set( + __isl_keep isl_set_list *list, int index); + isl_stat isl_set_list_foreach(__isl_keep isl_set_list *list, + isl_stat (*fn)(__isl_take isl_set *el, void *user), + void *user); + isl_stat isl_set_list_foreach_scc( + __isl_keep isl_set_list *list, + isl_bool (*follows)(__isl_keep isl_set *a, + __isl_keep isl_set *b, void *user), + void *follows_user + isl_stat (*fn)(__isl_take isl_set *el, void *user), + void *fn_user); - __isl_give isl_printer *isl_printer_print_pw_qpolynomial_fold( - __isl_take isl_printer *p, - __isl_keep isl_pw_qpolynomial_fold *pwf); - __isl_give isl_printer *isl_printer_print_union_pw_qpolynomial_fold( - __isl_take isl_printer *p, - __isl_keep isl_union_pw_qpolynomial_fold *upwf); +The function C calls C on each of the +strongly connected components of the graph with as vertices the elements +of C and a directed edge from vertex C to vertex C +iff C returns C<1>. The callbacks C and C +should return C<-1> on error. -For C, -output format of the printer -needs to be set to either C or C. -For C, -output format of the printer -needs to be set to C. -In case of printing in C, the user may want -to set the names of all dimensions +Lists can be printed using - __isl_give isl_pw_qpolynomial_fold * - isl_pw_qpolynomial_fold_set_dim_name( - __isl_take isl_pw_qpolynomial_fold *pwf, - enum isl_dim_type type, unsigned pos, - const char *s); + #include + __isl_give isl_printer *isl_printer_print_set_list( + __isl_take isl_printer *p, + __isl_keep isl_set_list *list); -=head3 Inspecting (Piecewise) Quasipolynomial Reductions +=head2 Associative arrays -To iterate over all piecewise quasipolynomial reductions in a union -piecewise quasipolynomial reduction, use the following function +Associative arrays map isl objects of a specific type to isl objects +of some (other) specific type. They are defined for several pairs +of types, including (C, C), +(C, C) and. +(C, C). +Here, we take associative arrays that map Cs to Cs +as an example. - int isl_union_pw_qpolynomial_fold_foreach_pw_qpolynomial_fold( - __isl_keep isl_union_pw_qpolynomial_fold *upwf, - int (*fn)(__isl_take isl_pw_qpolynomial_fold *pwf, - void *user), void *user); +Associative arrays can be created, copied and freed using +the following functions. -To iterate over the cells in a piecewise quasipolynomial reduction, -use either of the following two functions + #include + __isl_give isl_id_to_ast_expr *isl_id_to_ast_expr_alloc( + isl_ctx *ctx, int min_size); + __isl_give isl_id_to_ast_expr *isl_id_to_ast_expr_copy( + __isl_keep isl_id_to_ast_expr *id2expr); + __isl_null isl_id_to_ast_expr *isl_id_to_ast_expr_free( + __isl_take isl_id_to_ast_expr *id2expr); + +The C argument to C can be used +to specify the expected size of the associative array. +The associative array will be grown automatically as needed. + +Associative arrays can be inspected using the following functions. + + #include + isl_bool isl_id_to_ast_expr_has( + __isl_keep isl_id_to_ast_expr *id2expr, + __isl_keep isl_id *key); + __isl_give isl_ast_expr *isl_id_to_ast_expr_get( + __isl_keep isl_id_to_ast_expr *id2expr, + __isl_take isl_id *key); + isl_stat isl_id_to_ast_expr_foreach( + __isl_keep isl_id_to_ast_expr *id2expr, + isl_stat (*fn)(__isl_take isl_id *key, + __isl_take isl_ast_expr *val, void *user), + void *user); - int isl_pw_qpolynomial_fold_foreach_piece( - __isl_keep isl_pw_qpolynomial_fold *pwf, - int (*fn)(__isl_take isl_set *set, - __isl_take isl_qpolynomial_fold *fold, - void *user), void *user); - int isl_pw_qpolynomial_fold_foreach_lifted_piece( - __isl_keep isl_pw_qpolynomial_fold *pwf, - int (*fn)(__isl_take isl_set *set, - __isl_take isl_qpolynomial_fold *fold, - void *user), void *user); +They can be modified using the following function. -See L for an explanation -of the difference between these two functions. + #include + __isl_give isl_id_to_ast_expr *isl_id_to_ast_expr_set( + __isl_take isl_id_to_ast_expr *id2expr, + __isl_take isl_id *key, + __isl_take isl_ast_expr *val); + __isl_give isl_id_to_ast_expr *isl_id_to_ast_expr_drop( + __isl_take isl_id_to_ast_expr *id2expr, + __isl_take isl_id *key); -To iterate over all quasipolynomials in a reduction, use +Associative arrays can be printed using the following function. - int isl_qpolynomial_fold_foreach_qpolynomial( - __isl_keep isl_qpolynomial_fold *fold, - int (*fn)(__isl_take isl_qpolynomial *qp, - void *user), void *user); + #include + __isl_give isl_printer *isl_printer_print_id_to_ast_expr( + __isl_take isl_printer *p, + __isl_keep isl_id_to_ast_expr *id2expr); -=head3 Properties of Piecewise Quasipolynomial Reductions +=head2 Vectors -To check whether two union piecewise quasipolynomial reductions are -obviously equal, use +Vectors can be created, copied and freed using the following functions. - int isl_union_pw_qpolynomial_fold_plain_is_equal( - __isl_keep isl_union_pw_qpolynomial_fold *upwf1, - __isl_keep isl_union_pw_qpolynomial_fold *upwf2); + #include + __isl_give isl_vec *isl_vec_alloc(isl_ctx *ctx, + unsigned size); + __isl_give isl_vec *isl_vec_copy(__isl_keep isl_vec *vec); + __isl_null isl_vec *isl_vec_free(__isl_take isl_vec *vec); -=head3 Operations on Piecewise Quasipolynomial Reductions +Note that the elements of a newly created vector may have arbitrary values. +The elements can be changed and inspected using the following functions. - __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_scale( - __isl_take isl_qpolynomial_fold *fold, isl_int v); - __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_scale_val( - __isl_take isl_qpolynomial_fold *fold, - __isl_take isl_val *v); - __isl_give isl_pw_qpolynomial_fold * - isl_pw_qpolynomial_fold_scale_val( - __isl_take isl_pw_qpolynomial_fold *pwf, - __isl_take isl_val *v); - __isl_give isl_union_pw_qpolynomial_fold * - isl_union_pw_qpolynomial_fold_scale_val( - __isl_take isl_union_pw_qpolynomial_fold *upwf, + int isl_vec_size(__isl_keep isl_vec *vec); + __isl_give isl_val *isl_vec_get_element_val( + __isl_keep isl_vec *vec, int pos); + __isl_give isl_vec *isl_vec_set_element_si( + __isl_take isl_vec *vec, int pos, int v); + __isl_give isl_vec *isl_vec_set_element_val( + __isl_take isl_vec *vec, int pos, __isl_take isl_val *v); + __isl_give isl_vec *isl_vec_set_si(__isl_take isl_vec *vec, + int v); + __isl_give isl_vec *isl_vec_set_val( + __isl_take isl_vec *vec, __isl_take isl_val *v); + int isl_vec_cmp_element(__isl_keep isl_vec *vec1, + __isl_keep isl_vec *vec2, int pos); - __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_add( - __isl_take isl_pw_qpolynomial_fold *pwf1, - __isl_take isl_pw_qpolynomial_fold *pwf2); +C will return a negative value if anything went wrong. +In that case, the value of C<*v> is undefined. - __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_fold( - __isl_take isl_pw_qpolynomial_fold *pwf1, - __isl_take isl_pw_qpolynomial_fold *pwf2); +The following function can be used to concatenate two vectors. - __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_fold( - __isl_take isl_union_pw_qpolynomial_fold *upwf1, - __isl_take isl_union_pw_qpolynomial_fold *upwf2); + __isl_give isl_vec *isl_vec_concat(__isl_take isl_vec *vec1, + __isl_take isl_vec *vec2); - __isl_give isl_qpolynomial *isl_pw_qpolynomial_fold_eval( - __isl_take isl_pw_qpolynomial_fold *pwf, - __isl_take isl_point *pnt); +=head2 Matrices - __isl_give isl_qpolynomial *isl_union_pw_qpolynomial_fold_eval( - __isl_take isl_union_pw_qpolynomial_fold *upwf, - __isl_take isl_point *pnt); +Matrices can be created, copied and freed using the following functions. - __isl_give isl_pw_qpolynomial_fold * - isl_pw_qpolynomial_fold_intersect_params( - __isl_take isl_pw_qpolynomial_fold *pwf, - __isl_take isl_set *set); + #include + __isl_give isl_mat *isl_mat_alloc(isl_ctx *ctx, + unsigned n_row, unsigned n_col); + __isl_give isl_mat *isl_mat_copy(__isl_keep isl_mat *mat); + __isl_null isl_mat *isl_mat_free(__isl_take isl_mat *mat); - __isl_give isl_union_set *isl_union_pw_qpolynomial_fold_domain( - __isl_take isl_union_pw_qpolynomial_fold *upwf); - __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_intersect_domain( - __isl_take isl_union_pw_qpolynomial_fold *upwf, - __isl_take isl_union_set *uset); - __isl_give isl_union_pw_qpolynomial_fold * - isl_union_pw_qpolynomial_fold_intersect_params( - __isl_take isl_union_pw_qpolynomial_fold *upwf, - __isl_take isl_set *set); +Note that the elements of a newly created matrix may have arbitrary values. +The elements can be changed and inspected using the following functions. + + int isl_mat_rows(__isl_keep isl_mat *mat); + int isl_mat_cols(__isl_keep isl_mat *mat); + __isl_give isl_val *isl_mat_get_element_val( + __isl_keep isl_mat *mat, int row, int col); + __isl_give isl_mat *isl_mat_set_element_si(__isl_take isl_mat *mat, + int row, int col, int v); + __isl_give isl_mat *isl_mat_set_element_val( + __isl_take isl_mat *mat, int row, int col, + __isl_take isl_val *v); - __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_project_domain_on_params( - __isl_take isl_pw_qpolynomial_fold *pwf); +C will return a negative value if anything went wrong. +In that case, the value of C<*v> is undefined. - __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_coalesce( - __isl_take isl_pw_qpolynomial_fold *pwf); +The following function can be used to compute the (right) inverse +of a matrix, i.e., a matrix such that the product of the original +and the inverse (in that order) is a multiple of the identity matrix. +The input matrix is assumed to be of full row-rank. - __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_coalesce( - __isl_take isl_union_pw_qpolynomial_fold *upwf); + __isl_give isl_mat *isl_mat_right_inverse(__isl_take isl_mat *mat); - __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_gist_params( - __isl_take isl_qpolynomial_fold *fold, - __isl_take isl_set *context); - __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_gist( - __isl_take isl_qpolynomial_fold *fold, - __isl_take isl_set *context); +The following function can be used to compute the (right) kernel +(or null space) of a matrix, i.e., a matrix such that the product of +the original and the kernel (in that order) is the zero matrix. - __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_gist( - __isl_take isl_pw_qpolynomial_fold *pwf, - __isl_take isl_set *context); - __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_gist_params( - __isl_take isl_pw_qpolynomial_fold *pwf, - __isl_take isl_set *context); + __isl_give isl_mat *isl_mat_right_kernel(__isl_take isl_mat *mat); - __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_gist( - __isl_take isl_union_pw_qpolynomial_fold *upwf, - __isl_take isl_union_set *context); - __isl_give isl_union_pw_qpolynomial_fold * - isl_union_pw_qpolynomial_fold_gist_params( - __isl_take isl_union_pw_qpolynomial_fold *upwf, - __isl_take isl_set *context); +=head2 Bounds on Piecewise Quasipolynomials and Piecewise Quasipolynomial Reductions -The gist operation applies the gist operation to each of -the cells in the domain of the input piecewise quasipolynomial reduction. -In future, the operation will also exploit the context -to simplify the quasipolynomial reductions associated to each cell. +The following functions determine +an upper or lower bound on a quasipolynomial over its domain. __isl_give isl_pw_qpolynomial_fold * - isl_set_apply_pw_qpolynomial_fold( - __isl_take isl_set *set, - __isl_take isl_pw_qpolynomial_fold *pwf, - int *tight); - __isl_give isl_pw_qpolynomial_fold * - isl_map_apply_pw_qpolynomial_fold( - __isl_take isl_map *map, - __isl_take isl_pw_qpolynomial_fold *pwf, - int *tight); - __isl_give isl_union_pw_qpolynomial_fold * - isl_union_set_apply_union_pw_qpolynomial_fold( - __isl_take isl_union_set *uset, - __isl_take isl_union_pw_qpolynomial_fold *upwf, - int *tight); + isl_pw_qpolynomial_bound( + __isl_take isl_pw_qpolynomial *pwqp, + enum isl_fold type, int *tight); + __isl_give isl_union_pw_qpolynomial_fold * - isl_union_map_apply_union_pw_qpolynomial_fold( - __isl_take isl_union_map *umap, - __isl_take isl_union_pw_qpolynomial_fold *upwf, - int *tight); + isl_union_pw_qpolynomial_bound( + __isl_take isl_union_pw_qpolynomial *upwqp, + enum isl_fold type, int *tight); -The functions taking a map -compose the given map with the given piecewise quasipolynomial reduction. -That is, compute a bound (of the same type as C or C itself) -over all elements in the intersection of the range of the map -and the domain of the piecewise quasipolynomial reduction -as a function of an element in the domain of the map. -The functions taking a set compute a bound over all elements in the -intersection of the set and the domain of the -piecewise quasipolynomial reduction. +The C argument may be either C or C. +If C is not C, then C<*tight> is set to C<1> +is the returned bound is known be tight, i.e., for each value +of the parameters there is at least +one element in the domain that reaches the bound. +If the domain of C is not wrapping, then the bound is computed +over all elements in that domain and the result has a purely parametric +domain. If the domain of C is wrapping, then the bound is +computed over the range of the wrapped relation. The domain of the +wrapped relation becomes the domain of the result. =head2 Parametric Vertex Enumeration @@ -5268,48 +7276,42 @@ the vertices or iterating over all the chambers or cells and then iterating over all vertices that are active on the chamber. - int isl_vertices_foreach_vertex( + isl_stat isl_vertices_foreach_vertex( __isl_keep isl_vertices *vertices, - int (*fn)(__isl_take isl_vertex *vertex, void *user), - void *user); + isl_stat (*fn)(__isl_take isl_vertex *vertex, + void *user), void *user); - int isl_vertices_foreach_cell( + isl_stat isl_vertices_foreach_cell( __isl_keep isl_vertices *vertices, - int (*fn)(__isl_take isl_cell *cell, void *user), - void *user); - int isl_cell_foreach_vertex(__isl_keep isl_cell *cell, - int (*fn)(__isl_take isl_vertex *vertex, void *user), - void *user); + isl_stat (*fn)(__isl_take isl_cell *cell, + void *user), void *user); + isl_stat isl_cell_foreach_vertex(__isl_keep isl_cell *cell, + isl_stat (*fn)(__isl_take isl_vertex *vertex, + void *user), void *user); Other operations that can be performed on an C object are the following. - isl_ctx *isl_vertices_get_ctx( - __isl_keep isl_vertices *vertices); int isl_vertices_get_n_vertices( __isl_keep isl_vertices *vertices); void isl_vertices_free(__isl_take isl_vertices *vertices); Vertices can be inspected and destroyed using the following functions. - isl_ctx *isl_vertex_get_ctx(__isl_keep isl_vertex *vertex); int isl_vertex_get_id(__isl_keep isl_vertex *vertex); __isl_give isl_basic_set *isl_vertex_get_domain( __isl_keep isl_vertex *vertex); - __isl_give isl_basic_set *isl_vertex_get_expr( + __isl_give isl_multi_aff *isl_vertex_get_expr( __isl_keep isl_vertex *vertex); void isl_vertex_free(__isl_take isl_vertex *vertex); -C returns a singleton parametric set describing -the vertex, while C returns the activity domain +C returns a multiple quasi-affine expression +describing the vertex in terms of the parameters, +while C returns the activity domain of the vertex. -Note that C and C return -B basic sets, so they should mainly be used for inspection -and should not be mixed with integer sets. Chambers can be inspected and destroyed using the following functions. - isl_ctx *isl_cell_get_ctx(__isl_keep isl_cell *cell); __isl_give isl_basic_set *isl_cell_get_domain( __isl_keep isl_cell *cell); void isl_cell_free(__isl_take isl_cell *cell); @@ -5319,6 +7321,907 @@ This section collects functionality in C that has been specifically designed for use during polyhedral compilation. +=head2 Schedule Trees + +A schedule tree is a structured representation of a schedule, +assigning a relative order to a set of domain elements. +The relative order expressed by the schedule tree is +defined recursively. In particular, the order between +two domain elements is determined by the node that is closest +to the root that refers to both elements and that orders them apart. +Each node in the tree is of one of several types. +The root node is always of type C +(or C) +and it describes the (extra) domain elements to which the schedule applies. +The other types of nodes are as follows. + +=over + +=item C + +A band of schedule dimensions. Each schedule dimension is represented +by a union piecewise quasi-affine expression. If this expression +assigns a different value to two domain elements, while all previous +schedule dimensions in the same band assign them the same value, +then the two domain elements are ordered according to these two +different values. + +=item C + +An expansion node maps each of the domain elements that reach the node +to one or more domain elements. The image of this mapping forms +the set of domain elements that reach the child of the expansion node. +The function that maps each of the expanded domain elements +to the original domain element from which it was expanded +is called the contraction. + +=item C + +A filter node does not impose any ordering, but rather intersects +the set of domain elements that the current subtree refers to +with a given union set. The subtree of the filter node only +refers to domain elements in the intersection. +A filter node is typically only used a child of a sequence or +set node. + +=item C + +A leaf of the schedule tree. Leaf nodes do not impose any ordering. + +=item C + +A mark node can be used to attach any kind of information to a subtree +of the schedule tree. + +=item C + +A sequence node has one or more children, each of which is a filter node. +The filters on these filter nodes form a partition of +the domain elements that the current subtree refers to. +If two domain elements appear in distinct filters then the sequence +node orders them according to the child positions of the corresponding +filter nodes. + +=item C + +A set node is similar to a sequence node, except that +it expresses that domain elements appearing in distinct filters +may have any order. The order of the children of a set node +is therefore also immaterial. + +=back + +The following node types are only supported by the AST generator. + +=over + +=item C + +The context describes constraints on the parameters and +the schedule dimensions of outer +bands that the AST generator may assume to hold. It is also the only +kind of node that may introduce additional parameters. +The space of the context is that of the flat product of the outer +band nodes. In particular, if there are no outer band nodes, then +this space is the unnamed zero-dimensional space. +Since a context node references the outer band nodes, any tree +containing a context node is considered to be anchored. + +=item C + +An extension node instructs the AST generator to add additional +domain elements that need to be scheduled. +The additional domain elements are described by the range of +the extension map in terms of the outer schedule dimensions, +i.e., the flat product of the outer band nodes. +Note that domain elements are added whenever the AST generator +reaches the extension node, meaning that there are still some +active domain elements for which an AST needs to be generated. +The conditions under which some domain elements are still active +may however not be completely described by the outer AST nodes +generated at that point. + +An extension node may also appear as the root of a schedule tree, +when it is intended to be inserted into another tree +using C or C. +In this case, the domain of the extension node should +correspond to the flat product of the outer band nodes +in this other schedule tree at the point where the extension tree +will be inserted. + +=item C + +The guard describes constraints on the parameters and +the schedule dimensions of outer +bands that need to be enforced by the outer nodes +in the generated AST. +The space of the guard is that of the flat product of the outer +band nodes. In particular, if there are no outer band nodes, then +this space is the unnamed zero-dimensional space. +Since a guard node references the outer band nodes, any tree +containing a guard node is considered to be anchored. + +=back + +Except for the C nodes, +none of the nodes may introduce any parameters that were not +already present in the root domain node. + +A schedule tree is encapsulated in an C object. +The simplest such objects, those with a tree consisting of single domain node, +can be created using the following functions with either an empty +domain or a given domain. + + #include + __isl_give isl_schedule *isl_schedule_empty( + __isl_take isl_space *space); + __isl_give isl_schedule *isl_schedule_from_domain( + __isl_take isl_union_set *domain); + +The function C described +in L can also be used to construct schedules. + +C objects may be copied and freed using the following functions. + + #include + __isl_give isl_schedule *isl_schedule_copy( + __isl_keep isl_schedule *sched); + __isl_null isl_schedule *isl_schedule_free( + __isl_take isl_schedule *sched); + +The following functions checks whether two C objects +are obviously the same. + + #include + isl_bool isl_schedule_plain_is_equal( + __isl_keep isl_schedule *schedule1, + __isl_keep isl_schedule *schedule2); + +The domain of the schedule, i.e., the domain described by the root node, +can be obtained using the following function. + + #include + __isl_give isl_union_set *isl_schedule_get_domain( + __isl_keep isl_schedule *schedule); + +An extra top-level band node (right underneath the domain node) can +be introduced into the schedule using the following function. +The schedule tree is assumed not to have any anchored nodes. + + #include + __isl_give isl_schedule * + isl_schedule_insert_partial_schedule( + __isl_take isl_schedule *schedule, + __isl_take isl_multi_union_pw_aff *partial); + +A top-level context node (right underneath the domain node) can +be introduced into the schedule using the following function. + + #include + __isl_give isl_schedule *isl_schedule_insert_context( + __isl_take isl_schedule *schedule, + __isl_take isl_set *context) + +A top-level guard node (right underneath the domain node) can +be introduced into the schedule using the following function. + + #include + __isl_give isl_schedule *isl_schedule_insert_guard( + __isl_take isl_schedule *schedule, + __isl_take isl_set *guard) + +A schedule that combines two schedules either in the given +order or in an arbitrary order, i.e., with an C +or an C node, +can be created using the following functions. + + #include + __isl_give isl_schedule *isl_schedule_sequence( + __isl_take isl_schedule *schedule1, + __isl_take isl_schedule *schedule2); + __isl_give isl_schedule *isl_schedule_set( + __isl_take isl_schedule *schedule1, + __isl_take isl_schedule *schedule2); + +The domains of the two input schedules need to be disjoint. + +The following function can be used to restrict the domain +of a schedule with a domain node as root to be a subset of the given union set. +This operation may remove nodes in the tree that have become +redundant. + + #include + __isl_give isl_schedule *isl_schedule_intersect_domain( + __isl_take isl_schedule *schedule, + __isl_take isl_union_set *domain); + +The following function resets the user pointers on all parameter +and tuple identifiers referenced by the nodes of the given schedule. + + #include + __isl_give isl_schedule *isl_schedule_reset_user( + __isl_take isl_schedule *schedule); + +The following function aligns the parameters of all nodes +in the given schedule to the given space. + + #include + __isl_give isl_schedule *isl_schedule_align_params( + __isl_take isl_schedule *schedule, + __isl_take isl_space *space); + +The following function allows the user to plug in a given function +in the iteration domains. The input schedule is not allowed to contain +any expansion nodes. + + #include + __isl_give isl_schedule * + isl_schedule_pullback_union_pw_multi_aff( + __isl_take isl_schedule *schedule, + __isl_take isl_union_pw_multi_aff *upma); + +An C representation of the schedule can be obtained +from an C using the following function. + + #include + __isl_give isl_union_map *isl_schedule_get_map( + __isl_keep isl_schedule *sched); + +The resulting relation encodes the same relative ordering as +the schedule by mapping the domain elements to a common schedule space. +If the schedule_separate_components option is set, then the order +of the children of a set node is explicitly encoded in the result. +If the tree contains any expansion nodes, then the relation +is formulated in terms of the expanded domain elements. + +Schedules can be read from input using the following functions. + + #include + __isl_give isl_schedule *isl_schedule_read_from_file( + isl_ctx *ctx, FILE *input); + __isl_give isl_schedule *isl_schedule_read_from_str( + isl_ctx *ctx, const char *str); + +A representation of the schedule can be printed using + + #include + __isl_give isl_printer *isl_printer_print_schedule( + __isl_take isl_printer *p, + __isl_keep isl_schedule *schedule); + +The schedule tree can be traversed through the use of +C objects that point to a particular +position in the schedule tree. Whenever a C +is use to modify a node in the schedule tree, the original schedule +tree is left untouched and the modifications are performed to a copy +of the tree. The returned C then points to +this modified copy of the tree. + +The root of the schedule tree can be obtained using the following function. + + #include + __isl_give isl_schedule_node *isl_schedule_get_root( + __isl_keep isl_schedule *schedule); + +A pointer to a newly created schedule tree with a single domain +node can be created using the following functions. + + #include + __isl_give isl_schedule_node * + isl_schedule_node_from_domain( + __isl_take isl_union_set *domain); + __isl_give isl_schedule_node * + isl_schedule_node_from_extension( + __isl_take isl_union_map *extension); + +C creates a tree with an extension +node as root. + +Schedule nodes can be copied and freed using the following functions. + + #include + __isl_give isl_schedule_node *isl_schedule_node_copy( + __isl_keep isl_schedule_node *node); + __isl_null isl_schedule_node *isl_schedule_node_free( + __isl_take isl_schedule_node *node); + +The following functions can be used to check if two schedule +nodes point to the same position in the same schedule. + + #include + isl_bool isl_schedule_node_is_equal( + __isl_keep isl_schedule_node *node1, + __isl_keep isl_schedule_node *node2); + +The following properties can be obtained from a schedule node. + + #include + enum isl_schedule_node_type isl_schedule_node_get_type( + __isl_keep isl_schedule_node *node); + enum isl_schedule_node_type + isl_schedule_node_get_parent_type( + __isl_keep isl_schedule_node *node); + __isl_give isl_schedule *isl_schedule_node_get_schedule( + __isl_keep isl_schedule_node *node); + +The function C returns the type of +the node, while C returns +type of the parent of the node, which is required to exist. +The function C returns a copy +to the schedule to which the node belongs. + +The following functions can be used to move the schedule node +to a different position in the tree or to check if such a position +exists. + + #include + isl_bool isl_schedule_node_has_parent( + __isl_keep isl_schedule_node *node); + __isl_give isl_schedule_node *isl_schedule_node_parent( + __isl_take isl_schedule_node *node); + __isl_give isl_schedule_node *isl_schedule_node_root( + __isl_take isl_schedule_node *node); + __isl_give isl_schedule_node *isl_schedule_node_ancestor( + __isl_take isl_schedule_node *node, + int generation); + int isl_schedule_node_n_children( + __isl_keep isl_schedule_node *node); + __isl_give isl_schedule_node *isl_schedule_node_child( + __isl_take isl_schedule_node *node, int pos); + isl_bool isl_schedule_node_has_children( + __isl_keep isl_schedule_node *node); + __isl_give isl_schedule_node *isl_schedule_node_first_child( + __isl_take isl_schedule_node *node); + isl_bool isl_schedule_node_has_previous_sibling( + __isl_keep isl_schedule_node *node); + __isl_give isl_schedule_node * + isl_schedule_node_previous_sibling( + __isl_take isl_schedule_node *node); + isl_bool isl_schedule_node_has_next_sibling( + __isl_keep isl_schedule_node *node); + __isl_give isl_schedule_node * + isl_schedule_node_next_sibling( + __isl_take isl_schedule_node *node); + +For C, the ancestor of generation 0 +is the node itself, the ancestor of generation 1 is its parent and so on. + +It is also possible to query the number of ancestors of a node, +the position of the current node +within the children of its parent, the position of the subtree +containing a node within the children of an ancestor +or to obtain a copy of a given +child without destroying the current node. +Given two nodes that point to the same schedule, their closest +shared ancestor can be obtained using +C. + + #include + int isl_schedule_node_get_tree_depth( + __isl_keep isl_schedule_node *node); + int isl_schedule_node_get_child_position( + __isl_keep isl_schedule_node *node); + int isl_schedule_node_get_ancestor_child_position( + __isl_keep isl_schedule_node *node, + __isl_keep isl_schedule_node *ancestor); + __isl_give isl_schedule_node *isl_schedule_node_get_child( + __isl_keep isl_schedule_node *node, int pos); + __isl_give isl_schedule_node * + isl_schedule_node_get_shared_ancestor( + __isl_keep isl_schedule_node *node1, + __isl_keep isl_schedule_node *node2); + +All nodes in a schedule tree or +all descendants of a specific node (including the node) can be visited +in depth-first pre-order using the following functions. + + #include + isl_stat isl_schedule_foreach_schedule_node_top_down( + __isl_keep isl_schedule *sched, + isl_bool (*fn)(__isl_keep isl_schedule_node *node, + void *user), void *user); + + #include + isl_stat isl_schedule_node_foreach_descendant_top_down( + __isl_keep isl_schedule_node *node, + isl_bool (*fn)(__isl_keep isl_schedule_node *node, + void *user), void *user); + +The callback function is slightly different from the usual +callbacks in that it not only indicates success (non-negative result) +or failure (negative result), but also indicates whether the children +of the given node should be visited. In particular, if the callback +returns a positive value, then the children are visited, but if +the callback returns zero, then the children are not visited. + +The ancestors of a node in a schedule tree can be visited from +the root down to and including the parent of the node using +the following function. + + #include + isl_stat isl_schedule_node_foreach_ancestor_top_down( + __isl_keep isl_schedule_node *node, + isl_stat (*fn)(__isl_keep isl_schedule_node *node, + void *user), void *user); + +The following functions allows for a depth-first post-order +traversal of the nodes in a schedule tree or +of the descendants of a specific node (including the node +itself), where the user callback is allowed to modify the +visited node. + + #include + __isl_give isl_schedule * + isl_schedule_map_schedule_node_bottom_up( + __isl_take isl_schedule *schedule, + __isl_give isl_schedule_node *(*fn)( + __isl_take isl_schedule_node *node, + void *user), void *user); + + #include + __isl_give isl_schedule_node * + isl_schedule_node_map_descendant_bottom_up( + __isl_take isl_schedule_node *node, + __isl_give isl_schedule_node *(*fn)( + __isl_take isl_schedule_node *node, + void *user), void *user); + +The traversal continues from the node returned by the callback function. +It is the responsibility of the user to ensure that this does not +lead to an infinite loop. It is safest to always return a pointer +to the same position (same ancestors and child positions) as the input node. + +The following function removes a node (along with its descendants) +from a schedule tree and returns a pointer to the leaf at the +same position in the updated tree. +It is not allowed to remove the root of a schedule tree or +a child of a set or sequence node. + + #include + __isl_give isl_schedule_node *isl_schedule_node_cut( + __isl_take isl_schedule_node *node); + +The following function removes a single node +from a schedule tree and returns a pointer to the child +of the node, now located at the position of the original node +or to a leaf node at that position if there was no child. +It is not allowed to remove the root of a schedule tree, +a set or sequence node, a child of a set or sequence node or +a band node with an anchored subtree. + + #include + __isl_give isl_schedule_node *isl_schedule_node_delete( + __isl_take isl_schedule_node *node); + +Most nodes in a schedule tree only contain local information. +In some cases, however, a node may also refer to outer band nodes. +This means that the position of the node within the tree should +not be changed, or at least that no changes are performed to the +outer band nodes. The following function can be used to test +whether the subtree rooted at a given node contains any such nodes. + + #include + isl_bool isl_schedule_node_is_subtree_anchored( + __isl_keep isl_schedule_node *node); + +The following function resets the user pointers on all parameter +and tuple identifiers referenced by the given schedule node. + + #include + __isl_give isl_schedule_node *isl_schedule_node_reset_user( + __isl_take isl_schedule_node *node); + +The following function aligns the parameters of the given schedule +node to the given space. + + #include + __isl_give isl_schedule_node * + isl_schedule_node_align_params( + __isl_take isl_schedule_node *node, + __isl_take isl_space *space); + +Several node types have their own functions for querying +(and in some cases setting) some node type specific properties. + + #include + __isl_give isl_space *isl_schedule_node_band_get_space( + __isl_keep isl_schedule_node *node); + __isl_give isl_multi_union_pw_aff * + isl_schedule_node_band_get_partial_schedule( + __isl_keep isl_schedule_node *node); + __isl_give isl_union_map * + isl_schedule_node_band_get_partial_schedule_union_map( + __isl_keep isl_schedule_node *node); + unsigned isl_schedule_node_band_n_member( + __isl_keep isl_schedule_node *node); + isl_bool isl_schedule_node_band_member_get_coincident( + __isl_keep isl_schedule_node *node, int pos); + __isl_give isl_schedule_node * + isl_schedule_node_band_member_set_coincident( + __isl_take isl_schedule_node *node, int pos, + int coincident); + isl_bool isl_schedule_node_band_get_permutable( + __isl_keep isl_schedule_node *node); + __isl_give isl_schedule_node * + isl_schedule_node_band_set_permutable( + __isl_take isl_schedule_node *node, int permutable); + enum isl_ast_loop_type + isl_schedule_node_band_member_get_ast_loop_type( + __isl_keep isl_schedule_node *node, int pos); + __isl_give isl_schedule_node * + isl_schedule_node_band_member_set_ast_loop_type( + __isl_take isl_schedule_node *node, int pos, + enum isl_ast_loop_type type); + __isl_give isl_union_set * + enum isl_ast_loop_type + isl_schedule_node_band_member_get_isolate_ast_loop_type( + __isl_keep isl_schedule_node *node, int pos); + __isl_give isl_schedule_node * + isl_schedule_node_band_member_set_isolate_ast_loop_type( + __isl_take isl_schedule_node *node, int pos, + enum isl_ast_loop_type type); + isl_schedule_node_band_get_ast_build_options( + __isl_keep isl_schedule_node *node); + __isl_give isl_schedule_node * + isl_schedule_node_band_set_ast_build_options( + __isl_take isl_schedule_node *node, + __isl_take isl_union_set *options); + +The function C returns the space +of the partial schedule of the band. +The function C +returns a representation of the partial schedule of the band node +in the form of an C. +The coincident and permutable properties are set by +C on the schedule tree +it produces. +A scheduling dimension is considered to be ``coincident'' +if it satisfies the coincidence constraints within its band. +That is, if the dependence distances of the coincidence +constraints are all zero in that direction (for fixed +iterations of outer bands). +A band is marked permutable if it was produced using the Pluto-like scheduler. +Note that the scheduler may have to resort to a Feautrier style scheduling +step even if the default scheduler is used. +An C is one of C, +C, C or C. +For the meaning of these loop AST generation types and the difference +between the regular loop AST generation type and the isolate +loop AST generation type, see L. +The functions C +and C +may return C if an error occurs. +The AST build options govern how an AST is generated for +the individual schedule dimensions during AST generation. +See L. + + #include + __isl_give isl_set * + isl_schedule_node_context_get_context( + __isl_keep isl_schedule_node *node); + + #include + __isl_give isl_union_set * + isl_schedule_node_domain_get_domain( + __isl_keep isl_schedule_node *node); + + #include + __isl_give isl_union_map * + isl_schedule_node_expansion_get_expansion( + __isl_keep isl_schedule_node *node); + __isl_give isl_union_pw_multi_aff * + isl_schedule_node_expansion_get_contraction( + __isl_keep isl_schedule_node *node); + + #include + __isl_give isl_union_map * + isl_schedule_node_extension_get_extension( + __isl_keep isl_schedule_node *node); + + #include + __isl_give isl_union_set * + isl_schedule_node_filter_get_filter( + __isl_keep isl_schedule_node *node); + + #include + __isl_give isl_set *isl_schedule_node_guard_get_guard( + __isl_keep isl_schedule_node *node); + + #include + __isl_give isl_id *isl_schedule_node_mark_get_id( + __isl_keep isl_schedule_node *node); + +The following functions can be used to obtain an C, +an C or C representation of +partial schedules related to the node. + + #include + __isl_give isl_multi_union_pw_aff * + isl_schedule_node_get_prefix_schedule_multi_union_pw_aff( + __isl_keep isl_schedule_node *node); + __isl_give isl_union_pw_multi_aff * + isl_schedule_node_get_prefix_schedule_union_pw_multi_aff( + __isl_keep isl_schedule_node *node); + __isl_give isl_union_map * + isl_schedule_node_get_prefix_schedule_union_map( + __isl_keep isl_schedule_node *node); + __isl_give isl_union_map * + isl_schedule_node_get_prefix_schedule_relation( + __isl_keep isl_schedule_node *node); + __isl_give isl_union_map * + isl_schedule_node_get_subtree_schedule_union_map( + __isl_keep isl_schedule_node *node); + +In particular, the functions +C, +C +and C +return a relative ordering on the domain elements that reach the given +node determined by its ancestors. +The function C +additionally includes the domain constraints in the result. +The function C +returns a representation of the partial schedule defined by the +subtree rooted at the given node. +If the tree contains any expansion nodes, then the subtree schedule +is formulated in terms of the expanded domain elements. +The tree passed to functions returning a prefix schedule +may only contain extension nodes if these would not affect +the result of these functions. That is, if one of the ancestors +is an extension node, then all of the domain elements that were +added by the extension node need to have been filtered out +by filter nodes between the extension node and the input node. +The tree passed to C +may not contain in extension nodes in the selected subtree. + +The expansion/contraction defined by an entire subtree, combining +the expansions/contractions +on the expansion nodes in the subtree, can be obtained using +the following functions. + + #include + __isl_give isl_union_map * + isl_schedule_node_get_subtree_expansion( + __isl_keep isl_schedule_node *node); + __isl_give isl_union_pw_multi_aff * + isl_schedule_node_get_subtree_contraction( + __isl_keep isl_schedule_node *node); + +The total number of outer band members of given node, i.e., +the shared output dimension of the maps in the result +of C can be obtained +using the following function. + + #include + int isl_schedule_node_get_schedule_depth( + __isl_keep isl_schedule_node *node); + +The following functions return the elements that reach the given node +or the union of universes in the spaces that contain these elements. + + #include + __isl_give isl_union_set * + isl_schedule_node_get_domain( + __isl_keep isl_schedule_node *node); + __isl_give isl_union_set * + isl_schedule_node_get_universe_domain( + __isl_keep isl_schedule_node *node); + +The input tree of C +may only contain extension nodes if these would not affect +the result of this function. That is, if one of the ancestors +is an extension node, then all of the domain elements that were +added by the extension node need to have been filtered out +by filter nodes between the extension node and the input node. + +The following functions can be used to introduce additional nodes +in the schedule tree. The new node is introduced at the point +in the tree where the C points to and +the results points to the new node. + + #include + __isl_give isl_schedule_node * + isl_schedule_node_insert_partial_schedule( + __isl_take isl_schedule_node *node, + __isl_take isl_multi_union_pw_aff *schedule); + +This function inserts a new band node with (the greatest integer +part of) the given partial schedule. +The subtree rooted at the given node is assumed not to have +any anchored nodes. + + #include + __isl_give isl_schedule_node * + isl_schedule_node_insert_context( + __isl_take isl_schedule_node *node, + __isl_take isl_set *context); + +This function inserts a new context node with the given context constraints. + + #include + __isl_give isl_schedule_node * + isl_schedule_node_insert_filter( + __isl_take isl_schedule_node *node, + __isl_take isl_union_set *filter); + +This function inserts a new filter node with the given filter. +If the original node already pointed to a filter node, then the +two filter nodes are merged into one. + + #include + __isl_give isl_schedule_node * + isl_schedule_node_insert_guard( + __isl_take isl_schedule_node *node, + __isl_take isl_set *guard); + +This function inserts a new guard node with the given guard constraints. + + #include + __isl_give isl_schedule_node * + isl_schedule_node_insert_mark( + __isl_take isl_schedule_node *node, + __isl_take isl_id *mark); + +This function inserts a new mark node with the give mark identifier. + + #include + __isl_give isl_schedule_node * + isl_schedule_node_insert_sequence( + __isl_take isl_schedule_node *node, + __isl_take isl_union_set_list *filters); + __isl_give isl_schedule_node * + isl_schedule_node_insert_set( + __isl_take isl_schedule_node *node, + __isl_take isl_union_set_list *filters); + +These functions insert a new sequence or set node with the given +filters as children. + + #include + __isl_give isl_schedule_node *isl_schedule_node_group( + __isl_take isl_schedule_node *node, + __isl_take isl_id *group_id); + +This function introduces an expansion node in between the current +node and its parent that expands instances of a space with tuple +identifier C to the original domain elements that reach +the node. The group instances are identified by the prefix schedule +of those domain elements. The ancestors of the node are adjusted +to refer to the group instances instead of the original domain +elements. The return value points to the same node in the updated +schedule tree as the input node, i.e., to the child of the newly +introduced expansion node. Grouping instances of different statements +ensures that they will be treated as a single statement by the +AST generator up to the point of the expansion node. + +The partial schedule of a band node can be scaled (down) using +the following functions. + + #include + __isl_give isl_schedule_node * + isl_schedule_node_band_scale( + __isl_take isl_schedule_node *node, + __isl_take isl_multi_val *mv); + __isl_give isl_schedule_node * + isl_schedule_node_band_scale_down( + __isl_take isl_schedule_node *node, + __isl_take isl_multi_val *mv); + +The spaces of the two arguments need to match. +After scaling, the partial schedule is replaced by its greatest +integer part to ensure that the schedule remains integral. + +A band node can be tiled using the following function. + + #include + __isl_give isl_schedule_node *isl_schedule_node_band_tile( + __isl_take isl_schedule_node *node, + __isl_take isl_multi_val *sizes); + + isl_stat isl_options_set_tile_scale_tile_loops(isl_ctx *ctx, + int val); + int isl_options_get_tile_scale_tile_loops(isl_ctx *ctx); + isl_stat isl_options_set_tile_shift_point_loops(isl_ctx *ctx, + int val); + int isl_options_get_tile_shift_point_loops(isl_ctx *ctx); + +The C function tiles +the band using the given tile sizes inside its schedule. +A new child band node is created to represent the point loops and it is +inserted between the modified band and its children. +The subtree rooted at the given node is assumed not to have +any anchored nodes. +The C option specifies whether the tile +loops iterators should be scaled by the tile sizes. +If the C option is set, then the point loops +are shifted to start at zero. + +A band node can be split into two nested band nodes +using the following function. + + #include + __isl_give isl_schedule_node *isl_schedule_node_band_split( + __isl_take isl_schedule_node *node, int pos); + +The resulting outer band node contains the first C dimensions of +the schedule of C while the inner band contains the remaining dimensions. +The schedules of the two band nodes live in anonymous spaces. + +A band node can be moved down to the leaves of the subtree rooted +at the band node using the following function. + + #include + __isl_give isl_schedule_node *isl_schedule_node_band_sink( + __isl_take isl_schedule_node *node); + +The subtree rooted at the given node is assumed not to have +any anchored nodes. +The result points to the node in the resulting tree that is in the same +position as the node pointed to by C in the original tree. + + #include + __isl_give isl_schedule_node * + isl_schedule_node_order_after( + __isl_take isl_schedule_node *node, + __isl_take isl_union_set *filter); + +This function splits the domain elements that reach C +into those that satisfy C and those that do not and +arranges for the elements that do satisfy the filter to be +executed after those that do not. The order is imposed by +a sequence node, possibly reusing the grandparent of C +on two copies of the subtree attached to the original C. +Both copies are simplified with respect to their filter. + +Return a pointer to the copy of the subtree that does not +satisfy C. If there is no such copy (because all +reaching domain elements satisfy the filter), then return +the original pointer. + + #include + __isl_give isl_schedule_node * + isl_schedule_node_graft_before( + __isl_take isl_schedule_node *node, + __isl_take isl_schedule_node *graft); + __isl_give isl_schedule_node * + isl_schedule_node_graft_after( + __isl_take isl_schedule_node *node, + __isl_take isl_schedule_node *graft); + +This function inserts the C tree into the tree containing C +such that it is executed before (in case of C) +or after (in case of C) C. +The root node of C +should be an extension node where the domain of the extension +is the flat product of all outer band nodes of C. +The root node may also be a domain node. +The elements of the domain or the range of the extension may not +intersect with the domain elements that reach "node". +The schedule tree of C may not be anchored. + +The schedule tree of C is modified to include an extension node +corresponding to the root node of C as a child of the original +parent of C. The original node that C points to and the +child of the root node of C are attached to this extension node +through a sequence, with appropriate filters and with the child +of C appearing before or after the original C. + +If C already appears inside a sequence that is the child of +an extension node and if the spaces of the new domain elements +do not overlap with those of the original domain elements, +then that extension node is extended with the new extension +rather than introducing a new segment of extension and sequence nodes. + +Return a pointer to the same node in the modified tree that +C pointed to in the original tree. + +A representation of the schedule node can be printed using + + #include + __isl_give isl_printer *isl_printer_print_schedule_node( + __isl_take isl_printer *p, + __isl_keep isl_schedule_node *node); + =head2 Dependence Analysis C contains specialized functionality for performing @@ -5342,6 +8245,99 @@ If, on the other hand, all sources are I accesses, then value based dependence analysis is performed. +=head3 High-level Interface + +A high-level interface to dependence analysis is provided +by the following function. + + #include + __isl_give isl_union_flow * + isl_union_access_info_compute_flow( + __isl_take isl_union_access_info *access); + +The input C object describes the sink +access relations, the source access relations and a schedule, +while the output C object describes +the resulting dependence relations and the subsets of the +sink relations for which no source was found. + +An C is created, modified, copied and freed using +the following functions. + + #include + __isl_give isl_union_access_info * + isl_union_access_info_from_sink( + __isl_take isl_union_map *sink); + __isl_give isl_union_access_info * + isl_union_access_info_set_must_source( + __isl_take isl_union_access_info *access, + __isl_take isl_union_map *must_source); + __isl_give isl_union_access_info * + isl_union_access_info_set_may_source( + __isl_take isl_union_access_info *access, + __isl_take isl_union_map *may_source); + __isl_give isl_union_access_info * + isl_union_access_info_set_schedule( + __isl_take isl_union_access_info *access, + __isl_take isl_schedule *schedule); + __isl_give isl_union_access_info * + isl_union_access_info_set_schedule_map( + __isl_take isl_union_access_info *access, + __isl_take isl_union_map *schedule_map); + __isl_give isl_union_access_info * + isl_union_access_info_copy( + __isl_keep isl_union_access_info *access); + __isl_null isl_union_access_info * + isl_union_access_info_free( + __isl_take isl_union_access_info *access); + +The may sources set by C +do not need to include the must sources set by +C as a subset. +The user is free not to call one (or both) of these functions, +in which case the corresponding set is kept to its empty default. +Similarly, the default schedule initialized by +C is empty. +The current schedule is determined by the last call to either +C or +C. +The domain of the schedule corresponds to the domains of +the access relations. In particular, the domains of the access +relations are effectively intersected with the domain of the schedule +and only the resulting accesses are considered by the dependence analysis. + +The output of C can be examined +and freed using the following functions. + + #include + __isl_give isl_union_map *isl_union_flow_get_must_dependence( + __isl_keep isl_union_flow *flow); + __isl_give isl_union_map *isl_union_flow_get_may_dependence( + __isl_keep isl_union_flow *flow); + __isl_give isl_union_map *isl_union_flow_get_must_no_source( + __isl_keep isl_union_flow *flow); + __isl_give isl_union_map *isl_union_flow_get_may_no_source( + __isl_keep isl_union_flow *flow); + __isl_null isl_union_flow *isl_union_flow_free( + __isl_take isl_union_flow *flow); + +The relation returned by C +relates domain elements of must sources to domain elements of the sink. +The relation returned by C +relates domain elements of must or may sources to domain elements of the sink +and includes the previous relation as a subset. +The relation returned by C is the subset +of the sink relation for which no dependences have been found. +The relation returned by C is the subset +of the sink relation for which no definite dependences have been found. +That is, it contains those sink access that do not contribute to any +of the elements in the relation returned +by C. + +=head3 Low-level Interface + +A lower-level interface is provided by the following functions. + #include typedef int (*isl_access_level_before)(void *first, void *second); @@ -5354,13 +8350,14 @@ __isl_take isl_access_info *acc, __isl_take isl_map *source, int must, void *source_user); - void *isl_access_info_free(__isl_take isl_access_info *acc); + __isl_null isl_access_info *isl_access_info_free( + __isl_take isl_access_info *acc); __isl_give isl_flow *isl_access_info_compute_flow( __isl_take isl_access_info *acc); - int isl_flow_foreach(__isl_keep isl_flow *deps, - int (*fn)(__isl_take isl_map *dep, int must, + isl_stat isl_flow_foreach(__isl_keep isl_flow *deps, + isl_stat (*fn)(__isl_take isl_map *dep, int must, void *dep_user, void *user), void *user); __isl_give isl_map *isl_flow_get_no_source( @@ -5426,31 +8423,7 @@ After finishing with an C, the user should call C to free all associated memory. -A higher-level interface to dependence analysis is provided -by the following function. - - #include - - int isl_union_map_compute_flow(__isl_take isl_union_map *sink, - __isl_take isl_union_map *must_source, - __isl_take isl_union_map *may_source, - __isl_take isl_union_map *schedule, - __isl_give isl_union_map **must_dep, - __isl_give isl_union_map **may_dep, - __isl_give isl_union_map **must_no_source, - __isl_give isl_union_map **may_no_source); - -The arrays are identified by the tuple names of the ranges -of the accesses. The iteration domains by the tuple names -of the domains of the accesses and of the schedule. -The relative order of the iteration domains is given by the -schedule. The relations returned through C -and C are subsets of C. -Any of C, C, C -or C may be C, but a C value for -any of the other arguments is treated as an error. - -=head3 Interaction with Dependence Analysis +=head3 Interaction with the Low-level Interface During the dependence analysis, we frequently need to perform the following operation. Given a relation between sink iterations @@ -5508,10 +8481,8 @@ __isl_take isl_map *source_map); __isl_give isl_restriction *isl_restriction_empty( __isl_take isl_map *source_map); - void *isl_restriction_free( + __isl_null isl_restriction *isl_restriction_free( __isl_take isl_restriction *restr); - isl_ctx *isl_restriction_get_ctx( - __isl_keep isl_restriction *restr); C and C are special cases of C. C @@ -5534,179 +8505,185 @@ B -The following function can be used to compute a schedule -for a union of domains. + #include + __isl_give isl_schedule * + isl_schedule_constraints_compute_schedule( + __isl_take isl_schedule_constraints *sc); + +The function C can be +used to compute a schedule that satisfies the given schedule constraints. +These schedule constraints include the iteration domain for which +a schedule should be computed and dependences between pairs of +iterations. In particular, these dependences include +I dependences and I dependences. By default, the algorithm used to construct the schedule is similar to that of C. Alternatively, Feautrier's multi-dimensional scheduling algorithm can be selected. -The generated schedule respects all C dependences. +The generated schedule respects all validity dependences. That is, all dependence distances over these dependences in the scheduled space are lexicographically positive. -The default algorithm tries to minimize the dependence distances over -C dependences. + +The default algorithm tries to ensure that the dependence distances +over coincidence constraints are zero and to minimize the +dependence distances over proximity dependences. Moreover, it tries to obtain sequences (bands) of schedule dimensions -for groups of domains where the dependence distances have only -non-negative values. -When using Feautrier's algorithm, the C dependence -distances are only minimized during the extension to a +for groups of domains where the dependence distances over validity +dependences have only non-negative values. +Note that when minimizing the maximal dependence distance +over proximity dependences, a single affine expression in the parameters +is constructed that bounds all dependence distances. If no such expression +exists, then the algorithm will fail and resort to an alternative +scheduling algorithm. In particular, this means that adding proximity +dependences may eliminate valid solutions. A typical example where this +phenomenon may occur is when some subset of the proximity dependences +has no restriction on some parameter, forcing the coefficient of that +parameter to be zero, while some other subset forces the dependence +distance to depend on that parameter, requiring the same coefficient +to be non-zero. +When using Feautrier's algorithm, the coincidence and proximity constraints +are only taken into account during the extension to a full-dimensional schedule. +An C object can be constructed +and manipulated using the following functions. + #include - __isl_give isl_schedule *isl_union_set_compute_schedule( - __isl_take isl_union_set *domain, - __isl_take isl_union_map *validity, + __isl_give isl_schedule_constraints * + isl_schedule_constraints_copy( + __isl_keep isl_schedule_constraints *sc); + __isl_give isl_schedule_constraints * + isl_schedule_constraints_on_domain( + __isl_take isl_union_set *domain); + __isl_give isl_schedule_constraints * + isl_schedule_constraints_set_context( + __isl_take isl_schedule_constraints *sc, + __isl_take isl_set *context); + __isl_give isl_schedule_constraints * + isl_schedule_constraints_set_validity( + __isl_take isl_schedule_constraints *sc, + __isl_take isl_union_map *validity); + __isl_give isl_schedule_constraints * + isl_schedule_constraints_set_coincidence( + __isl_take isl_schedule_constraints *sc, + __isl_take isl_union_map *coincidence); + __isl_give isl_schedule_constraints * + isl_schedule_constraints_set_proximity( + __isl_take isl_schedule_constraints *sc, __isl_take isl_union_map *proximity); - void *isl_schedule_free(__isl_take isl_schedule *sched); - -A mapping from the domains to the scheduled space can be obtained -from an C using the following function. - - __isl_give isl_union_map *isl_schedule_get_map( - __isl_keep isl_schedule *sched); - -A representation of the schedule can be printed using - - __isl_give isl_printer *isl_printer_print_schedule( - __isl_take isl_printer *p, - __isl_keep isl_schedule *schedule); - -A representation of the schedule as a forest of bands can be obtained -using the following function. - - __isl_give isl_band_list *isl_schedule_get_band_forest( - __isl_keep isl_schedule *schedule); + __isl_give isl_schedule_constraints * + isl_schedule_constraints_set_conditional_validity( + __isl_take isl_schedule_constraints *sc, + __isl_take isl_union_map *condition, + __isl_take isl_union_map *validity); + __isl_null isl_schedule_constraints * + isl_schedule_constraints_free( + __isl_take isl_schedule_constraints *sc); + +The initial C object created by +C does not impose any constraints. +That is, it has an empty set of dependences. +The function C allows the user +to specify additional constraints on the parameters that may +be assumed to hold during the construction of the schedule. +The function C replaces the +validity dependences, mapping domain elements I to domain +elements that should be scheduled after I. +The function C replaces the +coincidence dependences, mapping domain elements I to domain +elements that should be scheduled together with I, if possible. +The function C replaces the +proximity dependences, mapping domain elements I to domain +elements that should be scheduled either before I +or as early as possible after I. + +The function C +replaces the conditional validity constraints. +A conditional validity constraint is only imposed when any of the corresponding +conditions is satisfied, i.e., when any of them is non-zero. +That is, the scheduler ensures that within each band if the dependence +distances over the condition constraints are not all zero +then all corresponding conditional validity constraints are respected. +A conditional validity constraint corresponds to a condition +if the two are adjacent, i.e., if the domain of one relation intersect +the range of the other relation. +The typical use case of conditional validity constraints is +to allow order constraints between live ranges to be violated +as long as the live ranges themselves are local to the band. +To allow more fine-grained control over which conditions correspond +to which conditional validity constraints, the domains and ranges +of these relations may include I. That is, the domains and +ranges of those relation may themselves be wrapped relations +where the iteration domain appears in the domain of those wrapped relations +and the range of the wrapped relations can be arbitrarily chosen +by the user. Conditions and conditional validity constraints are only +considered adjacent to each other if the entire wrapped relation matches. +In particular, a relation with a tag will never be considered adjacent +to a relation without a tag. -The individual bands can be visited in depth-first post-order -using the following function. +An C object can be inspected +using the following functions. #include - int isl_schedule_foreach_band( - __isl_keep isl_schedule *sched, - int (*fn)(__isl_keep isl_band *band, void *user), - void *user); - -The list can be manipulated as explained in L<"Lists">. -The bands inside the list can be copied and freed using the following -functions. - - #include - __isl_give isl_band *isl_band_copy( - __isl_keep isl_band *band); - void *isl_band_free(__isl_take isl_band *band); - -Each band contains zero or more scheduling dimensions. -These are referred to as the members of the band. -The section of the schedule that corresponds to the band is -referred to as the partial schedule of the band. -For those nodes that participate in a band, the outer scheduling -dimensions form the prefix schedule, while the inner scheduling -dimensions form the suffix schedule. -That is, if we take a cut of the band forest, then the union of -the concatenations of the prefix, partial and suffix schedules of -each band in the cut is equal to the entire schedule (modulo -some possible padding at the end with zero scheduling dimensions). -The properties of a band can be inspected using the following functions. - - #include - isl_ctx *isl_band_get_ctx(__isl_keep isl_band *band); - - int isl_band_has_children(__isl_keep isl_band *band); - __isl_give isl_band_list *isl_band_get_children( - __isl_keep isl_band *band); - - __isl_give isl_union_map *isl_band_get_prefix_schedule( - __isl_keep isl_band *band); - __isl_give isl_union_map *isl_band_get_partial_schedule( - __isl_keep isl_band *band); - __isl_give isl_union_map *isl_band_get_suffix_schedule( - __isl_keep isl_band *band); - - int isl_band_n_member(__isl_keep isl_band *band); - int isl_band_member_is_zero_distance( - __isl_keep isl_band *band, int pos); - - int isl_band_list_foreach_band( - __isl_keep isl_band_list *list, - int (*fn)(__isl_keep isl_band *band, void *user), - void *user); - -Note that a scheduling dimension is considered to be ``zero -distance'' if it does not carry any proximity dependences -within its band. -That is, if the dependence distances of the proximity -dependences are all zero in that direction (for fixed -iterations of outer bands). -Like C, -the function C calls C on the bands -in depth-first post-order. - -A band can be tiled using the following function. - - #include - int isl_band_tile(__isl_keep isl_band *band, - __isl_take isl_vec *sizes); - - int isl_options_set_tile_scale_tile_loops(isl_ctx *ctx, - int val); - int isl_options_get_tile_scale_tile_loops(isl_ctx *ctx); - int isl_options_set_tile_shift_point_loops(isl_ctx *ctx, - int val); - int isl_options_get_tile_shift_point_loops(isl_ctx *ctx); - -The C function tiles the band using the given tile sizes -inside its schedule. -A new child band is created to represent the point loops and it is -inserted between the modified band and its children. -The C option specifies whether the tile -loops iterators should be scaled by the tile sizes. -If the C option is set, then the point loops -are shifted to start at zero. - -A band can be split into two nested bands using the following function. - - int isl_band_split(__isl_keep isl_band *band, int pos); + __isl_give isl_union_map * + isl_schedule_constraints_get_validity( + __isl_keep isl_schedule_constraints *sc); + __isl_give isl_union_map * + isl_schedule_constraints_get_coincidence( + __isl_keep isl_schedule_constraints *sc); + __isl_give isl_union_map * + isl_schedule_constraints_get_conditional_validity( + __isl_keep isl_schedule_constraints *sc); + __isl_give isl_union_map * + isl_schedule_constraints_get_conditional_validity_condition( + __isl_keep isl_schedule_constraints *sc); -The resulting outer band contains the first C dimensions of C -while the inner band contains the remaining dimensions. +The following function computes a schedule directly from +an iteration domain and validity and proximity dependences +and is implemented in terms of the functions described above. +The use of C is discouraged. -A representation of the band can be printed using + #include + __isl_give isl_schedule *isl_union_set_compute_schedule( + __isl_take isl_union_set *domain, + __isl_take isl_union_map *validity, + __isl_take isl_union_map *proximity); - #include - __isl_give isl_printer *isl_printer_print_band( - __isl_take isl_printer *p, - __isl_keep isl_band *band); +The generated schedule represents a schedule tree. +For more information on schedule trees, see +L. =head3 Options #include - int isl_options_set_schedule_max_coefficient( + isl_stat isl_options_set_schedule_max_coefficient( isl_ctx *ctx, int val); int isl_options_get_schedule_max_coefficient( isl_ctx *ctx); - int isl_options_set_schedule_max_constant_term( + isl_stat isl_options_set_schedule_max_constant_term( isl_ctx *ctx, int val); int isl_options_get_schedule_max_constant_term( isl_ctx *ctx); - int isl_options_set_schedule_fuse(isl_ctx *ctx, int val); - int isl_options_get_schedule_fuse(isl_ctx *ctx); - int isl_options_set_schedule_maximize_band_depth( + isl_stat isl_options_set_schedule_serialize_sccs( + isl_ctx *ctx, int val); + int isl_options_get_schedule_serialize_sccs(isl_ctx *ctx); + isl_stat isl_options_set_schedule_maximize_band_depth( isl_ctx *ctx, int val); int isl_options_get_schedule_maximize_band_depth( isl_ctx *ctx); - int isl_options_set_schedule_outer_zero_distance( + isl_stat isl_options_set_schedule_outer_coincidence( isl_ctx *ctx, int val); - int isl_options_get_schedule_outer_zero_distance( + int isl_options_get_schedule_outer_coincidence( isl_ctx *ctx); - int isl_options_set_schedule_split_scaled( + isl_stat isl_options_set_schedule_split_scaled( isl_ctx *ctx, int val); int isl_options_get_schedule_split_scaled( isl_ctx *ctx); - int isl_options_set_schedule_algorithm( + isl_stat isl_options_set_schedule_algorithm( isl_ctx *ctx, int val); int isl_options_get_schedule_algorithm( isl_ctx *ctx); - int isl_options_set_schedule_separate_components( + isl_stat isl_options_set_schedule_separate_components( isl_ctx *ctx, int val); int isl_options_get_schedule_separate_components( isl_ctx *ctx); @@ -5730,13 +8707,14 @@ unrelated dimensions. A value of -1 means that this option does not introduce bounds on the constant coefficients. -=item * schedule_fuse +=item * schedule_serialize_sccs -This option controls the level of fusion. -If this option is set to C, then loops in the -resulting schedule will be distributed as much as possible. -If this option is set to C, then C will -try to fuse loops in the resulting schedule. +If this option is set, then all strongly connected components +in the dependence graph are serialized as soon as they are detected. +This means in particular that instances of statements will only +appear in the same band node if these statements belong +to the same strongly connected component at the point where +the band node is constructed. =item * schedule_maximize_band_depth @@ -5745,16 +8723,15 @@ backtrack and split bands as early as possible. This reduces the number of splits and maximizes the width of the bands. Wider bands give more possibilities for tiling. -Note that if the C option is set to C, +Note that if the C options is set, then bands will be split as early as possible, even if there is no need. The C option therefore has no effect in this case. -=item * schedule_outer_zero_distance +=item * schedule_outer_coincidence If this option is set, then we try to construct schedules where the outermost scheduling dimension in each band -results in a zero dependence distance over the proximity -dependences. +satisfies the coincidence constraints. =item * schedule_split_scaled @@ -5773,12 +8750,8 @@ =item * schedule_separate_components -If at any point the dependence graph contains any (weakly connected) components, -then these components are scheduled separately. -If this option is not set, then some iterations of the domains -in these components may be scheduled together. -If this option is set, then the components are given consecutive -schedules. +If this option is set then the function C +will treat set nodes in the same way as sequence nodes. =back @@ -5786,40 +8759,51 @@ This section describes the C functionality for generating ASTs that visit all the elements -in a domain in an order specified by a schedule. -In particular, given a C, an AST is generated +in a domain in an order specified by a schedule tree or +a schedule map. +In case the schedule given as a C, an AST is generated that visits all the elements in the domain of the C according to the lexicographic order of the corresponding image element(s). If the range of the C consists of elements in more than one space, then each of these spaces is handled separately in an arbitrary order. -It should be noted that the image elements only specify the I +It should be noted that the schedule tree or the image elements +in a schedule map only specify the I in which the corresponding domain elements should be visited. -No direct relation between the image elements and the loop iterators -in the generated AST should be assumed. +No direct relation between the partial schedule values +or the image elements on the one hand and the loop iterators +in the generated AST on the other hand should be assumed. Each AST is generated within a build. The initial build simply specifies the constraints on the parameters (if any) and can be created, inspected, copied and freed using the following functions. #include + __isl_give isl_ast_build *isl_ast_build_alloc( + isl_ctx *ctx); __isl_give isl_ast_build *isl_ast_build_from_context( __isl_take isl_set *set); - isl_ctx *isl_ast_build_get_ctx( - __isl_keep isl_ast_build *build); __isl_give isl_ast_build *isl_ast_build_copy( __isl_keep isl_ast_build *build); - void *isl_ast_build_free( + __isl_null isl_ast_build *isl_ast_build_free( __isl_take isl_ast_build *build); The C argument is usually a parameter set with zero or more parameters. +In fact, when creating an AST using C, +this set is required to be a parameter set. +An C created using C does not +specify any parameter constraints. More C functions are described in L and L. -Finally, the AST itself can be constructed using the following -function. +Finally, the AST itself can be constructed using one of the following +functions. #include - __isl_give isl_ast_node *isl_ast_build_ast_from_schedule( + __isl_give isl_ast_node *isl_ast_build_node_from_schedule( + __isl_keep isl_ast_build *build, + __isl_take isl_schedule *schedule); + __isl_give isl_ast_node * + isl_ast_build_node_from_schedule_map( __isl_keep isl_ast_build *build, __isl_take isl_union_map *schedule); @@ -5828,19 +8812,19 @@ The basic properties of an AST node can be obtained as follows. #include - isl_ctx *isl_ast_node_get_ctx( - __isl_keep isl_ast_node *node); enum isl_ast_node_type isl_ast_node_get_type( __isl_keep isl_ast_node *node); The type of an AST node is one of C, C, -C or +C, +C or C. An C represents a for node. An C represents an if node. An C represents a compound node. +An C introduces a mark in the AST. An C represents an expression statement. An expression statement typically corresponds to a domain element, i.e., one of the elements that is visited by the AST. @@ -5858,7 +8842,7 @@ __isl_keep isl_ast_node *node); __isl_give isl_ast_node *isl_ast_node_for_get_body( __isl_keep isl_ast_node *node); - int isl_ast_node_for_is_degenerate( + isl_bool isl_ast_node_for_is_degenerate( __isl_keep isl_ast_node *node); An C is considered degenerate if it is known to execute @@ -5869,7 +8853,7 @@ __isl_keep isl_ast_node *node); __isl_give isl_ast_node *isl_ast_node_if_get_then( __isl_keep isl_ast_node *node); - int isl_ast_node_if_has_else( + isl_bool isl_ast_node_if_has_else( __isl_keep isl_ast_node *node); __isl_give isl_ast_node *isl_ast_node_if_get_else( __isl_keep isl_ast_node *node); @@ -5878,6 +8862,15 @@ isl_ast_node_block_get_children( __isl_keep isl_ast_node *node); + __isl_give isl_id *isl_ast_node_mark_get_id( + __isl_keep isl_ast_node *node); + __isl_give isl_ast_node *isl_ast_node_mark_get_node( + __isl_keep isl_ast_node *node); + +C returns the identifier of the mark. +C returns the child node that is being marked. + + #include __isl_give isl_ast_expr *isl_ast_node_user_get_expr( __isl_keep isl_ast_node *node); @@ -5885,8 +8878,6 @@ the following functions. #include - isl_ctx *isl_ast_expr_get_ctx( - __isl_keep isl_ast_expr *expr); enum isl_ast_expr_type isl_ast_expr_get_type( __isl_keep isl_ast_expr *expr); @@ -5906,10 +8897,10 @@ int isl_ast_expr_get_op_n_arg(__isl_keep isl_ast_expr *expr); __isl_give isl_ast_expr *isl_ast_expr_get_op_arg( __isl_keep isl_ast_expr *expr, int pos); - int isl_ast_node_foreach_ast_op_type( + isl_stat isl_ast_node_foreach_ast_op_type( __isl_keep isl_ast_node *node, - int (*fn)(enum isl_ast_op_type type, void *user), - void *user); + isl_stat (*fn)(enum isl_ast_op_type type, + void *user), void *user); C returns the type of the operation performed. C returns the number of @@ -5982,6 +8973,10 @@ Remainder of integer division, where dividend is known to be non-negative. +=item C + +Equal to zero iff the remainder on integer division is zero. + =item C Conditional operator defined on three arguments. @@ -6029,6 +9024,19 @@ the number of arguments in the function call, the first argument representing the function being called. +=item C + +An array access. +The number of arguments of the C is one more than +the number of index expressions in the array access, the first argument +representing the array being accessed. + +=item C + +A member access. +This operation has two arguments, a structure and the name of +the member of the structure being accessed. + =back #include @@ -6038,16 +9046,19 @@ Return the identifier represented by the AST expression. #include - int isl_ast_expr_get_int(__isl_keep isl_ast_expr *expr, - isl_int *v); __isl_give isl_val *isl_ast_expr_get_val( __isl_keep isl_ast_expr *expr); Return the integer represented by the AST expression. -Note that the integer is returned by C -through the C argument. -The return value of this function itself indicates whether the -operation was performed successfully. + +=head3 Properties of ASTs + + #include + isl_bool isl_ast_expr_is_equal( + __isl_keep isl_ast_expr *expr1, + __isl_keep isl_ast_expr *expr2); + +Check if two Cs are equal to each other. =head3 Manipulating and printing the AST @@ -6056,14 +9067,16 @@ #include __isl_give isl_ast_node *isl_ast_node_copy( __isl_keep isl_ast_node *node); - void *isl_ast_node_free(__isl_take isl_ast_node *node); + __isl_null isl_ast_node *isl_ast_node_free( + __isl_take isl_ast_node *node); AST expressions can be copied and freed using the following functions. #include __isl_give isl_ast_expr *isl_ast_expr_copy( __isl_keep isl_ast_expr *expr); - void *isl_ast_expr_free(__isl_take isl_ast_expr *expr); + __isl_null isl_ast_expr *isl_ast_expr_free( + __isl_take isl_ast_expr *expr); New AST expressions can be created either directly or within the context of an C. @@ -6075,6 +9088,8 @@ __isl_take isl_id *id); __isl_give isl_ast_expr *isl_ast_expr_neg( __isl_take isl_ast_expr *expr); + __isl_give isl_ast_expr *isl_ast_expr_address_of( + __isl_take isl_ast_expr *expr); __isl_give isl_ast_expr *isl_ast_expr_add( __isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2); @@ -6087,25 +9102,104 @@ __isl_give isl_ast_expr *isl_ast_expr_div( __isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2); + __isl_give isl_ast_expr *isl_ast_expr_pdiv_q( + __isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2); + __isl_give isl_ast_expr *isl_ast_expr_pdiv_r( + __isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2); __isl_give isl_ast_expr *isl_ast_expr_and( __isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) + __isl_give isl_ast_expr *isl_ast_expr_and_then( + __isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2) __isl_give isl_ast_expr *isl_ast_expr_or( __isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) + __isl_give isl_ast_expr *isl_ast_expr_or_else( + __isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2) + __isl_give isl_ast_expr *isl_ast_expr_eq( + __isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2); + __isl_give isl_ast_expr *isl_ast_expr_le( + __isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2); + __isl_give isl_ast_expr *isl_ast_expr_lt( + __isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2); + __isl_give isl_ast_expr *isl_ast_expr_ge( + __isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2); + __isl_give isl_ast_expr *isl_ast_expr_gt( + __isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2); + __isl_give isl_ast_expr *isl_ast_expr_access( + __isl_take isl_ast_expr *array, + __isl_take isl_ast_expr_list *indices); + __isl_give isl_ast_expr *isl_ast_expr_call( + __isl_take isl_ast_expr *function, + __isl_take isl_ast_expr_list *arguments); + +The function C can be applied to an +C of type C only. It is meant +to represent the address of the C. The function +C as well as C are short-circuit +versions of C and C, respectively. #include + __isl_give isl_ast_expr *isl_ast_build_expr_from_set( + __isl_keep isl_ast_build *build, + __isl_take isl_set *set); __isl_give isl_ast_expr *isl_ast_build_expr_from_pw_aff( __isl_keep isl_ast_build *build, __isl_take isl_pw_aff *pa); __isl_give isl_ast_expr * + isl_ast_build_access_from_pw_multi_aff( + __isl_keep isl_ast_build *build, + __isl_take isl_pw_multi_aff *pma); + __isl_give isl_ast_expr * + isl_ast_build_access_from_multi_pw_aff( + __isl_keep isl_ast_build *build, + __isl_take isl_multi_pw_aff *mpa); + __isl_give isl_ast_expr * isl_ast_build_call_from_pw_multi_aff( __isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma); + __isl_give isl_ast_expr * + isl_ast_build_call_from_multi_pw_aff( + __isl_keep isl_ast_build *build, + __isl_take isl_multi_pw_aff *mpa); -The domains of C and C should correspond +The set and +the domains of C, C and C should correspond to the schedule space of C. -The tuple id of C is used as the function being called. +The tuple id of C or C is used as the array being accessed or +the function being called. +If the accessed space is a nested relation, then it is taken +to represent an access of the member specified by the range +of this nested relation of the structure specified by the domain +of the nested relation. + +The following functions can be used to modify an C. + + #include + __isl_give isl_ast_expr *isl_ast_expr_set_op_arg( + __isl_take isl_ast_expr *expr, int pos, + __isl_take isl_ast_expr *arg); + +Replace the argument of C at position C by C. + + #include + __isl_give isl_ast_expr *isl_ast_expr_substitute_ids( + __isl_take isl_ast_expr *expr, + __isl_take isl_id_to_ast_expr *id2expr); + +The function C replaces the +subexpressions of C of type C +by the corresponding expression in C, if there is any. + User specified data can be attached to an C and obtained from the same C using the following functions. @@ -6126,6 +9220,8 @@ __isl_give isl_printer *isl_printer_print_ast_node( __isl_take isl_printer *p, __isl_keep isl_ast_node *node); + __isl_give char *isl_ast_expr_to_str( + __isl_keep isl_ast_expr *expr); More advanced printing can be performed using the following functions. @@ -6172,7 +9268,8 @@ __isl_give isl_ast_print_options * isl_ast_print_options_copy( __isl_keep isl_ast_print_options *options); - void *isl_ast_print_options_free( + __isl_null isl_ast_print_options * + isl_ast_print_options_free( __isl_take isl_ast_print_options *options); __isl_give isl_ast_print_options * @@ -6208,37 +9305,47 @@ The following option determines the type to be used for iterators while printing the AST. - int isl_options_set_ast_iterator_type( + isl_stat isl_options_set_ast_iterator_type( isl_ctx *ctx, const char *val); const char *isl_options_get_ast_iterator_type( isl_ctx *ctx); +The AST printer only prints body nodes as blocks if these +blocks cannot be safely omitted. +For example, a C node with one body node will not be +surrounded with braces in C. +A block will always be printed by setting the following option. + + isl_stat isl_options_set_ast_always_print_block(isl_ctx *ctx, + int val); + int isl_options_get_ast_always_print_block(isl_ctx *ctx); + =head3 Options #include - int isl_options_set_ast_build_atomic_upper_bound( + isl_stat isl_options_set_ast_build_atomic_upper_bound( isl_ctx *ctx, int val); int isl_options_get_ast_build_atomic_upper_bound( isl_ctx *ctx); - int isl_options_set_ast_build_prefer_pdiv(isl_ctx *ctx, + isl_stat isl_options_set_ast_build_prefer_pdiv(isl_ctx *ctx, int val); int isl_options_get_ast_build_prefer_pdiv(isl_ctx *ctx); - int isl_options_set_ast_build_exploit_nested_bounds( + isl_stat isl_options_set_ast_build_exploit_nested_bounds( isl_ctx *ctx, int val); int isl_options_get_ast_build_exploit_nested_bounds( isl_ctx *ctx); - int isl_options_set_ast_build_group_coscheduled( + isl_stat isl_options_set_ast_build_group_coscheduled( isl_ctx *ctx, int val); int isl_options_get_ast_build_group_coscheduled( isl_ctx *ctx); - int isl_options_set_ast_build_scale_strides( + isl_stat isl_options_set_ast_build_scale_strides( isl_ctx *ctx, int val); int isl_options_get_ast_build_scale_strides( isl_ctx *ctx); - int isl_options_set_ast_build_allow_else(isl_ctx *ctx, + isl_stat isl_options_set_ast_build_allow_else(isl_ctx *ctx, int val); int isl_options_get_ast_build_allow_else(isl_ctx *ctx); - int isl_options_set_ast_build_allow_or(isl_ctx *ctx, + isl_stat isl_options_set_ast_build_allow_or(isl_ctx *ctx, int val); int isl_options_get_ast_build_allow_or(isl_ctx *ctx); @@ -6346,13 +9453,223 @@ =back -=head3 Fine-grained Control over AST Generation +=head3 AST Generation Options (Schedule Tree) + +In case of AST construction from a schedule tree, the options +that control how an AST is created from the individual schedule +dimensions are stored in the band nodes of the tree +(see L). + +In particular, a schedule dimension can be handled in four +different ways, atomic, separate, unroll or the default. +This loop AST generation type can be set using +C. +Alternatively, +the first three can be selected by including a one-dimensional +element with as value the position of the schedule dimension +within the band and as name one of C, C +or C in the options +set by C. +Only one of these three may be specified for +any given schedule dimension within a band node. +If none of these is specified, then the default +is used. The meaning of the options is as follows. + +=over + +=item C + +When this option is specified, the AST generator will make +sure that a given domains space only appears in a single +loop at the specified level. + +For example, for the schedule tree + + domain: "{ a[i] : 0 <= i < 10; b[i] : 0 <= i < 10 }" + child: + schedule: "[{ a[i] -> [i]; b[i] -> [i+1] }]" + options: "{ atomic[x] }" + +the following AST will be generated + + for (int c0 = 0; c0 <= 10; c0 += 1) { + if (c0 >= 1) + b(c0 - 1); + if (c0 <= 9) + a(c0); + } + +On the other hand, for the schedule tree + + domain: "{ a[i] : 0 <= i < 10; b[i] : 0 <= i < 10 }" + child: + schedule: "[{ a[i] -> [i]; b[i] -> [i+1] }]" + options: "{ separate[x] }" + +the following AST will be generated + + { + a(0); + for (int c0 = 1; c0 <= 9; c0 += 1) { + b(c0 - 1); + a(c0); + } + b(9); + } + +If neither C nor C is specified, then the AST generator +may produce either of these two results or some intermediate form. + +=item C + +When this option is specified, the AST generator will +split the domain of the specified schedule dimension +into pieces with a fixed set of statements for which +instances need to be executed by the iterations in +the schedule domain part. This option tends to avoid +the generation of guards inside the corresponding loops. +See also the C option. + +=item C + +When this option is specified, the AST generator will +I unroll the corresponding schedule dimension. +It is the responsibility of the user to ensure that such +unrolling is possible. +To obtain a partial unrolling, the user should apply an additional +strip-mining to the schedule and fully unroll the inner schedule +dimension. + +=back + +The C option is a bit more involved. It allows the user +to isolate a range of schedule dimension values from smaller and +greater values. Additionally, the user may specify a different +atomic/separate/unroll choice for the isolated part and the remaining +parts. The typical use case of the C option is to isolate +full tiles from partial tiles. +The part that needs to be isolated may depend on outer schedule dimensions. +The option therefore needs to be able to reference those outer schedule +dimensions. In particular, the space of the C option is that +of a wrapped map with as domain the flat product of all outer band nodes +and as range the space of the current band node. +The atomic/separate/unroll choice for the isolated part is determined +by an option that lives in an unnamed wrapped space with as domain +a zero-dimensional C space and as range the regular +C, C or C space. +This option may also be set directly using +C. +The atomic/separate/unroll choice for the remaining part is determined +by the regular C, C or C option. +The use of the C option causes any tree containing the node +to be considered anchored. + +As an example, consider the isolation of full tiles from partial tiles +in a tiling of a triangular domain. The original schedule is as follows. + + domain: "{ A[i,j] : 0 <= i,j and i + j <= 100 }" + child: + schedule: "[{ A[i,j] -> [floor(i/10)] }, \ + { A[i,j] -> [floor(j/10)] }, \ + { A[i,j] -> [i] }, { A[i,j] -> [j] }]" + +The output is + + for (int c0 = 0; c0 <= 10; c0 += 1) + for (int c1 = 0; c1 <= -c0 + 10; c1 += 1) + for (int c2 = 10 * c0; + c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1) + for (int c3 = 10 * c1; + c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1) + A(c2, c3); + +Isolating the full tiles, we have the following input + + domain: "{ A[i,j] : 0 <= i,j and i + j <= 100 }" + child: + schedule: "[{ A[i,j] -> [floor(i/10)] }, \ + { A[i,j] -> [floor(j/10)] }, \ + { A[i,j] -> [i] }, { A[i,j] -> [j] }]" + options: "{ isolate[[] -> [a,b,c,d]] : 0 <= 10a,10b and \ + 10a+9+10b+9 <= 100 }" + +and output + + { + for (int c0 = 0; c0 <= 8; c0 += 1) { + for (int c1 = 0; c1 <= -c0 + 8; c1 += 1) + for (int c2 = 10 * c0; + c2 <= 10 * c0 + 9; c2 += 1) + for (int c3 = 10 * c1; + c3 <= 10 * c1 + 9; c3 += 1) + A(c2, c3); + for (int c1 = -c0 + 9; c1 <= -c0 + 10; c1 += 1) + for (int c2 = 10 * c0; + c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1) + for (int c3 = 10 * c1; + c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1) + A(c2, c3); + } + for (int c0 = 9; c0 <= 10; c0 += 1) + for (int c1 = 0; c1 <= -c0 + 10; c1 += 1) + for (int c2 = 10 * c0; + c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1) + for (int c3 = 10 * c1; + c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1) + A(c2, c3); + } + +We may then additionally unroll the innermost loop of the isolated part + + domain: "{ A[i,j] : 0 <= i,j and i + j <= 100 }" + child: + schedule: "[{ A[i,j] -> [floor(i/10)] }, \ + { A[i,j] -> [floor(j/10)] }, \ + { A[i,j] -> [i] }, { A[i,j] -> [j] }]" + options: "{ isolate[[] -> [a,b,c,d]] : 0 <= 10a,10b and \ + 10a+9+10b+9 <= 100; [isolate[] -> unroll[3]] }" + +to obtain + + { + for (int c0 = 0; c0 <= 8; c0 += 1) { + for (int c1 = 0; c1 <= -c0 + 8; c1 += 1) + for (int c2 = 10 * c0; c2 <= 10 * c0 + 9; c2 += 1) { + A(c2, 10 * c1); + A(c2, 10 * c1 + 1); + A(c2, 10 * c1 + 2); + A(c2, 10 * c1 + 3); + A(c2, 10 * c1 + 4); + A(c2, 10 * c1 + 5); + A(c2, 10 * c1 + 6); + A(c2, 10 * c1 + 7); + A(c2, 10 * c1 + 8); + A(c2, 10 * c1 + 9); + } + for (int c1 = -c0 + 9; c1 <= -c0 + 10; c1 += 1) + for (int c2 = 10 * c0; + c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1) + for (int c3 = 10 * c1; + c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1) + A(c2, c3); + } + for (int c0 = 9; c0 <= 10; c0 += 1) + for (int c1 = 0; c1 <= -c0 + 10; c1 += 1) + for (int c2 = 10 * c0; + c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1) + for (int c3 = 10 * c1; + c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1) + A(c2, c3); + } -Besides specifying the constraints on the parameters, -an C object can be used to control -various aspects of the AST generation process. -The most prominent way of control is through ``options'', -which can be set using the following function. + +=head3 AST Generation Options (Schedule Map) + +In case of AST construction using +C, the options +that control how an AST is created from the individual schedule +dimensions are stored in the C. +They can be set using the following function. #include __isl_give isl_ast_build * @@ -6360,9 +9677,10 @@ __isl_take isl_ast_build *control, __isl_take isl_union_map *options); -The options are encoded in an . +The options are encoded in an C. The domain of this union relation refers to the schedule domain, -i.e., the range of the schedule passed to C. +i.e., the range of the schedule passed +to C. In the case of nested AST generation (see L), the domain of C should refer to the extra piece of the schedule. That is, it should be equal to the range of the wrapped relation in the @@ -6381,6 +9699,9 @@ =item C +B + This space is a wrapped relation between two one dimensional spaces. The input space represents the schedule dimension to which the option applies and the output space represents the separation class. @@ -6528,6 +9849,16 @@ =back +=head3 Fine-grained Control over AST Generation + +Besides specifying the constraints on the parameters, +an C object can be used to control +various aspects of the AST generation process. +In case of AST construction using +C, +the most prominent way of control is through ``options'', +as explained above. + Additional control is available through the following functions. #include @@ -6599,6 +9930,19 @@ __isl_take isl_ast_node *node, __isl_keep isl_ast_build *build, void *user), void *user); + __isl_give isl_ast_build * + isl_ast_build_set_before_each_mark( + __isl_take isl_ast_build *build, + isl_stat (*fn)(__isl_keep isl_id *mark, + __isl_keep isl_ast_build *build, + void *user), void *user); + __isl_give isl_ast_build * + isl_ast_build_set_after_each_mark( + __isl_take isl_ast_build *build, + __isl_give isl_ast_node *(*fn)( + __isl_take isl_ast_node *node, + __isl_keep isl_ast_build *build, + void *user), void *user); The callback set by C will be called for each domain AST node. @@ -6613,7 +9957,15 @@ In particular, if the user has also specified an C callback, then the annotation can be retrieved from the node passed to that callback using C. -All callbacks should C on failure. +The callbacks set by C +and C will be called for each +mark AST node that is created, i.e., for each mark schedule node +in the input schedule tree. The first will be called in depth-first +pre-order, while the second will be called in depth-first post-order. +Since the callback set by C +is called before the mark AST node is actually constructed, it is passed +the identifier of the mark node. +All callbacks should C (or -1) on failure. The given C can be used to create new C objects using C or C. @@ -6622,8 +9974,8 @@ C allows the user to create an AST within the context of another AST. These nested ASTs are created using the -same C function that is used to create the -outer AST. The C argument should be an C +same C function that is used to create +the outer AST. The C argument should be an C passed to a callback set by C. The space of the range of the C argument should refer diff -Nru cloog-0.18.2/isl/GIT_HEAD_ID cloog-0.18.4/isl/GIT_HEAD_ID --- cloog-0.18.2/isl/GIT_HEAD_ID 2013-12-18 12:46:31.000000000 +0000 +++ cloog-0.18.4/isl/GIT_HEAD_ID 2015-07-27 12:06:06.000000000 +0000 @@ -1 +1 @@ -UNKNOWN +isl-0.15 diff -Nru cloog-0.18.2/isl/imath/gmp_compat.c cloog-0.18.4/isl/imath/gmp_compat.c --- cloog-0.18.2/isl/imath/gmp_compat.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/imath/gmp_compat.c 2015-07-27 11:46:11.000000000 +0000 @@ -0,0 +1,862 @@ +/* + Name: gmp_compat.c + Purpose: Provide GMP compatiable routines for imath library + Author: David Peixotto + + Copyright (c) 2012 Qualcomm Innovation Center, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + */ +#include "gmp_compat.h" +#include +#include +#include +#include + +#ifdef NDEBUG +#define CHECK(res) (res) +#else +#define CHECK(res) assert(((res) == MP_OK) && "expected MP_OK") +#endif + +/************************************************************************* + * + * Functions with direct translations + * + *************************************************************************/ +/* gmp: mpq_clear */ +void GMPQAPI(clear)(mp_rat x) { + mp_rat_clear(x); +} + +/* gmp: mpq_cmp */ +int GMPQAPI(cmp)(mp_rat op1, mp_rat op2) { + return mp_rat_compare(op1, op2); +} + +/* gmp: mpq_init */ +void GMPQAPI(init)(mp_rat x) { + CHECK(mp_rat_init(x)); +} + +/* gmp: mpq_mul */ +void GMPQAPI(mul)(mp_rat product, mp_rat multiplier, mp_rat multiplicand) { + CHECK(mp_rat_mul(multiplier, multiplicand, product)); +} + +/* gmp: mpq_set*/ +void GMPQAPI(set)(mp_rat rop, mp_rat op) { + CHECK(mp_rat_copy(op, rop)); +} + +/* gmp: mpz_abs */ +void GMPZAPI(abs)(mp_int rop, mp_int op) { + CHECK(mp_int_abs(op, rop)); +} + +/* gmp: mpz_add */ +void GMPZAPI(add)(mp_int rop, mp_int op1, mp_int op2) { + CHECK(mp_int_add(op1, op2, rop)); +} + +/* gmp: mpz_clear */ +void GMPZAPI(clear)(mp_int x) { + mp_int_clear(x); +} + +/* gmp: mpz_cmp_si */ +int GMPZAPI(cmp_si)(mp_int op1, long op2) { + return mp_int_compare_value(op1, op2); +} + +/* gmp: mpz_cmpabs */ +int GMPZAPI(cmpabs)(mp_int op1, mp_int op2) { + return mp_int_compare_unsigned(op1, op2); +} + +/* gmp: mpz_cmp */ +int GMPZAPI(cmp)(mp_int op1, mp_int op2) { + return mp_int_compare(op1, op2); +} + +/* gmp: mpz_init */ +void GMPZAPI(init)(mp_int x) { + CHECK(mp_int_init(x)); +} + +/* gmp: mpz_mul */ +void GMPZAPI(mul)(mp_int rop, mp_int op1, mp_int op2) { + CHECK(mp_int_mul(op1, op2, rop)); +} + +/* gmp: mpz_neg */ +void GMPZAPI(neg)(mp_int rop, mp_int op) { + CHECK(mp_int_neg(op, rop)); +} + +/* gmp: mpz_set_si */ +void GMPZAPI(set_si)(mp_int rop, long op) { + CHECK(mp_int_set_value(rop, op)); +} + +/* gmp: mpz_set */ +void GMPZAPI(set)(mp_int rop, mp_int op) { + CHECK(mp_int_copy(op, rop)); +} + +/* gmp: mpz_sub */ +void GMPZAPI(sub)(mp_int rop, mp_int op1, mp_int op2) { + CHECK(mp_int_sub(op1, op2, rop)); +} + +/* gmp: mpz_swap */ +void GMPZAPI(swap)(mp_int rop1, mp_int rop2) { + mp_int_swap(rop1, rop2); +} + +/* gmp: mpq_sgn */ +int GMPQAPI(sgn)(mp_rat op) { + return mp_rat_compare_zero(op); +} + +/* gmp: mpz_sgn */ +int GMPZAPI(sgn)(mp_int op) { + return mp_int_compare_zero(op); +} + +/* gmp: mpq_set_ui */ +void GMPQAPI(set_ui)(mp_rat rop, unsigned long op1, unsigned long op2) { + CHECK(mp_rat_set_uvalue(rop, op1, op2)); +} + +/* gmp: mpz_set_ui */ +void GMPZAPI(set_ui)(mp_int rop, unsigned long op) { + CHECK(mp_int_set_uvalue(rop, op)); +} + +/* gmp: mpq_den_ref */ +mp_int GMPQAPI(denref)(mp_rat op) { + return mp_rat_denom_ref(op); +} + +/* gmp: mpq_num_ref */ +mp_int GMPQAPI(numref)(mp_rat op) { + return mp_rat_numer_ref(op); +} + +/* gmp: mpq_canonicalize */ +void GMPQAPI(canonicalize)(mp_rat op) { + CHECK(mp_rat_reduce(op)); +} + +/************************************************************************* + * + * Functions that can be implemented as a combination of imath functions + * + *************************************************************************/ +/* gmp: mpz_addmul */ +/* gmp: rop = rop + (op1 * op2) */ +void GMPZAPI(addmul)(mp_int rop, mp_int op1, mp_int op2) { + mpz_t tempz; + mp_int temp = &tempz; + mp_int_init(temp); + + CHECK(mp_int_mul(op1, op2, temp)); + CHECK(mp_int_add(rop, temp, rop)); + mp_int_clear(temp); +} + +/* gmp: mpz_divexact */ +/* gmp: only produces correct results when d divides n */ +void GMPZAPI(divexact)(mp_int q, mp_int n, mp_int d) { + CHECK(mp_int_div(n, d, q, NULL)); +} + +/* gmp: mpz_divisible_p */ +/* gmp: return 1 if d divides n, 0 otherwise */ +/* gmp: 0 is considered to divide 0*/ +int GMPZAPI(divisible_p)(mp_int n, mp_int d) { + /* variables to hold remainder */ + mpz_t rz; + mp_int r = &rz; + int r_is_zero; + + /* check for n = 0, d = 0 */ + int n_is_zero = mp_int_compare_zero(n) == 0; + int d_is_zero = mp_int_compare_zero(d) == 0; + if (n_is_zero && d_is_zero) + return 1; + + /* return true if remainder is 0 */ + CHECK(mp_int_init(r)); + CHECK(mp_int_div(n, d, NULL, r)); + r_is_zero = mp_int_compare_zero(r) == 0; + mp_int_clear(r); + + return r_is_zero; +} + +/* gmp: mpz_submul */ +/* gmp: rop = rop - (op1 * op2) */ +void GMPZAPI(submul)(mp_int rop, mp_int op1, mp_int op2) { + mpz_t tempz; + mp_int temp = &tempz; + mp_int_init(temp); + + CHECK(mp_int_mul(op1, op2, temp)); + CHECK(mp_int_sub(rop, temp, rop)); + + mp_int_clear(temp); +} + +/* gmp: mpz_add_ui */ +void GMPZAPI(add_ui)(mp_int rop, mp_int op1, unsigned long op2) { + mpz_t tempz; + mp_int temp = &tempz; + CHECK(mp_int_init_uvalue(temp, op2)); + + CHECK(mp_int_add(op1, temp, rop)); + + mp_int_clear(temp); +} + +/* gmp: mpz_divexact_ui */ +/* gmp: only produces correct results when d divides n */ +void GMPZAPI(divexact_ui)(mp_int q, mp_int n, unsigned long d) { + mpz_t tempz; + mp_int temp = &tempz; + CHECK(mp_int_init_uvalue(temp, d)); + + CHECK(mp_int_div(n, temp, q, NULL)); + + mp_int_clear(temp); +} + +/* gmp: mpz_mul_ui */ +void GMPZAPI(mul_ui)(mp_int rop, mp_int op1, unsigned long op2) { + mpz_t tempz; + mp_int temp = &tempz; + CHECK(mp_int_init_uvalue(temp, op2)); + + CHECK(mp_int_mul(op1, temp, rop)); + + mp_int_clear(temp); +} + +/* gmp: mpz_pow_ui */ +/* gmp: 0^0 = 1 */ +void GMPZAPI(pow_ui)(mp_int rop, mp_int base, unsigned long exp) { + mpz_t tempz; + mp_int temp = &tempz; + + /* check for 0^0 */ + if (exp == 0 && mp_int_compare_zero(base) == 0) { + CHECK(mp_int_set_value(rop, 1)); + return; + } + + /* rop = base^exp */ + CHECK(mp_int_init_uvalue(temp, exp)); + CHECK(mp_int_expt_full(base, temp, rop)); + mp_int_clear(temp); +} + +/* gmp: mpz_sub_ui */ +void GMPZAPI(sub_ui)(mp_int rop, mp_int op1, unsigned long op2) { + mpz_t tempz; + mp_int temp = &tempz; + CHECK(mp_int_init_uvalue(temp, op2)); + + CHECK(mp_int_sub(op1, temp, rop)); + + mp_int_clear(temp); +} + +/************************************************************************* + * + * Functions with different behavior in corner cases + * + *************************************************************************/ + +/* gmp: mpz_gcd */ +void GMPZAPI(gcd)(mp_int rop, mp_int op1, mp_int op2) { + int op1_is_zero = mp_int_compare_zero(op1) == 0; + int op2_is_zero = mp_int_compare_zero(op2) == 0; + + if (op1_is_zero && op2_is_zero) { + mp_int_zero(rop); + return; + } + + CHECK(mp_int_gcd(op1, op2, rop)); +} + +/* gmp: mpz_get_str */ +char* GMPZAPI(get_str)(char *str, int radix, mp_int op) { + int i, r, len; + + /* Support negative radix like gmp */ + r = radix; + if (r < 0) + r = -r; + + /* Compute the length of the string needed to hold the int */ + len = mp_int_string_len(op, r); + if (str == NULL) { + str = malloc(len); + } + + /* Convert to string using imath function */ + CHECK(mp_int_to_string(op, r, str, len)); + + /* Change case to match gmp */ + for (i = 0; i < len - 1; i++) + if (radix < 0) + str[i] = toupper(str[i]); + else + str[i] = tolower(str[i]); + return str; +} + +/* gmp: mpq_get_str */ +char* GMPQAPI(get_str)(char *str, int radix, mp_rat op) { + int i, r, len; + + /* Only print numerator if it is a whole number */ + if (mp_int_compare_value(mp_rat_denom_ref(op), 1) == 0) + return GMPZAPI(get_str)(str, radix, mp_rat_numer_ref(op)); + + /* Support negative radix like gmp */ + r = radix; + if (r < 0) + r = -r; + + /* Compute the length of the string needed to hold the int */ + len = mp_rat_string_len(op, r); + if (str == NULL) { + str = malloc(len); + } + + /* Convert to string using imath function */ + CHECK(mp_rat_to_string(op, r, str, len)); + + /* Change case to match gmp */ + for (i = 0; i < len; i++) + if (radix < 0) + str[i] = toupper(str[i]); + else + str[i] = tolower(str[i]); + + return str; +} + +/* gmp: mpz_set_str */ +int GMPZAPI(set_str)(mp_int rop, char *str, int base) { + mp_result res = mp_int_read_string(rop, base, str); + return ((res == MP_OK) ? 0 : -1); +} + +/* gmp: mpq_set_str */ +int GMPQAPI(set_str)(mp_rat rop, char *s, int base) { + char *slash; + char *str; + mp_result resN; + mp_result resD; + int res = 0; + + /* Copy string to temporary storage so we can modify it below */ + str = malloc(strlen(s)+1); + strcpy(str, s); + + /* Properly format the string as an int by terminating at the / */ + slash = strchr(str, '/'); + if (slash) + *slash = '\0'; + + /* Parse numerator */ + resN = mp_int_read_string(mp_rat_numer_ref(rop), base, str); + + /* Parse denomenator if given or set to 1 if not */ + if (slash) + resD = mp_int_read_string(mp_rat_denom_ref(rop), base, slash+1); + else + resD = mp_int_set_uvalue(mp_rat_denom_ref(rop), 1); + + /* Return failure if either parse failed */ + if (resN != MP_OK || resD != MP_OK) + res = -1; + + free(str); + return res; +} + +static unsigned long get_long_bits(mp_int op) { + /* Deal with integer that does not fit into unsigned long. We want to grab + * the least significant digits that will fit into the long. Read the digits + * into the long starting at the most significant digit that fits into a + * long. The long is shifted over by MP_DIGIT_BIT before each digit is added. + * The shift is decomposed into two steps to follow the patten used in the + * rest of the imath library. The two step shift is used to accomedate + * architectures that don't deal well with 32-bit shifts. */ + mp_size num_digits_in_long = sizeof(unsigned long) / sizeof(mp_digit); + mp_digit *digits = MP_DIGITS(op); + unsigned long out = 0; + int i; + + for (i = num_digits_in_long - 1; i >= 0; i--) { + out <<= (MP_DIGIT_BIT/2); + out <<= (MP_DIGIT_BIT/2); + out |= digits[i]; + } + + return out; +} + +/* gmp: mpz_get_ui */ +unsigned long GMPZAPI(get_ui)(mp_int op) { + unsigned long out; + + /* Try a standard conversion that fits into an unsigned long */ + mp_result res = mp_int_to_uint(op, &out); + if (res == MP_OK) + return out; + + /* Abort the try if we don't have a range error in the conversion. + * The range error indicates that the value cannot fit into a long. */ + CHECK(res == MP_RANGE ? MP_OK : MP_RANGE); + if (res != MP_RANGE) + return 0; + + return get_long_bits(op); +} + +/* gmp: mpz_get_si */ +long GMPZAPI(get_si)(mp_int op) { + long out; + unsigned long uout; + int long_msb; + + /* Try a standard conversion that fits into a long */ + mp_result res = mp_int_to_int(op, &out); + if (res == MP_OK) + return out; + + /* Abort the try if we don't have a range error in the conversion. + * The range error indicates that the value cannot fit into a long. */ + CHECK(res == MP_RANGE ? MP_OK : MP_RANGE); + if (res != MP_RANGE) + return 0; + + /* get least significant bits into an unsigned long */ + uout = get_long_bits(op); + + /* clear the top bit */ + long_msb = (sizeof(unsigned long) * 8) - 1; + uout &= (~(1UL << long_msb)); + + /* convert to negative if needed based on sign of op */ + if (MP_SIGN(op) == MP_NEG) + uout = 0 - uout; + + out = (long) uout; + return out; +} + +/* gmp: mpz_lcm */ +void GMPZAPI(lcm)(mp_int rop, mp_int op1, mp_int op2) { + int op1_is_zero = mp_int_compare_zero(op1) == 0; + int op2_is_zero = mp_int_compare_zero(op2) == 0; + + if (op1_is_zero || op2_is_zero) { + mp_int_zero(rop); + return; + } + + CHECK(mp_int_lcm(op1, op2, rop)); + CHECK(mp_int_abs(rop, rop)); +} + +/* gmp: mpz_mul_2exp */ +/* gmp: allow big values for op2 when op1 == 0 */ +void GMPZAPI(mul_2exp)(mp_int rop, mp_int op1, unsigned long op2) { + if (mp_int_compare_zero(op1) == 0) + mp_int_zero(rop); + else + CHECK(mp_int_mul_pow2(op1, op2, rop)); +} + +/************************************************************************* + * + * Functions needing expanded functionality + * + *************************************************************************/ +/* [Note]Overview of division implementation + + All division operations (N / D) compute q and r such that + + N = q * D + r, with 0 <= abs(r) < abs(d) + + The q and r values are not uniquely specified by N and D. To specify which q + and r values should be used, GMP implements three different rounding modes + for integer division: + + ceiling - round q twords +infinity, r has opposite sign as d + floor - round q twords -infinity, r has same sign as d + truncate - round q twords zero, r has same sign as n + + The imath library only supports truncate as a rounding mode. We need to + implement the other rounding modes in terms of truncating division. We first + perform the division in trucate mode and then adjust q accordingly. Once we + know q, we can easily compute the correct r according the the formula above + by computing: + + r = N - q * D + + The main task is to compute q. We can compute the correct q from a trucated + version as follows. + + For ceiling rounding mode, if q is less than 0 then the truncated rounding + mode is the same as the ceiling rounding mode. If q is greater than zero + then we need to round q up by one because the truncated version was rounded + down to zero. If q equals zero then check to see if the result of the + divison is positive. A positive result needs to increment q to one. + + For floor rounding mode, if q is greater than 0 then the trucated rounding + mode is the same as the floor rounding mode. If q is less than zero then we + need to round q down by one because the trucated mode rounded q up by one + twords zero. If q is zero then we need to check to see if the result of the + division is negative. A negative result needs to decrement q to negative + one. + */ + +/* gmp: mpz_cdiv_q */ +void GMPZAPI(cdiv_q)(mp_int q, mp_int n, mp_int d) { + mpz_t rz; + mp_int r = &rz; + int qsign, rsign, nsign, dsign; + CHECK(mp_int_init(r)); + + /* save signs before division because q can alias with n or d */ + nsign = mp_int_compare_zero(n); + dsign = mp_int_compare_zero(d); + + /* truncating division */ + CHECK(mp_int_div(n, d, q, r)); + + /* see: [Note]Overview of division implementation */ + qsign = mp_int_compare_zero(q); + rsign = mp_int_compare_zero(r); + if (qsign > 0) { /* q > 0 */ + if (rsign != 0) { /* r != 0 */ + CHECK(mp_int_add_value(q, 1, q)); + } + } + else if (qsign == 0) { /* q == 0 */ + if (rsign != 0) { /* r != 0 */ + if ((nsign > 0 && dsign > 0) || (nsign < 0 && dsign < 0)) { + CHECK(mp_int_set_value(q, 1)); + } + } + } + mp_int_clear(r); +} + +/* gmp: mpz_fdiv_q */ +void GMPZAPI(fdiv_q)(mp_int q, mp_int n, mp_int d) { + mpz_t rz; + mp_int r = &rz; + int qsign, rsign, nsign, dsign; + CHECK(mp_int_init(r)); + + /* save signs before division because q can alias with n or d */ + nsign = mp_int_compare_zero(n); + dsign = mp_int_compare_zero(d); + + /* truncating division */ + CHECK(mp_int_div(n, d, q, r)); + + /* see: [Note]Overview of division implementation */ + qsign = mp_int_compare_zero(q); + rsign = mp_int_compare_zero(r); + if (qsign < 0) { /* q < 0 */ + if (rsign != 0) { /* r != 0 */ + CHECK(mp_int_sub_value(q, 1, q)); + } + } + else if (qsign == 0) { /* q == 0 */ + if (rsign != 0) { /* r != 0 */ + if ((nsign < 0 && dsign > 0) || (nsign > 0 && dsign < 0)) { + CHECK(mp_int_set_value(q, -1)); + } + } + } + mp_int_clear(r); +} + +/* gmp: mpz_fdiv_r */ +void GMPZAPI(fdiv_r)(mp_int r, mp_int n, mp_int d) { + mpz_t qz; + mpz_t tempz; + mpz_t orig_dz; + mpz_t orig_nz; + mp_int q = &qz; + mp_int temp = &tempz; + mp_int orig_d = &orig_dz; + mp_int orig_n = &orig_nz; + CHECK(mp_int_init(q)); + CHECK(mp_int_init(temp)); + /* Make a copy of n in case n and d in case they overlap with q */ + CHECK(mp_int_init_copy(orig_d, d)); + CHECK(mp_int_init_copy(orig_n, n)); + + /* floor division */ + GMPZAPI(fdiv_q)(q, n, d); + + /* see: [Note]Overview of division implementation */ + /* n = q * d + r ==> r = n - q * d */ + mp_int_mul(q, orig_d, temp); + mp_int_sub(orig_n, temp, r); + + mp_int_clear(q); + mp_int_clear(temp); + mp_int_clear(orig_d); + mp_int_clear(orig_n); +} + +/* gmp: mpz_tdiv_q */ +void GMPZAPI(tdiv_q)(mp_int q, mp_int n, mp_int d) { + /* truncating division*/ + CHECK(mp_int_div(n, d, q, NULL)); +} + +/* gmp: mpz_fdiv_q_ui */ +unsigned long GMPZAPI(fdiv_q_ui)(mp_int q, mp_int n, unsigned long d) { + mpz_t tempz; + mp_int temp = &tempz; + mpz_t rz; + mp_int r = &rz; + mpz_t orig_nz; + mp_int orig_n = &orig_nz; + unsigned long rl; + CHECK(mp_int_init_uvalue(temp, d)); + CHECK(mp_int_init(r)); + /* Make a copy of n in case n and q overlap */ + CHECK(mp_int_init_copy(orig_n, n)); + + /* use floor division mode to compute q and r */ + GMPZAPI(fdiv_q)(q, n, temp); + GMPZAPI(fdiv_r)(r, orig_n, temp); + CHECK(mp_int_to_uint(r, &rl)); + + mp_int_clear(temp); + mp_int_clear(r); + mp_int_clear(orig_n); + + return rl; +} + +/* gmp: mpz_export */ +void* GMPZAPI(export)(void *rop, size_t *countp, int order, size_t size, int endian, size_t nails, mp_int op) { + int i; + int num_used_bytes; + size_t num_words, num_missing_bytes; + unsigned char* dst; + unsigned char* src; + + /* We do not have a complete implementation. Assert to ensure our + * restrictions are in place, We do not support big endian output, but do not + * check that native endian is little endian. */ + assert(nails == 0 && "Do not support non-full words"); + assert((endian == 0 || endian == -1) && "Do not support big endian"); + + /* The gmp API requires that order must be -1 or 1. + Not sure how gmp behaves when order is not 1 or -1, so force all non-one + values to -1 for now. */ + if (order != 1) order = -1; + + /* Test for zero */ + if (mp_int_compare_zero(op) == 0) { + if (countp) + *countp = 0; + return rop; + } + + /* Calculate how many words we need */ + num_used_bytes = mp_int_unsigned_len(op); + num_words = (num_used_bytes + (size-1)) / size; /* ceil division */ + assert(num_used_bytes > 0); + + /* Check to see if we will have missing bytes in the last word. + + Missing bytes can only occur when the size of words we output is + greater than the size of words used internally by imath. The number of + missing bytes is the number of bytes needed to fill out the last word. If + this number is greater than the size of a single mp_digit, then we need to + pad the word with extra zeros. Otherwise, the missing bytes can be filled + directly from the zeros in the last digit in the number. + */ + num_missing_bytes = (size * num_words) - num_used_bytes; + assert(num_missing_bytes < size); + + /* Allocate space for the result if needed */ + if (rop == NULL) { + rop = malloc(num_words * size); + } + + /* Initialize dst and src pointers */ + dst = (unsigned char *)rop; + src = (unsigned char *)MP_DIGITS(op); + + /* Most significant word first */ + if (order == 1) { + size_t words_written = 0; + src += (num_words-1) * size; + + /* Handle write of first word specially */ + for (i = 0; i < size - num_missing_bytes; i++) + dst[i] = src[i]; + for (; i < size; i++) + dst[i] = 0; + dst += size; + src -= size; + words_written++; + + for (; words_written < num_words; words_written++) { + for (i = 0; i < size; i++) + dst[i] = src[i]; + dst += size; + src -= size; + } + } + /* Least significant word first */ + else { + size_t words_written = 0; + for (; words_written < num_words - 1; words_written++) { + for (i = 0; i < size; i++) + dst[i] = src[i]; + dst += size; + src += size; + } + + /* Handle write of last word specially */ + for (i = 0; i < size - num_missing_bytes; i++) + dst[i] = src[i]; + + for (; i < size; i++) + dst[i] = 0; + } + + if (countp) + *countp = num_words; + return rop; +} + +/* gmp: mpz_import */ +void GMPZAPI(import)(mp_int rop, size_t count, int order, size_t size, int endian, size_t nails, const void* op) { + mpz_t tmpz; + mp_int tmp = &tmpz; + size_t total_size; + size_t num_digits; + const char *src; + char *dst; + int i; + if (count == 0 || op == NULL) + return; + + /* We do not have a complete implementation. Assert to ensure our + * restrictions are in place, We do not support big endian output, but do not + * check that native endian is little endian. */ + assert(nails == 0 && "Do not support non-full words"); + assert((endian == 0 || endian == -1) && "Do not support big endian"); + + /* Compute number of needed digits by ceil division */ + total_size = count * size; + num_digits = (total_size + sizeof(mp_digit) - 1) / sizeof(mp_digit); + + /* Init temporary */ + mp_int_init_size(tmp, num_digits); + for (i = 0; i < num_digits; i++) + tmp->digits[i] = 0; + + /* Copy bytes */ + src = (const char *) op; + dst = (char *)MP_DIGITS(tmp); + + /* Most significant word is first */ + if (order == 1) { + size_t word; + dst += (count - 1) * size; + for (word = 0; word < count; word++) { + for (i = 0; i < size; i++) + dst[i] = src[i]; + dst -= size; + src += size; + } + } + /* Least significant word is first */ + else { + size_t word; + for (word = 0; word < count; word++) { + for (i = 0; i < size; i++) + dst[i] = src[i]; + dst += size; + src += size; + } + } + MP_USED(tmp) = num_digits; + + /* Remove leading zeros from number */ + { + mp_size uz_ = MP_USED(tmp); + mp_digit *dz_ = MP_DIGITS(tmp) + uz_ -1; + while (uz_ > 1 && (*dz_-- == 0)) + --uz_; + MP_USED(tmp) = uz_; + } + + /* Copy to destination */ + mp_int_copy(tmp, rop); + mp_int_clear(tmp); +} + +/* gmp: mpz_sizeinbase */ +size_t GMPZAPI(sizeinbase)(mp_int op, int base) { + mp_result res; + size_t size; + + /* If op == 0, return 1 */ + if (mp_int_compare_zero(op) == 0) + return 1; + + /* Compute string length in base */ + res = mp_int_string_len(op, base); + CHECK((res > 0) == MP_OK); + + /* Now adjust the final size by getting rid of string artifacts */ + size = res; + + /* subtract one for the null terminator */ + size -= 1; + + /* subtract one for the negative sign */ + if (mp_int_compare_zero(op) < 0) + size -= 1; + + return size; +} diff -Nru cloog-0.18.2/isl/imath/gmp_compat.h cloog-0.18.4/isl/imath/gmp_compat.h --- cloog-0.18.2/isl/imath/gmp_compat.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/imath/gmp_compat.h 2015-07-27 11:46:11.000000000 +0000 @@ -0,0 +1,229 @@ +/* + Name: gmp_compat.h + Purpose: Provide GMP compatiable routines for imath library + Author: David Peixotto + + Copyright (c) 2012 Qualcomm Innovation Center, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + */ + +#ifndef IMATH_GMP_COMPAT_H_ +#define IMATH_GMP_COMPAT_H_ +#include "imath.h" +#include "imrat.h" +#include + +#define GMPZAPI(fun) impz_ ## fun +#define GMPQAPI(fun) impq_ ## fun + +#ifdef __cplusplus +extern "C" { +#endif +/************************************************************************* + * + * Functions with direct translations + * + *************************************************************************/ +/* gmp: mpq_clear */ +void GMPQAPI(clear)(mp_rat x); + +/* gmp: mpq_cmp */ +int GMPQAPI(cmp)(mp_rat op1, mp_rat op2); + +/* gmp: mpq_init */ +void GMPQAPI(init)(mp_rat x); + +/* gmp: mpq_mul */ +void GMPQAPI(mul)(mp_rat product, mp_rat multiplier, mp_rat multiplicand); + +/* gmp: mpq_set */ +void GMPQAPI(set)(mp_rat rop, mp_rat op); + +/* gmp: mpz_abs */ +void GMPZAPI(abs)(mp_int rop, mp_int op); + +/* gmp: mpz_add */ +void GMPZAPI(add)(mp_int rop, mp_int op1, mp_int op2); + +/* gmp: mpz_clear */ +void GMPZAPI(clear)(mp_int x); + +/* gmp: mpz_cmp_si */ +int GMPZAPI(cmp_si)(mp_int op1, long op2); + +/* gmp: mpz_cmpabs */ +int GMPZAPI(cmpabs)(mp_int op1, mp_int op2); + +/* gmp: mpz_cmp */ +int GMPZAPI(cmp)(mp_int op1, mp_int op2); + +/* gmp: mpz_init */ +void GMPZAPI(init)(mp_int x); + +/* gmp: mpz_mul */ +void GMPZAPI(mul)(mp_int rop, mp_int op1, mp_int op2); + +/* gmp: mpz_neg */ +void GMPZAPI(neg)(mp_int rop, mp_int op); + +/* gmp: mpz_set_si */ +void GMPZAPI(set_si)(mp_int rop, long op); + +/* gmp: mpz_set */ +void GMPZAPI(set)(mp_int rop, mp_int op); + +/* gmp: mpz_sub */ +void GMPZAPI(sub)(mp_int rop, mp_int op1, mp_int op2); + +/* gmp: mpz_swap */ +void GMPZAPI(swap)(mp_int rop1, mp_int rop2); + +/* gmp: mpq_sgn */ +int GMPQAPI(sgn)(mp_rat op); + +/* gmp: mpz_sgn */ +int GMPZAPI(sgn)(mp_int op); + +/* gmp: mpq_set_ui */ +void GMPQAPI(set_ui)(mp_rat rop, unsigned long op1, unsigned long op2); + +/* gmp: mpz_set_ui */ +void GMPZAPI(set_ui)(mp_int rop, unsigned long op); + +/* gmp: mpq_den_ref */ +mp_int GMPQAPI(denref)(mp_rat op); + +/* gmp: mpq_num_ref */ +mp_int GMPQAPI(numref)(mp_rat op); + +/* gmp: mpq_canonicalize */ +void GMPQAPI(canonicalize)(mp_rat op); + +/************************************************************************* + * + * Functions that can be implemented as a combination of imath functions + * + *************************************************************************/ +/* gmp: mpz_addmul */ +void GMPZAPI(addmul)(mp_int rop, mp_int op1, mp_int op2); + +/* gmp: mpz_divexact */ +void GMPZAPI(divexact)(mp_int q, mp_int n, mp_int d); + +/* gmp: mpz_divisible_p */ +int GMPZAPI(divisible_p)(mp_int n, mp_int d); + +/* gmp: mpz_submul */ +void GMPZAPI(submul)(mp_int rop, mp_int op1, mp_int op2); + +/* gmp: mpz_add_ui */ +void GMPZAPI(add_ui)(mp_int rop, mp_int op1, unsigned long op2); + +/* gmp: mpz_divexact_ui */ +void GMPZAPI(divexact_ui)(mp_int q, mp_int n, unsigned long d); + +/* gmp: mpz_mul_ui */ +void GMPZAPI(mul_ui)(mp_int rop, mp_int op1, unsigned long op2); + +/* gmp: mpz_pow_ui */ +void GMPZAPI(pow_ui)(mp_int rop, mp_int base, unsigned long exp); + +/* gmp: mpz_sub_ui */ +void GMPZAPI(sub_ui)(mp_int rop, mp_int op1, unsigned long op2); + +/* gmp: mpz_fdiv_q_ui */ +unsigned long GMPZAPI(fdiv_q_ui)(mp_int q, mp_int n, unsigned long d); + +/* gmp: mpz_sizeinbase */ +size_t GMPZAPI(sizeinbase)(mp_int op, int base); + +/************************************************************************* + * + * Functions with different behavior in corner cases + * + *************************************************************************/ +/* gmp: mpz_gcd */ +/* gmp: When op1 = 0 and op2 = 0, return 0.*/ +void GMPZAPI(gcd)(mp_int rop, mp_int op1, mp_int op2); + +/* gmp: mpz_get_str */ +/* gmp: If str is NULL then allocate space using the default allocator. */ +char* GMPZAPI(get_str)(char *str, int radix, mp_int op); + +/* gmp: mpq_get_str */ +/* gmp: If str is NULL then allocate space using the default allocator. */ +/* gmp: If value is a whole number do not print denomenator. */ +/* TODO: Need to handle 0 values better. GMP prints 0/4 instead of 0.*/ +char* GMPQAPI(get_str)(char *str, int radix, mp_rat op); + +/* gmp: mpz_set_str */ +/* gmp: Allow and ignore spaces in string. */ +int GMPZAPI(set_str)(mp_int rop, char *str, int base); + +/* gmp: mpq_set_str */ +int GMPQAPI(set_str)(mp_rat rop, char *str, int base); + +/* gmp: mpz_get_ui */ +/* gmp: Return least significant bits if value is too big for a long. */ +unsigned long GMPZAPI(get_ui)(mp_int op); + +/* gmp: mpz_get_si */ +/* gmp: Return least significant bits if value is too bit for a long. */ +/* gmp: If value is too big for long, return the least significant + (8*sizeof(long)-1) bits from the op and set the sign bit according to + the sign of the op. */ +long GMPZAPI(get_si)(mp_int op); + +/* gmp: mpz_lcm */ +/* gmp: When op1 = 0 or op2 = 0, return 0.*/ +/* gmp: The resutl of lcm(a,b) is always positive. */ +void GMPZAPI(lcm)(mp_int rop, mp_int op1, mp_int op2); + +/* gmp: mpz_mul_2exp */ +/* gmp: allow big values for op2 when op1 == 0 */ +void GMPZAPI(mul_2exp)(mp_int rop, mp_int op1, unsigned long op2); + +/************************************************************************* + * + * Functions needing expanded functionality + * + *************************************************************************/ +/* gmp: mpz_cdiv_q */ +void GMPZAPI(cdiv_q)(mp_int q, mp_int n, mp_int d); + +/* gmp: mpz_fdiv_q */ +void GMPZAPI(fdiv_q)(mp_int q, mp_int n, mp_int d); + +/* gmp: mpz_fdiv_r */ +void GMPZAPI(fdiv_r)(mp_int r, mp_int n, mp_int d); + +/* gmp: mpz_tdiv_q */ +void GMPZAPI(tdiv_q)(mp_int q, mp_int n, mp_int d); + +/* gmp: mpz_export */ +void* GMPZAPI(export)(void *rop, size_t *countp, int order, size_t size, int endian, size_t nails, mp_int op); + +/* gmp: mpz_import */ +void GMPZAPI(import)(mp_int rop, size_t count, int order, size_t size, int endian, size_t nails, const void* op); + +#ifdef __cplusplus +} +#endif +#endif /* end IMATH_GMP_COMPAT_H_ */ diff -Nru cloog-0.18.2/isl/imath/imath.c cloog-0.18.4/isl/imath/imath.c --- cloog-0.18.2/isl/imath/imath.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/imath/imath.c 2015-07-27 11:46:11.000000000 +0000 @@ -0,0 +1,3256 @@ +/* + Name: imath.c + Purpose: Arbitrary precision integer arithmetic routines. + Author: M. J. Fromberger + + Copyright (C) 2002-2007 Michael J. Fromberger, All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + */ + +#include "imath.h" + +#if DEBUG +#include +#endif + +#include +#include +#include + +#include + +#if DEBUG +#define STATIC /* public */ +#else +#define STATIC static +#endif + +const mp_result MP_OK = 0; /* no error, all is well */ +const mp_result MP_FALSE = 0; /* boolean false */ +const mp_result MP_TRUE = -1; /* boolean true */ +const mp_result MP_MEMORY = -2; /* out of memory */ +const mp_result MP_RANGE = -3; /* argument out of range */ +const mp_result MP_UNDEF = -4; /* result undefined */ +const mp_result MP_TRUNC = -5; /* output truncated */ +const mp_result MP_BADARG = -6; /* invalid null argument */ +const mp_result MP_MINERR = -6; + +const mp_sign MP_NEG = 1; /* value is strictly negative */ +const mp_sign MP_ZPOS = 0; /* value is non-negative */ + +STATIC const char *s_unknown_err = "unknown result code"; +STATIC const char *s_error_msg[] = { + "error code 0", + "boolean true", + "out of memory", + "argument out of range", + "result undefined", + "output truncated", + "invalid argument", + NULL +}; + +/* Argument checking macros + Use CHECK() where a return value is required; NRCHECK() elsewhere */ +#define CHECK(TEST) assert(TEST) +#define NRCHECK(TEST) assert(TEST) + +/* The ith entry of this table gives the value of log_i(2). + + An integer value n requires ceil(log_i(n)) digits to be represented + in base i. Since it is easy to compute lg(n), by counting bits, we + can compute log_i(n) = lg(n) * log_i(2). + + The use of this table eliminates a dependency upon linkage against + the standard math libraries. + + If MP_MAX_RADIX is increased, this table should be expanded too. + */ +STATIC const double s_log2[] = { + 0.000000000, 0.000000000, 1.000000000, 0.630929754, /* (D)(D) 2 3 */ + 0.500000000, 0.430676558, 0.386852807, 0.356207187, /* 4 5 6 7 */ + 0.333333333, 0.315464877, 0.301029996, 0.289064826, /* 8 9 10 11 */ + 0.278942946, 0.270238154, 0.262649535, 0.255958025, /* 12 13 14 15 */ + 0.250000000, 0.244650542, 0.239812467, 0.235408913, /* 16 17 18 19 */ + 0.231378213, 0.227670249, 0.224243824, 0.221064729, /* 20 21 22 23 */ + 0.218104292, 0.215338279, 0.212746054, 0.210309918, /* 24 25 26 27 */ + 0.208014598, 0.205846832, 0.203795047, 0.201849087, /* 28 29 30 31 */ + 0.200000000, 0.198239863, 0.196561632, 0.194959022, /* 32 33 34 35 */ + 0.193426404, /* 36 */ +}; + + + +/* Return the number of digits needed to represent a static value */ +#define MP_VALUE_DIGITS(V) \ +((sizeof(V)+(sizeof(mp_digit)-1))/sizeof(mp_digit)) + +/* Round precision P to nearest word boundary */ +#define ROUND_PREC(P) ((mp_size)(2*(((P)+1)/2))) + +/* Set array P of S digits to zero */ +#define ZERO(P, S) \ +do{ \ + mp_size i__ = (S) * sizeof(mp_digit); \ + mp_digit *p__ = (P); \ + memset(p__, 0, i__); \ +} while(0) + +/* Copy S digits from array P to array Q */ +#define COPY(P, Q, S) \ +do{ \ + mp_size i__ = (S) * sizeof(mp_digit); \ + mp_digit *p__ = (P), *q__ = (Q); \ + memcpy(q__, p__, i__); \ +} while(0) + +/* Reverse N elements of type T in array A */ +#define REV(T, A, N) \ +do{ \ + T *u_ = (A), *v_ = u_ + (N) - 1; \ + while (u_ < v_) { \ + T xch = *u_; \ + *u_++ = *v_; \ + *v_-- = xch; \ + } \ +} while(0) + +#define CLAMP(Z) \ +do{ \ + mp_int z_ = (Z); \ + mp_size uz_ = MP_USED(z_); \ + mp_digit *dz_ = MP_DIGITS(z_) + uz_ -1; \ + while (uz_ > 1 && (*dz_-- == 0)) \ + --uz_; \ + MP_USED(z_) = uz_; \ +} while(0) + +/* Select min/max. Do not provide expressions for which multiple + evaluation would be problematic, e.g. x++ */ +#define MIN(A, B) ((B)<(A)?(B):(A)) +#define MAX(A, B) ((B)>(A)?(B):(A)) + +/* Exchange lvalues A and B of type T, e.g. + SWAP(int, x, y) where x and y are variables of type int. */ +#define SWAP(T, A, B) \ +do{ \ + T t_ = (A); \ + A = (B); \ + B = t_; \ +} while(0) + +/* Used to set up and access simple temp stacks within functions. */ +#define DECLARE_TEMP(N) \ + mpz_t temp[(N)]; \ + int last__ = 0 +#define CLEANUP_TEMP() \ + CLEANUP: \ + while (--last__ >= 0) \ + mp_int_clear(TEMP(last__)) +#define TEMP(K) (temp + (K)) +#define LAST_TEMP() TEMP(last__) +#define SETUP(E) \ +do{ \ + if ((res = (E)) != MP_OK) \ + goto CLEANUP; \ + ++(last__); \ +} while(0) + +/* Compare value to zero. */ +#define CMPZ(Z) \ +(((Z)->used==1&&(Z)->digits[0]==0)?0:((Z)->sign==MP_NEG)?-1:1) + +/* Multiply X by Y into Z, ignoring signs. Requires that Z have + enough storage preallocated to hold the result. */ +#define UMUL(X, Y, Z) \ +do{ \ + mp_size ua_ = MP_USED(X), ub_ = MP_USED(Y); \ + mp_size o_ = ua_ + ub_; \ + ZERO(MP_DIGITS(Z), o_); \ + (void) s_kmul(MP_DIGITS(X), MP_DIGITS(Y), MP_DIGITS(Z), ua_, ub_); \ + MP_USED(Z) = o_; \ + CLAMP(Z); \ +} while(0) + +/* Square X into Z. Requires that Z have enough storage to hold the + result. */ +#define USQR(X, Z) \ +do{ \ + mp_size ua_ = MP_USED(X), o_ = ua_ + ua_; \ + ZERO(MP_DIGITS(Z), o_); \ + (void) s_ksqr(MP_DIGITS(X), MP_DIGITS(Z), ua_); \ + MP_USED(Z) = o_; \ + CLAMP(Z); \ +} while(0) + +#define UPPER_HALF(W) ((mp_word)((W) >> MP_DIGIT_BIT)) +#define LOWER_HALF(W) ((mp_digit)(W)) +#define HIGH_BIT_SET(W) ((W) >> (MP_WORD_BIT - 1)) +#define ADD_WILL_OVERFLOW(W, V) ((MP_WORD_MAX - (V)) < (W)) + + + +/* Default number of digits allocated to a new mp_int */ +#if IMATH_TEST +mp_size default_precision = MP_DEFAULT_PREC; +#else +STATIC const mp_size default_precision = MP_DEFAULT_PREC; +#endif + +/* Minimum number of digits to invoke recursive multiply */ +#if IMATH_TEST +mp_size multiply_threshold = MP_MULT_THRESH; +#else +STATIC const mp_size multiply_threshold = MP_MULT_THRESH; +#endif + +/* Allocate a buffer of (at least) num digits, or return + NULL if that couldn't be done. */ +STATIC mp_digit *s_alloc(mp_size num); + +/* Release a buffer of digits allocated by s_alloc(). */ +STATIC void s_free(void *ptr); + +/* Insure that z has at least min digits allocated, resizing if + necessary. Returns true if successful, false if out of memory. */ +STATIC int s_pad(mp_int z, mp_size min); + +/* Fill in a "fake" mp_int on the stack with a given value */ +STATIC void s_fake(mp_int z, mp_small value, mp_digit vbuf[]); +STATIC void s_ufake(mp_int z, mp_usmall value, mp_digit vbuf[]); + +/* Compare two runs of digits of given length, returns <0, 0, >0 */ +STATIC int s_cdig(mp_digit *da, mp_digit *db, mp_size len); + +/* Pack the unsigned digits of v into array t */ +STATIC int s_uvpack(mp_usmall v, mp_digit t[]); + +/* Compare magnitudes of a and b, returns <0, 0, >0 */ +STATIC int s_ucmp(mp_int a, mp_int b); + +/* Compare magnitudes of a and v, returns <0, 0, >0 */ +STATIC int s_vcmp(mp_int a, mp_small v); +STATIC int s_uvcmp(mp_int a, mp_usmall uv); + +/* Unsigned magnitude addition; assumes dc is big enough. + Carry out is returned (no memory allocated). */ +STATIC mp_digit s_uadd(mp_digit *da, mp_digit *db, mp_digit *dc, + mp_size size_a, mp_size size_b); + +/* Unsigned magnitude subtraction. Assumes dc is big enough. */ +STATIC void s_usub(mp_digit *da, mp_digit *db, mp_digit *dc, + mp_size size_a, mp_size size_b); + +/* Unsigned recursive multiplication. Assumes dc is big enough. */ +STATIC int s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc, + mp_size size_a, mp_size size_b); + +/* Unsigned magnitude multiplication. Assumes dc is big enough. */ +STATIC void s_umul(mp_digit *da, mp_digit *db, mp_digit *dc, + mp_size size_a, mp_size size_b); + +/* Unsigned recursive squaring. Assumes dc is big enough. */ +STATIC int s_ksqr(mp_digit *da, mp_digit *dc, mp_size size_a); + +/* Unsigned magnitude squaring. Assumes dc is big enough. */ +STATIC void s_usqr(mp_digit *da, mp_digit *dc, mp_size size_a); + +/* Single digit addition. Assumes a is big enough. */ +STATIC void s_dadd(mp_int a, mp_digit b); + +/* Single digit multiplication. Assumes a is big enough. */ +STATIC void s_dmul(mp_int a, mp_digit b); + +/* Single digit multiplication on buffers; assumes dc is big enough. */ +STATIC void s_dbmul(mp_digit *da, mp_digit b, mp_digit *dc, + mp_size size_a); + +/* Single digit division. Replaces a with the quotient, + returns the remainder. */ +STATIC mp_digit s_ddiv(mp_int a, mp_digit b); + +/* Quick division by a power of 2, replaces z (no allocation) */ +STATIC void s_qdiv(mp_int z, mp_size p2); + +/* Quick remainder by a power of 2, replaces z (no allocation) */ +STATIC void s_qmod(mp_int z, mp_size p2); + +/* Quick multiplication by a power of 2, replaces z. + Allocates if necessary; returns false in case this fails. */ +STATIC int s_qmul(mp_int z, mp_size p2); + +/* Quick subtraction from a power of 2, replaces z. + Allocates if necessary; returns false in case this fails. */ +STATIC int s_qsub(mp_int z, mp_size p2); + +/* Return maximum k such that 2^k divides z. */ +STATIC int s_dp2k(mp_int z); + +/* Return k >= 0 such that z = 2^k, or -1 if there is no such k. */ +STATIC int s_isp2(mp_int z); + +/* Set z to 2^k. May allocate; returns false in case this fails. */ +STATIC int s_2expt(mp_int z, mp_small k); + +/* Normalize a and b for division, returns normalization constant */ +STATIC int s_norm(mp_int a, mp_int b); + +/* Compute constant mu for Barrett reduction, given modulus m, result + replaces z, m is untouched. */ +STATIC mp_result s_brmu(mp_int z, mp_int m); + +/* Reduce a modulo m, using Barrett's algorithm. */ +STATIC int s_reduce(mp_int x, mp_int m, mp_int mu, mp_int q1, mp_int q2); + +/* Modular exponentiation, using Barrett reduction */ +STATIC mp_result s_embar(mp_int a, mp_int b, mp_int m, mp_int mu, mp_int c); + +/* Unsigned magnitude division. Assumes |a| > |b|. Allocates temporaries; + overwrites a with quotient, b with remainder. */ +STATIC mp_result s_udiv_knuth(mp_int a, mp_int b); + +/* Compute the number of digits in radix r required to represent the given + value. Does not account for sign flags, terminators, etc. */ +STATIC int s_outlen(mp_int z, mp_size r); + +/* Guess how many digits of precision will be needed to represent a radix r + value of the specified number of digits. Returns a value guaranteed to be + no smaller than the actual number required. */ +STATIC mp_size s_inlen(int len, mp_size r); + +/* Convert a character to a digit value in radix r, or + -1 if out of range */ +STATIC int s_ch2val(char c, int r); + +/* Convert a digit value to a character */ +STATIC char s_val2ch(int v, int caps); + +/* Take 2's complement of a buffer in place */ +STATIC void s_2comp(unsigned char *buf, int len); + +/* Convert a value to binary, ignoring sign. On input, *limpos is the bound on + how many bytes should be written to buf; on output, *limpos is set to the + number of bytes actually written. */ +STATIC mp_result s_tobin(mp_int z, unsigned char *buf, int *limpos, int pad); + +#if DEBUG +/* Dump a representation of the mp_int to standard output */ +void s_print(char *tag, mp_int z); +void s_print_buf(char *tag, mp_digit *buf, mp_size num); +#endif + +mp_result mp_int_init(mp_int z) +{ + if (z == NULL) + return MP_BADARG; + + z->single = 0; + z->digits = &(z->single); + z->alloc = 1; + z->used = 1; + z->sign = MP_ZPOS; + + return MP_OK; +} + +mp_int mp_int_alloc(void) +{ + mp_int out = malloc(sizeof(mpz_t)); + + if (out != NULL) + mp_int_init(out); + + return out; +} + +mp_result mp_int_init_size(mp_int z, mp_size prec) +{ + CHECK(z != NULL); + + if (prec == 0) + prec = default_precision; + else if (prec == 1) + return mp_int_init(z); + else + prec = (mp_size) ROUND_PREC(prec); + + if ((MP_DIGITS(z) = s_alloc(prec)) == NULL) + return MP_MEMORY; + + z->digits[0] = 0; + MP_USED(z) = 1; + MP_ALLOC(z) = prec; + MP_SIGN(z) = MP_ZPOS; + + return MP_OK; +} + +mp_result mp_int_init_copy(mp_int z, mp_int old) +{ + mp_result res; + mp_size uold; + + CHECK(z != NULL && old != NULL); + + uold = MP_USED(old); + if (uold == 1) { + mp_int_init(z); + } + else { + mp_size target = MAX(uold, default_precision); + + if ((res = mp_int_init_size(z, target)) != MP_OK) + return res; + } + + MP_USED(z) = uold; + MP_SIGN(z) = MP_SIGN(old); + COPY(MP_DIGITS(old), MP_DIGITS(z), uold); + + return MP_OK; +} + +mp_result mp_int_init_value(mp_int z, mp_small value) +{ + mpz_t vtmp; + mp_digit vbuf[MP_VALUE_DIGITS(value)]; + + s_fake(&vtmp, value, vbuf); + return mp_int_init_copy(z, &vtmp); +} + +mp_result mp_int_init_uvalue(mp_int z, mp_usmall uvalue) +{ + mpz_t vtmp; + mp_digit vbuf[MP_VALUE_DIGITS(uvalue)]; + + s_ufake(&vtmp, uvalue, vbuf); + return mp_int_init_copy(z, &vtmp); +} + +mp_result mp_int_set_value(mp_int z, mp_small value) +{ + mpz_t vtmp; + mp_digit vbuf[MP_VALUE_DIGITS(value)]; + + s_fake(&vtmp, value, vbuf); + return mp_int_copy(&vtmp, z); +} + +mp_result mp_int_set_uvalue(mp_int z, mp_usmall uvalue) +{ + mpz_t vtmp; + mp_digit vbuf[MP_VALUE_DIGITS(uvalue)]; + + s_ufake(&vtmp, uvalue, vbuf); + return mp_int_copy(&vtmp, z); +} + +void mp_int_clear(mp_int z) +{ + if (z == NULL) + return; + + if (MP_DIGITS(z) != NULL) { + if (MP_DIGITS(z) != &(z->single)) + s_free(MP_DIGITS(z)); + + MP_DIGITS(z) = NULL; + } +} + +void mp_int_free(mp_int z) +{ + NRCHECK(z != NULL); + + mp_int_clear(z); + free(z); /* note: NOT s_free() */ +} + +mp_result mp_int_copy(mp_int a, mp_int c) +{ + CHECK(a != NULL && c != NULL); + + if (a != c) { + mp_size ua = MP_USED(a); + mp_digit *da, *dc; + + if (!s_pad(c, ua)) + return MP_MEMORY; + + da = MP_DIGITS(a); dc = MP_DIGITS(c); + COPY(da, dc, ua); + + MP_USED(c) = ua; + MP_SIGN(c) = MP_SIGN(a); + } + + return MP_OK; +} + +void mp_int_swap(mp_int a, mp_int c) +{ + if (a != c) { + mpz_t tmp = *a; + + *a = *c; + *c = tmp; + + if (MP_DIGITS(a) == &(c->single)) + MP_DIGITS(a) = &(a->single); + if (MP_DIGITS(c) == &(a->single)) + MP_DIGITS(c) = &(c->single); + } +} + +void mp_int_zero(mp_int z) +{ + NRCHECK(z != NULL); + + z->digits[0] = 0; + MP_USED(z) = 1; + MP_SIGN(z) = MP_ZPOS; +} + +mp_result mp_int_abs(mp_int a, mp_int c) +{ + mp_result res; + + CHECK(a != NULL && c != NULL); + + if ((res = mp_int_copy(a, c)) != MP_OK) + return res; + + MP_SIGN(c) = MP_ZPOS; + return MP_OK; +} + +mp_result mp_int_neg(mp_int a, mp_int c) +{ + mp_result res; + + CHECK(a != NULL && c != NULL); + + if ((res = mp_int_copy(a, c)) != MP_OK) + return res; + + if (CMPZ(c) != 0) + MP_SIGN(c) = 1 - MP_SIGN(a); + + return MP_OK; +} + +mp_result mp_int_add(mp_int a, mp_int b, mp_int c) +{ + mp_size ua, ub, uc, max; + + CHECK(a != NULL && b != NULL && c != NULL); + + ua = MP_USED(a); ub = MP_USED(b); uc = MP_USED(c); + max = MAX(ua, ub); + + if (MP_SIGN(a) == MP_SIGN(b)) { + /* Same sign -- add magnitudes, preserve sign of addends */ + mp_digit carry; + + if (!s_pad(c, max)) + return MP_MEMORY; + + carry = s_uadd(MP_DIGITS(a), MP_DIGITS(b), MP_DIGITS(c), ua, ub); + uc = max; + + if (carry) { + if (!s_pad(c, max + 1)) + return MP_MEMORY; + + c->digits[max] = carry; + ++uc; + } + + MP_USED(c) = uc; + MP_SIGN(c) = MP_SIGN(a); + + } + else { + /* Different signs -- subtract magnitudes, preserve sign of greater */ + mp_int x, y; + int cmp = s_ucmp(a, b); /* magnitude comparision, sign ignored */ + + /* Set x to max(a, b), y to min(a, b) to simplify later code. + A special case yields zero for equal magnitudes. + */ + if (cmp == 0) { + mp_int_zero(c); + return MP_OK; + } + else if (cmp < 0) { + x = b; y = a; + } + else { + x = a; y = b; + } + + if (!s_pad(c, MP_USED(x))) + return MP_MEMORY; + + /* Subtract smaller from larger */ + s_usub(MP_DIGITS(x), MP_DIGITS(y), MP_DIGITS(c), MP_USED(x), MP_USED(y)); + MP_USED(c) = MP_USED(x); + CLAMP(c); + + /* Give result the sign of the larger */ + MP_SIGN(c) = MP_SIGN(x); + } + + return MP_OK; +} + +mp_result mp_int_add_value(mp_int a, mp_small value, mp_int c) +{ + mpz_t vtmp; + mp_digit vbuf[MP_VALUE_DIGITS(value)]; + + s_fake(&vtmp, value, vbuf); + + return mp_int_add(a, &vtmp, c); +} + +mp_result mp_int_sub(mp_int a, mp_int b, mp_int c) +{ + mp_size ua, ub, uc, max; + + CHECK(a != NULL && b != NULL && c != NULL); + + ua = MP_USED(a); ub = MP_USED(b); uc = MP_USED(c); + max = MAX(ua, ub); + + if (MP_SIGN(a) != MP_SIGN(b)) { + /* Different signs -- add magnitudes and keep sign of a */ + mp_digit carry; + + if (!s_pad(c, max)) + return MP_MEMORY; + + carry = s_uadd(MP_DIGITS(a), MP_DIGITS(b), MP_DIGITS(c), ua, ub); + uc = max; + + if (carry) { + if (!s_pad(c, max + 1)) + return MP_MEMORY; + + c->digits[max] = carry; + ++uc; + } + + MP_USED(c) = uc; + MP_SIGN(c) = MP_SIGN(a); + + } + else { + /* Same signs -- subtract magnitudes */ + mp_int x, y; + mp_sign osign; + int cmp = s_ucmp(a, b); + + if (!s_pad(c, max)) + return MP_MEMORY; + + if (cmp >= 0) { + x = a; y = b; osign = MP_ZPOS; + } + else { + x = b; y = a; osign = MP_NEG; + } + + if (MP_SIGN(a) == MP_NEG && cmp != 0) + osign = 1 - osign; + + s_usub(MP_DIGITS(x), MP_DIGITS(y), MP_DIGITS(c), MP_USED(x), MP_USED(y)); + MP_USED(c) = MP_USED(x); + CLAMP(c); + + MP_SIGN(c) = osign; + } + + return MP_OK; +} + +mp_result mp_int_sub_value(mp_int a, mp_small value, mp_int c) +{ + mpz_t vtmp; + mp_digit vbuf[MP_VALUE_DIGITS(value)]; + + s_fake(&vtmp, value, vbuf); + + return mp_int_sub(a, &vtmp, c); +} + +mp_result mp_int_mul(mp_int a, mp_int b, mp_int c) +{ + mp_digit *out; + mp_size osize, ua, ub, p = 0; + mp_sign osign; + + CHECK(a != NULL && b != NULL && c != NULL); + + /* If either input is zero, we can shortcut multiplication */ + if (mp_int_compare_zero(a) == 0 || mp_int_compare_zero(b) == 0) { + mp_int_zero(c); + return MP_OK; + } + + /* Output is positive if inputs have same sign, otherwise negative */ + osign = (MP_SIGN(a) == MP_SIGN(b)) ? MP_ZPOS : MP_NEG; + + /* If the output is not identical to any of the inputs, we'll write the + results directly; otherwise, allocate a temporary space. */ + ua = MP_USED(a); ub = MP_USED(b); + osize = MAX(ua, ub); + osize = 4 * ((osize + 1) / 2); + + if (c == a || c == b) { + p = ROUND_PREC(osize); + p = MAX(p, default_precision); + + if ((out = s_alloc(p)) == NULL) + return MP_MEMORY; + } + else { + if (!s_pad(c, osize)) + return MP_MEMORY; + + out = MP_DIGITS(c); + } + ZERO(out, osize); + + if (!s_kmul(MP_DIGITS(a), MP_DIGITS(b), out, ua, ub)) + return MP_MEMORY; + + /* If we allocated a new buffer, get rid of whatever memory c was already + using, and fix up its fields to reflect that. + */ + if (out != MP_DIGITS(c)) { + if ((void *) MP_DIGITS(c) != (void *) c) + s_free(MP_DIGITS(c)); + MP_DIGITS(c) = out; + MP_ALLOC(c) = p; + } + + MP_USED(c) = osize; /* might not be true, but we'll fix it ... */ + CLAMP(c); /* ... right here */ + MP_SIGN(c) = osign; + + return MP_OK; +} + +mp_result mp_int_mul_value(mp_int a, mp_small value, mp_int c) +{ + mpz_t vtmp; + mp_digit vbuf[MP_VALUE_DIGITS(value)]; + + s_fake(&vtmp, value, vbuf); + + return mp_int_mul(a, &vtmp, c); +} + +mp_result mp_int_mul_pow2(mp_int a, mp_small p2, mp_int c) +{ + mp_result res; + CHECK(a != NULL && c != NULL && p2 >= 0); + + if ((res = mp_int_copy(a, c)) != MP_OK) + return res; + + if (s_qmul(c, (mp_size) p2)) + return MP_OK; + else + return MP_MEMORY; +} + +mp_result mp_int_sqr(mp_int a, mp_int c) +{ + mp_digit *out; + mp_size osize, p = 0; + + CHECK(a != NULL && c != NULL); + + /* Get a temporary buffer big enough to hold the result */ + osize = (mp_size) 4 * ((MP_USED(a) + 1) / 2); + if (a == c) { + p = ROUND_PREC(osize); + p = MAX(p, default_precision); + + if ((out = s_alloc(p)) == NULL) + return MP_MEMORY; + } + else { + if (!s_pad(c, osize)) + return MP_MEMORY; + + out = MP_DIGITS(c); + } + ZERO(out, osize); + + s_ksqr(MP_DIGITS(a), out, MP_USED(a)); + + /* Get rid of whatever memory c was already using, and fix up its fields to + reflect the new digit array it's using + */ + if (out != MP_DIGITS(c)) { + if ((void *) MP_DIGITS(c) != (void *) c) + s_free(MP_DIGITS(c)); + MP_DIGITS(c) = out; + MP_ALLOC(c) = p; + } + + MP_USED(c) = osize; /* might not be true, but we'll fix it ... */ + CLAMP(c); /* ... right here */ + MP_SIGN(c) = MP_ZPOS; + + return MP_OK; +} + +mp_result mp_int_div(mp_int a, mp_int b, mp_int q, mp_int r) +{ + int cmp, lg; + mp_result res = MP_OK; + mp_int qout, rout; + mp_sign sa = MP_SIGN(a), sb = MP_SIGN(b); + DECLARE_TEMP(2); + + CHECK(a != NULL && b != NULL && q != r); + + if (CMPZ(b) == 0) + return MP_UNDEF; + else if ((cmp = s_ucmp(a, b)) < 0) { + /* If |a| < |b|, no division is required: + q = 0, r = a + */ + if (r && (res = mp_int_copy(a, r)) != MP_OK) + return res; + + if (q) + mp_int_zero(q); + + return MP_OK; + } + else if (cmp == 0) { + /* If |a| = |b|, no division is required: + q = 1 or -1, r = 0 + */ + if (r) + mp_int_zero(r); + + if (q) { + mp_int_zero(q); + q->digits[0] = 1; + + if (sa != sb) + MP_SIGN(q) = MP_NEG; + } + + return MP_OK; + } + + /* When |a| > |b|, real division is required. We need someplace to store + quotient and remainder, but q and r are allowed to be NULL or to overlap + with the inputs. + */ + if ((lg = s_isp2(b)) < 0) { + if (q && b != q) { + if ((res = mp_int_copy(a, q)) != MP_OK) + goto CLEANUP; + else + qout = q; + } + else { + qout = LAST_TEMP(); + SETUP(mp_int_init_copy(LAST_TEMP(), a)); + } + + if (r && a != r) { + if ((res = mp_int_copy(b, r)) != MP_OK) + goto CLEANUP; + else + rout = r; + } + else { + rout = LAST_TEMP(); + SETUP(mp_int_init_copy(LAST_TEMP(), b)); + } + + if ((res = s_udiv_knuth(qout, rout)) != MP_OK) goto CLEANUP; + } + else { + if (q && (res = mp_int_copy(a, q)) != MP_OK) goto CLEANUP; + if (r && (res = mp_int_copy(a, r)) != MP_OK) goto CLEANUP; + + if (q) s_qdiv(q, (mp_size) lg); qout = q; + if (r) s_qmod(r, (mp_size) lg); rout = r; + } + + /* Recompute signs for output */ + if (rout) { + MP_SIGN(rout) = sa; + if (CMPZ(rout) == 0) + MP_SIGN(rout) = MP_ZPOS; + } + if (qout) { + MP_SIGN(qout) = (sa == sb) ? MP_ZPOS : MP_NEG; + if (CMPZ(qout) == 0) + MP_SIGN(qout) = MP_ZPOS; + } + + if (q && (res = mp_int_copy(qout, q)) != MP_OK) goto CLEANUP; + if (r && (res = mp_int_copy(rout, r)) != MP_OK) goto CLEANUP; + + CLEANUP_TEMP(); + return res; +} + +mp_result mp_int_mod(mp_int a, mp_int m, mp_int c) +{ + mp_result res; + mpz_t tmp; + mp_int out; + + if (m == c) { + mp_int_init(&tmp); + out = &tmp; + } + else { + out = c; + } + + if ((res = mp_int_div(a, m, NULL, out)) != MP_OK) + goto CLEANUP; + + if (CMPZ(out) < 0) + res = mp_int_add(out, m, c); + else + res = mp_int_copy(out, c); + + CLEANUP: + if (out != c) + mp_int_clear(&tmp); + + return res; +} + +mp_result mp_int_div_value(mp_int a, mp_small value, mp_int q, mp_small *r) +{ + mpz_t vtmp, rtmp; + mp_digit vbuf[MP_VALUE_DIGITS(value)]; + mp_result res; + + mp_int_init(&rtmp); + s_fake(&vtmp, value, vbuf); + + if ((res = mp_int_div(a, &vtmp, q, &rtmp)) != MP_OK) + goto CLEANUP; + + if (r) + (void) mp_int_to_int(&rtmp, r); /* can't fail */ + + CLEANUP: + mp_int_clear(&rtmp); + return res; +} + +mp_result mp_int_div_pow2(mp_int a, mp_small p2, mp_int q, mp_int r) +{ + mp_result res = MP_OK; + + CHECK(a != NULL && p2 >= 0 && q != r); + + if (q != NULL && (res = mp_int_copy(a, q)) == MP_OK) + s_qdiv(q, (mp_size) p2); + + if (res == MP_OK && r != NULL && (res = mp_int_copy(a, r)) == MP_OK) + s_qmod(r, (mp_size) p2); + + return res; +} + +mp_result mp_int_expt(mp_int a, mp_small b, mp_int c) +{ + mpz_t t; + mp_result res; + unsigned int v = abs(b); + + CHECK(c != NULL); + if (b < 0) + return MP_RANGE; + + if ((res = mp_int_init_copy(&t, a)) != MP_OK) + return res; + + (void) mp_int_set_value(c, 1); + while (v != 0) { + if (v & 1) { + if ((res = mp_int_mul(c, &t, c)) != MP_OK) + goto CLEANUP; + } + + v >>= 1; + if (v == 0) break; + + if ((res = mp_int_sqr(&t, &t)) != MP_OK) + goto CLEANUP; + } + + CLEANUP: + mp_int_clear(&t); + return res; +} + +mp_result mp_int_expt_value(mp_small a, mp_small b, mp_int c) +{ + mpz_t t; + mp_result res; + unsigned int v = abs(b); + + CHECK(c != NULL); + if (b < 0) + return MP_RANGE; + + if ((res = mp_int_init_value(&t, a)) != MP_OK) + return res; + + (void) mp_int_set_value(c, 1); + while (v != 0) { + if (v & 1) { + if ((res = mp_int_mul(c, &t, c)) != MP_OK) + goto CLEANUP; + } + + v >>= 1; + if (v == 0) break; + + if ((res = mp_int_sqr(&t, &t)) != MP_OK) + goto CLEANUP; + } + + CLEANUP: + mp_int_clear(&t); + return res; +} + +mp_result mp_int_expt_full(mp_int a, mp_int b, mp_int c) +{ + mpz_t t; + mp_result res; + unsigned ix, jx; + + CHECK(a != NULL && b != NULL && c != NULL); + if (MP_SIGN(b) == MP_NEG) + return MP_RANGE; + + if ((res = mp_int_init_copy(&t, a)) != MP_OK) + return res; + + (void) mp_int_set_value(c, 1); + for (ix = 0; ix < MP_USED(b); ++ix) { + mp_digit d = b->digits[ix]; + + for (jx = 0; jx < MP_DIGIT_BIT; ++jx) { + if (d & 1) { + if ((res = mp_int_mul(c, &t, c)) != MP_OK) + goto CLEANUP; + } + + d >>= 1; + if (d == 0 && ix + 1 == MP_USED(b)) + break; + if ((res = mp_int_sqr(&t, &t)) != MP_OK) + goto CLEANUP; + } + } + + CLEANUP: + mp_int_clear(&t); + return res; +} + +int mp_int_compare(mp_int a, mp_int b) +{ + mp_sign sa; + + CHECK(a != NULL && b != NULL); + + sa = MP_SIGN(a); + if (sa == MP_SIGN(b)) { + int cmp = s_ucmp(a, b); + + /* If they're both zero or positive, the normal comparison applies; if both + negative, the sense is reversed. */ + if (sa == MP_ZPOS) + return cmp; + else + return -cmp; + + } + else { + if (sa == MP_ZPOS) + return 1; + else + return -1; + } +} + +int mp_int_compare_unsigned(mp_int a, mp_int b) +{ + NRCHECK(a != NULL && b != NULL); + + return s_ucmp(a, b); +} + +int mp_int_compare_zero(mp_int z) +{ + NRCHECK(z != NULL); + + if (MP_USED(z) == 1 && z->digits[0] == 0) + return 0; + else if (MP_SIGN(z) == MP_ZPOS) + return 1; + else + return -1; +} + +int mp_int_compare_value(mp_int z, mp_small value) +{ + mp_sign vsign = (value < 0) ? MP_NEG : MP_ZPOS; + int cmp; + + CHECK(z != NULL); + + if (vsign == MP_SIGN(z)) { + cmp = s_vcmp(z, value); + + return (vsign == MP_ZPOS) ? cmp : -cmp; + } + else { + return (value < 0) ? 1 : -1; + } +} + +int mp_int_compare_uvalue(mp_int z, mp_usmall uv) +{ + CHECK(z != NULL); + + if (MP_SIGN(z) == MP_NEG) + return -1; + else + return s_uvcmp(z, uv); +} + +mp_result mp_int_exptmod(mp_int a, mp_int b, mp_int m, mp_int c) +{ + mp_result res; + mp_size um; + mp_int s; + DECLARE_TEMP(3); + + CHECK(a != NULL && b != NULL && c != NULL && m != NULL); + + /* Zero moduli and negative exponents are not considered. */ + if (CMPZ(m) == 0) + return MP_UNDEF; + if (CMPZ(b) < 0) + return MP_RANGE; + + um = MP_USED(m); + SETUP(mp_int_init_size(TEMP(0), 2 * um)); + SETUP(mp_int_init_size(TEMP(1), 2 * um)); + + if (c == b || c == m) { + SETUP(mp_int_init_size(TEMP(2), 2 * um)); + s = TEMP(2); + } + else { + s = c; + } + + if ((res = mp_int_mod(a, m, TEMP(0))) != MP_OK) goto CLEANUP; + + if ((res = s_brmu(TEMP(1), m)) != MP_OK) goto CLEANUP; + + if ((res = s_embar(TEMP(0), b, m, TEMP(1), s)) != MP_OK) + goto CLEANUP; + + res = mp_int_copy(s, c); + + CLEANUP_TEMP(); + return res; +} + +mp_result mp_int_exptmod_evalue(mp_int a, mp_small value, mp_int m, mp_int c) +{ + mpz_t vtmp; + mp_digit vbuf[MP_VALUE_DIGITS(value)]; + + s_fake(&vtmp, value, vbuf); + + return mp_int_exptmod(a, &vtmp, m, c); +} + +mp_result mp_int_exptmod_bvalue(mp_small value, mp_int b, + mp_int m, mp_int c) +{ + mpz_t vtmp; + mp_digit vbuf[MP_VALUE_DIGITS(value)]; + + s_fake(&vtmp, value, vbuf); + + return mp_int_exptmod(&vtmp, b, m, c); +} + +mp_result mp_int_exptmod_known(mp_int a, mp_int b, mp_int m, mp_int mu, mp_int c) +{ + mp_result res; + mp_size um; + mp_int s; + DECLARE_TEMP(2); + + CHECK(a && b && m && c); + + /* Zero moduli and negative exponents are not considered. */ + if (CMPZ(m) == 0) + return MP_UNDEF; + if (CMPZ(b) < 0) + return MP_RANGE; + + um = MP_USED(m); + SETUP(mp_int_init_size(TEMP(0), 2 * um)); + + if (c == b || c == m) { + SETUP(mp_int_init_size(TEMP(1), 2 * um)); + s = TEMP(1); + } + else { + s = c; + } + + if ((res = mp_int_mod(a, m, TEMP(0))) != MP_OK) goto CLEANUP; + + if ((res = s_embar(TEMP(0), b, m, mu, s)) != MP_OK) + goto CLEANUP; + + res = mp_int_copy(s, c); + + CLEANUP_TEMP(); + return res; +} + +mp_result mp_int_redux_const(mp_int m, mp_int c) +{ + CHECK(m != NULL && c != NULL && m != c); + + return s_brmu(c, m); +} + +mp_result mp_int_invmod(mp_int a, mp_int m, mp_int c) +{ + mp_result res; + mp_sign sa; + DECLARE_TEMP(2); + + CHECK(a != NULL && m != NULL && c != NULL); + + if (CMPZ(a) == 0 || CMPZ(m) <= 0) + return MP_RANGE; + + sa = MP_SIGN(a); /* need this for the result later */ + + for (last__ = 0; last__ < 2; ++last__) + mp_int_init(LAST_TEMP()); + + if ((res = mp_int_egcd(a, m, TEMP(0), TEMP(1), NULL)) != MP_OK) + goto CLEANUP; + + if (mp_int_compare_value(TEMP(0), 1) != 0) { + res = MP_UNDEF; + goto CLEANUP; + } + + /* It is first necessary to constrain the value to the proper range */ + if ((res = mp_int_mod(TEMP(1), m, TEMP(1))) != MP_OK) + goto CLEANUP; + + /* Now, if 'a' was originally negative, the value we have is actually the + magnitude of the negative representative; to get the positive value we + have to subtract from the modulus. Otherwise, the value is okay as it + stands. + */ + if (sa == MP_NEG) + res = mp_int_sub(m, TEMP(1), c); + else + res = mp_int_copy(TEMP(1), c); + + CLEANUP_TEMP(); + return res; +} + +/* Binary GCD algorithm due to Josef Stein, 1961 */ +mp_result mp_int_gcd(mp_int a, mp_int b, mp_int c) +{ + int ca, cb, k = 0; + mpz_t u, v, t; + mp_result res; + + CHECK(a != NULL && b != NULL && c != NULL); + + ca = CMPZ(a); + cb = CMPZ(b); + if (ca == 0 && cb == 0) + return MP_UNDEF; + else if (ca == 0) + return mp_int_abs(b, c); + else if (cb == 0) + return mp_int_abs(a, c); + + mp_int_init(&t); + if ((res = mp_int_init_copy(&u, a)) != MP_OK) + goto U; + if ((res = mp_int_init_copy(&v, b)) != MP_OK) + goto V; + + MP_SIGN(&u) = MP_ZPOS; MP_SIGN(&v) = MP_ZPOS; + + { /* Divide out common factors of 2 from u and v */ + int div2_u = s_dp2k(&u), div2_v = s_dp2k(&v); + + k = MIN(div2_u, div2_v); + s_qdiv(&u, (mp_size) k); + s_qdiv(&v, (mp_size) k); + } + + if (mp_int_is_odd(&u)) { + if ((res = mp_int_neg(&v, &t)) != MP_OK) + goto CLEANUP; + } + else { + if ((res = mp_int_copy(&u, &t)) != MP_OK) + goto CLEANUP; + } + + for (;;) { + s_qdiv(&t, s_dp2k(&t)); + + if (CMPZ(&t) > 0) { + if ((res = mp_int_copy(&t, &u)) != MP_OK) + goto CLEANUP; + } + else { + if ((res = mp_int_neg(&t, &v)) != MP_OK) + goto CLEANUP; + } + + if ((res = mp_int_sub(&u, &v, &t)) != MP_OK) + goto CLEANUP; + + if (CMPZ(&t) == 0) + break; + } + + if ((res = mp_int_abs(&u, c)) != MP_OK) + goto CLEANUP; + if (!s_qmul(c, (mp_size) k)) + res = MP_MEMORY; + + CLEANUP: + mp_int_clear(&v); + V: mp_int_clear(&u); + U: mp_int_clear(&t); + + return res; +} + +/* This is the binary GCD algorithm again, but this time we keep track of the + elementary matrix operations as we go, so we can get values x and y + satisfying c = ax + by. + */ +mp_result mp_int_egcd(mp_int a, mp_int b, mp_int c, + mp_int x, mp_int y) +{ + int k, ca, cb; + mp_result res; + DECLARE_TEMP(8); + + CHECK(a != NULL && b != NULL && c != NULL && + (x != NULL || y != NULL)); + + ca = CMPZ(a); + cb = CMPZ(b); + if (ca == 0 && cb == 0) + return MP_UNDEF; + else if (ca == 0) { + if ((res = mp_int_abs(b, c)) != MP_OK) return res; + mp_int_zero(x); (void) mp_int_set_value(y, 1); return MP_OK; + } + else if (cb == 0) { + if ((res = mp_int_abs(a, c)) != MP_OK) return res; + (void) mp_int_set_value(x, 1); mp_int_zero(y); return MP_OK; + } + + /* Initialize temporaries: + A:0, B:1, C:2, D:3, u:4, v:5, ou:6, ov:7 */ + for (last__ = 0; last__ < 4; ++last__) + mp_int_init(LAST_TEMP()); + TEMP(0)->digits[0] = 1; + TEMP(3)->digits[0] = 1; + + SETUP(mp_int_init_copy(TEMP(4), a)); + SETUP(mp_int_init_copy(TEMP(5), b)); + + /* We will work with absolute values here */ + MP_SIGN(TEMP(4)) = MP_ZPOS; + MP_SIGN(TEMP(5)) = MP_ZPOS; + + { /* Divide out common factors of 2 from u and v */ + int div2_u = s_dp2k(TEMP(4)), div2_v = s_dp2k(TEMP(5)); + + k = MIN(div2_u, div2_v); + s_qdiv(TEMP(4), k); + s_qdiv(TEMP(5), k); + } + + SETUP(mp_int_init_copy(TEMP(6), TEMP(4))); + SETUP(mp_int_init_copy(TEMP(7), TEMP(5))); + + for (;;) { + while (mp_int_is_even(TEMP(4))) { + s_qdiv(TEMP(4), 1); + + if (mp_int_is_odd(TEMP(0)) || mp_int_is_odd(TEMP(1))) { + if ((res = mp_int_add(TEMP(0), TEMP(7), TEMP(0))) != MP_OK) + goto CLEANUP; + if ((res = mp_int_sub(TEMP(1), TEMP(6), TEMP(1))) != MP_OK) + goto CLEANUP; + } + + s_qdiv(TEMP(0), 1); + s_qdiv(TEMP(1), 1); + } + + while (mp_int_is_even(TEMP(5))) { + s_qdiv(TEMP(5), 1); + + if (mp_int_is_odd(TEMP(2)) || mp_int_is_odd(TEMP(3))) { + if ((res = mp_int_add(TEMP(2), TEMP(7), TEMP(2))) != MP_OK) + goto CLEANUP; + if ((res = mp_int_sub(TEMP(3), TEMP(6), TEMP(3))) != MP_OK) + goto CLEANUP; + } + + s_qdiv(TEMP(2), 1); + s_qdiv(TEMP(3), 1); + } + + if (mp_int_compare(TEMP(4), TEMP(5)) >= 0) { + if ((res = mp_int_sub(TEMP(4), TEMP(5), TEMP(4))) != MP_OK) goto CLEANUP; + if ((res = mp_int_sub(TEMP(0), TEMP(2), TEMP(0))) != MP_OK) goto CLEANUP; + if ((res = mp_int_sub(TEMP(1), TEMP(3), TEMP(1))) != MP_OK) goto CLEANUP; + } + else { + if ((res = mp_int_sub(TEMP(5), TEMP(4), TEMP(5))) != MP_OK) goto CLEANUP; + if ((res = mp_int_sub(TEMP(2), TEMP(0), TEMP(2))) != MP_OK) goto CLEANUP; + if ((res = mp_int_sub(TEMP(3), TEMP(1), TEMP(3))) != MP_OK) goto CLEANUP; + } + + if (CMPZ(TEMP(4)) == 0) { + if (x && (res = mp_int_copy(TEMP(2), x)) != MP_OK) goto CLEANUP; + if (y && (res = mp_int_copy(TEMP(3), y)) != MP_OK) goto CLEANUP; + if (c) { + if (!s_qmul(TEMP(5), k)) { + res = MP_MEMORY; + goto CLEANUP; + } + + res = mp_int_copy(TEMP(5), c); + } + + break; + } + } + + CLEANUP_TEMP(); + return res; +} + +mp_result mp_int_lcm(mp_int a, mp_int b, mp_int c) +{ + mpz_t lcm; + mp_result res; + + CHECK(a != NULL && b != NULL && c != NULL); + + /* Since a * b = gcd(a, b) * lcm(a, b), we can compute + lcm(a, b) = (a / gcd(a, b)) * b. + + This formulation insures everything works even if the input + variables share space. + */ + if ((res = mp_int_init(&lcm)) != MP_OK) + return res; + if ((res = mp_int_gcd(a, b, &lcm)) != MP_OK) + goto CLEANUP; + if ((res = mp_int_div(a, &lcm, &lcm, NULL)) != MP_OK) + goto CLEANUP; + if ((res = mp_int_mul(&lcm, b, &lcm)) != MP_OK) + goto CLEANUP; + + res = mp_int_copy(&lcm, c); + + CLEANUP: + mp_int_clear(&lcm); + + return res; +} + +int mp_int_divisible_value(mp_int a, mp_small v) +{ + mp_small rem = 0; + + if (mp_int_div_value(a, v, NULL, &rem) != MP_OK) + return 0; + + return rem == 0; +} + +int mp_int_is_pow2(mp_int z) +{ + CHECK(z != NULL); + + return s_isp2(z); +} + +/* Implementation of Newton's root finding method, based loosely on a patch + contributed by Hal Finkel + modified by M. J. Fromberger. + */ +mp_result mp_int_root(mp_int a, mp_small b, mp_int c) +{ + mp_result res = MP_OK; + int flips = 0; + DECLARE_TEMP(5); + + CHECK(a != NULL && c != NULL && b > 0); + + if (b == 1) { + return mp_int_copy(a, c); + } + if (MP_SIGN(a) == MP_NEG) { + if (b % 2 == 0) + return MP_UNDEF; /* root does not exist for negative a with even b */ + else + flips = 1; + } + + SETUP(mp_int_init_copy(LAST_TEMP(), a)); + SETUP(mp_int_init_copy(LAST_TEMP(), a)); + SETUP(mp_int_init(LAST_TEMP())); + SETUP(mp_int_init(LAST_TEMP())); + SETUP(mp_int_init(LAST_TEMP())); + + (void) mp_int_abs(TEMP(0), TEMP(0)); + (void) mp_int_abs(TEMP(1), TEMP(1)); + + for (;;) { + if ((res = mp_int_expt(TEMP(1), b, TEMP(2))) != MP_OK) + goto CLEANUP; + + if (mp_int_compare_unsigned(TEMP(2), TEMP(0)) <= 0) + break; + + if ((res = mp_int_sub(TEMP(2), TEMP(0), TEMP(2))) != MP_OK) + goto CLEANUP; + if ((res = mp_int_expt(TEMP(1), b - 1, TEMP(3))) != MP_OK) + goto CLEANUP; + if ((res = mp_int_mul_value(TEMP(3), b, TEMP(3))) != MP_OK) + goto CLEANUP; + if ((res = mp_int_div(TEMP(2), TEMP(3), TEMP(4), NULL)) != MP_OK) + goto CLEANUP; + if ((res = mp_int_sub(TEMP(1), TEMP(4), TEMP(4))) != MP_OK) + goto CLEANUP; + + if (mp_int_compare_unsigned(TEMP(1), TEMP(4)) == 0) { + if ((res = mp_int_sub_value(TEMP(4), 1, TEMP(4))) != MP_OK) + goto CLEANUP; + } + if ((res = mp_int_copy(TEMP(4), TEMP(1))) != MP_OK) + goto CLEANUP; + } + + if ((res = mp_int_copy(TEMP(1), c)) != MP_OK) + goto CLEANUP; + + /* If the original value of a was negative, flip the output sign. */ + if (flips) + (void) mp_int_neg(c, c); /* cannot fail */ + + CLEANUP_TEMP(); + return res; +} + +mp_result mp_int_to_int(mp_int z, mp_small *out) +{ + mp_usmall uv = 0; + mp_size uz; + mp_digit *dz; + mp_sign sz; + + CHECK(z != NULL); + + /* Make sure the value is representable as a small integer */ + sz = MP_SIGN(z); + if ((sz == MP_ZPOS && mp_int_compare_value(z, MP_SMALL_MAX) > 0) || + mp_int_compare_value(z, MP_SMALL_MIN) < 0) + return MP_RANGE; + + uz = MP_USED(z); + dz = MP_DIGITS(z) + uz - 1; + + while (uz > 0) { + uv <<= MP_DIGIT_BIT/2; + uv = (uv << (MP_DIGIT_BIT/2)) | *dz--; + --uz; + } + + if (out) + *out = (sz == MP_NEG) ? -(mp_small)uv : (mp_small)uv; + + return MP_OK; +} + +mp_result mp_int_to_uint(mp_int z, mp_usmall *out) +{ + mp_usmall uv = 0; + mp_size uz; + mp_digit *dz; + mp_sign sz; + + CHECK(z != NULL); + + /* Make sure the value is representable as an unsigned small integer */ + sz = MP_SIGN(z); + if (sz == MP_NEG || mp_int_compare_uvalue(z, MP_USMALL_MAX) > 0) + return MP_RANGE; + + uz = MP_USED(z); + dz = MP_DIGITS(z) + uz - 1; + + while (uz > 0) { + uv <<= MP_DIGIT_BIT/2; + uv = (uv << (MP_DIGIT_BIT/2)) | *dz--; + --uz; + } + + if (out) + *out = uv; + + return MP_OK; +} + +mp_result mp_int_to_string(mp_int z, mp_size radix, + char *str, int limit) +{ + mp_result res; + int cmp = 0; + + CHECK(z != NULL && str != NULL && limit >= 2); + + if (radix < MP_MIN_RADIX || radix > MP_MAX_RADIX) + return MP_RANGE; + + if (CMPZ(z) == 0) { + *str++ = s_val2ch(0, 1); + } + else { + mpz_t tmp; + char *h, *t; + + if ((res = mp_int_init_copy(&tmp, z)) != MP_OK) + return res; + + if (MP_SIGN(z) == MP_NEG) { + *str++ = '-'; + --limit; + } + h = str; + + /* Generate digits in reverse order until finished or limit reached */ + for (/* */; limit > 0; --limit) { + mp_digit d; + + if ((cmp = CMPZ(&tmp)) == 0) + break; + + d = s_ddiv(&tmp, (mp_digit)radix); + *str++ = s_val2ch(d, 1); + } + t = str - 1; + + /* Put digits back in correct output order */ + while (h < t) { + char tc = *h; + *h++ = *t; + *t-- = tc; + } + + mp_int_clear(&tmp); + } + + *str = '\0'; + if (cmp == 0) + return MP_OK; + else + return MP_TRUNC; +} + +mp_result mp_int_string_len(mp_int z, mp_size radix) +{ + int len; + + CHECK(z != NULL); + + if (radix < MP_MIN_RADIX || radix > MP_MAX_RADIX) + return MP_RANGE; + + len = s_outlen(z, radix) + 1; /* for terminator */ + + /* Allow for sign marker on negatives */ + if (MP_SIGN(z) == MP_NEG) + len += 1; + + return len; +} + +/* Read zero-terminated string into z */ +mp_result mp_int_read_string(mp_int z, mp_size radix, const char *str) +{ + return mp_int_read_cstring(z, radix, str, NULL); +} + +mp_result mp_int_read_cstring(mp_int z, mp_size radix, const char *str, char **end) +{ + int ch; + + CHECK(z != NULL && str != NULL); + + if (radix < MP_MIN_RADIX || radix > MP_MAX_RADIX) + return MP_RANGE; + + /* Skip leading whitespace */ + while (isspace((int)*str)) + ++str; + + /* Handle leading sign tag (+/-, positive default) */ + switch (*str) { + case '-': + MP_SIGN(z) = MP_NEG; + ++str; + break; + case '+': + ++str; /* fallthrough */ + default: + MP_SIGN(z) = MP_ZPOS; + break; + } + + /* Skip leading zeroes */ + while ((ch = s_ch2val(*str, radix)) == 0) + ++str; + + /* Make sure there is enough space for the value */ + if (!s_pad(z, s_inlen(strlen(str), radix))) + return MP_MEMORY; + + MP_USED(z) = 1; z->digits[0] = 0; + + while (*str != '\0' && ((ch = s_ch2val(*str, radix)) >= 0)) { + s_dmul(z, (mp_digit)radix); + s_dadd(z, (mp_digit)ch); + ++str; + } + + CLAMP(z); + + /* Override sign for zero, even if negative specified. */ + if (CMPZ(z) == 0) + MP_SIGN(z) = MP_ZPOS; + + if (end != NULL) + *end = (char *)str; + + /* Return a truncation error if the string has unprocessed characters + remaining, so the caller can tell if the whole string was done */ + if (*str != '\0') + return MP_TRUNC; + else + return MP_OK; +} + +mp_result mp_int_count_bits(mp_int z) +{ + mp_size nbits = 0, uz; + mp_digit d; + + CHECK(z != NULL); + + uz = MP_USED(z); + if (uz == 1 && z->digits[0] == 0) + return 1; + + --uz; + nbits = uz * MP_DIGIT_BIT; + d = z->digits[uz]; + + while (d != 0) { + d >>= 1; + ++nbits; + } + + return nbits; +} + +mp_result mp_int_to_binary(mp_int z, unsigned char *buf, int limit) +{ + static const int PAD_FOR_2C = 1; + + mp_result res; + int limpos = limit; + + CHECK(z != NULL && buf != NULL); + + res = s_tobin(z, buf, &limpos, PAD_FOR_2C); + + if (MP_SIGN(z) == MP_NEG) + s_2comp(buf, limpos); + + return res; +} + +mp_result mp_int_read_binary(mp_int z, unsigned char *buf, int len) +{ + mp_size need, i; + unsigned char *tmp; + mp_digit *dz; + + CHECK(z != NULL && buf != NULL && len > 0); + + /* Figure out how many digits are needed to represent this value */ + need = ((len * CHAR_BIT) + (MP_DIGIT_BIT - 1)) / MP_DIGIT_BIT; + if (!s_pad(z, need)) + return MP_MEMORY; + + mp_int_zero(z); + + /* If the high-order bit is set, take the 2's complement before reading the + value (it will be restored afterward) */ + if (buf[0] >> (CHAR_BIT - 1)) { + MP_SIGN(z) = MP_NEG; + s_2comp(buf, len); + } + + dz = MP_DIGITS(z); + for (tmp = buf, i = len; i > 0; --i, ++tmp) { + s_qmul(z, (mp_size) CHAR_BIT); + *dz |= *tmp; + } + + /* Restore 2's complement if we took it before */ + if (MP_SIGN(z) == MP_NEG) + s_2comp(buf, len); + + return MP_OK; +} + +mp_result mp_int_binary_len(mp_int z) +{ + mp_result res = mp_int_count_bits(z); + int bytes = mp_int_unsigned_len(z); + + if (res <= 0) + return res; + + bytes = (res + (CHAR_BIT - 1)) / CHAR_BIT; + + /* If the highest-order bit falls exactly on a byte boundary, we need to pad + with an extra byte so that the sign will be read correctly when reading it + back in. */ + if (bytes * CHAR_BIT == res) + ++bytes; + + return bytes; +} + +mp_result mp_int_to_unsigned(mp_int z, unsigned char *buf, int limit) +{ + static const int NO_PADDING = 0; + + CHECK(z != NULL && buf != NULL); + + return s_tobin(z, buf, &limit, NO_PADDING); +} + +mp_result mp_int_read_unsigned(mp_int z, unsigned char *buf, int len) +{ + mp_size need, i; + unsigned char *tmp; + + CHECK(z != NULL && buf != NULL && len > 0); + + /* Figure out how many digits are needed to represent this value */ + need = ((len * CHAR_BIT) + (MP_DIGIT_BIT - 1)) / MP_DIGIT_BIT; + if (!s_pad(z, need)) + return MP_MEMORY; + + mp_int_zero(z); + + for (tmp = buf, i = len; i > 0; --i, ++tmp) { + (void) s_qmul(z, CHAR_BIT); + *MP_DIGITS(z) |= *tmp; + } + + return MP_OK; +} + +mp_result mp_int_unsigned_len(mp_int z) +{ + mp_result res = mp_int_count_bits(z); + int bytes; + + if (res <= 0) + return res; + + bytes = (res + (CHAR_BIT - 1)) / CHAR_BIT; + + return bytes; +} + +const char *mp_error_string(mp_result res) +{ + int ix; + if (res > 0) + return s_unknown_err; + + res = -res; + for (ix = 0; ix < res && s_error_msg[ix] != NULL; ++ix) + ; + + if (s_error_msg[ix] != NULL) + return s_error_msg[ix]; + else + return s_unknown_err; +} + +/*------------------------------------------------------------------------*/ +/* Private functions for internal use. These make assumptions. */ + +STATIC mp_digit *s_alloc(mp_size num) +{ + mp_digit *out = malloc(num * sizeof(mp_digit)); + + assert(out != NULL); /* for debugging */ +#if DEBUG > 1 + { + mp_digit v = (mp_digit) 0xdeadbeef; + int ix; + + for (ix = 0; ix < num; ++ix) + out[ix] = v; + } +#endif + + return out; +} + +STATIC mp_digit *s_realloc(mp_digit *old, mp_size osize, mp_size nsize) +{ +#if DEBUG > 1 + mp_digit *new = s_alloc(nsize); + int ix; + + for (ix = 0; ix < nsize; ++ix) + new[ix] = (mp_digit) 0xdeadbeef; + + memcpy(new, old, osize * sizeof(mp_digit)); +#else + mp_digit *new = realloc(old, nsize * sizeof(mp_digit)); + + assert(new != NULL); /* for debugging */ +#endif + return new; +} + +STATIC void s_free(void *ptr) +{ + free(ptr); +} + +STATIC int s_pad(mp_int z, mp_size min) +{ + if (MP_ALLOC(z) < min) { + mp_size nsize = ROUND_PREC(min); + mp_digit *tmp; + + if ((void *)z->digits == (void *)z) { + if ((tmp = s_alloc(nsize)) == NULL) + return 0; + + COPY(MP_DIGITS(z), tmp, MP_USED(z)); + } + else if ((tmp = s_realloc(MP_DIGITS(z), MP_ALLOC(z), nsize)) == NULL) + return 0; + + MP_DIGITS(z) = tmp; + MP_ALLOC(z) = nsize; + } + + return 1; +} + +/* Note: This will not work correctly when value == MP_SMALL_MIN */ +STATIC void s_fake(mp_int z, mp_small value, mp_digit vbuf[]) +{ + mp_usmall uv = (mp_usmall) (value < 0) ? -value : value; + s_ufake(z, uv, vbuf); + if (value < 0) + z->sign = MP_NEG; +} + +STATIC void s_ufake(mp_int z, mp_usmall value, mp_digit vbuf[]) +{ + mp_size ndig = (mp_size) s_uvpack(value, vbuf); + + z->used = ndig; + z->alloc = MP_VALUE_DIGITS(value); + z->sign = MP_ZPOS; + z->digits = vbuf; +} + +STATIC int s_cdig(mp_digit *da, mp_digit *db, mp_size len) +{ + mp_digit *dat = da + len - 1, *dbt = db + len - 1; + + for (/* */; len != 0; --len, --dat, --dbt) { + if (*dat > *dbt) + return 1; + else if (*dat < *dbt) + return -1; + } + + return 0; +} + +STATIC int s_uvpack(mp_usmall uv, mp_digit t[]) +{ + int ndig = 0; + + if (uv == 0) + t[ndig++] = 0; + else { + while (uv != 0) { + t[ndig++] = (mp_digit) uv; + uv >>= MP_DIGIT_BIT/2; + uv >>= MP_DIGIT_BIT/2; + } + } + + return ndig; +} + +STATIC int s_ucmp(mp_int a, mp_int b) +{ + mp_size ua = MP_USED(a), ub = MP_USED(b); + + if (ua > ub) + return 1; + else if (ub > ua) + return -1; + else + return s_cdig(MP_DIGITS(a), MP_DIGITS(b), ua); +} + +STATIC int s_vcmp(mp_int a, mp_small v) +{ + mp_usmall uv = (mp_usmall) (v < 0) ? -v : v; + return s_uvcmp(a, uv); +} + +STATIC int s_uvcmp(mp_int a, mp_usmall uv) +{ + mpz_t vtmp; + mp_digit vdig[MP_VALUE_DIGITS(uv)]; + + s_ufake(&vtmp, uv, vdig); + return s_ucmp(a, &vtmp); +} + +STATIC mp_digit s_uadd(mp_digit *da, mp_digit *db, mp_digit *dc, + mp_size size_a, mp_size size_b) +{ + mp_size pos; + mp_word w = 0; + + /* Insure that da is the longer of the two to simplify later code */ + if (size_b > size_a) { + SWAP(mp_digit *, da, db); + SWAP(mp_size, size_a, size_b); + } + + /* Add corresponding digits until the shorter number runs out */ + for (pos = 0; pos < size_b; ++pos, ++da, ++db, ++dc) { + w = w + (mp_word) *da + (mp_word) *db; + *dc = LOWER_HALF(w); + w = UPPER_HALF(w); + } + + /* Propagate carries as far as necessary */ + for (/* */; pos < size_a; ++pos, ++da, ++dc) { + w = w + *da; + + *dc = LOWER_HALF(w); + w = UPPER_HALF(w); + } + + /* Return carry out */ + return (mp_digit)w; +} + +STATIC void s_usub(mp_digit *da, mp_digit *db, mp_digit *dc, + mp_size size_a, mp_size size_b) +{ + mp_size pos; + mp_word w = 0; + + /* We assume that |a| >= |b| so this should definitely hold */ + assert(size_a >= size_b); + + /* Subtract corresponding digits and propagate borrow */ + for (pos = 0; pos < size_b; ++pos, ++da, ++db, ++dc) { + w = ((mp_word)MP_DIGIT_MAX + 1 + /* MP_RADIX */ + (mp_word)*da) - w - (mp_word)*db; + + *dc = LOWER_HALF(w); + w = (UPPER_HALF(w) == 0); + } + + /* Finish the subtraction for remaining upper digits of da */ + for (/* */; pos < size_a; ++pos, ++da, ++dc) { + w = ((mp_word)MP_DIGIT_MAX + 1 + /* MP_RADIX */ + (mp_word)*da) - w; + + *dc = LOWER_HALF(w); + w = (UPPER_HALF(w) == 0); + } + + /* If there is a borrow out at the end, it violates the precondition */ + assert(w == 0); +} + +STATIC int s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc, + mp_size size_a, mp_size size_b) +{ + mp_size bot_size; + + /* Make sure b is the smaller of the two input values */ + if (size_b > size_a) { + SWAP(mp_digit *, da, db); + SWAP(mp_size, size_a, size_b); + } + + /* Insure that the bottom is the larger half in an odd-length split; the code + below relies on this being true. + */ + bot_size = (size_a + 1) / 2; + + /* If the values are big enough to bother with recursion, use the Karatsuba + algorithm to compute the product; otherwise use the normal multiplication + algorithm + */ + if (multiply_threshold && + size_a >= multiply_threshold && + size_b > bot_size) { + + mp_digit *t1, *t2, *t3, carry; + + mp_digit *a_top = da + bot_size; + mp_digit *b_top = db + bot_size; + + mp_size at_size = size_a - bot_size; + mp_size bt_size = size_b - bot_size; + mp_size buf_size = 2 * bot_size; + + /* Do a single allocation for all three temporary buffers needed; each + buffer must be big enough to hold the product of two bottom halves, and + one buffer needs space for the completed product; twice the space is + plenty. + */ + if ((t1 = s_alloc(4 * buf_size)) == NULL) return 0; + t2 = t1 + buf_size; + t3 = t2 + buf_size; + ZERO(t1, 4 * buf_size); + + /* t1 and t2 are initially used as temporaries to compute the inner product + (a1 + a0)(b1 + b0) = a1b1 + a1b0 + a0b1 + a0b0 + */ + carry = s_uadd(da, a_top, t1, bot_size, at_size); /* t1 = a1 + a0 */ + t1[bot_size] = carry; + + carry = s_uadd(db, b_top, t2, bot_size, bt_size); /* t2 = b1 + b0 */ + t2[bot_size] = carry; + + (void) s_kmul(t1, t2, t3, bot_size + 1, bot_size + 1); /* t3 = t1 * t2 */ + + /* Now we'll get t1 = a0b0 and t2 = a1b1, and subtract them out so that + we're left with only the pieces we want: t3 = a1b0 + a0b1 + */ + ZERO(t1, buf_size); + ZERO(t2, buf_size); + (void) s_kmul(da, db, t1, bot_size, bot_size); /* t1 = a0 * b0 */ + (void) s_kmul(a_top, b_top, t2, at_size, bt_size); /* t2 = a1 * b1 */ + + /* Subtract out t1 and t2 to get the inner product */ + s_usub(t3, t1, t3, buf_size + 2, buf_size); + s_usub(t3, t2, t3, buf_size + 2, buf_size); + + /* Assemble the output value */ + COPY(t1, dc, buf_size); + carry = s_uadd(t3, dc + bot_size, dc + bot_size, + buf_size + 1, buf_size); + assert(carry == 0); + + carry = s_uadd(t2, dc + 2*bot_size, dc + 2*bot_size, + buf_size, buf_size); + assert(carry == 0); + + s_free(t1); /* note t2 and t3 are just internal pointers to t1 */ + } + else { + s_umul(da, db, dc, size_a, size_b); + } + + return 1; +} + +STATIC void s_umul(mp_digit *da, mp_digit *db, mp_digit *dc, + mp_size size_a, mp_size size_b) +{ + mp_size a, b; + mp_word w; + + for (a = 0; a < size_a; ++a, ++dc, ++da) { + mp_digit *dct = dc; + mp_digit *dbt = db; + + if (*da == 0) + continue; + + w = 0; + for (b = 0; b < size_b; ++b, ++dbt, ++dct) { + w = (mp_word)*da * (mp_word)*dbt + w + (mp_word)*dct; + + *dct = LOWER_HALF(w); + w = UPPER_HALF(w); + } + + *dct = (mp_digit)w; + } +} + +STATIC int s_ksqr(mp_digit *da, mp_digit *dc, mp_size size_a) +{ + if (multiply_threshold && size_a > multiply_threshold) { + mp_size bot_size = (size_a + 1) / 2; + mp_digit *a_top = da + bot_size; + mp_digit *t1, *t2, *t3, carry; + mp_size at_size = size_a - bot_size; + mp_size buf_size = 2 * bot_size; + + if ((t1 = s_alloc(4 * buf_size)) == NULL) return 0; + t2 = t1 + buf_size; + t3 = t2 + buf_size; + ZERO(t1, 4 * buf_size); + + (void) s_ksqr(da, t1, bot_size); /* t1 = a0 ^ 2 */ + (void) s_ksqr(a_top, t2, at_size); /* t2 = a1 ^ 2 */ + + (void) s_kmul(da, a_top, t3, bot_size, at_size); /* t3 = a0 * a1 */ + + /* Quick multiply t3 by 2, shifting left (can't overflow) */ + { + int i, top = bot_size + at_size; + mp_word w, save = 0; + + for (i = 0; i < top; ++i) { + w = t3[i]; + w = (w << 1) | save; + t3[i] = LOWER_HALF(w); + save = UPPER_HALF(w); + } + t3[i] = LOWER_HALF(save); + } + + /* Assemble the output value */ + COPY(t1, dc, 2 * bot_size); + carry = s_uadd(t3, dc + bot_size, dc + bot_size, + buf_size + 1, buf_size); + assert(carry == 0); + + carry = s_uadd(t2, dc + 2*bot_size, dc + 2*bot_size, + buf_size, buf_size); + assert(carry == 0); + + s_free(t1); /* note that t2 and t2 are internal pointers only */ + + } + else { + s_usqr(da, dc, size_a); + } + + return 1; +} + +STATIC void s_usqr(mp_digit *da, mp_digit *dc, mp_size size_a) +{ + mp_size i, j; + mp_word w; + + for (i = 0; i < size_a; ++i, dc += 2, ++da) { + mp_digit *dct = dc, *dat = da; + + if (*da == 0) + continue; + + /* Take care of the first digit, no rollover */ + w = (mp_word)*dat * (mp_word)*dat + (mp_word)*dct; + *dct = LOWER_HALF(w); + w = UPPER_HALF(w); + ++dat; ++dct; + + for (j = i + 1; j < size_a; ++j, ++dat, ++dct) { + mp_word t = (mp_word)*da * (mp_word)*dat; + mp_word u = w + (mp_word)*dct, ov = 0; + + /* Check if doubling t will overflow a word */ + if (HIGH_BIT_SET(t)) + ov = 1; + + w = t + t; + + /* Check if adding u to w will overflow a word */ + if (ADD_WILL_OVERFLOW(w, u)) + ov = 1; + + w += u; + + *dct = LOWER_HALF(w); + w = UPPER_HALF(w); + if (ov) { + w += MP_DIGIT_MAX; /* MP_RADIX */ + ++w; + } + } + + w = w + *dct; + *dct = (mp_digit)w; + while ((w = UPPER_HALF(w)) != 0) { + ++dct; w = w + *dct; + *dct = LOWER_HALF(w); + } + + assert(w == 0); + } +} + +STATIC void s_dadd(mp_int a, mp_digit b) +{ + mp_word w = 0; + mp_digit *da = MP_DIGITS(a); + mp_size ua = MP_USED(a); + + w = (mp_word)*da + b; + *da++ = LOWER_HALF(w); + w = UPPER_HALF(w); + + for (ua -= 1; ua > 0; --ua, ++da) { + w = (mp_word)*da + w; + + *da = LOWER_HALF(w); + w = UPPER_HALF(w); + } + + if (w) { + *da = (mp_digit)w; + MP_USED(a) += 1; + } +} + +STATIC void s_dmul(mp_int a, mp_digit b) +{ + mp_word w = 0; + mp_digit *da = MP_DIGITS(a); + mp_size ua = MP_USED(a); + + while (ua > 0) { + w = (mp_word)*da * b + w; + *da++ = LOWER_HALF(w); + w = UPPER_HALF(w); + --ua; + } + + if (w) { + *da = (mp_digit)w; + MP_USED(a) += 1; + } +} + +STATIC void s_dbmul(mp_digit *da, mp_digit b, mp_digit *dc, mp_size size_a) +{ + mp_word w = 0; + + while (size_a > 0) { + w = (mp_word)*da++ * (mp_word)b + w; + + *dc++ = LOWER_HALF(w); + w = UPPER_HALF(w); + --size_a; + } + + if (w) + *dc = LOWER_HALF(w); +} + +STATIC mp_digit s_ddiv(mp_int a, mp_digit b) +{ + mp_word w = 0, qdigit; + mp_size ua = MP_USED(a); + mp_digit *da = MP_DIGITS(a) + ua - 1; + + for (/* */; ua > 0; --ua, --da) { + w = (w << MP_DIGIT_BIT) | *da; + + if (w >= b) { + qdigit = w / b; + w = w % b; + } + else { + qdigit = 0; + } + + *da = (mp_digit)qdigit; + } + + CLAMP(a); + return (mp_digit)w; +} + +STATIC void s_qdiv(mp_int z, mp_size p2) +{ + mp_size ndig = p2 / MP_DIGIT_BIT, nbits = p2 % MP_DIGIT_BIT; + mp_size uz = MP_USED(z); + + if (ndig) { + mp_size mark; + mp_digit *to, *from; + + if (ndig >= uz) { + mp_int_zero(z); + return; + } + + to = MP_DIGITS(z); from = to + ndig; + + for (mark = ndig; mark < uz; ++mark) + *to++ = *from++; + + MP_USED(z) = uz - ndig; + } + + if (nbits) { + mp_digit d = 0, *dz, save; + mp_size up = MP_DIGIT_BIT - nbits; + + uz = MP_USED(z); + dz = MP_DIGITS(z) + uz - 1; + + for (/* */; uz > 0; --uz, --dz) { + save = *dz; + + *dz = (*dz >> nbits) | (d << up); + d = save; + } + + CLAMP(z); + } + + if (MP_USED(z) == 1 && z->digits[0] == 0) + MP_SIGN(z) = MP_ZPOS; +} + +STATIC void s_qmod(mp_int z, mp_size p2) +{ + mp_size start = p2 / MP_DIGIT_BIT + 1, rest = p2 % MP_DIGIT_BIT; + mp_size uz = MP_USED(z); + mp_digit mask = (1 << rest) - 1; + + if (start <= uz) { + MP_USED(z) = start; + z->digits[start - 1] &= mask; + CLAMP(z); + } +} + +STATIC int s_qmul(mp_int z, mp_size p2) +{ + mp_size uz, need, rest, extra, i; + mp_digit *from, *to, d; + + if (p2 == 0) + return 1; + + uz = MP_USED(z); + need = p2 / MP_DIGIT_BIT; rest = p2 % MP_DIGIT_BIT; + + /* Figure out if we need an extra digit at the top end; this occurs if the + topmost `rest' bits of the high-order digit of z are not zero, meaning + they will be shifted off the end if not preserved */ + extra = 0; + if (rest != 0) { + mp_digit *dz = MP_DIGITS(z) + uz - 1; + + if ((*dz >> (MP_DIGIT_BIT - rest)) != 0) + extra = 1; + } + + if (!s_pad(z, uz + need + extra)) + return 0; + + /* If we need to shift by whole digits, do that in one pass, then + to back and shift by partial digits. + */ + if (need > 0) { + from = MP_DIGITS(z) + uz - 1; + to = from + need; + + for (i = 0; i < uz; ++i) + *to-- = *from--; + + ZERO(MP_DIGITS(z), need); + uz += need; + } + + if (rest) { + d = 0; + for (i = need, from = MP_DIGITS(z) + need; i < uz; ++i, ++from) { + mp_digit save = *from; + + *from = (*from << rest) | (d >> (MP_DIGIT_BIT - rest)); + d = save; + } + + d >>= (MP_DIGIT_BIT - rest); + if (d != 0) { + *from = d; + uz += extra; + } + } + + MP_USED(z) = uz; + CLAMP(z); + + return 1; +} + +/* Compute z = 2^p2 - |z|; requires that 2^p2 >= |z| + The sign of the result is always zero/positive. + */ +STATIC int s_qsub(mp_int z, mp_size p2) +{ + mp_digit hi = (1 << (p2 % MP_DIGIT_BIT)), *zp; + mp_size tdig = (p2 / MP_DIGIT_BIT), pos; + mp_word w = 0; + + if (!s_pad(z, tdig + 1)) + return 0; + + for (pos = 0, zp = MP_DIGITS(z); pos < tdig; ++pos, ++zp) { + w = ((mp_word) MP_DIGIT_MAX + 1) - w - (mp_word)*zp; + + *zp = LOWER_HALF(w); + w = UPPER_HALF(w) ? 0 : 1; + } + + w = ((mp_word) MP_DIGIT_MAX + 1 + hi) - w - (mp_word)*zp; + *zp = LOWER_HALF(w); + + assert(UPPER_HALF(w) != 0); /* no borrow out should be possible */ + + MP_SIGN(z) = MP_ZPOS; + CLAMP(z); + + return 1; +} + +STATIC int s_dp2k(mp_int z) +{ + int k = 0; + mp_digit *dp = MP_DIGITS(z), d; + + if (MP_USED(z) == 1 && *dp == 0) + return 1; + + while (*dp == 0) { + k += MP_DIGIT_BIT; + ++dp; + } + + d = *dp; + while ((d & 1) == 0) { + d >>= 1; + ++k; + } + + return k; +} + +STATIC int s_isp2(mp_int z) +{ + mp_size uz = MP_USED(z), k = 0; + mp_digit *dz = MP_DIGITS(z), d; + + while (uz > 1) { + if (*dz++ != 0) + return -1; + k += MP_DIGIT_BIT; + --uz; + } + + d = *dz; + while (d > 1) { + if (d & 1) + return -1; + ++k; d >>= 1; + } + + return (int) k; +} + +STATIC int s_2expt(mp_int z, mp_small k) +{ + mp_size ndig, rest; + mp_digit *dz; + + ndig = (k + MP_DIGIT_BIT) / MP_DIGIT_BIT; + rest = k % MP_DIGIT_BIT; + + if (!s_pad(z, ndig)) + return 0; + + dz = MP_DIGITS(z); + ZERO(dz, ndig); + *(dz + ndig - 1) = (1 << rest); + MP_USED(z) = ndig; + + return 1; +} + +STATIC int s_norm(mp_int a, mp_int b) +{ + mp_digit d = b->digits[MP_USED(b) - 1]; + int k = 0; + + while (d < (mp_digit) (1 << (MP_DIGIT_BIT - 1))) { /* d < (MP_RADIX / 2) */ + d <<= 1; + ++k; + } + + /* These multiplications can't fail */ + if (k != 0) { + (void) s_qmul(a, (mp_size) k); + (void) s_qmul(b, (mp_size) k); + } + + return k; +} + +STATIC mp_result s_brmu(mp_int z, mp_int m) +{ + mp_size um = MP_USED(m) * 2; + + if (!s_pad(z, um)) + return MP_MEMORY; + + s_2expt(z, MP_DIGIT_BIT * um); + return mp_int_div(z, m, z, NULL); +} + +STATIC int s_reduce(mp_int x, mp_int m, mp_int mu, mp_int q1, mp_int q2) +{ + mp_size um = MP_USED(m), umb_p1, umb_m1; + + umb_p1 = (um + 1) * MP_DIGIT_BIT; + umb_m1 = (um - 1) * MP_DIGIT_BIT; + + if (mp_int_copy(x, q1) != MP_OK) + return 0; + + /* Compute q2 = floor((floor(x / b^(k-1)) * mu) / b^(k+1)) */ + s_qdiv(q1, umb_m1); + UMUL(q1, mu, q2); + s_qdiv(q2, umb_p1); + + /* Set x = x mod b^(k+1) */ + s_qmod(x, umb_p1); + + /* Now, q is a guess for the quotient a / m. + Compute x - q * m mod b^(k+1), replacing x. This may be off + by a factor of 2m, but no more than that. + */ + UMUL(q2, m, q1); + s_qmod(q1, umb_p1); + (void) mp_int_sub(x, q1, x); /* can't fail */ + + /* The result may be < 0; if it is, add b^(k+1) to pin it in the proper + range. */ + if ((CMPZ(x) < 0) && !s_qsub(x, umb_p1)) + return 0; + + /* If x > m, we need to back it off until it is in range. This will be + required at most twice. */ + if (mp_int_compare(x, m) >= 0) { + (void) mp_int_sub(x, m, x); + if (mp_int_compare(x, m) >= 0) + (void) mp_int_sub(x, m, x); + } + + /* At this point, x has been properly reduced. */ + return 1; +} + +/* Perform modular exponentiation using Barrett's method, where mu is the + reduction constant for m. Assumes a < m, b > 0. */ +STATIC mp_result s_embar(mp_int a, mp_int b, mp_int m, mp_int mu, mp_int c) +{ + mp_digit *db, *dbt, umu, d; + mp_result res; + DECLARE_TEMP(3); + + umu = MP_USED(mu); db = MP_DIGITS(b); dbt = db + MP_USED(b) - 1; + + while (last__ < 3) { + SETUP(mp_int_init_size(LAST_TEMP(), 4 * umu)); + ZERO(MP_DIGITS(TEMP(last__ - 1)), MP_ALLOC(TEMP(last__ - 1))); + } + + (void) mp_int_set_value(c, 1); + + /* Take care of low-order digits */ + while (db < dbt) { + int i; + + for (d = *db, i = MP_DIGIT_BIT; i > 0; --i, d >>= 1) { + if (d & 1) { + /* The use of a second temporary avoids allocation */ + UMUL(c, a, TEMP(0)); + if (!s_reduce(TEMP(0), m, mu, TEMP(1), TEMP(2))) { + res = MP_MEMORY; goto CLEANUP; + } + mp_int_copy(TEMP(0), c); + } + + + USQR(a, TEMP(0)); + assert(MP_SIGN(TEMP(0)) == MP_ZPOS); + if (!s_reduce(TEMP(0), m, mu, TEMP(1), TEMP(2))) { + res = MP_MEMORY; goto CLEANUP; + } + assert(MP_SIGN(TEMP(0)) == MP_ZPOS); + mp_int_copy(TEMP(0), a); + } + + ++db; + } + + /* Take care of highest-order digit */ + d = *dbt; + for (;;) { + if (d & 1) { + UMUL(c, a, TEMP(0)); + if (!s_reduce(TEMP(0), m, mu, TEMP(1), TEMP(2))) { + res = MP_MEMORY; goto CLEANUP; + } + mp_int_copy(TEMP(0), c); + } + + d >>= 1; + if (!d) break; + + USQR(a, TEMP(0)); + if (!s_reduce(TEMP(0), m, mu, TEMP(1), TEMP(2))) { + res = MP_MEMORY; goto CLEANUP; + } + (void) mp_int_copy(TEMP(0), a); + } + + CLEANUP_TEMP(); + return res; +} + +#if 0 +/* + The s_udiv function produces incorrect results. For example, with test + div:11141460315522012760862883825:48318382095:0,230584300062375935 + commenting out the function for now and using s_udiv_knuth instead. + STATIC mp_result s_udiv(mp_int a, mp_int b); +*/ +/* Precondition: a >= b and b > 0 + Postcondition: a' = a / b, b' = a % b + */ +STATIC mp_result s_udiv(mp_int a, mp_int b) +{ + mpz_t q, r, t; + mp_size ua, ub, qpos = 0; + mp_digit *da, btop; + mp_result res = MP_OK; + int k, skip = 0; + + /* Force signs to positive */ + MP_SIGN(a) = MP_ZPOS; + MP_SIGN(b) = MP_ZPOS; + + /* Normalize, per Knuth */ + k = s_norm(a, b); + + ua = MP_USED(a); ub = MP_USED(b); btop = b->digits[ub - 1]; + if ((res = mp_int_init_size(&q, ua)) != MP_OK) return res; + if ((res = mp_int_init_size(&t, ua + 1)) != MP_OK) goto CLEANUP; + + da = MP_DIGITS(a); + r.digits = da + ua - 1; /* The contents of r are shared with a */ + r.used = 1; + r.sign = MP_ZPOS; + r.alloc = MP_ALLOC(a); + ZERO(t.digits, t.alloc); + + /* Solve for quotient digits, store in q.digits in reverse order */ + while (r.digits >= da) { + assert(qpos <= q.alloc); + + if (s_ucmp(b, &r) > 0) { + r.digits -= 1; + r.used += 1; + + if (++skip > 1 && qpos > 0) + q.digits[qpos++] = 0; + + CLAMP(&r); + } + else { + mp_word pfx = r.digits[r.used - 1]; + mp_word qdigit; + + if (r.used > 1 && pfx < btop) { + pfx <<= MP_DIGIT_BIT / 2; + pfx <<= MP_DIGIT_BIT / 2; + pfx |= r.digits[r.used - 2]; + } + + qdigit = pfx / btop; + if (qdigit > MP_DIGIT_MAX) { + qdigit = MP_DIGIT_MAX; + } + + s_dbmul(MP_DIGITS(b), (mp_digit) qdigit, t.digits, ub); + t.used = ub + 1; CLAMP(&t); + while (s_ucmp(&t, &r) > 0) { + --qdigit; + (void) mp_int_sub(&t, b, &t); /* cannot fail */ + } + + s_usub(r.digits, t.digits, r.digits, r.used, t.used); + CLAMP(&r); + + q.digits[qpos++] = (mp_digit) qdigit; + ZERO(t.digits, t.used); + skip = 0; + } + } + + /* Put quotient digits in the correct order, and discard extra zeroes */ + q.used = qpos; + REV(mp_digit, q.digits, qpos); + CLAMP(&q); + + /* Denormalize the remainder */ + CLAMP(a); + if (k != 0) + s_qdiv(a, k); + + mp_int_copy(a, b); /* ok: 0 <= r < b */ + mp_int_copy(&q, a); /* ok: q <= a */ + + mp_int_clear(&t); + CLEANUP: + mp_int_clear(&q); + return res; +} +#endif + +/* Division of nonnegative integers + + This function implements division algorithm for unsigned multi-precision + integers. The algorithm is based on Algorithm D from Knuth's "The Art of + Computer Programming", 3rd ed. 1998, pg 272-273. + + We diverge from Knuth's algorithm in that we do not perform the subtraction + from the remainder until we have determined that we have the correct + quotient digit. This makes our algorithm less efficient that Knuth because + we might have to perform multiple multiplication and comparison steps before + the subtraction. The advantage is that it is easy to implement and ensure + correctness without worrying about underflow from the subtraction. + + inputs: u a n+m digit integer in base b (b is 2^MP_DIGIT_BIT) + v a n digit integer in base b (b is 2^MP_DIGIT_BIT) + n >= 1 + m >= 0 + outputs: u / v stored in u + u % v stored in v + */ +STATIC mp_result s_udiv_knuth(mp_int u, mp_int v) { + mpz_t q, r, t; + mp_result + res = MP_OK; + int k,j; + mp_size m,n; + + /* Force signs to positive */ + MP_SIGN(u) = MP_ZPOS; + MP_SIGN(v) = MP_ZPOS; + + /* Use simple division algorithm when v is only one digit long */ + if (MP_USED(v) == 1) { + mp_digit d, rem; + d = v->digits[0]; + rem = s_ddiv(u, d); + mp_int_set_value(v, rem); + return MP_OK; + } + + /************************************************************/ + /* Algorithm D */ + /************************************************************/ + /* The n and m variables are defined as used by Knuth. + u is an n digit number with digits u_{n-1}..u_0. + v is an n+m digit number with digits from v_{m+n-1}..v_0. + We require that n > 1 and m >= 0 */ + n = MP_USED(v); + m = MP_USED(u) - n; + assert(n > 1); + assert(m >= 0); + + /************************************************************/ + /* D1: Normalize. + The normalization step provides the necessary condition for Theorem B, + which states that the quotient estimate for q_j, call it qhat + + qhat = u_{j+n}u_{j+n-1} / v_{n-1} + + is bounded by + + qhat - 2 <= q_j <= qhat. + + That is, qhat is always greater than the actual quotient digit q, + and it is never more than two larger than the actual quotient digit. */ + k = s_norm(u, v); + + /* Extend size of u by one if needed. + + The algorithm begins with a value of u that has one more digit of input. + The normalization step sets u_{m+n}..u_0 = 2^k * u_{m+n-1}..u_0. If the + multiplication did not increase the number of digits of u, we need to add + a leading zero here. + */ + if (k == 0 || MP_USED(u) != m + n + 1) { + if (!s_pad(u, m+n+1)) + return MP_MEMORY; + u->digits[m+n] = 0; + u->used = m+n+1; + } + + /* Add a leading 0 to v. + + The multiplication in step D4 multiplies qhat * 0v_{n-1}..v_0. We need to + add the leading zero to v here to ensure that the multiplication will + produce the full n+1 digit result. */ + if (!s_pad(v, n+1)) return MP_MEMORY; v->digits[n] = 0; + + /* Initialize temporary variables q and t. + q allocates space for m+1 digits to store the quotient digits + t allocates space for n+1 digits to hold the result of q_j*v */ + if ((res = mp_int_init_size(&q, m + 1)) != MP_OK) return res; + if ((res = mp_int_init_size(&t, n + 1)) != MP_OK) goto CLEANUP; + + /************************************************************/ + /* D2: Initialize j */ + j = m; + r.digits = MP_DIGITS(u) + j; /* The contents of r are shared with u */ + r.used = n + 1; + r.sign = MP_ZPOS; + r.alloc = MP_ALLOC(u); + ZERO(t.digits, t.alloc); + + /* Calculate the m+1 digits of the quotient result */ + for (; j >= 0; j--) { + /************************************************************/ + /* D3: Calculate q' */ + /* r->digits is aligned to position j of the number u */ + mp_word pfx, qhat; + pfx = r.digits[n]; + pfx <<= MP_DIGIT_BIT / 2; + pfx <<= MP_DIGIT_BIT / 2; + pfx |= r.digits[n-1]; /* pfx = u_{j+n}{j+n-1} */ + + qhat = pfx / v->digits[n-1]; + /* Check to see if qhat > b, and decrease qhat if so. + Theorem B guarantess that qhat is at most 2 larger than the + actual value, so it is possible that qhat is greater than + the maximum value that will fit in a digit */ + if (qhat > MP_DIGIT_MAX) + qhat = MP_DIGIT_MAX; + + /************************************************************/ + /* D4,D5,D6: Multiply qhat * v and test for a correct value of q + + We proceed a bit different than the way described by Knuth. This way is + simpler but less efficent. Instead of doing the multiply and subtract + then checking for underflow, we first do the multiply of qhat * v and + see if it is larger than the current remainder r. If it is larger, we + decrease qhat by one and try again. We may need to decrease qhat one + more time before we get a value that is smaller than r. + + This way is less efficent than Knuth becuase we do more multiplies, but + we do not need to worry about underflow this way. */ + /* t = qhat * v */ + s_dbmul(MP_DIGITS(v), (mp_digit) qhat, t.digits, n+1); t.used = n + 1; + CLAMP(&t); + + /* Clamp r for the comparison. Comparisons do not like leading zeros. */ + CLAMP(&r); + if (s_ucmp(&t, &r) > 0) { /* would the remainder be negative? */ + qhat -= 1; /* try a smaller q */ + s_dbmul(MP_DIGITS(v), (mp_digit) qhat, t.digits, n+1); + t.used = n + 1; CLAMP(&t); + if (s_ucmp(&t, &r) > 0) { /* would the remainder be negative? */ + assert(qhat > 0); + qhat -= 1; /* try a smaller q */ + s_dbmul(MP_DIGITS(v), (mp_digit) qhat, t.digits, n+1); + t.used = n + 1; CLAMP(&t); + } + assert(s_ucmp(&t, &r) <= 0 && "The mathematics failed us."); + } + /* Unclamp r. The D algorithm expects r = u_{j+n}..u_j to always be n+1 + digits long. */ + r.used = n + 1; + + /************************************************************/ + /* D4: Multiply and subtract */ + /* note: The multiply was completed above so we only need to subtract here. + **/ + s_usub(r.digits, t.digits, r.digits, r.used, t.used); + + /************************************************************/ + /* D5: Test remainder */ + /* note: Not needed because we always check that qhat is the correct value + * before performing the subtract. + * Value cast to mp_digit to prevent warning, qhat has been clamped to MP_DIGIT_MAX */ + q.digits[j] = (mp_digit)qhat; + + /************************************************************/ + /* D6: Add back */ + /* note: Not needed because we always check that qhat is the correct value + * before performing the subtract. */ + + /************************************************************/ + /* D7: Loop on j */ + r.digits--; + ZERO(t.digits, t.alloc); + } + + /* Get rid of leading zeros in q */ + q.used = m + 1; + CLAMP(&q); + + /* Denormalize the remainder */ + CLAMP(u); /* use u here because the r.digits pointer is off-by-one */ + if (k != 0) + s_qdiv(u, k); + + mp_int_copy(u, v); /* ok: 0 <= r < v */ + mp_int_copy(&q, u); /* ok: q <= u */ + + mp_int_clear(&t); + CLEANUP: + mp_int_clear(&q); + return res; +} + +STATIC int s_outlen(mp_int z, mp_size r) +{ + mp_result bits; + double raw; + + assert(r >= MP_MIN_RADIX && r <= MP_MAX_RADIX); + + bits = mp_int_count_bits(z); + raw = (double)bits * s_log2[r]; + + return (int)(raw + 0.999999); +} + +STATIC mp_size s_inlen(int len, mp_size r) +{ + double raw = (double)len / s_log2[r]; + mp_size bits = (mp_size)(raw + 0.5); + + return (mp_size)((bits + (MP_DIGIT_BIT - 1)) / MP_DIGIT_BIT) + 1; +} + +STATIC int s_ch2val(char c, int r) +{ + int out; + + if (isdigit((unsigned char) c)) + out = c - '0'; + else if (r > 10 && isalpha((unsigned char) c)) + out = toupper(c) - 'A' + 10; + else + return -1; + + return (out >= r) ? -1 : out; +} + +STATIC char s_val2ch(int v, int caps) +{ + assert(v >= 0); + + if (v < 10) + return v + '0'; + else { + char out = (v - 10) + 'a'; + + if (caps) + return toupper(out); + else + return out; + } +} + +STATIC void s_2comp(unsigned char *buf, int len) +{ + int i; + unsigned short s = 1; + + for (i = len - 1; i >= 0; --i) { + unsigned char c = ~buf[i]; + + s = c + s; + c = s & UCHAR_MAX; + s >>= CHAR_BIT; + + buf[i] = c; + } + + /* last carry out is ignored */ +} + +STATIC mp_result s_tobin(mp_int z, unsigned char *buf, int *limpos, int pad) +{ + mp_size uz; + mp_digit *dz; + int pos = 0, limit = *limpos; + + uz = MP_USED(z); dz = MP_DIGITS(z); + while (uz > 0 && pos < limit) { + mp_digit d = *dz++; + int i; + + for (i = sizeof(mp_digit); i > 0 && pos < limit; --i) { + buf[pos++] = (unsigned char)d; + d >>= CHAR_BIT; + + /* Don't write leading zeroes */ + if (d == 0 && uz == 1) + i = 0; /* exit loop without signaling truncation */ + } + + /* Detect truncation (loop exited with pos >= limit) */ + if (i > 0) break; + + --uz; + } + + if (pad != 0 && (buf[pos - 1] >> (CHAR_BIT - 1))) { + if (pos < limit) + buf[pos++] = 0; + else + uz = 1; + } + + /* Digits are in reverse order, fix that */ + REV(unsigned char, buf, pos); + + /* Return the number of bytes actually written */ + *limpos = pos; + + return (uz == 0) ? MP_OK : MP_TRUNC; +} + +#if DEBUG +void s_print(char *tag, mp_int z) +{ + int i; + + fprintf(stderr, "%s: %c ", tag, + (MP_SIGN(z) == MP_NEG) ? '-' : '+'); + + for (i = MP_USED(z) - 1; i >= 0; --i) + fprintf(stderr, "%0*X", (int)(MP_DIGIT_BIT / 4), z->digits[i]); + + fputc('\n', stderr); + +} + +void s_print_buf(char *tag, mp_digit *buf, mp_size num) +{ + int i; + + fprintf(stderr, "%s: ", tag); + + for (i = num - 1; i >= 0; --i) + fprintf(stderr, "%0*X", (int)(MP_DIGIT_BIT / 4), buf[i]); + + fputc('\n', stderr); +} +#endif + +/* Here there be dragons */ diff -Nru cloog-0.18.2/isl/imath/imath.h cloog-0.18.4/isl/imath/imath.h --- cloog-0.18.2/isl/imath/imath.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/imath/imath.h 2015-07-27 11:46:11.000000000 +0000 @@ -0,0 +1,232 @@ +/* + Name: imath.h + Purpose: Arbitrary precision integer arithmetic routines. + Author: M. J. Fromberger + + Copyright (C) 2002-2007 Michael J. Fromberger, All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + */ + +#ifndef IMATH_H_ +#define IMATH_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef unsigned char mp_sign; +typedef unsigned int mp_size; +typedef int mp_result; +typedef long mp_small; /* must be a signed type */ +typedef unsigned long mp_usmall; /* must be an unsigned type */ + +/* Force building with uint64_t so that the library builds consistently + * whether we build from the makefile or by embedding imath in another project. + */ +#undef USE_64BIT_WORDS +#define USE_64BIT_WORDS +#ifdef USE_64BIT_WORDS +typedef uint32_t mp_digit; +typedef uint64_t mp_word; +#else +typedef uint16_t mp_digit; +typedef uint32_t mp_word; +#endif + +typedef struct mpz { + mp_digit single; + mp_digit *digits; + mp_size alloc; + mp_size used; + mp_sign sign; +} mpz_t, *mp_int; + +#define MP_DIGITS(Z) ((Z)->digits) +#define MP_ALLOC(Z) ((Z)->alloc) +#define MP_USED(Z) ((Z)->used) +#define MP_SIGN(Z) ((Z)->sign) + +extern const mp_result MP_OK; +extern const mp_result MP_FALSE; +extern const mp_result MP_TRUE; +extern const mp_result MP_MEMORY; +extern const mp_result MP_RANGE; +extern const mp_result MP_UNDEF; +extern const mp_result MP_TRUNC; +extern const mp_result MP_BADARG; +extern const mp_result MP_MINERR; + +#define MP_DIGIT_BIT (sizeof(mp_digit) * CHAR_BIT) +#define MP_WORD_BIT (sizeof(mp_word) * CHAR_BIT) +#define MP_SMALL_MIN LONG_MIN +#define MP_SMALL_MAX LONG_MAX +#define MP_USMALL_MIN ULONG_MIN +#define MP_USMALL_MAX ULONG_MAX + +#ifdef USE_64BIT_WORDS +# define MP_DIGIT_MAX (UINT32_MAX * UINT64_C(1)) +# define MP_WORD_MAX (UINT64_MAX) +#else +# define MP_DIGIT_MAX (UINT16_MAX * 1UL) +# define MP_WORD_MAX (UINT32_MAX * 1UL) +#endif + +#define MP_MIN_RADIX 2 +#define MP_MAX_RADIX 36 + +/* Values with fewer than this many significant digits use the standard + multiplication algorithm; otherwise, a recursive algorithm is used. + Choose a value to suit your platform. + */ +#define MP_MULT_THRESH 22 + +#define MP_DEFAULT_PREC 8 /* default memory allocation, in digits */ + +extern const mp_sign MP_NEG; +extern const mp_sign MP_ZPOS; + +#define mp_int_is_odd(Z) ((Z)->digits[0] & 1) +#define mp_int_is_even(Z) !((Z)->digits[0] & 1) + +mp_result mp_int_init(mp_int z); +mp_int mp_int_alloc(void); +mp_result mp_int_init_size(mp_int z, mp_size prec); +mp_result mp_int_init_copy(mp_int z, mp_int old); +mp_result mp_int_init_value(mp_int z, mp_small value); +mp_result mp_int_init_uvalue(mp_int z, mp_usmall uvalue); +mp_result mp_int_set_value(mp_int z, mp_small value); +mp_result mp_int_set_uvalue(mp_int z, mp_usmall uvalue); +void mp_int_clear(mp_int z); +void mp_int_free(mp_int z); + +mp_result mp_int_copy(mp_int a, mp_int c); /* c = a */ +void mp_int_swap(mp_int a, mp_int c); /* swap a, c */ +void mp_int_zero(mp_int z); /* z = 0 */ +mp_result mp_int_abs(mp_int a, mp_int c); /* c = |a| */ +mp_result mp_int_neg(mp_int a, mp_int c); /* c = -a */ +mp_result mp_int_add(mp_int a, mp_int b, mp_int c); /* c = a + b */ +mp_result mp_int_add_value(mp_int a, mp_small value, mp_int c); +mp_result mp_int_sub(mp_int a, mp_int b, mp_int c); /* c = a - b */ +mp_result mp_int_sub_value(mp_int a, mp_small value, mp_int c); +mp_result mp_int_mul(mp_int a, mp_int b, mp_int c); /* c = a * b */ +mp_result mp_int_mul_value(mp_int a, mp_small value, mp_int c); +mp_result mp_int_mul_pow2(mp_int a, mp_small p2, mp_int c); +mp_result mp_int_sqr(mp_int a, mp_int c); /* c = a * a */ +mp_result mp_int_div(mp_int a, mp_int b, /* q = a / b */ + mp_int q, mp_int r); /* r = a % b */ +mp_result mp_int_div_value(mp_int a, mp_small value, /* q = a / value */ + mp_int q, mp_small *r); /* r = a % value */ +mp_result mp_int_div_pow2(mp_int a, mp_small p2, /* q = a / 2^p2 */ + mp_int q, mp_int r); /* r = q % 2^p2 */ +mp_result mp_int_mod(mp_int a, mp_int m, mp_int c); /* c = a % m */ +#define mp_int_mod_value(A, V, R) mp_int_div_value((A), (V), 0, (R)) +mp_result mp_int_expt(mp_int a, mp_small b, mp_int c); /* c = a^b */ +mp_result mp_int_expt_value(mp_small a, mp_small b, mp_int c); /* c = a^b */ +mp_result mp_int_expt_full(mp_int a, mp_int b, mp_int c); /* c = a^b */ + +int mp_int_compare(mp_int a, mp_int b); /* a <=> b */ +int mp_int_compare_unsigned(mp_int a, mp_int b); /* |a| <=> |b| */ +int mp_int_compare_zero(mp_int z); /* a <=> 0 */ +int mp_int_compare_value(mp_int z, mp_small v); /* a <=> v */ +int mp_int_compare_uvalue(mp_int z, mp_usmall uv); /* a <=> uv */ + +/* Returns true if v|a, false otherwise (including errors) */ +int mp_int_divisible_value(mp_int a, mp_small v); + +/* Returns k >= 0 such that z = 2^k, if one exists; otherwise < 0 */ +int mp_int_is_pow2(mp_int z); + +mp_result mp_int_exptmod(mp_int a, mp_int b, mp_int m, + mp_int c); /* c = a^b (mod m) */ +mp_result mp_int_exptmod_evalue(mp_int a, mp_small value, + mp_int m, mp_int c); /* c = a^v (mod m) */ +mp_result mp_int_exptmod_bvalue(mp_small value, mp_int b, + mp_int m, mp_int c); /* c = v^b (mod m) */ +mp_result mp_int_exptmod_known(mp_int a, mp_int b, + mp_int m, mp_int mu, + mp_int c); /* c = a^b (mod m) */ +mp_result mp_int_redux_const(mp_int m, mp_int c); + +mp_result mp_int_invmod(mp_int a, mp_int m, mp_int c); /* c = 1/a (mod m) */ + +mp_result mp_int_gcd(mp_int a, mp_int b, mp_int c); /* c = gcd(a, b) */ + +mp_result mp_int_egcd(mp_int a, mp_int b, mp_int c, /* c = gcd(a, b) */ + mp_int x, mp_int y); /* c = ax + by */ + +mp_result mp_int_lcm(mp_int a, mp_int b, mp_int c); /* c = lcm(a, b) */ + +mp_result mp_int_root(mp_int a, mp_small b, mp_int c); /* c = floor(a^{1/b}) */ +#define mp_int_sqrt(a, c) mp_int_root(a, 2, c) /* c = floor(sqrt(a)) */ + +/* Convert to a small int, if representable; else MP_RANGE */ +mp_result mp_int_to_int(mp_int z, mp_small *out); +mp_result mp_int_to_uint(mp_int z, mp_usmall *out); + +/* Convert to nul-terminated string with the specified radix, writing at + most limit characters including the nul terminator */ +mp_result mp_int_to_string(mp_int z, mp_size radix, + char *str, int limit); + +/* Return the number of characters required to represent + z in the given radix. May over-estimate. */ +mp_result mp_int_string_len(mp_int z, mp_size radix); + +/* Read zero-terminated string into z */ +mp_result mp_int_read_string(mp_int z, mp_size radix, const char *str); +mp_result mp_int_read_cstring(mp_int z, mp_size radix, const char *str, + char **end); + +/* Return the number of significant bits in z */ +mp_result mp_int_count_bits(mp_int z); + +/* Convert z to two's complement binary, writing at most limit bytes */ +mp_result mp_int_to_binary(mp_int z, unsigned char *buf, int limit); + +/* Read a two's complement binary value into z from the given buffer */ +mp_result mp_int_read_binary(mp_int z, unsigned char *buf, int len); + +/* Return the number of bytes required to represent z in binary. */ +mp_result mp_int_binary_len(mp_int z); + +/* Convert z to unsigned binary, writing at most limit bytes */ +mp_result mp_int_to_unsigned(mp_int z, unsigned char *buf, int limit); + +/* Read an unsigned binary value into z from the given buffer */ +mp_result mp_int_read_unsigned(mp_int z, unsigned char *buf, int len); + +/* Return the number of bytes required to represent z as unsigned output */ +mp_result mp_int_unsigned_len(mp_int z); + +/* Return a statically allocated string describing error code res */ +const char *mp_error_string(mp_result res); + +#if DEBUG +void s_print(char *tag, mp_int z); +void s_print_buf(char *tag, mp_digit *buf, mp_size num); +#endif + +#ifdef __cplusplus +} +#endif +#endif /* end IMATH_H_ */ diff -Nru cloog-0.18.2/isl/imath/imrat.c cloog-0.18.4/isl/imath/imrat.c --- cloog-0.18.2/isl/imath/imrat.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/imath/imrat.c 2015-07-27 11:46:11.000000000 +0000 @@ -0,0 +1,958 @@ +/* + Name: imrat.c + Purpose: Arbitrary precision rational arithmetic routines. + Author: M. J. Fromberger + + Copyright (C) 2002-2007 Michael J. Fromberger, All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + */ + +#include "imrat.h" +#include +#include +#include +#include + +#define TEMP(K) (temp + (K)) +#define SETUP(E, C) \ +do{if((res = (E)) != MP_OK) goto CLEANUP; ++(C);}while(0) + +/* Argument checking: + Use CHECK() where a return value is required; NRCHECK() elsewhere */ +#define CHECK(TEST) assert(TEST) +#define NRCHECK(TEST) assert(TEST) + +/* Reduce the given rational, in place, to lowest terms and canonical form. + Zero is represented as 0/1, one as 1/1. Signs are adjusted so that the sign + of the numerator is definitive. */ +static mp_result s_rat_reduce(mp_rat r); + +/* Common code for addition and subtraction operations on rationals. */ +static mp_result s_rat_combine(mp_rat a, mp_rat b, mp_rat c, + mp_result (*comb_f)(mp_int, mp_int, mp_int)); + +mp_result mp_rat_init(mp_rat r) +{ + mp_result res; + + if ((res = mp_int_init(MP_NUMER_P(r))) != MP_OK) + return res; + if ((res = mp_int_init(MP_DENOM_P(r))) != MP_OK) { + mp_int_clear(MP_NUMER_P(r)); + return res; + } + + return mp_int_set_value(MP_DENOM_P(r), 1); +} + +mp_rat mp_rat_alloc(void) +{ + mp_rat out = malloc(sizeof(*out)); + + if (out != NULL) { + if (mp_rat_init(out) != MP_OK) { + free(out); + return NULL; + } + } + + return out; +} + +mp_result mp_rat_reduce(mp_rat r) { + return s_rat_reduce(r); +} + +mp_result mp_rat_init_size(mp_rat r, mp_size n_prec, mp_size d_prec) +{ + mp_result res; + + if ((res = mp_int_init_size(MP_NUMER_P(r), n_prec)) != MP_OK) + return res; + if ((res = mp_int_init_size(MP_DENOM_P(r), d_prec)) != MP_OK) { + mp_int_clear(MP_NUMER_P(r)); + return res; + } + + return mp_int_set_value(MP_DENOM_P(r), 1); +} + +mp_result mp_rat_init_copy(mp_rat r, mp_rat old) +{ + mp_result res; + + if ((res = mp_int_init_copy(MP_NUMER_P(r), MP_NUMER_P(old))) != MP_OK) + return res; + if ((res = mp_int_init_copy(MP_DENOM_P(r), MP_DENOM_P(old))) != MP_OK) + mp_int_clear(MP_NUMER_P(r)); + + return res; +} + +mp_result mp_rat_set_value(mp_rat r, mp_small numer, mp_small denom) +{ + mp_result res; + + if (denom == 0) + return MP_UNDEF; + + if ((res = mp_int_set_value(MP_NUMER_P(r), numer)) != MP_OK) + return res; + if ((res = mp_int_set_value(MP_DENOM_P(r), denom)) != MP_OK) + return res; + + return s_rat_reduce(r); +} + +mp_result mp_rat_set_uvalue(mp_rat r, mp_usmall numer, mp_usmall denom) +{ + mp_result res; + + if (denom == 0) + return MP_UNDEF; + + if ((res = mp_int_set_uvalue(MP_NUMER_P(r), numer)) != MP_OK) + return res; + if ((res = mp_int_set_uvalue(MP_DENOM_P(r), denom)) != MP_OK) + return res; + + return s_rat_reduce(r); +} + +void mp_rat_clear(mp_rat r) +{ + mp_int_clear(MP_NUMER_P(r)); + mp_int_clear(MP_DENOM_P(r)); + +} + +void mp_rat_free(mp_rat r) +{ + NRCHECK(r != NULL); + + if (r->num.digits != NULL) + mp_rat_clear(r); + + free(r); +} + +mp_result mp_rat_numer(mp_rat r, mp_int z) +{ + return mp_int_copy(MP_NUMER_P(r), z); +} + +mp_int mp_rat_numer_ref(mp_rat r) +{ + return MP_NUMER_P(r); +} + + +mp_result mp_rat_denom(mp_rat r, mp_int z) +{ + return mp_int_copy(MP_DENOM_P(r), z); +} + +mp_int mp_rat_denom_ref(mp_rat r) +{ + return MP_DENOM_P(r); +} + +mp_sign mp_rat_sign(mp_rat r) +{ + return MP_SIGN(MP_NUMER_P(r)); +} + +mp_result mp_rat_copy(mp_rat a, mp_rat c) +{ + mp_result res; + + if ((res = mp_int_copy(MP_NUMER_P(a), MP_NUMER_P(c))) != MP_OK) + return res; + + res = mp_int_copy(MP_DENOM_P(a), MP_DENOM_P(c)); + return res; +} + +void mp_rat_zero(mp_rat r) +{ + mp_int_zero(MP_NUMER_P(r)); + mp_int_set_value(MP_DENOM_P(r), 1); + +} + +mp_result mp_rat_abs(mp_rat a, mp_rat c) +{ + mp_result res; + + if ((res = mp_int_abs(MP_NUMER_P(a), MP_NUMER_P(c))) != MP_OK) + return res; + + res = mp_int_abs(MP_DENOM_P(a), MP_DENOM_P(c)); + return res; +} + +mp_result mp_rat_neg(mp_rat a, mp_rat c) +{ + mp_result res; + + if ((res = mp_int_neg(MP_NUMER_P(a), MP_NUMER_P(c))) != MP_OK) + return res; + + res = mp_int_copy(MP_DENOM_P(a), MP_DENOM_P(c)); + return res; +} + +mp_result mp_rat_recip(mp_rat a, mp_rat c) +{ + mp_result res; + + if (mp_rat_compare_zero(a) == 0) + return MP_UNDEF; + + if ((res = mp_rat_copy(a, c)) != MP_OK) + return res; + + mp_int_swap(MP_NUMER_P(c), MP_DENOM_P(c)); + + /* Restore the signs of the swapped elements */ + { + mp_sign tmp = MP_SIGN(MP_NUMER_P(c)); + + MP_SIGN(MP_NUMER_P(c)) = MP_SIGN(MP_DENOM_P(c)); + MP_SIGN(MP_DENOM_P(c)) = tmp; + } + + return MP_OK; +} + +mp_result mp_rat_add(mp_rat a, mp_rat b, mp_rat c) +{ + return s_rat_combine(a, b, c, mp_int_add); + +} + +mp_result mp_rat_sub(mp_rat a, mp_rat b, mp_rat c) +{ + return s_rat_combine(a, b, c, mp_int_sub); + +} + +mp_result mp_rat_mul(mp_rat a, mp_rat b, mp_rat c) +{ + mp_result res; + + if ((res = mp_int_mul(MP_NUMER_P(a), MP_NUMER_P(b), MP_NUMER_P(c))) != MP_OK) + return res; + + if (mp_int_compare_zero(MP_NUMER_P(c)) != 0) { + if ((res = mp_int_mul(MP_DENOM_P(a), MP_DENOM_P(b), MP_DENOM_P(c))) != MP_OK) + return res; + } + + return s_rat_reduce(c); +} + +mp_result mp_rat_div(mp_rat a, mp_rat b, mp_rat c) +{ + mp_result res = MP_OK; + + if (mp_rat_compare_zero(b) == 0) + return MP_UNDEF; + + if (c == a || c == b) { + mpz_t tmp; + + if ((res = mp_int_init(&tmp)) != MP_OK) return res; + if ((res = mp_int_mul(MP_NUMER_P(a), MP_DENOM_P(b), &tmp)) != MP_OK) + goto CLEANUP; + if ((res = mp_int_mul(MP_DENOM_P(a), MP_NUMER_P(b), MP_DENOM_P(c))) != MP_OK) + goto CLEANUP; + res = mp_int_copy(&tmp, MP_NUMER_P(c)); + + CLEANUP: + mp_int_clear(&tmp); + } + else { + if ((res = mp_int_mul(MP_NUMER_P(a), MP_DENOM_P(b), MP_NUMER_P(c))) != MP_OK) + return res; + if ((res = mp_int_mul(MP_DENOM_P(a), MP_NUMER_P(b), MP_DENOM_P(c))) != MP_OK) + return res; + } + + if (res != MP_OK) + return res; + else + return s_rat_reduce(c); +} + +mp_result mp_rat_add_int(mp_rat a, mp_int b, mp_rat c) +{ + mpz_t tmp; + mp_result res; + + if ((res = mp_int_init_copy(&tmp, b)) != MP_OK) + return res; + + if ((res = mp_int_mul(&tmp, MP_DENOM_P(a), &tmp)) != MP_OK) + goto CLEANUP; + + if ((res = mp_rat_copy(a, c)) != MP_OK) + goto CLEANUP; + + if ((res = mp_int_add(MP_NUMER_P(c), &tmp, MP_NUMER_P(c))) != MP_OK) + goto CLEANUP; + + res = s_rat_reduce(c); + + CLEANUP: + mp_int_clear(&tmp); + return res; +} + +mp_result mp_rat_sub_int(mp_rat a, mp_int b, mp_rat c) +{ + mpz_t tmp; + mp_result res; + + if ((res = mp_int_init_copy(&tmp, b)) != MP_OK) + return res; + + if ((res = mp_int_mul(&tmp, MP_DENOM_P(a), &tmp)) != MP_OK) + goto CLEANUP; + + if ((res = mp_rat_copy(a, c)) != MP_OK) + goto CLEANUP; + + if ((res = mp_int_sub(MP_NUMER_P(c), &tmp, MP_NUMER_P(c))) != MP_OK) + goto CLEANUP; + + res = s_rat_reduce(c); + + CLEANUP: + mp_int_clear(&tmp); + return res; +} + +mp_result mp_rat_mul_int(mp_rat a, mp_int b, mp_rat c) +{ + mp_result res; + + if ((res = mp_rat_copy(a, c)) != MP_OK) + return res; + + if ((res = mp_int_mul(MP_NUMER_P(c), b, MP_NUMER_P(c))) != MP_OK) + return res; + + return s_rat_reduce(c); +} + +mp_result mp_rat_div_int(mp_rat a, mp_int b, mp_rat c) +{ + mp_result res; + + if (mp_int_compare_zero(b) == 0) + return MP_UNDEF; + + if ((res = mp_rat_copy(a, c)) != MP_OK) + return res; + + if ((res = mp_int_mul(MP_DENOM_P(c), b, MP_DENOM_P(c))) != MP_OK) + return res; + + return s_rat_reduce(c); +} + +mp_result mp_rat_expt(mp_rat a, mp_small b, mp_rat c) +{ + mp_result res; + + /* Special cases for easy powers. */ + if (b == 0) + return mp_rat_set_value(c, 1, 1); + else if(b == 1) + return mp_rat_copy(a, c); + + /* Since rationals are always stored in lowest terms, it is not necessary to + reduce again when raising to an integer power. */ + if ((res = mp_int_expt(MP_NUMER_P(a), b, MP_NUMER_P(c))) != MP_OK) + return res; + + return mp_int_expt(MP_DENOM_P(a), b, MP_DENOM_P(c)); +} + +int mp_rat_compare(mp_rat a, mp_rat b) +{ + /* Quick check for opposite signs. Works because the sign of the numerator + is always definitive. */ + if (MP_SIGN(MP_NUMER_P(a)) != MP_SIGN(MP_NUMER_P(b))) { + if (MP_SIGN(MP_NUMER_P(a)) == MP_ZPOS) + return 1; + else + return -1; + } + else { + /* Compare absolute magnitudes; if both are positive, the answer stands, + otherwise it needs to be reflected about zero. */ + int cmp = mp_rat_compare_unsigned(a, b); + + if (MP_SIGN(MP_NUMER_P(a)) == MP_ZPOS) + return cmp; + else + return -cmp; + } +} + +int mp_rat_compare_unsigned(mp_rat a, mp_rat b) +{ + /* If the denominators are equal, we can quickly compare numerators without + multiplying. Otherwise, we actually have to do some work. */ + if (mp_int_compare_unsigned(MP_DENOM_P(a), MP_DENOM_P(b)) == 0) + return mp_int_compare_unsigned(MP_NUMER_P(a), MP_NUMER_P(b)); + + else { + mpz_t temp[2]; + mp_result res; + int cmp = INT_MAX, last = 0; + + /* t0 = num(a) * den(b), t1 = num(b) * den(a) */ + SETUP(mp_int_init_copy(TEMP(last), MP_NUMER_P(a)), last); + SETUP(mp_int_init_copy(TEMP(last), MP_NUMER_P(b)), last); + + if ((res = mp_int_mul(TEMP(0), MP_DENOM_P(b), TEMP(0))) != MP_OK || + (res = mp_int_mul(TEMP(1), MP_DENOM_P(a), TEMP(1))) != MP_OK) + goto CLEANUP; + + cmp = mp_int_compare_unsigned(TEMP(0), TEMP(1)); + + CLEANUP: + while (--last >= 0) + mp_int_clear(TEMP(last)); + + return cmp; + } +} + +int mp_rat_compare_zero(mp_rat r) +{ + return mp_int_compare_zero(MP_NUMER_P(r)); +} + +int mp_rat_compare_value(mp_rat r, mp_small n, mp_small d) +{ + mpq_t tmp; + mp_result res; + int out = INT_MAX; + + if ((res = mp_rat_init(&tmp)) != MP_OK) + return out; + if ((res = mp_rat_set_value(&tmp, n, d)) != MP_OK) + goto CLEANUP; + + out = mp_rat_compare(r, &tmp); + + CLEANUP: + mp_rat_clear(&tmp); + return out; +} + +int mp_rat_is_integer(mp_rat r) +{ + return (mp_int_compare_value(MP_DENOM_P(r), 1) == 0); +} + +mp_result mp_rat_to_ints(mp_rat r, mp_small *num, mp_small *den) +{ + mp_result res; + + if ((res = mp_int_to_int(MP_NUMER_P(r), num)) != MP_OK) + return res; + + res = mp_int_to_int(MP_DENOM_P(r), den); + return res; +} + +mp_result mp_rat_to_string(mp_rat r, mp_size radix, char *str, int limit) +{ + char *start; + int len; + mp_result res; + + /* Write the numerator. The sign of the rational number is written by the + underlying integer implementation. */ + if ((res = mp_int_to_string(MP_NUMER_P(r), radix, str, limit)) != MP_OK) + return res; + + /* If the value is zero, don't bother writing any denominator */ + if (mp_int_compare_zero(MP_NUMER_P(r)) == 0) + return MP_OK; + + /* Locate the end of the numerator, and make sure we are not going to exceed + the limit by writing a slash. */ + len = strlen(str); + start = str + len; + limit -= len; + if(limit == 0) + return MP_TRUNC; + + *start++ = '/'; + limit -= 1; + + res = mp_int_to_string(MP_DENOM_P(r), radix, start, limit); + return res; +} + +mp_result mp_rat_to_decimal(mp_rat r, mp_size radix, mp_size prec, + mp_round_mode round, char *str, int limit) +{ + mpz_t temp[3]; + mp_result res; + char *start = str; + int len, lead_0, left = limit, last = 0; + + SETUP(mp_int_init_copy(TEMP(last), MP_NUMER_P(r)), last); + SETUP(mp_int_init(TEMP(last)), last); + SETUP(mp_int_init(TEMP(last)), last); + + /* Get the unsigned integer part by dividing denominator into the absolute + value of the numerator. */ + mp_int_abs(TEMP(0), TEMP(0)); + if ((res = mp_int_div(TEMP(0), MP_DENOM_P(r), TEMP(0), TEMP(1))) != MP_OK) + goto CLEANUP; + + /* Now: T0 = integer portion, unsigned; + T1 = remainder, from which fractional part is computed. */ + + /* Count up leading zeroes after the radix point. */ + for (lead_0 = 0; lead_0 < prec && mp_int_compare(TEMP(1), MP_DENOM_P(r)) < 0; + ++lead_0) { + if ((res = mp_int_mul_value(TEMP(1), radix, TEMP(1))) != MP_OK) + goto CLEANUP; + } + + /* Multiply remainder by a power of the radix sufficient to get the right + number of significant figures. */ + if (prec > lead_0) { + if ((res = mp_int_expt_value(radix, prec - lead_0, TEMP(2))) != MP_OK) + goto CLEANUP; + if ((res = mp_int_mul(TEMP(1), TEMP(2), TEMP(1))) != MP_OK) + goto CLEANUP; + } + if ((res = mp_int_div(TEMP(1), MP_DENOM_P(r), TEMP(1), TEMP(2))) != MP_OK) + goto CLEANUP; + + /* Now: T1 = significant digits of fractional part; + T2 = leftovers, to use for rounding. + + At this point, what we do depends on the rounding mode. The default is + MP_ROUND_DOWN, for which everything is as it should be already. + */ + switch (round) { + int cmp; + + case MP_ROUND_UP: + if (mp_int_compare_zero(TEMP(2)) != 0) { + if (prec == 0) + res = mp_int_add_value(TEMP(0), 1, TEMP(0)); + else + res = mp_int_add_value(TEMP(1), 1, TEMP(1)); + } + break; + + case MP_ROUND_HALF_UP: + case MP_ROUND_HALF_DOWN: + if ((res = mp_int_mul_pow2(TEMP(2), 1, TEMP(2))) != MP_OK) + goto CLEANUP; + + cmp = mp_int_compare(TEMP(2), MP_DENOM_P(r)); + + if (round == MP_ROUND_HALF_UP) + cmp += 1; + + if (cmp > 0) { + if (prec == 0) + res = mp_int_add_value(TEMP(0), 1, TEMP(0)); + else + res = mp_int_add_value(TEMP(1), 1, TEMP(1)); + } + break; + + case MP_ROUND_DOWN: + break; /* No action required */ + + default: + return MP_BADARG; /* Invalid rounding specifier */ + } + + /* The sign of the output should be the sign of the numerator, but if all the + displayed digits will be zero due to the precision, a negative shouldn't + be shown. */ + if (MP_SIGN(MP_NUMER_P(r)) == MP_NEG && + (mp_int_compare_zero(TEMP(0)) != 0 || + mp_int_compare_zero(TEMP(1)) != 0)) { + *start++ = '-'; + left -= 1; + } + + if ((res = mp_int_to_string(TEMP(0), radix, start, left)) != MP_OK) + goto CLEANUP; + + len = strlen(start); + start += len; + left -= len; + + if (prec == 0) + goto CLEANUP; + + *start++ = '.'; + left -= 1; + + if (left < prec + 1) { + res = MP_TRUNC; + goto CLEANUP; + } + + memset(start, '0', lead_0 - 1); + left -= lead_0; + start += lead_0 - 1; + + res = mp_int_to_string(TEMP(1), radix, start, left); + + CLEANUP: + while (--last >= 0) + mp_int_clear(TEMP(last)); + + return res; +} + +mp_result mp_rat_string_len(mp_rat r, mp_size radix) +{ + mp_result n_len, d_len = 0; + + n_len = mp_int_string_len(MP_NUMER_P(r), radix); + + if (mp_int_compare_zero(MP_NUMER_P(r)) != 0) + d_len = mp_int_string_len(MP_DENOM_P(r), radix); + + /* Though simplistic, this formula is correct. Space for the sign flag is + included in n_len, and the space for the NUL that is counted in n_len + counts for the separator here. The space for the NUL counted in d_len + counts for the final terminator here. */ + + return n_len + d_len; + +} + +mp_result mp_rat_decimal_len(mp_rat r, mp_size radix, mp_size prec) +{ + int z_len, f_len; + + z_len = mp_int_string_len(MP_NUMER_P(r), radix); + + if (prec == 0) + f_len = 1; /* terminator only */ + else + f_len = 1 + prec + 1; /* decimal point, digits, terminator */ + + return z_len + f_len; +} + +mp_result mp_rat_read_string(mp_rat r, mp_size radix, const char *str) +{ + return mp_rat_read_cstring(r, radix, str, NULL); +} + +mp_result mp_rat_read_cstring(mp_rat r, mp_size radix, const char *str, + char **end) +{ + mp_result res; + char *endp; + + if ((res = mp_int_read_cstring(MP_NUMER_P(r), radix, str, &endp)) != MP_OK && + (res != MP_TRUNC)) + return res; + + /* Skip whitespace between numerator and (possible) separator */ + while (isspace((unsigned char) *endp)) + ++endp; + + /* If there is no separator, we will stop reading at this point. */ + if (*endp != '/') { + mp_int_set_value(MP_DENOM_P(r), 1); + if (end != NULL) + *end = endp; + return res; + } + + ++endp; /* skip separator */ + if ((res = mp_int_read_cstring(MP_DENOM_P(r), radix, endp, end)) != MP_OK) + return res; + + /* Make sure the value is well-defined */ + if (mp_int_compare_zero(MP_DENOM_P(r)) == 0) + return MP_UNDEF; + + /* Reduce to lowest terms */ + return s_rat_reduce(r); +} + +/* Read a string and figure out what format it's in. The radix may be supplied + as zero to use "default" behaviour. + + This function will accept either a/b notation or decimal notation. + */ +mp_result mp_rat_read_ustring(mp_rat r, mp_size radix, const char *str, + char **end) +{ + char *endp; + mp_result res; + + if (radix == 0) + radix = 10; /* default to decimal input */ + + if ((res = mp_rat_read_cstring(r, radix, str, &endp)) != MP_OK) { + if (res == MP_TRUNC) { + if (*endp == '.') + res = mp_rat_read_cdecimal(r, radix, str, &endp); + } + else + return res; + } + + if (end != NULL) + *end = endp; + + return res; +} + +mp_result mp_rat_read_decimal(mp_rat r, mp_size radix, const char *str) +{ + return mp_rat_read_cdecimal(r, radix, str, NULL); +} + +mp_result mp_rat_read_cdecimal(mp_rat r, mp_size radix, const char *str, + char **end) +{ + mp_result res; + mp_sign osign; + char *endp; + + while (isspace((unsigned char) *str)) + ++str; + + switch (*str) { + case '-': + osign = MP_NEG; + break; + default: + osign = MP_ZPOS; + } + + if ((res = mp_int_read_cstring(MP_NUMER_P(r), radix, str, &endp)) != MP_OK && + (res != MP_TRUNC)) + return res; + + /* This needs to be here. */ + (void) mp_int_set_value(MP_DENOM_P(r), 1); + + if (*endp != '.') { + if (end != NULL) + *end = endp; + return res; + } + + /* If the character following the decimal point is whitespace or a sign flag, + we will consider this a truncated value. This special case is because + mp_int_read_string() will consider whitespace or sign flags to be valid + starting characters for a value, and we do not want them following the + decimal point. + + Once we have done this check, it is safe to read in the value of the + fractional piece as a regular old integer. + */ + ++endp; + if (*endp == '\0') { + if (end != NULL) + *end = endp; + return MP_OK; + } + else if(isspace((unsigned char) *endp) || *endp == '-' || *endp == '+') { + return MP_TRUNC; + } + else { + mpz_t frac; + mp_result save_res; + char *save = endp; + int num_lz = 0; + + /* Make a temporary to hold the part after the decimal point. */ + if ((res = mp_int_init(&frac)) != MP_OK) + return res; + + if ((res = mp_int_read_cstring(&frac, radix, endp, &endp)) != MP_OK && + (res != MP_TRUNC)) + goto CLEANUP; + + /* Save this response for later. */ + save_res = res; + + if (mp_int_compare_zero(&frac) == 0) + goto FINISHED; + + /* Discard trailing zeroes (somewhat inefficiently) */ + while (mp_int_divisible_value(&frac, radix)) + if ((res = mp_int_div_value(&frac, radix, &frac, NULL)) != MP_OK) + goto CLEANUP; + + /* Count leading zeros after the decimal point */ + while (save[num_lz] == '0') + ++num_lz; + + /* Find the least power of the radix that is at least as large as the + significant value of the fractional part, ignoring leading zeroes. */ + (void) mp_int_set_value(MP_DENOM_P(r), radix); + + while (mp_int_compare(MP_DENOM_P(r), &frac) < 0) { + if ((res = mp_int_mul_value(MP_DENOM_P(r), radix, MP_DENOM_P(r))) != MP_OK) + goto CLEANUP; + } + + /* Also shift by enough to account for leading zeroes */ + while (num_lz > 0) { + if ((res = mp_int_mul_value(MP_DENOM_P(r), radix, MP_DENOM_P(r))) != MP_OK) + goto CLEANUP; + + --num_lz; + } + + /* Having found this power, shift the numerator leftward that many, digits, + and add the nonzero significant digits of the fractional part to get the + result. */ + if ((res = mp_int_mul(MP_NUMER_P(r), MP_DENOM_P(r), MP_NUMER_P(r))) != MP_OK) + goto CLEANUP; + + { /* This addition needs to be unsigned. */ + MP_SIGN(MP_NUMER_P(r)) = MP_ZPOS; + if ((res = mp_int_add(MP_NUMER_P(r), &frac, MP_NUMER_P(r))) != MP_OK) + goto CLEANUP; + + MP_SIGN(MP_NUMER_P(r)) = osign; + } + if ((res = s_rat_reduce(r)) != MP_OK) + goto CLEANUP; + + /* At this point, what we return depends on whether reading the fractional + part was truncated or not. That information is saved from when we + called mp_int_read_string() above. */ + FINISHED: + res = save_res; + if (end != NULL) + *end = endp; + + CLEANUP: + mp_int_clear(&frac); + + return res; + } +} + +/* Private functions for internal use. Make unchecked assumptions about format + and validity of inputs. */ + +static mp_result s_rat_reduce(mp_rat r) +{ + mpz_t gcd; + mp_result res = MP_OK; + + if (mp_int_compare_zero(MP_NUMER_P(r)) == 0) { + mp_int_set_value(MP_DENOM_P(r), 1); + return MP_OK; + } + + /* If the greatest common divisor of the numerator and denominator is greater + than 1, divide it out. */ + if ((res = mp_int_init(&gcd)) != MP_OK) + return res; + + if ((res = mp_int_gcd(MP_NUMER_P(r), MP_DENOM_P(r), &gcd)) != MP_OK) + goto CLEANUP; + + if (mp_int_compare_value(&gcd, 1) != 0) { + if ((res = mp_int_div(MP_NUMER_P(r), &gcd, MP_NUMER_P(r), NULL)) != MP_OK) + goto CLEANUP; + if ((res = mp_int_div(MP_DENOM_P(r), &gcd, MP_DENOM_P(r), NULL)) != MP_OK) + goto CLEANUP; + } + + /* Fix up the signs of numerator and denominator */ + if (MP_SIGN(MP_NUMER_P(r)) == MP_SIGN(MP_DENOM_P(r))) + MP_SIGN(MP_NUMER_P(r)) = MP_SIGN(MP_DENOM_P(r)) = MP_ZPOS; + else { + MP_SIGN(MP_NUMER_P(r)) = MP_NEG; + MP_SIGN(MP_DENOM_P(r)) = MP_ZPOS; + } + + CLEANUP: + mp_int_clear(&gcd); + + return res; +} + +static mp_result s_rat_combine(mp_rat a, mp_rat b, mp_rat c, + mp_result (*comb_f)(mp_int, mp_int, mp_int)) +{ + mp_result res; + + /* Shortcut when denominators are already common */ + if (mp_int_compare(MP_DENOM_P(a), MP_DENOM_P(b)) == 0) { + if ((res = (comb_f)(MP_NUMER_P(a), MP_NUMER_P(b), MP_NUMER_P(c))) != MP_OK) + return res; + if ((res = mp_int_copy(MP_DENOM_P(a), MP_DENOM_P(c))) != MP_OK) + return res; + + return s_rat_reduce(c); + } + else { + mpz_t temp[2]; + int last = 0; + + SETUP(mp_int_init_copy(TEMP(last), MP_NUMER_P(a)), last); + SETUP(mp_int_init_copy(TEMP(last), MP_NUMER_P(b)), last); + + if ((res = mp_int_mul(TEMP(0), MP_DENOM_P(b), TEMP(0))) != MP_OK) + goto CLEANUP; + if ((res = mp_int_mul(TEMP(1), MP_DENOM_P(a), TEMP(1))) != MP_OK) + goto CLEANUP; + if ((res = (comb_f)(TEMP(0), TEMP(1), MP_NUMER_P(c))) != MP_OK) + goto CLEANUP; + + res = mp_int_mul(MP_DENOM_P(a), MP_DENOM_P(b), MP_DENOM_P(c)); + + CLEANUP: + while (--last >= 0) + mp_int_clear(TEMP(last)); + + if (res == MP_OK) + return s_rat_reduce(c); + else + return res; + } +} + +/* Here there be dragons */ diff -Nru cloog-0.18.2/isl/imath/imrat.h cloog-0.18.4/isl/imath/imrat.h --- cloog-0.18.2/isl/imath/imrat.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/imath/imrat.h 2015-07-27 11:46:11.000000000 +0000 @@ -0,0 +1,124 @@ +/* + Name: imrat.h + Purpose: Arbitrary precision rational arithmetic routines. + Author: M. J. Fromberger + + Copyright (C) 2002-2007 Michael J. Fromberger, All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + */ + +#ifndef IMRAT_H_ +#define IMRAT_H_ + +#include "imath.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct mpq { + mpz_t num; /* Numerator */ + mpz_t den; /* Denominator, <> 0 */ +} mpq_t, *mp_rat; + +#define MP_NUMER_P(Q) (&((Q)->num)) /* Pointer to numerator */ +#define MP_DENOM_P(Q) (&((Q)->den)) /* Pointer to denominator */ + +/* Rounding constants */ +typedef enum { + MP_ROUND_DOWN, + MP_ROUND_HALF_UP, + MP_ROUND_UP, + MP_ROUND_HALF_DOWN +} mp_round_mode; + +mp_result mp_rat_init(mp_rat r); +mp_rat mp_rat_alloc(void); +mp_result mp_rat_reduce(mp_rat r); +mp_result mp_rat_init_size(mp_rat r, mp_size n_prec, mp_size d_prec); +mp_result mp_rat_init_copy(mp_rat r, mp_rat old); +mp_result mp_rat_set_value(mp_rat r, mp_small numer, mp_small denom); +mp_result mp_rat_set_uvalue(mp_rat r, mp_usmall numer, mp_usmall denom); +void mp_rat_clear(mp_rat r); +void mp_rat_free(mp_rat r); +mp_result mp_rat_numer(mp_rat r, mp_int z); /* z = num(r) */ +mp_int mp_rat_numer_ref(mp_rat r); /* &num(r) */ +mp_result mp_rat_denom(mp_rat r, mp_int z); /* z = den(r) */ +mp_int mp_rat_denom_ref(mp_rat r); /* &den(r) */ +mp_sign mp_rat_sign(mp_rat r); + +mp_result mp_rat_copy(mp_rat a, mp_rat c); /* c = a */ +void mp_rat_zero(mp_rat r); /* r = 0 */ +mp_result mp_rat_abs(mp_rat a, mp_rat c); /* c = |a| */ +mp_result mp_rat_neg(mp_rat a, mp_rat c); /* c = -a */ +mp_result mp_rat_recip(mp_rat a, mp_rat c); /* c = 1 / a */ +mp_result mp_rat_add(mp_rat a, mp_rat b, mp_rat c); /* c = a + b */ +mp_result mp_rat_sub(mp_rat a, mp_rat b, mp_rat c); /* c = a - b */ +mp_result mp_rat_mul(mp_rat a, mp_rat b, mp_rat c); /* c = a * b */ +mp_result mp_rat_div(mp_rat a, mp_rat b, mp_rat c); /* c = a / b */ + +mp_result mp_rat_add_int(mp_rat a, mp_int b, mp_rat c); /* c = a + b */ +mp_result mp_rat_sub_int(mp_rat a, mp_int b, mp_rat c); /* c = a - b */ +mp_result mp_rat_mul_int(mp_rat a, mp_int b, mp_rat c); /* c = a * b */ +mp_result mp_rat_div_int(mp_rat a, mp_int b, mp_rat c); /* c = a / b */ +mp_result mp_rat_expt(mp_rat a, mp_small b, mp_rat c); /* c = a ^ b */ + +int mp_rat_compare(mp_rat a, mp_rat b); /* a <=> b */ +int mp_rat_compare_unsigned(mp_rat a, mp_rat b); /* |a| <=> |b| */ +int mp_rat_compare_zero(mp_rat r); /* r <=> 0 */ +int mp_rat_compare_value(mp_rat r, mp_small n, mp_small d); /* r <=> n/d */ +int mp_rat_is_integer(mp_rat r); + +/* Convert to integers, if representable (returns MP_RANGE if not). */ +mp_result mp_rat_to_ints(mp_rat r, mp_small *num, mp_small *den); + +/* Convert to nul-terminated string with the specified radix, writing + at most limit characters including the nul terminator. */ +mp_result mp_rat_to_string(mp_rat r, mp_size radix, char *str, int limit); + +/* Convert to decimal format in the specified radix and precision, + writing at most limit characters including a nul terminator. */ +mp_result mp_rat_to_decimal(mp_rat r, mp_size radix, mp_size prec, + mp_round_mode round, char *str, int limit); + +/* Return the number of characters required to represent r in the given + radix. May over-estimate. */ +mp_result mp_rat_string_len(mp_rat r, mp_size radix); + +/* Return the number of characters required to represent r in decimal + format with the given radix and precision. May over-estimate. */ +mp_result mp_rat_decimal_len(mp_rat r, mp_size radix, mp_size prec); + +/* Read zero-terminated string into r */ +mp_result mp_rat_read_string(mp_rat r, mp_size radix, const char *str); +mp_result mp_rat_read_cstring(mp_rat r, mp_size radix, const char *str, + char **end); +mp_result mp_rat_read_ustring(mp_rat r, mp_size radix, const char *str, + char **end); + +/* Read zero-terminated string in decimal format into r */ +mp_result mp_rat_read_decimal(mp_rat r, mp_size radix, const char *str); +mp_result mp_rat_read_cdecimal(mp_rat r, mp_size radix, const char *str, + char **end); + +#ifdef __cplusplus +} +#endif +#endif /* IMRAT_H_ */ diff -Nru cloog-0.18.2/isl/imath_wrap/gmp_compat.c cloog-0.18.4/isl/imath_wrap/gmp_compat.c --- cloog-0.18.2/isl/imath_wrap/gmp_compat.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/imath_wrap/gmp_compat.c 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,2 @@ +#include "wrap.h" +#include "../imath/gmp_compat.c" diff -Nru cloog-0.18.2/isl/imath_wrap/gmp_compat.h cloog-0.18.4/isl/imath_wrap/gmp_compat.h --- cloog-0.18.2/isl/imath_wrap/gmp_compat.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/imath_wrap/gmp_compat.h 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,2 @@ +#include "wrap.h" +#include "../imath/gmp_compat.h" diff -Nru cloog-0.18.2/isl/imath_wrap/imath.c cloog-0.18.4/isl/imath_wrap/imath.c --- cloog-0.18.2/isl/imath_wrap/imath.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/imath_wrap/imath.c 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,2 @@ +#include "wrap.h" +#include "../imath/imath.c" diff -Nru cloog-0.18.2/isl/imath_wrap/imath.h cloog-0.18.4/isl/imath_wrap/imath.h --- cloog-0.18.2/isl/imath_wrap/imath.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/imath_wrap/imath.h 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,2 @@ +#include "wrap.h" +#include "../imath/imath.h" diff -Nru cloog-0.18.2/isl/imath_wrap/imrat.c cloog-0.18.4/isl/imath_wrap/imrat.c --- cloog-0.18.2/isl/imath_wrap/imrat.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/imath_wrap/imrat.c 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,2 @@ +#include "wrap.h" +#include "../imath/imrat.c" diff -Nru cloog-0.18.2/isl/imath_wrap/imrat.h cloog-0.18.4/isl/imath_wrap/imrat.h --- cloog-0.18.2/isl/imath_wrap/imrat.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/imath_wrap/imrat.h 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,2 @@ +#include "wrap.h" +#include "../imath/imrat.h" diff -Nru cloog-0.18.2/isl/imath_wrap/wrap.h cloog-0.18.4/isl/imath_wrap/wrap.h --- cloog-0.18.2/isl/imath_wrap/wrap.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/imath_wrap/wrap.h 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,172 @@ +#ifndef ISL_IMATH_WRAP +#define ISL_IMATH_WRAP + +#define MP_BADARG ISL_MP_BADARG +#define MP_FALSE ISL_MP_FALSE +#define MP_MEMORY ISL_MP_MEMORY +#define MP_MINERR ISL_MP_MINERR +#define MP_NEG ISL_MP_NEG +#define MP_OK ISL_MP_OK +#define MP_RANGE ISL_MP_RANGE +#define MP_TRUE ISL_MP_TRUE +#define MP_TRUNC ISL_MP_TRUNC +#define MP_UNDEF ISL_MP_UNDEF +#define MP_ZPOS ISL_MP_ZPOS + +#define impq_canonicalize isl_impq_canonicalize +#define impq_clear isl_impq_clear +#define impq_cmp isl_impq_cmp +#define impq_denref isl_impq_denref +#define impq_get_str isl_impq_get_str +#define impq_init isl_impq_init +#define impq_mul isl_impq_mul +#define impq_numref isl_impq_numref +#define impq_set isl_impq_set +#define impq_set_str isl_impq_set_str +#define impq_set_ui isl_impq_set_ui +#define impq_sgn isl_impq_sgn +#define impz_abs isl_impz_abs +#define impz_add isl_impz_add +#define impz_addmul isl_impz_addmul +#define impz_add_ui isl_impz_add_ui +#define impz_cdiv_q isl_impz_cdiv_q +#define impz_clear isl_impz_clear +#define impz_cmp isl_impz_cmp +#define impz_cmpabs isl_impz_cmpabs +#define impz_cmp_si isl_impz_cmp_si +#define impz_divexact isl_impz_divexact +#define impz_divexact_ui isl_impz_divexact_ui +#define impz_divisible_p isl_impz_divisible_p +#define impz_export isl_impz_export +#define impz_fdiv_q isl_impz_fdiv_q +#define impz_fdiv_q_ui isl_impz_fdiv_q_ui +#define impz_fdiv_r isl_impz_fdiv_r +#define impz_gcd isl_impz_gcd +#define impz_get_si isl_impz_get_si +#define impz_get_str isl_impz_get_str +#define impz_get_ui isl_impz_get_ui +#define impz_import isl_impz_import +#define impz_init isl_impz_init +#define impz_lcm isl_impz_lcm +#define impz_mul isl_impz_mul +#define impz_mul_2exp isl_impz_mul_2exp +#define impz_mul_ui isl_impz_mul_ui +#define impz_neg isl_impz_neg +#define impz_pow_ui isl_impz_pow_ui +#define impz_set isl_impz_set +#define impz_set_si isl_impz_set_si +#define impz_set_str isl_impz_set_str +#define impz_set_ui isl_impz_set_ui +#define impz_sgn isl_impz_sgn +#define impz_sizeinbase isl_impz_sizeinbase +#define impz_sub isl_impz_sub +#define impz_submul isl_impz_submul +#define impz_sub_ui isl_impz_sub_ui +#define impz_swap isl_impz_swap +#define impz_tdiv_q isl_impz_tdiv_q +#define mp_error_string isl_mp_error_string +#define mp_int_abs isl_mp_int_abs +#define mp_int_add isl_mp_int_add +#define mp_int_add_value isl_mp_int_add_value +#define mp_int_alloc isl_mp_int_alloc +#define mp_int_binary_len isl_mp_int_binary_len +#define mp_int_clear isl_mp_int_clear +#define mp_int_compare isl_mp_int_compare +#define mp_int_compare_unsigned isl_mp_int_compare_unsigned +#define mp_int_compare_uvalue isl_mp_int_compare_uvalue +#define mp_int_compare_value isl_mp_int_compare_value +#define mp_int_compare_zero isl_mp_int_compare_zero +#define mp_int_copy isl_mp_int_copy +#define mp_int_count_bits isl_mp_int_count_bits +#define mp_int_div isl_mp_int_div +#define mp_int_divisible_value isl_mp_int_divisible_value +#define mp_int_div_pow2 isl_mp_int_div_pow2 +#define mp_int_div_value isl_mp_int_div_value +#define mp_int_egcd isl_mp_int_egcd +#define mp_int_expt isl_mp_int_expt +#define mp_int_expt_full isl_mp_int_expt_full +#define mp_int_exptmod isl_mp_int_exptmod +#define mp_int_exptmod_bvalue isl_mp_int_exptmod_bvalue +#define mp_int_exptmod_evalue isl_mp_int_exptmod_evalue +#define mp_int_exptmod_known isl_mp_int_exptmod_known +#define mp_int_expt_value isl_mp_int_expt_value +#define mp_int_free isl_mp_int_free +#define mp_int_gcd isl_mp_int_gcd +#define mp_int_init isl_mp_int_init +#define mp_int_init_copy isl_mp_int_init_copy +#define mp_int_init_size isl_mp_int_init_size +#define mp_int_init_uvalue isl_mp_int_init_uvalue +#define mp_int_init_value isl_mp_int_init_value +#define mp_int_invmod isl_mp_int_invmod +#define mp_int_is_pow2 isl_mp_int_is_pow2 +#define mp_int_lcm isl_mp_int_lcm +#define mp_int_mod isl_mp_int_mod +#define mp_int_mul isl_mp_int_mul +#define mp_int_mul_pow2 isl_mp_int_mul_pow2 +#define mp_int_mul_value isl_mp_int_mul_value +#define mp_int_neg isl_mp_int_neg +#define mp_int_read_binary isl_mp_int_read_binary +#define mp_int_read_cstring isl_mp_int_read_cstring +#define mp_int_read_string isl_mp_int_read_string +#define mp_int_read_unsigned isl_mp_int_read_unsigned +#define mp_int_redux_const isl_mp_int_redux_const +#define mp_int_root isl_mp_int_root +#define mp_int_set_uvalue isl_mp_int_set_uvalue +#define mp_int_set_value isl_mp_int_set_value +#define mp_int_sqr isl_mp_int_sqr +#define mp_int_string_len isl_mp_int_string_len +#define mp_int_sub isl_mp_int_sub +#define mp_int_sub_value isl_mp_int_sub_value +#define mp_int_swap isl_mp_int_swap +#define mp_int_to_binary isl_mp_int_to_binary +#define mp_int_to_int isl_mp_int_to_int +#define mp_int_to_string isl_mp_int_to_string +#define mp_int_to_uint isl_mp_int_to_uint +#define mp_int_to_unsigned isl_mp_int_to_unsigned +#define mp_int_unsigned_len isl_mp_int_unsigned_len +#define mp_int_zero isl_mp_int_zero +#define mp_rat_abs isl_mp_rat_abs +#define mp_rat_add isl_mp_rat_add +#define mp_rat_add_int isl_mp_rat_add_int +#define mp_rat_alloc isl_mp_rat_alloc +#define mp_rat_clear isl_mp_rat_clear +#define mp_rat_compare isl_mp_rat_compare +#define mp_rat_compare_unsigned isl_mp_rat_compare_unsigned +#define mp_rat_compare_value isl_mp_rat_compare_value +#define mp_rat_compare_zero isl_mp_rat_compare_zero +#define mp_rat_copy isl_mp_rat_copy +#define mp_rat_decimal_len isl_mp_rat_decimal_len +#define mp_rat_denom isl_mp_rat_denom +#define mp_rat_denom_ref isl_mp_rat_denom_ref +#define mp_rat_div isl_mp_rat_div +#define mp_rat_div_int isl_mp_rat_div_int +#define mp_rat_expt isl_mp_rat_expt +#define mp_rat_free isl_mp_rat_free +#define mp_rat_init isl_mp_rat_init +#define mp_rat_init_copy isl_mp_rat_init_copy +#define mp_rat_init_size isl_mp_rat_init_size +#define mp_rat_is_integer isl_mp_rat_is_integer +#define mp_rat_mul isl_mp_rat_mul +#define mp_rat_mul_int isl_mp_rat_mul_int +#define mp_rat_neg isl_mp_rat_neg +#define mp_rat_numer isl_mp_rat_numer +#define mp_rat_numer_ref isl_mp_rat_numer_ref +#define mp_rat_read_cdecimal isl_mp_rat_read_cdecimal +#define mp_rat_read_cstring isl_mp_rat_read_cstring +#define mp_rat_read_decimal isl_mp_rat_read_decimal +#define mp_rat_read_string isl_mp_rat_read_string +#define mp_rat_read_ustring isl_mp_rat_read_ustring +#define mp_rat_recip isl_mp_rat_recip +#define mp_rat_reduce isl_mp_rat_reduce +#define mp_rat_set_uvalue isl_mp_rat_set_uvalue +#define mp_rat_set_value isl_mp_rat_set_value +#define mp_rat_sign isl_mp_rat_sign +#define mp_rat_string_len isl_mp_rat_string_len +#define mp_rat_sub isl_mp_rat_sub +#define mp_rat_sub_int isl_mp_rat_sub_int +#define mp_rat_to_decimal isl_mp_rat_to_decimal +#define mp_rat_to_ints isl_mp_rat_to_ints +#define mp_rat_to_string isl_mp_rat_to_string +#define mp_rat_zero isl_mp_rat_zero + +#endif diff -Nru cloog-0.18.2/isl/include/isl/aff.h cloog-0.18.4/isl/include/isl/aff.h --- cloog-0.18.2/isl/include/isl/aff.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/aff.h 2015-07-24 12:23:09.000000000 +0000 @@ -15,16 +15,19 @@ #endif __isl_give isl_aff *isl_aff_zero_on_domain(__isl_take isl_local_space *ls); +__isl_give isl_aff *isl_aff_val_on_domain(__isl_take isl_local_space *ls, + __isl_take isl_val *val); __isl_give isl_aff *isl_aff_var_on_domain(__isl_take isl_local_space *ls, enum isl_dim_type type, unsigned pos); +__isl_give isl_aff *isl_aff_nan_on_domain(__isl_take isl_local_space *ls); __isl_give isl_aff *isl_aff_copy(__isl_keep isl_aff *aff); -void *isl_aff_free(__isl_take isl_aff *aff); +__isl_null isl_aff *isl_aff_free(__isl_take isl_aff *aff); isl_ctx *isl_aff_get_ctx(__isl_keep isl_aff *aff); int isl_aff_dim(__isl_keep isl_aff *aff, enum isl_dim_type type); -int isl_aff_involves_dims(__isl_keep isl_aff *aff, +isl_bool isl_aff_involves_dims(__isl_keep isl_aff *aff, enum isl_dim_type type, unsigned first, unsigned n); __isl_give isl_space *isl_aff_get_domain_space(__isl_keep isl_aff *aff); @@ -35,55 +38,50 @@ const char *isl_aff_get_dim_name(__isl_keep isl_aff *aff, enum isl_dim_type type, unsigned pos); -int isl_aff_get_constant(__isl_keep isl_aff *aff, isl_int *v); __isl_give isl_val *isl_aff_get_constant_val(__isl_keep isl_aff *aff); -int isl_aff_get_coefficient(__isl_keep isl_aff *aff, - enum isl_dim_type type, int pos, isl_int *v); __isl_give isl_val *isl_aff_get_coefficient_val(__isl_keep isl_aff *aff, enum isl_dim_type type, int pos); -int isl_aff_get_denominator(__isl_keep isl_aff *aff, isl_int *v); +int isl_aff_coefficient_sgn(__isl_keep isl_aff *aff, + enum isl_dim_type type, int pos); __isl_give isl_val *isl_aff_get_denominator_val(__isl_keep isl_aff *aff); -__isl_give isl_aff *isl_aff_set_constant(__isl_take isl_aff *aff, isl_int v); __isl_give isl_aff *isl_aff_set_constant_si(__isl_take isl_aff *aff, int v); __isl_give isl_aff *isl_aff_set_constant_val(__isl_take isl_aff *aff, __isl_take isl_val *v); -__isl_give isl_aff *isl_aff_set_coefficient(__isl_take isl_aff *aff, - enum isl_dim_type type, int pos, isl_int v); __isl_give isl_aff *isl_aff_set_coefficient_si(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, int v); __isl_give isl_aff *isl_aff_set_coefficient_val(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, __isl_take isl_val *v); -__isl_give isl_aff *isl_aff_set_denominator(__isl_take isl_aff *aff, isl_int v); -__isl_give isl_aff *isl_aff_add_constant(__isl_take isl_aff *aff, isl_int v); __isl_give isl_aff *isl_aff_add_constant_si(__isl_take isl_aff *aff, int v); __isl_give isl_aff *isl_aff_add_constant_val(__isl_take isl_aff *aff, __isl_take isl_val *v); -__isl_give isl_aff *isl_aff_add_constant_num(__isl_take isl_aff *aff, - isl_int v); __isl_give isl_aff *isl_aff_add_constant_num_si(__isl_take isl_aff *aff, int v); -__isl_give isl_aff *isl_aff_add_coefficient(__isl_take isl_aff *aff, - enum isl_dim_type type, int pos, isl_int v); __isl_give isl_aff *isl_aff_add_coefficient_si(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, int v); __isl_give isl_aff *isl_aff_add_coefficient_val(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, __isl_take isl_val *v); -int isl_aff_is_cst(__isl_keep isl_aff *aff); +isl_bool isl_aff_is_cst(__isl_keep isl_aff *aff); +__isl_give isl_aff *isl_aff_set_tuple_id(__isl_take isl_aff *aff, + enum isl_dim_type type, __isl_take isl_id *id); __isl_give isl_aff *isl_aff_set_dim_name(__isl_take isl_aff *aff, enum isl_dim_type type, unsigned pos, const char *s); __isl_give isl_aff *isl_aff_set_dim_id(__isl_take isl_aff *aff, enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); -int isl_aff_plain_is_equal(__isl_keep isl_aff *aff1, __isl_keep isl_aff *aff2); -int isl_aff_plain_is_zero(__isl_keep isl_aff *aff); +int isl_aff_find_dim_by_name(__isl_keep isl_aff *aff, enum isl_dim_type type, + const char *name); + +isl_bool isl_aff_plain_is_equal(__isl_keep isl_aff *aff1, + __isl_keep isl_aff *aff2); +isl_bool isl_aff_plain_is_zero(__isl_keep isl_aff *aff); +isl_bool isl_aff_is_nan(__isl_keep isl_aff *aff); __isl_give isl_aff *isl_aff_get_div(__isl_keep isl_aff *aff, int pos); __isl_give isl_aff *isl_aff_neg(__isl_take isl_aff *aff); __isl_give isl_aff *isl_aff_ceil(__isl_take isl_aff *aff); __isl_give isl_aff *isl_aff_floor(__isl_take isl_aff *aff); -__isl_give isl_aff *isl_aff_mod(__isl_take isl_aff *aff, isl_int mod); __isl_give isl_aff *isl_aff_mod_val(__isl_take isl_aff *aff, __isl_take isl_val *mod); @@ -96,10 +94,8 @@ __isl_give isl_aff *isl_aff_sub(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2); -__isl_give isl_aff *isl_aff_scale(__isl_take isl_aff *aff, isl_int f); __isl_give isl_aff *isl_aff_scale_val(__isl_take isl_aff *aff, __isl_take isl_val *v); -__isl_give isl_aff *isl_aff_scale_down(__isl_take isl_aff *aff, isl_int f); __isl_give isl_aff *isl_aff_scale_down_ui(__isl_take isl_aff *aff, unsigned f); __isl_give isl_aff *isl_aff_scale_down_val(__isl_take isl_aff *aff, __isl_take isl_val *v); @@ -108,6 +104,9 @@ enum isl_dim_type type, unsigned first, unsigned n); __isl_give isl_aff *isl_aff_add_dims(__isl_take isl_aff *aff, enum isl_dim_type type, unsigned n); +__isl_give isl_aff *isl_aff_move_dims(__isl_take isl_aff *aff, + enum isl_dim_type dst_type, unsigned dst_pos, + enum isl_dim_type src_type, unsigned src_pos, unsigned n); __isl_give isl_aff *isl_aff_drop_dims(__isl_take isl_aff *aff, enum isl_dim_type type, unsigned first, unsigned n); __isl_give isl_aff *isl_aff_project_domain_on_params(__isl_take isl_aff *aff); @@ -120,6 +119,8 @@ __isl_give isl_aff *isl_aff_gist_params(__isl_take isl_aff *aff, __isl_take isl_set *context); +__isl_give isl_aff *isl_aff_pullback_aff(__isl_take isl_aff *aff1, + __isl_take isl_aff *aff2); __isl_give isl_aff *isl_aff_pullback_multi_aff(__isl_take isl_aff *aff, __isl_take isl_multi_aff *ma); @@ -148,21 +149,31 @@ __isl_take isl_local_space *ls); __isl_give isl_pw_aff *isl_pw_aff_var_on_domain(__isl_take isl_local_space *ls, enum isl_dim_type type, unsigned pos); +__isl_give isl_pw_aff *isl_pw_aff_nan_on_domain(__isl_take isl_local_space *ls); +__isl_give isl_pw_aff *isl_pw_aff_val_on_domain(__isl_take isl_set *domain, + __isl_take isl_val *v); __isl_give isl_pw_aff *isl_set_indicator_function(__isl_take isl_set *set); const char *isl_pw_aff_get_dim_name(__isl_keep isl_pw_aff *pa, enum isl_dim_type type, unsigned pos); -int isl_pw_aff_has_dim_id(__isl_keep isl_pw_aff *pa, +isl_bool isl_pw_aff_has_dim_id(__isl_keep isl_pw_aff *pa, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_pw_aff_get_dim_id(__isl_keep isl_pw_aff *pa, enum isl_dim_type type, unsigned pos); __isl_give isl_pw_aff *isl_pw_aff_set_dim_id(__isl_take isl_pw_aff *pma, enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); -int isl_pw_aff_is_empty(__isl_keep isl_pw_aff *pwaff); -int isl_pw_aff_plain_is_equal(__isl_keep isl_pw_aff *pwaff1, +int isl_pw_aff_find_dim_by_name(__isl_keep isl_pw_aff *pa, + enum isl_dim_type type, const char *name); + +isl_bool isl_pw_aff_is_empty(__isl_keep isl_pw_aff *pwaff); +isl_bool isl_pw_aff_involves_nan(__isl_keep isl_pw_aff *pa); +int isl_pw_aff_plain_cmp(__isl_keep isl_pw_aff *pa1, + __isl_keep isl_pw_aff *pa2); +isl_bool isl_pw_aff_plain_is_equal(__isl_keep isl_pw_aff *pwaff1, __isl_keep isl_pw_aff *pwaff2); +int isl_pw_aff_is_equal(__isl_keep isl_pw_aff *pa1, __isl_keep isl_pw_aff *pa2); __isl_give isl_pw_aff *isl_pw_aff_union_min(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2); @@ -172,23 +183,30 @@ __isl_take isl_pw_aff *pwaff2); __isl_give isl_pw_aff *isl_pw_aff_copy(__isl_keep isl_pw_aff *pwaff); -void *isl_pw_aff_free(__isl_take isl_pw_aff *pwaff); +__isl_null isl_pw_aff *isl_pw_aff_free(__isl_take isl_pw_aff *pwaff); unsigned isl_pw_aff_dim(__isl_keep isl_pw_aff *pwaff, enum isl_dim_type type); -int isl_pw_aff_involves_dims(__isl_keep isl_pw_aff *pwaff, +isl_bool isl_pw_aff_involves_dims(__isl_keep isl_pw_aff *pwaff, enum isl_dim_type type, unsigned first, unsigned n); -int isl_pw_aff_is_cst(__isl_keep isl_pw_aff *pwaff); +isl_bool isl_pw_aff_is_cst(__isl_keep isl_pw_aff *pwaff); __isl_give isl_pw_aff *isl_pw_aff_align_params(__isl_take isl_pw_aff *pwaff, __isl_take isl_space *model); +isl_bool isl_pw_aff_has_tuple_id(__isl_keep isl_pw_aff *pa, + enum isl_dim_type type); __isl_give isl_id *isl_pw_aff_get_tuple_id(__isl_keep isl_pw_aff *pa, enum isl_dim_type type); __isl_give isl_pw_aff *isl_pw_aff_set_tuple_id(__isl_take isl_pw_aff *pwaff, enum isl_dim_type type, __isl_take isl_id *id); +__isl_give isl_pw_aff *isl_pw_aff_reset_tuple_id(__isl_take isl_pw_aff *pa, + enum isl_dim_type type); +__isl_give isl_pw_aff *isl_pw_aff_reset_user(__isl_take isl_pw_aff *pa); +__isl_give isl_set *isl_pw_aff_params(__isl_take isl_pw_aff *pwa); __isl_give isl_set *isl_pw_aff_domain(__isl_take isl_pw_aff *pwaff); +__isl_give isl_pw_aff *isl_pw_aff_from_range(__isl_take isl_pw_aff *pwa); __isl_give isl_pw_aff *isl_pw_aff_min(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2); @@ -205,8 +223,6 @@ __isl_give isl_pw_aff *isl_pw_aff_neg(__isl_take isl_pw_aff *pwaff); __isl_give isl_pw_aff *isl_pw_aff_ceil(__isl_take isl_pw_aff *pwaff); __isl_give isl_pw_aff *isl_pw_aff_floor(__isl_take isl_pw_aff *pwaff); -__isl_give isl_pw_aff *isl_pw_aff_mod(__isl_take isl_pw_aff *pwaff, - isl_int mod); __isl_give isl_pw_aff *isl_pw_aff_mod_val(__isl_take isl_pw_aff *pa, __isl_take isl_val *mod); __isl_give isl_pw_aff *isl_pw_aff_tdiv_q(__isl_take isl_pw_aff *pa1, @@ -218,16 +234,14 @@ __isl_take isl_set *set); __isl_give isl_pw_aff *isl_pw_aff_intersect_domain(__isl_take isl_pw_aff *pa, __isl_take isl_set *set); +__isl_give isl_pw_aff *isl_pw_aff_subtract_domain(__isl_take isl_pw_aff *pa, + __isl_take isl_set *set); __isl_give isl_pw_aff *isl_pw_aff_cond(__isl_take isl_pw_aff *cond, __isl_take isl_pw_aff *pwaff_true, __isl_take isl_pw_aff *pwaff_false); -__isl_give isl_pw_aff *isl_pw_aff_scale(__isl_take isl_pw_aff *pwaff, - isl_int f); __isl_give isl_pw_aff *isl_pw_aff_scale_val(__isl_take isl_pw_aff *pa, __isl_take isl_val *v); -__isl_give isl_pw_aff *isl_pw_aff_scale_down(__isl_take isl_pw_aff *pwaff, - isl_int f); __isl_give isl_pw_aff *isl_pw_aff_scale_down_val(__isl_take isl_pw_aff *pa, __isl_take isl_val *f); @@ -235,6 +249,9 @@ enum isl_dim_type type, unsigned first, unsigned n); __isl_give isl_pw_aff *isl_pw_aff_add_dims(__isl_take isl_pw_aff *pwaff, enum isl_dim_type type, unsigned n); +__isl_give isl_pw_aff *isl_pw_aff_move_dims(__isl_take isl_pw_aff *pa, + enum isl_dim_type dst_type, unsigned dst_pos, + enum isl_dim_type src_type, unsigned src_pos, unsigned n); __isl_give isl_pw_aff *isl_pw_aff_drop_dims(__isl_take isl_pw_aff *pwaff, enum isl_dim_type type, unsigned first, unsigned n); @@ -248,15 +265,18 @@ __isl_take isl_pw_aff *pa, __isl_take isl_multi_aff *ma); __isl_give isl_pw_aff *isl_pw_aff_pullback_pw_multi_aff( __isl_take isl_pw_aff *pa, __isl_take isl_pw_multi_aff *pma); +__isl_give isl_pw_aff *isl_pw_aff_pullback_multi_pw_aff( + __isl_take isl_pw_aff *pa, __isl_take isl_multi_pw_aff *mpa); int isl_pw_aff_n_piece(__isl_keep isl_pw_aff *pwaff); -int isl_pw_aff_foreach_piece(__isl_keep isl_pw_aff *pwaff, - int (*fn)(__isl_take isl_set *set, __isl_take isl_aff *aff, +isl_stat isl_pw_aff_foreach_piece(__isl_keep isl_pw_aff *pwaff, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_aff *aff, void *user), void *user); __isl_give isl_set *isl_set_from_pw_aff(__isl_take isl_pw_aff *pwaff); __isl_give isl_map *isl_map_from_pw_aff(__isl_take isl_pw_aff *pwaff); +__isl_give isl_set *isl_pw_aff_pos_set(__isl_take isl_pw_aff *pa); __isl_give isl_set *isl_pw_aff_nonneg_set(__isl_take isl_pw_aff *pwaff); __isl_give isl_set *isl_pw_aff_zero_set(__isl_take isl_pw_aff *pwaff); __isl_give isl_set *isl_pw_aff_non_zero_set(__isl_take isl_pw_aff *pwaff); @@ -274,6 +294,13 @@ __isl_give isl_set *isl_pw_aff_gt_set(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2); +__isl_give isl_map *isl_pw_aff_eq_map(__isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2); +__isl_give isl_map *isl_pw_aff_lt_map(__isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2); +__isl_give isl_map *isl_pw_aff_gt_map(__isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2); + __isl_give isl_pw_aff *isl_pw_aff_read_from_str(isl_ctx *ctx, const char *str); __isl_give isl_printer *isl_printer_print_pw_aff(__isl_take isl_printer *p, __isl_keep isl_pw_aff *pwaff); @@ -296,20 +323,25 @@ __isl_take isl_pw_aff_list *list2); ISL_DECLARE_MULTI(aff) +ISL_DECLARE_MULTI_NEG(aff) +ISL_DECLARE_MULTI_DIMS(aff) +ISL_DECLARE_MULTI_WITH_DOMAIN(aff) __isl_give isl_multi_aff *isl_multi_aff_from_aff(__isl_take isl_aff *aff); __isl_give isl_multi_aff *isl_multi_aff_identity(__isl_take isl_space *space); +__isl_give isl_multi_aff *isl_multi_aff_domain_map(__isl_take isl_space *space); +__isl_give isl_multi_aff *isl_multi_aff_range_map(__isl_take isl_space *space); +__isl_give isl_multi_aff *isl_multi_aff_project_out_map( + __isl_take isl_space *space, enum isl_dim_type type, + unsigned first, unsigned n); -int isl_multi_aff_plain_is_equal(__isl_keep isl_multi_aff *maff1, - __isl_keep isl_multi_aff *maff2); +__isl_give isl_multi_aff *isl_multi_aff_multi_val_on_space( + __isl_take isl_space *space, __isl_take isl_multi_val *mv); + +__isl_give isl_multi_aff *isl_multi_aff_floor(__isl_take isl_multi_aff *ma); __isl_give isl_multi_aff *isl_multi_aff_add(__isl_take isl_multi_aff *maff1, __isl_take isl_multi_aff *maff2); -__isl_give isl_multi_aff *isl_multi_aff_sub(__isl_take isl_multi_aff *ma1, - __isl_take isl_multi_aff *ma2); - -__isl_give isl_multi_aff *isl_multi_aff_scale(__isl_take isl_multi_aff *maff, - isl_int f); __isl_give isl_multi_aff *isl_multi_aff_product( __isl_take isl_multi_aff *ma1, __isl_take isl_multi_aff *ma2); @@ -325,11 +357,16 @@ __isl_give isl_multi_aff *isl_multi_aff_pullback_multi_aff( __isl_take isl_multi_aff *ma1, __isl_take isl_multi_aff *ma2); +__isl_give isl_multi_aff *isl_multi_aff_move_dims(__isl_take isl_multi_aff *ma, + enum isl_dim_type dst_type, unsigned dst_pos, + enum isl_dim_type src_type, unsigned src_pos, unsigned n); + __isl_give isl_set *isl_multi_aff_lex_le_set(__isl_take isl_multi_aff *ma1, __isl_take isl_multi_aff *ma2); __isl_give isl_set *isl_multi_aff_lex_ge_set(__isl_take isl_multi_aff *ma1, __isl_take isl_multi_aff *ma2); +__isl_give char *isl_multi_aff_to_str(__isl_keep isl_multi_aff *aff); __isl_give isl_printer *isl_printer_print_multi_aff(__isl_take isl_printer *p, __isl_keep isl_multi_aff *maff); @@ -338,16 +375,28 @@ void isl_multi_aff_dump(__isl_keep isl_multi_aff *maff); ISL_DECLARE_MULTI(pw_aff) +ISL_DECLARE_MULTI_NEG(pw_aff) +ISL_DECLARE_MULTI_DIMS(pw_aff) +ISL_DECLARE_MULTI_WITH_DOMAIN(pw_aff) +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_zero(__isl_take isl_space *space); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_identity( __isl_take isl_space *space); +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_range_map( + __isl_take isl_space *space); +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_project_out_map( + __isl_take isl_space *space, enum isl_dim_type type, + unsigned first, unsigned n); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_multi_aff( __isl_take isl_multi_aff *ma); +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_pw_aff( + __isl_take isl_pw_aff *pa); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_alloc(__isl_take isl_set *set, __isl_take isl_multi_aff *maff); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_copy( __isl_keep isl_pw_multi_aff *pma); -void *isl_pw_multi_aff_free(__isl_take isl_pw_multi_aff *pma); +__isl_null isl_pw_multi_aff *isl_pw_multi_aff_free( + __isl_take isl_pw_multi_aff *pma); unsigned isl_pw_multi_aff_dim(__isl_keep isl_pw_multi_aff *pma, enum isl_dim_type type); @@ -362,17 +411,24 @@ __isl_keep isl_pw_multi_aff *pma); __isl_give isl_space *isl_pw_multi_aff_get_space( __isl_keep isl_pw_multi_aff *pma); -int isl_pw_multi_aff_has_tuple_name(__isl_keep isl_pw_multi_aff *pma, +isl_bool isl_pw_multi_aff_has_tuple_name(__isl_keep isl_pw_multi_aff *pma, enum isl_dim_type type); const char *isl_pw_multi_aff_get_tuple_name(__isl_keep isl_pw_multi_aff *pma, enum isl_dim_type type); __isl_give isl_id *isl_pw_multi_aff_get_tuple_id( __isl_keep isl_pw_multi_aff *pma, enum isl_dim_type type); -int isl_pw_multi_aff_has_tuple_id(__isl_keep isl_pw_multi_aff *pma, +isl_bool isl_pw_multi_aff_has_tuple_id(__isl_keep isl_pw_multi_aff *pma, enum isl_dim_type type); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_set_tuple_id( __isl_take isl_pw_multi_aff *pma, enum isl_dim_type type, __isl_take isl_id *id); +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_reset_tuple_id( + __isl_take isl_pw_multi_aff *pma, enum isl_dim_type type); +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_reset_user( + __isl_take isl_pw_multi_aff *pma); + +int isl_pw_multi_aff_find_dim_by_name(__isl_keep isl_pw_multi_aff *pma, + enum isl_dim_type type, const char *name); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_drop_dims( __isl_take isl_pw_multi_aff *pma, @@ -384,6 +440,9 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_domain( __isl_take isl_set *set); +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_multi_val_on_domain( + __isl_take isl_set *domain, __isl_take isl_multi_val *mv); + const char *isl_pw_multi_aff_get_dim_name(__isl_keep isl_pw_multi_aff *pma, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_pw_multi_aff_get_dim_id( @@ -393,12 +452,19 @@ __isl_take isl_pw_multi_aff *pma, enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); -int isl_pw_multi_aff_plain_is_equal(__isl_keep isl_pw_multi_aff *pma1, +isl_bool isl_pw_multi_aff_plain_is_equal(__isl_keep isl_pw_multi_aff *pma1, __isl_keep isl_pw_multi_aff *pma2); +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_fix_si( + __isl_take isl_pw_multi_aff *pma, enum isl_dim_type type, + unsigned pos, int value); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_union_add( __isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2); +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_neg( + __isl_take isl_pw_multi_aff *pma); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_add( __isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_sub( @@ -406,6 +472,8 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_val( __isl_take isl_pw_multi_aff *pma, __isl_take isl_val *v); +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_down_val( + __isl_take isl_pw_multi_aff *pma, __isl_take isl_val *v); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_multi_val( __isl_take isl_pw_multi_aff *pma, __isl_take isl_multi_val *mv); @@ -416,6 +484,9 @@ __isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2); +__isl_give isl_multi_aff *isl_multi_aff_flatten_domain( + __isl_take isl_multi_aff *ma); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_range_product( __isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_flat_range_product( @@ -427,6 +498,8 @@ __isl_take isl_pw_multi_aff *pma, __isl_take isl_set *set); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_domain( __isl_take isl_pw_multi_aff *pma, __isl_take isl_set *set); +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_subtract_domain( + __isl_take isl_pw_multi_aff *pma, __isl_take isl_set *set); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_project_domain_on_params( __isl_take isl_pw_multi_aff *pma); @@ -446,8 +519,8 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_pullback_pw_multi_aff( __isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2); -int isl_pw_multi_aff_foreach_piece(__isl_keep isl_pw_multi_aff *pma, - int (*fn)(__isl_take isl_set *set, __isl_take isl_multi_aff *maff, +isl_stat isl_pw_multi_aff_foreach_piece(__isl_keep isl_pw_multi_aff *pma, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_multi_aff *maff, void *user), void *user); __isl_give isl_map *isl_map_from_pw_multi_aff(__isl_take isl_pw_multi_aff *pma); @@ -466,11 +539,24 @@ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_empty( __isl_take isl_space *space); +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_from_aff( + __isl_take isl_aff *aff); +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_from_pw_multi_aff( + __isl_take isl_pw_multi_aff *pma); __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_from_domain( __isl_take isl_union_set *uset); +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_multi_val_on_domain( + __isl_take isl_union_set *domain, __isl_take isl_multi_val *mv); __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_copy( __isl_keep isl_union_pw_multi_aff *upma); -void *isl_union_pw_multi_aff_free(__isl_take isl_union_pw_multi_aff *upma); +__isl_null isl_union_pw_multi_aff *isl_union_pw_multi_aff_free( + __isl_take isl_union_pw_multi_aff *upma); + +__isl_give isl_union_pw_multi_aff *isl_union_set_identity_union_pw_multi_aff( + __isl_take isl_union_set *uset); + +__isl_give isl_union_pw_aff *isl_union_pw_multi_aff_get_union_pw_aff( + __isl_keep isl_union_pw_multi_aff *upma, int pos); __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_add_pw_multi_aff( __isl_take isl_union_pw_multi_aff *upma, @@ -481,20 +567,72 @@ __isl_give isl_space *isl_union_pw_multi_aff_get_space( __isl_keep isl_union_pw_multi_aff *upma); -int isl_union_pw_multi_aff_foreach_pw_multi_aff( +unsigned isl_union_pw_multi_aff_dim(__isl_keep isl_union_pw_multi_aff *upma, + enum isl_dim_type type); +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_set_dim_name( + __isl_take isl_union_pw_multi_aff *upma, + enum isl_dim_type type, unsigned pos, const char *s); + +int isl_union_pw_multi_aff_find_dim_by_name( + __isl_keep isl_union_pw_multi_aff *upma, enum isl_dim_type type, + const char *name); + +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_drop_dims( + __isl_take isl_union_pw_multi_aff *upma, + enum isl_dim_type type, unsigned first, unsigned n); +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_reset_user( + __isl_take isl_union_pw_multi_aff *upma); + +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_coalesce( + __isl_take isl_union_pw_multi_aff *upma); +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_gist_params( + __isl_take isl_union_pw_multi_aff *upma, __isl_take isl_set *context); +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_gist( + __isl_take isl_union_pw_multi_aff *upma, + __isl_take isl_union_set *context); + +__isl_give isl_union_pw_multi_aff * +isl_union_pw_multi_aff_pullback_union_pw_multi_aff( + __isl_take isl_union_pw_multi_aff *upma1, + __isl_take isl_union_pw_multi_aff *upma2); + +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_align_params( + __isl_take isl_union_pw_multi_aff *upma, __isl_take isl_space *model); + +int isl_union_pw_multi_aff_n_pw_multi_aff( + __isl_keep isl_union_pw_multi_aff *upma); + +isl_stat isl_union_pw_multi_aff_foreach_pw_multi_aff( __isl_keep isl_union_pw_multi_aff *upma, - int (*fn)(__isl_take isl_pw_multi_aff *pma, void *user), void *user); + isl_stat (*fn)(__isl_take isl_pw_multi_aff *pma, void *user), + void *user); +__isl_give isl_pw_multi_aff *isl_union_pw_multi_aff_extract_pw_multi_aff( + __isl_keep isl_union_pw_multi_aff *upma, __isl_take isl_space *space); + +isl_bool isl_union_pw_multi_aff_plain_is_equal( + __isl_keep isl_union_pw_multi_aff *upma1, + __isl_keep isl_union_pw_multi_aff *upma2); __isl_give isl_union_set *isl_union_pw_multi_aff_domain( __isl_take isl_union_pw_multi_aff *upma); +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_neg( + __isl_take isl_union_pw_multi_aff *upma); + __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_add( __isl_take isl_union_pw_multi_aff *upma1, __isl_take isl_union_pw_multi_aff *upma2); +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_union_add( + __isl_take isl_union_pw_multi_aff *upma1, + __isl_take isl_union_pw_multi_aff *upma2); __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_sub( __isl_take isl_union_pw_multi_aff *upma1, __isl_take isl_union_pw_multi_aff *upma2); +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_scale_val( + __isl_take isl_union_pw_multi_aff *upma, __isl_take isl_val *val); +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_scale_down_val( + __isl_take isl_union_pw_multi_aff *upma, __isl_take isl_val *val); __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_scale_multi_val( __isl_take isl_union_pw_multi_aff *upma, __isl_take isl_multi_val *mv); @@ -502,9 +640,14 @@ __isl_take isl_union_pw_multi_aff *upma1, __isl_take isl_union_pw_multi_aff *upma2); +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_intersect_params( + __isl_take isl_union_pw_multi_aff *upma, __isl_take isl_set *set); __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_intersect_domain( __isl_take isl_union_pw_multi_aff *upma, __isl_take isl_union_set *uset); +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_subtract_domain( + __isl_take isl_union_pw_multi_aff *upma, + __isl_take isl_union_set *uset); __isl_give isl_union_map *isl_union_map_from_union_pw_multi_aff( __isl_take isl_union_pw_multi_aff *upma); @@ -525,17 +668,249 @@ __isl_give isl_multi_pw_aff *isl_multi_pw_aff_identity( __isl_take isl_space *space); +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_from_multi_aff( + __isl_take isl_multi_aff *ma); __isl_give isl_multi_pw_aff *isl_multi_pw_aff_from_pw_aff( __isl_take isl_pw_aff *pa); +__isl_give isl_set *isl_multi_pw_aff_domain(__isl_take isl_multi_pw_aff *mpa); +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_intersect_params( + __isl_take isl_multi_pw_aff *mpa, __isl_take isl_set *set); +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_intersect_domain( + __isl_take isl_multi_pw_aff *mpa, __isl_take isl_set *domain); + +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_coalesce( + __isl_take isl_multi_pw_aff *mpa); +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_gist( + __isl_take isl_multi_pw_aff *mpa, __isl_take isl_set *set); +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_gist_params( + __isl_take isl_multi_pw_aff *mpa, __isl_take isl_set *set); + +isl_bool isl_multi_pw_aff_is_equal(__isl_keep isl_multi_pw_aff *mpa1, + __isl_keep isl_multi_pw_aff *mpa2); + +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_pullback_multi_aff( + __isl_take isl_multi_pw_aff *mpa, __isl_take isl_multi_aff *ma); +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_pullback_pw_multi_aff( + __isl_take isl_multi_pw_aff *mpa, __isl_take isl_pw_multi_aff *pma); +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_pullback_multi_pw_aff( + __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2); + +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_move_dims( + __isl_take isl_multi_pw_aff *pma, + enum isl_dim_type dst_type, unsigned dst_pos, + enum isl_dim_type src_type, unsigned src_pos, unsigned n); + +__isl_give isl_set *isl_set_from_multi_pw_aff(__isl_take isl_multi_pw_aff *mpa); +__isl_give isl_map *isl_map_from_multi_pw_aff(__isl_take isl_multi_pw_aff *mpa); +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_multi_pw_aff( + __isl_take isl_multi_pw_aff *mpa); +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_from_pw_multi_aff( + __isl_take isl_pw_multi_aff *pma); + +__isl_give isl_map *isl_multi_pw_aff_eq_map(__isl_take isl_multi_pw_aff *mpa1, + __isl_take isl_multi_pw_aff *mpa2); +__isl_give isl_map *isl_multi_pw_aff_lex_lt_map( + __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2); +__isl_give isl_map *isl_multi_pw_aff_lex_gt_map( + __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2); +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_read_from_str(isl_ctx *ctx, + const char *str); __isl_give isl_printer *isl_printer_print_multi_pw_aff( __isl_take isl_printer *p, __isl_keep isl_multi_pw_aff *mpa); void isl_multi_pw_aff_dump(__isl_keep isl_multi_pw_aff *mpa); +__isl_give isl_union_pw_aff *isl_union_pw_aff_copy( + __isl_keep isl_union_pw_aff *upa); +__isl_null isl_union_pw_aff *isl_union_pw_aff_free( + __isl_take isl_union_pw_aff *upa); + +isl_ctx *isl_union_pw_aff_get_ctx(__isl_keep isl_union_pw_aff *upa); +__isl_give isl_space *isl_union_pw_aff_get_space( + __isl_keep isl_union_pw_aff *upa); + +unsigned isl_union_pw_aff_dim(__isl_keep isl_union_pw_aff *upa, + enum isl_dim_type type); +__isl_give isl_union_pw_aff *isl_union_pw_aff_set_dim_name( + __isl_take isl_union_pw_aff *upa, enum isl_dim_type type, + unsigned pos, const char *s); + +int isl_union_pw_aff_find_dim_by_name(__isl_keep isl_union_pw_aff *upa, + enum isl_dim_type type, const char *name); + +__isl_give isl_union_pw_aff *isl_union_pw_aff_drop_dims( + __isl_take isl_union_pw_aff *upa, + enum isl_dim_type type, unsigned first, unsigned n); +__isl_give isl_union_pw_aff *isl_union_pw_aff_reset_user( + __isl_take isl_union_pw_aff *upa); + +__isl_give isl_union_pw_aff *isl_union_pw_aff_empty( + __isl_take isl_space *space); +__isl_give isl_union_pw_aff *isl_union_pw_aff_from_pw_aff( + __isl_take isl_pw_aff *pa); +__isl_give isl_union_pw_aff *isl_union_pw_aff_val_on_domain( + __isl_take isl_union_set *domain, __isl_take isl_val *v); +__isl_give isl_union_pw_aff *isl_union_pw_aff_aff_on_domain( + __isl_take isl_union_set *domain, __isl_take isl_aff *aff); +__isl_give isl_union_pw_aff *isl_union_pw_aff_add_pw_aff( + __isl_take isl_union_pw_aff *upa, __isl_take isl_pw_aff *pa); + +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_from_union_pw_aff( + __isl_take isl_union_pw_aff *upa); + +int isl_union_pw_aff_n_pw_aff(__isl_keep isl_union_pw_aff *upa); + +isl_stat isl_union_pw_aff_foreach_pw_aff(__isl_keep isl_union_pw_aff *upa, + isl_stat (*fn)(__isl_take isl_pw_aff *ma, void *user), void *user); +__isl_give isl_pw_aff *isl_union_pw_aff_extract_pw_aff( + __isl_keep isl_union_pw_aff *upa, __isl_take isl_space *space); + +isl_bool isl_union_pw_aff_plain_is_equal(__isl_keep isl_union_pw_aff *upa1, + __isl_keep isl_union_pw_aff *upa2); + +__isl_give isl_union_set *isl_union_pw_aff_domain( + __isl_take isl_union_pw_aff *upa); + +__isl_give isl_union_pw_aff *isl_union_pw_aff_neg( + __isl_take isl_union_pw_aff *upa); + +__isl_give isl_union_pw_aff *isl_union_pw_aff_add( + __isl_take isl_union_pw_aff *upa1, __isl_take isl_union_pw_aff *upa2); +__isl_give isl_union_pw_aff *isl_union_pw_aff_union_add( + __isl_take isl_union_pw_aff *upa1, __isl_take isl_union_pw_aff *upa2); +__isl_give isl_union_pw_aff *isl_union_pw_aff_sub( + __isl_take isl_union_pw_aff *upa1, __isl_take isl_union_pw_aff *upa2); + +__isl_give isl_union_pw_aff *isl_union_pw_aff_coalesce( + __isl_take isl_union_pw_aff *upa); +__isl_give isl_union_pw_aff *isl_union_pw_aff_gist( + __isl_take isl_union_pw_aff *upa, __isl_take isl_union_set *context); +__isl_give isl_union_pw_aff *isl_union_pw_aff_gist_params( + __isl_take isl_union_pw_aff *upa, __isl_take isl_set *context); + +__isl_give isl_union_pw_aff *isl_union_pw_aff_pullback_union_pw_multi_aff( + __isl_take isl_union_pw_aff *upa, + __isl_take isl_union_pw_multi_aff *upma); + +__isl_give isl_union_pw_aff *isl_union_pw_aff_floor( + __isl_take isl_union_pw_aff *upa); + +__isl_give isl_union_pw_aff *isl_union_pw_aff_scale_val( + __isl_take isl_union_pw_aff *upa, __isl_take isl_val *v); +__isl_give isl_union_pw_aff *isl_union_pw_aff_scale_down_val( + __isl_take isl_union_pw_aff *upa, __isl_take isl_val *v); +__isl_give isl_union_pw_aff *isl_union_pw_aff_mod_val( + __isl_take isl_union_pw_aff *upa, __isl_take isl_val *f); + +__isl_give isl_union_pw_aff *isl_union_pw_aff_align_params( + __isl_take isl_union_pw_aff *upa, __isl_take isl_space *model); + +__isl_give isl_union_pw_aff *isl_union_pw_aff_intersect_params( + __isl_take isl_union_pw_aff *upa, __isl_take isl_set *set); +__isl_give isl_union_pw_aff *isl_union_pw_aff_intersect_domain( + __isl_take isl_union_pw_aff *upa, __isl_take isl_union_set *uset); +__isl_give isl_union_pw_aff *isl_union_pw_aff_subtract_domain( + __isl_take isl_union_pw_aff *upa, __isl_take isl_union_set *uset); + +__isl_give isl_union_pw_aff *isl_union_pw_aff_set_dim_name( + __isl_take isl_union_pw_aff *upa, + enum isl_dim_type type, unsigned pos, const char *s); + +__isl_give isl_union_set *isl_union_pw_aff_zero_union_set( + __isl_take isl_union_pw_aff *upa); + +__isl_give isl_union_map *isl_union_map_from_union_pw_aff( + __isl_take isl_union_pw_aff *upa); + +__isl_give char *isl_union_pw_aff_to_str(__isl_keep isl_union_pw_aff *upa); +__isl_give isl_printer *isl_printer_print_union_pw_aff( + __isl_take isl_printer *p, __isl_keep isl_union_pw_aff *upa); + +ISL_DECLARE_MULTI(union_pw_aff) +ISL_DECLARE_MULTI_NEG(union_pw_aff) + +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_from_multi_aff( + __isl_take isl_multi_aff *ma); +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_from_union_pw_aff( + __isl_take isl_union_pw_aff *upa); +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_from_multi_pw_aff( + __isl_take isl_multi_pw_aff *mpa); +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_multi_val_on_domain( + __isl_take isl_union_set *domain, __isl_take isl_multi_val *mv); +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_multi_aff_on_domain( + __isl_take isl_union_set *domain, __isl_take isl_multi_aff *ma); + +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_floor( + __isl_take isl_multi_union_pw_aff *mupa); + +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_intersect_domain( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_union_set *uset); +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_intersect_params( + __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_set *params); +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_intersect_range( + __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_set *set); + +__isl_give isl_union_set *isl_multi_union_pw_aff_domain( + __isl_take isl_multi_union_pw_aff *mupa); + +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_gist( + __isl_take isl_multi_union_pw_aff *aff, + __isl_take isl_union_set *context); +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_gist_params( + __isl_take isl_multi_union_pw_aff *aff, __isl_take isl_set *context); + +__isl_give isl_union_pw_aff *isl_multi_union_pw_aff_apply_aff( + __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_aff *aff); +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_apply_multi_aff( + __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_multi_aff *ma); +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_apply_multi_aff( + __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_multi_aff *ma); +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_apply_pw_multi_aff( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_pw_multi_aff *pma); + +__isl_give isl_multi_union_pw_aff * +isl_multi_union_pw_aff_pullback_union_pw_multi_aff( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_union_pw_multi_aff *upma); + +__isl_give isl_union_pw_multi_aff * +isl_union_pw_multi_aff_from_multi_union_pw_aff( + __isl_take isl_multi_union_pw_aff *mupa); + +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_union_add( + __isl_take isl_multi_union_pw_aff *mupa1, + __isl_take isl_multi_union_pw_aff *mupa2); + +__isl_give isl_multi_union_pw_aff * +isl_multi_union_pw_aff_from_union_pw_multi_aff( + __isl_take isl_union_pw_multi_aff *upma); + +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_from_union_map( + __isl_take isl_union_map *umap); +__isl_give isl_union_map *isl_union_map_from_multi_union_pw_aff( + __isl_take isl_multi_union_pw_aff *mupa); + +__isl_give isl_union_set *isl_multi_union_pw_aff_zero_union_set( + __isl_take isl_multi_union_pw_aff *mupa); + +__isl_give isl_multi_pw_aff *isl_multi_union_pw_aff_extract_multi_pw_aff( + __isl_keep isl_multi_union_pw_aff *mupa, __isl_take isl_space *space); + +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_read_from_str( + isl_ctx *ctx, const char *str); +__isl_give char *isl_multi_union_pw_aff_to_str( + __isl_keep isl_multi_union_pw_aff *mupa); +__isl_give isl_printer *isl_printer_print_multi_union_pw_aff( + __isl_take isl_printer *p, __isl_keep isl_multi_union_pw_aff *mupa); +void isl_multi_union_pw_aff_dump(__isl_keep isl_multi_union_pw_aff *mupa); + +ISL_DECLARE_LIST_FN(union_pw_aff) +ISL_DECLARE_LIST_FN(union_pw_multi_aff) + #if defined(__cplusplus) } #endif -#include - #endif diff -Nru cloog-0.18.2/isl/include/isl/aff_type.h cloog-0.18.4/isl/include/isl/aff_type.h --- cloog-0.18.2/isl/include/isl/aff_type.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/aff_type.h 2015-07-24 12:23:09.000000000 +0000 @@ -17,6 +17,11 @@ ISL_DECLARE_LIST(pw_aff) +struct isl_union_pw_aff; +typedef struct isl_union_pw_aff isl_union_pw_aff; + +ISL_DECLARE_LIST_TYPE(union_pw_aff) + struct isl_multi_aff; typedef struct isl_multi_aff isl_multi_aff; @@ -26,9 +31,14 @@ struct isl_union_pw_multi_aff; typedef struct isl_union_pw_multi_aff isl_union_pw_multi_aff; +ISL_DECLARE_LIST_TYPE(union_pw_multi_aff) + struct isl_multi_pw_aff; typedef struct isl_multi_pw_aff isl_multi_pw_aff; +struct isl_multi_union_pw_aff; +typedef struct isl_multi_union_pw_aff isl_multi_union_pw_aff; + #if defined(__cplusplus) } #endif diff -Nru cloog-0.18.2/isl/include/isl/arg.h cloog-0.18.4/isl/include/isl/arg.h --- cloog-0.18.2/isl/include/isl/arg.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/arg.h 2015-07-24 12:23:09.000000000 +0000 @@ -148,6 +148,16 @@ .u = { .choice = { .choice = c, .default_value = d, \ .default_selected = ds, .set = NULL } } \ }, +#define ISL_ARG_PHANTOM_USER_CHOICE_F(s,l,c,setter,d,h,fl) { \ + .type = isl_arg_choice, \ + .short_name = s, \ + .long_name = l, \ + .offset = -1, \ + .help_msg = h, \ + .flags = fl, \ + .u = { .choice = { .choice = c, .default_value = d, \ + .default_selected = d, .set = setter } } \ +}, #define ISL_ARG_USER_OPT_CHOICE(st,f,s,l,c,setter,d,ds,h) { \ .type = isl_arg_choice, \ .short_name = s, \ @@ -252,10 +262,10 @@ }, #define ISL_ARG_CHILD(st,f,l,c,h) \ _ISL_ARG_CHILD(offsetof(st, f),l,c,h,0) -#define ISL_ARG_GROUP_F(c,h,fl) \ - _ISL_ARG_CHILD(-1,NULL,c,h,fl) -#define ISL_ARG_GROUP(c,h) \ - ISL_ARG_GROUP_F(c,h,0) +#define ISL_ARG_GROUP_F(l,c,h,fl) \ + _ISL_ARG_CHILD(-1,l,c,h,fl) +#define ISL_ARG_GROUP(l,c,h) \ + ISL_ARG_GROUP_F(l,c,h,0) #define ISL_ARG_FLAGS(st,f,s,l,c,d,h) { \ .type = isl_arg_flags, \ .short_name = s, \ diff -Nru cloog-0.18.2/isl/include/isl/ast_build.h cloog-0.18.4/isl/include/isl/ast_build.h --- cloog-0.18.2/isl/include/isl/ast_build.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/ast_build.h 2015-07-24 12:23:09.000000000 +0000 @@ -4,6 +4,7 @@ #include #include #include +#include #if defined(__cplusplus) extern "C" { @@ -13,34 +14,35 @@ typedef struct isl_ast_build isl_ast_build; -int isl_options_set_ast_build_atomic_upper_bound(isl_ctx *ctx, int val); +isl_stat isl_options_set_ast_build_atomic_upper_bound(isl_ctx *ctx, int val); int isl_options_get_ast_build_atomic_upper_bound(isl_ctx *ctx); -int isl_options_set_ast_build_prefer_pdiv(isl_ctx *ctx, int val); +isl_stat isl_options_set_ast_build_prefer_pdiv(isl_ctx *ctx, int val); int isl_options_get_ast_build_prefer_pdiv(isl_ctx *ctx); -int isl_options_set_ast_build_exploit_nested_bounds(isl_ctx *ctx, int val); +isl_stat isl_options_set_ast_build_exploit_nested_bounds(isl_ctx *ctx, int val); int isl_options_get_ast_build_exploit_nested_bounds(isl_ctx *ctx); -int isl_options_set_ast_build_group_coscheduled(isl_ctx *ctx, int val); +isl_stat isl_options_set_ast_build_group_coscheduled(isl_ctx *ctx, int val); int isl_options_get_ast_build_group_coscheduled(isl_ctx *ctx); #define ISL_AST_BUILD_SEPARATION_BOUNDS_EXPLICIT 0 #define ISL_AST_BUILD_SEPARATION_BOUNDS_IMPLICIT 1 -int isl_options_set_ast_build_separation_bounds(isl_ctx *ctx, int val); +isl_stat isl_options_set_ast_build_separation_bounds(isl_ctx *ctx, int val); int isl_options_get_ast_build_separation_bounds(isl_ctx *ctx); -int isl_options_set_ast_build_scale_strides(isl_ctx *ctx, int val); +isl_stat isl_options_set_ast_build_scale_strides(isl_ctx *ctx, int val); int isl_options_get_ast_build_scale_strides(isl_ctx *ctx); -int isl_options_set_ast_build_allow_else(isl_ctx *ctx, int val); +isl_stat isl_options_set_ast_build_allow_else(isl_ctx *ctx, int val); int isl_options_get_ast_build_allow_else(isl_ctx *ctx); -int isl_options_set_ast_build_allow_or(isl_ctx *ctx, int val); +isl_stat isl_options_set_ast_build_allow_or(isl_ctx *ctx, int val); int isl_options_get_ast_build_allow_or(isl_ctx *ctx); isl_ctx *isl_ast_build_get_ctx(__isl_keep isl_ast_build *build); +__isl_give isl_ast_build *isl_ast_build_alloc(isl_ctx *ctx); __isl_give isl_ast_build *isl_ast_build_from_context(__isl_take isl_set *set); __isl_give isl_space *isl_ast_build_get_schedule_space( @@ -53,7 +55,8 @@ __isl_give isl_ast_build *isl_ast_build_copy( __isl_keep isl_ast_build *build); -void *isl_ast_build_free(__isl_take isl_ast_build *build); +__isl_null isl_ast_build *isl_ast_build_free( + __isl_take isl_ast_build *build); __isl_give isl_ast_build *isl_ast_build_set_options( __isl_take isl_ast_build *build, @@ -73,16 +76,36 @@ __isl_take isl_ast_build *build, __isl_give isl_ast_node *(*fn)(__isl_take isl_ast_node *node, __isl_keep isl_ast_build *build, void *user), void *user); +__isl_give isl_ast_build *isl_ast_build_set_before_each_mark( + __isl_take isl_ast_build *build, + isl_stat (*fn)(__isl_keep isl_id *mark, __isl_keep isl_ast_build *build, + void *user), void *user); +__isl_give isl_ast_build *isl_ast_build_set_after_each_mark( + __isl_take isl_ast_build *build, + __isl_give isl_ast_node *(*fn)(__isl_take isl_ast_node *node, + __isl_keep isl_ast_build *build, void *user), void *user); __isl_give isl_ast_build *isl_ast_build_set_create_leaf( __isl_take isl_ast_build *build, __isl_give isl_ast_node *(*fn)(__isl_take isl_ast_build *build, void *user), void *user); +__isl_give isl_ast_expr *isl_ast_build_expr_from_set( + __isl_keep isl_ast_build *build, __isl_take isl_set *set); __isl_give isl_ast_expr *isl_ast_build_expr_from_pw_aff( __isl_keep isl_ast_build *build, __isl_take isl_pw_aff *pa); +__isl_give isl_ast_expr *isl_ast_build_access_from_pw_multi_aff( + __isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma); +__isl_give isl_ast_expr *isl_ast_build_access_from_multi_pw_aff( + __isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa); __isl_give isl_ast_expr *isl_ast_build_call_from_pw_multi_aff( __isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma); +__isl_give isl_ast_expr *isl_ast_build_call_from_multi_pw_aff( + __isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa); +__isl_give isl_ast_node *isl_ast_build_node_from_schedule( + __isl_keep isl_ast_build *build, __isl_take isl_schedule *schedule); +__isl_give isl_ast_node *isl_ast_build_node_from_schedule_map( + __isl_keep isl_ast_build *build, __isl_take isl_union_map *schedule); __isl_give isl_ast_node *isl_ast_build_ast_from_schedule( __isl_keep isl_ast_build *build, __isl_take isl_union_map *schedule); diff -Nru cloog-0.18.2/isl/include/isl/ast.h cloog-0.18.4/isl/include/isl/ast.h --- cloog-0.18.2/isl/include/isl/ast.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/ast.h 2015-07-24 12:23:09.000000000 +0000 @@ -2,7 +2,9 @@ #define ISL_AST_H #include +#include #include +#include #include #include #include @@ -11,62 +13,12 @@ extern "C" { #endif -struct isl_ast_expr; -typedef struct isl_ast_expr isl_ast_expr; - -struct isl_ast_node; -typedef struct isl_ast_node isl_ast_node; - -enum isl_ast_op_type { - isl_ast_op_error = -1, - isl_ast_op_and, - isl_ast_op_and_then, - isl_ast_op_or, - isl_ast_op_or_else, - isl_ast_op_max, - isl_ast_op_min, - isl_ast_op_minus, - isl_ast_op_add, - isl_ast_op_sub, - isl_ast_op_mul, - isl_ast_op_div, - isl_ast_op_fdiv_q, /* Round towards -infty */ - isl_ast_op_pdiv_q, /* Dividend is non-negative */ - isl_ast_op_pdiv_r, /* Dividend is non-negative */ - isl_ast_op_cond, - isl_ast_op_select, - isl_ast_op_eq, - isl_ast_op_le, - isl_ast_op_lt, - isl_ast_op_ge, - isl_ast_op_gt, - isl_ast_op_call -}; - -enum isl_ast_expr_type { - isl_ast_expr_error = -1, - isl_ast_expr_op, - isl_ast_expr_id, - isl_ast_expr_int -}; - -enum isl_ast_node_type { - isl_ast_node_error = -1, - isl_ast_node_for = 1, - isl_ast_node_if, - isl_ast_node_block, - isl_ast_node_user -}; - -struct isl_ast_print_options; -typedef struct isl_ast_print_options isl_ast_print_options; - -ISL_DECLARE_LIST(ast_expr) -ISL_DECLARE_LIST(ast_node) - -int isl_options_set_ast_iterator_type(isl_ctx *ctx, const char *val); +isl_stat isl_options_set_ast_iterator_type(isl_ctx *ctx, const char *val); const char *isl_options_get_ast_iterator_type(isl_ctx *ctx); +isl_stat isl_options_set_ast_always_print_block(isl_ctx *ctx, int val); +int isl_options_get_ast_always_print_block(isl_ctx *ctx); + __isl_give isl_ast_expr *isl_ast_expr_from_val(__isl_take isl_val *v); __isl_give isl_ast_expr *isl_ast_expr_from_id(__isl_take isl_id *id); __isl_give isl_ast_expr *isl_ast_expr_neg(__isl_take isl_ast_expr *expr); @@ -78,17 +30,39 @@ __isl_take isl_ast_expr *expr2); __isl_give isl_ast_expr *isl_ast_expr_div(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2); +__isl_give isl_ast_expr *isl_ast_expr_pdiv_q(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2); +__isl_give isl_ast_expr *isl_ast_expr_pdiv_r(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2); __isl_give isl_ast_expr *isl_ast_expr_and(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2); +__isl_give isl_ast_expr *isl_ast_expr_and_then(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2); __isl_give isl_ast_expr *isl_ast_expr_or(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2); +__isl_give isl_ast_expr *isl_ast_expr_or_else(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2); +__isl_give isl_ast_expr *isl_ast_expr_le(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2); +__isl_give isl_ast_expr *isl_ast_expr_lt(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2); +__isl_give isl_ast_expr *isl_ast_expr_ge(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2); +__isl_give isl_ast_expr *isl_ast_expr_gt(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2); +__isl_give isl_ast_expr *isl_ast_expr_eq(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2); +__isl_give isl_ast_expr *isl_ast_expr_access(__isl_take isl_ast_expr *array, + __isl_take isl_ast_expr_list *indices); +__isl_give isl_ast_expr *isl_ast_expr_call(__isl_take isl_ast_expr *function, + __isl_take isl_ast_expr_list *arguments); +__isl_give isl_ast_expr *isl_ast_expr_address_of(__isl_take isl_ast_expr *expr); __isl_give isl_ast_expr *isl_ast_expr_copy(__isl_keep isl_ast_expr *expr); -void *isl_ast_expr_free(__isl_take isl_ast_expr *expr); +__isl_null isl_ast_expr *isl_ast_expr_free(__isl_take isl_ast_expr *expr); isl_ctx *isl_ast_expr_get_ctx(__isl_keep isl_ast_expr *expr); enum isl_ast_expr_type isl_ast_expr_get_type(__isl_keep isl_ast_expr *expr); -int isl_ast_expr_get_int(__isl_keep isl_ast_expr *expr, isl_int *v); __isl_give isl_val *isl_ast_expr_get_val(__isl_keep isl_ast_expr *expr); __isl_give isl_id *isl_ast_expr_get_id(__isl_keep isl_ast_expr *expr); @@ -96,6 +70,14 @@ int isl_ast_expr_get_op_n_arg(__isl_keep isl_ast_expr *expr); __isl_give isl_ast_expr *isl_ast_expr_get_op_arg(__isl_keep isl_ast_expr *expr, int pos); +__isl_give isl_ast_expr *isl_ast_expr_set_op_arg(__isl_take isl_ast_expr *expr, + int pos, __isl_take isl_ast_expr *arg); + +isl_bool isl_ast_expr_is_equal(__isl_keep isl_ast_expr *expr1, + __isl_keep isl_ast_expr *expr2); + +__isl_give isl_ast_expr *isl_ast_expr_substitute_ids( + __isl_take isl_ast_expr *expr, __isl_take isl_id_to_ast_expr *id2expr); __isl_give isl_printer *isl_printer_print_ast_expr(__isl_take isl_printer *p, __isl_keep isl_ast_expr *expr); @@ -104,7 +86,7 @@ __isl_give isl_ast_node *isl_ast_node_alloc_user(__isl_take isl_ast_expr *expr); __isl_give isl_ast_node *isl_ast_node_copy(__isl_keep isl_ast_node *node); -void *isl_ast_node_free(__isl_take isl_ast_node *node); +__isl_null isl_ast_node *isl_ast_node_free(__isl_take isl_ast_node *node); isl_ctx *isl_ast_node_get_ctx(__isl_keep isl_ast_node *node); enum isl_ast_node_type isl_ast_node_get_type(__isl_keep isl_ast_node *node); @@ -123,19 +105,23 @@ __isl_keep isl_ast_node *node); __isl_give isl_ast_node *isl_ast_node_for_get_body( __isl_keep isl_ast_node *node); -int isl_ast_node_for_is_degenerate(__isl_keep isl_ast_node *node); +isl_bool isl_ast_node_for_is_degenerate(__isl_keep isl_ast_node *node); __isl_give isl_ast_expr *isl_ast_node_if_get_cond( __isl_keep isl_ast_node *node); __isl_give isl_ast_node *isl_ast_node_if_get_then( __isl_keep isl_ast_node *node); -int isl_ast_node_if_has_else(__isl_keep isl_ast_node *node); +isl_bool isl_ast_node_if_has_else(__isl_keep isl_ast_node *node); __isl_give isl_ast_node *isl_ast_node_if_get_else( __isl_keep isl_ast_node *node); __isl_give isl_ast_node_list *isl_ast_node_block_get_children( __isl_keep isl_ast_node *node); +__isl_give isl_id *isl_ast_node_mark_get_id(__isl_keep isl_ast_node *node); +__isl_give isl_ast_node *isl_ast_node_mark_get_node( + __isl_keep isl_ast_node *node); + __isl_give isl_ast_expr *isl_ast_node_user_get_expr( __isl_keep isl_ast_node *node); @@ -146,7 +132,8 @@ __isl_give isl_ast_print_options *isl_ast_print_options_alloc(isl_ctx *ctx); __isl_give isl_ast_print_options *isl_ast_print_options_copy( __isl_keep isl_ast_print_options *options); -void *isl_ast_print_options_free(__isl_take isl_ast_print_options *options); +__isl_null isl_ast_print_options *isl_ast_print_options_free( + __isl_take isl_ast_print_options *options); isl_ctx *isl_ast_print_options_get_ctx( __isl_keep isl_ast_print_options *options); @@ -163,8 +150,8 @@ __isl_keep isl_ast_node *node, void *user), void *user); -int isl_ast_node_foreach_ast_op_type(__isl_keep isl_ast_node *node, - int (*fn)(enum isl_ast_op_type type, void *user), void *user); +isl_stat isl_ast_node_foreach_ast_op_type(__isl_keep isl_ast_node *node, + isl_stat (*fn)(enum isl_ast_op_type type, void *user), void *user); __isl_give isl_printer *isl_ast_op_type_print_macro( enum isl_ast_op_type type, __isl_take isl_printer *p); __isl_give isl_printer *isl_ast_node_print_macros( diff -Nru cloog-0.18.2/isl/include/isl/ast_type.h cloog-0.18.4/isl/include/isl/ast_type.h --- cloog-0.18.2/isl/include/isl/ast_type.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/ast_type.h 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,80 @@ +#ifndef ISL_AST_TYPE_H +#define ISL_AST_TYPE_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +struct isl_ast_expr; +typedef struct isl_ast_expr isl_ast_expr; + +struct isl_ast_node; +typedef struct isl_ast_node isl_ast_node; + +enum isl_ast_op_type { + isl_ast_op_error = -1, + isl_ast_op_and, + isl_ast_op_and_then, + isl_ast_op_or, + isl_ast_op_or_else, + isl_ast_op_max, + isl_ast_op_min, + isl_ast_op_minus, + isl_ast_op_add, + isl_ast_op_sub, + isl_ast_op_mul, + isl_ast_op_div, + isl_ast_op_fdiv_q, /* Round towards -infty */ + isl_ast_op_pdiv_q, /* Dividend is non-negative */ + isl_ast_op_pdiv_r, /* Dividend is non-negative */ + isl_ast_op_zdiv_r, /* Result only compared against zero */ + isl_ast_op_cond, + isl_ast_op_select, + isl_ast_op_eq, + isl_ast_op_le, + isl_ast_op_lt, + isl_ast_op_ge, + isl_ast_op_gt, + isl_ast_op_call, + isl_ast_op_access, + isl_ast_op_member, + isl_ast_op_address_of +}; + +enum isl_ast_expr_type { + isl_ast_expr_error = -1, + isl_ast_expr_op, + isl_ast_expr_id, + isl_ast_expr_int +}; + +enum isl_ast_node_type { + isl_ast_node_error = -1, + isl_ast_node_for = 1, + isl_ast_node_if, + isl_ast_node_block, + isl_ast_node_mark, + isl_ast_node_user +}; + +enum isl_ast_loop_type { + isl_ast_loop_error = -1, + isl_ast_loop_default = 0, + isl_ast_loop_atomic, + isl_ast_loop_unroll, + isl_ast_loop_separate +}; + +struct isl_ast_print_options; +typedef struct isl_ast_print_options isl_ast_print_options; + +ISL_DECLARE_LIST(ast_expr) +ISL_DECLARE_LIST(ast_node) + +#if defined(__cplusplus) +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/include/isl/band.h cloog-0.18.4/isl/include/isl/band.h --- cloog-0.18.2/isl/include/isl/band.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/band.h 2015-07-24 12:23:09.000000000 +0000 @@ -16,7 +16,7 @@ ISL_DECLARE_LIST(band) __isl_give isl_band *isl_band_copy(__isl_keep isl_band *band); -void *isl_band_free(__isl_take isl_band *band); +__isl_null isl_band *isl_band_free(__isl_take isl_band *band); isl_ctx *isl_band_get_ctx(__isl_keep isl_band *band); @@ -31,16 +31,16 @@ __isl_give isl_union_map *isl_band_get_suffix_schedule( __isl_keep isl_band *band); -int isl_options_set_tile_scale_tile_loops(isl_ctx *ctx, int val); +isl_stat isl_options_set_tile_scale_tile_loops(isl_ctx *ctx, int val); int isl_options_get_tile_scale_tile_loops(isl_ctx *ctx); -int isl_options_set_tile_shift_point_loops(isl_ctx *ctx, int val); +isl_stat isl_options_set_tile_shift_point_loops(isl_ctx *ctx, int val); int isl_options_get_tile_shift_point_loops(isl_ctx *ctx); int isl_band_tile(__isl_keep isl_band *band, __isl_take isl_vec *sizes); int isl_band_split(__isl_keep isl_band *band, int pos); int isl_band_n_member(__isl_keep isl_band *band); -int isl_band_member_is_zero_distance(__isl_keep isl_band *band, int pos); +int isl_band_member_is_coincident(__isl_keep isl_band *band, int pos); int isl_band_list_foreach_band(__isl_keep isl_band_list *list, int (*fn)(__isl_keep isl_band *band, void *user), void *user); diff -Nru cloog-0.18.2/isl/include/isl/blk.h cloog-0.18.4/isl/include/isl/blk.h --- cloog-0.18.2/isl/include/isl/blk.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/blk.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright 2008-2009 Katholieke Universiteit Leuven - * - * Use of this software is governed by the MIT license - * - * Written by Sven Verdoolaege, K.U.Leuven, Departement - * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium - */ - -#ifndef ISL_BLK_H -#define ISL_BLK_H - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - -struct isl_blk { - size_t size; - isl_int *data; -}; - -#define ISL_BLK_CACHE_SIZE 20 - -struct isl_ctx; - -struct isl_blk isl_blk_alloc(struct isl_ctx *ctx, size_t n); -struct isl_blk isl_blk_empty(void); -int isl_blk_is_error(struct isl_blk block); -struct isl_blk isl_blk_extend(struct isl_ctx *ctx, struct isl_blk block, - size_t new_n); -void isl_blk_free(struct isl_ctx *ctx, struct isl_blk block); -void isl_blk_clear_cache(struct isl_ctx *ctx); - -#if defined(__cplusplus) -} -#endif - -#endif diff -Nru cloog-0.18.2/isl/include/isl/config.h.in cloog-0.18.4/isl/include/isl/config.h.in --- cloog-0.18.2/isl/include/isl/config.h.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/config.h.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#undef GCC_WARN_UNUSED_RESULT - -#undef ISL_PIPLIB diff -Nru cloog-0.18.2/isl/include/isl/constraint.h cloog-0.18.4/isl/include/isl/constraint.h --- cloog-0.18.2/isl/include/isl/constraint.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/constraint.h 2015-07-24 12:23:09.000000000 +0000 @@ -29,24 +29,33 @@ isl_ctx *isl_constraint_get_ctx(__isl_keep isl_constraint *c); +__isl_give isl_constraint *isl_constraint_alloc_equality( + __isl_take isl_local_space *ls); +__isl_give isl_constraint *isl_constraint_alloc_inequality( + __isl_take isl_local_space *ls); __isl_give isl_constraint *isl_equality_alloc(__isl_take isl_local_space *ls); __isl_give isl_constraint *isl_inequality_alloc(__isl_take isl_local_space *ls); struct isl_constraint *isl_constraint_cow(struct isl_constraint *c); struct isl_constraint *isl_constraint_copy(struct isl_constraint *c); -void *isl_constraint_free(__isl_take isl_constraint *c); +__isl_null isl_constraint *isl_constraint_free(__isl_take isl_constraint *c); +int isl_basic_map_n_constraint(__isl_keep isl_basic_map *bmap); int isl_basic_set_n_constraint(__isl_keep isl_basic_set *bset); -int isl_basic_map_foreach_constraint(__isl_keep isl_basic_map *bmap, - int (*fn)(__isl_take isl_constraint *c, void *user), void *user); -int isl_basic_set_foreach_constraint(__isl_keep isl_basic_set *bset, - int (*fn)(__isl_take isl_constraint *c, void *user), void *user); +isl_stat isl_basic_map_foreach_constraint(__isl_keep isl_basic_map *bmap, + isl_stat (*fn)(__isl_take isl_constraint *c, void *user), void *user); +isl_stat isl_basic_set_foreach_constraint(__isl_keep isl_basic_set *bset, + isl_stat (*fn)(__isl_take isl_constraint *c, void *user), void *user); +__isl_give isl_constraint_list *isl_basic_map_get_constraint_list( + __isl_keep isl_basic_map *bmap); +__isl_give isl_constraint_list *isl_basic_set_get_constraint_list( + __isl_keep isl_basic_set *bset); int isl_constraint_is_equal(struct isl_constraint *constraint1, struct isl_constraint *constraint2); -int isl_basic_set_foreach_bound_pair(__isl_keep isl_basic_set *bset, +isl_stat isl_basic_set_foreach_bound_pair(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned pos, - int (*fn)(__isl_take isl_constraint *lower, + isl_stat (*fn)(__isl_take isl_constraint *lower, __isl_take isl_constraint *upper, __isl_take isl_basic_set *bset, void *user), void *user); @@ -77,46 +86,37 @@ int isl_constraint_dim(struct isl_constraint *constraint, enum isl_dim_type type); -int isl_constraint_involves_dims(__isl_keep isl_constraint *constraint, +isl_bool isl_constraint_involves_dims(__isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned first, unsigned n); const char *isl_constraint_get_dim_name(__isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned pos); -void isl_constraint_get_constant(__isl_keep isl_constraint *constraint, - isl_int *v); __isl_give isl_val *isl_constraint_get_constant_val( __isl_keep isl_constraint *constraint); -void isl_constraint_get_coefficient(__isl_keep isl_constraint *constraint, - enum isl_dim_type type, int pos, isl_int *v); __isl_give isl_val *isl_constraint_get_coefficient_val( __isl_keep isl_constraint *constraint, enum isl_dim_type type, int pos); -__isl_give isl_constraint *isl_constraint_set_constant( - __isl_take isl_constraint *constraint, isl_int v); __isl_give isl_constraint *isl_constraint_set_constant_si( __isl_take isl_constraint *constraint, int v); __isl_give isl_constraint *isl_constraint_set_constant_val( __isl_take isl_constraint *constraint, __isl_take isl_val *v); -__isl_give isl_constraint *isl_constraint_set_coefficient( - __isl_take isl_constraint *constraint, - enum isl_dim_type type, int pos, isl_int v); __isl_give isl_constraint *isl_constraint_set_coefficient_si( __isl_take isl_constraint *constraint, enum isl_dim_type type, int pos, int v); __isl_give isl_constraint *isl_constraint_set_coefficient_val( __isl_take isl_constraint *constraint, - enum isl_dim_type type, int pos, isl_val *v); + enum isl_dim_type type, int pos, __isl_take isl_val *v); __isl_give isl_aff *isl_constraint_get_div(__isl_keep isl_constraint *constraint, int pos); struct isl_constraint *isl_constraint_negate(struct isl_constraint *constraint); -int isl_constraint_is_equality(__isl_keep isl_constraint *constraint); +isl_bool isl_constraint_is_equality(__isl_keep isl_constraint *constraint); int isl_constraint_is_div_constraint(__isl_keep isl_constraint *constraint); -int isl_constraint_is_lower_bound(__isl_keep isl_constraint *constraint, +isl_bool isl_constraint_is_lower_bound(__isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned pos); -int isl_constraint_is_upper_bound(__isl_keep isl_constraint *constraint, +isl_bool isl_constraint_is_upper_bound(__isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned pos); __isl_give isl_basic_map *isl_basic_map_from_constraint( @@ -134,6 +134,11 @@ __isl_give isl_basic_set *isl_basic_set_drop_constraint( __isl_take isl_basic_set *bset, __isl_take isl_constraint *constraint); +int isl_constraint_plain_cmp(__isl_keep isl_constraint *c1, + __isl_keep isl_constraint *c2); +int isl_constraint_cmp_last_non_zero(__isl_keep isl_constraint *c1, + __isl_keep isl_constraint *c2); + __isl_give isl_printer *isl_printer_print_constraint(__isl_take isl_printer *p, __isl_keep isl_constraint *c); void isl_constraint_dump(__isl_keep isl_constraint *c); @@ -142,6 +147,4 @@ } #endif -#include - #endif diff -Nru cloog-0.18.2/isl/include/isl/ctx.h cloog-0.18.4/isl/include/isl/ctx.h --- cloog-0.18.2/isl/include/isl/ctx.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/ctx.h 2015-07-24 12:23:09.000000000 +0000 @@ -13,11 +13,7 @@ #include #include -#include -#include #include -#include -#include #ifndef __isl_give #define __isl_give @@ -28,6 +24,9 @@ #ifndef __isl_keep #define __isl_keep #endif +#ifndef __isl_null +#define __isl_null +#endif #ifndef __isl_export #define __isl_export #endif @@ -38,12 +37,6 @@ #define __isl_subclass(super) #endif -#ifdef GCC_WARN_UNUSED_RESULT -#define WARN_UNUSED GCC_WARN_UNUSED_RESULT -#else -#define WARN_UNUSED -#endif - #if defined(__cplusplus) extern "C" { #endif @@ -78,16 +71,33 @@ enum isl_error { isl_error_none = 0, isl_error_abort, + isl_error_alloc, isl_error_unknown, isl_error_internal, isl_error_invalid, + isl_error_quota, isl_error_unsupported }; +typedef enum { + isl_stat_error = -1, + isl_stat_ok = 0, +} isl_stat; +typedef enum { + isl_bool_error = -1, + isl_bool_false = 0, + isl_bool_true = 1 +} isl_bool; struct isl_ctx; typedef struct isl_ctx isl_ctx; /* Some helper macros */ +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) +#define ISL_DEPRECATED __attribute__((__deprecated__)) +#else +#define ISL_DEPRECATED +#endif + #define ISL_FL_INIT(l, f) (l) = (f) /* Specific flags location. */ #define ISL_FL_SET(l, f) ((l) |= (f)) #define ISL_FL_CLR(l, f) ((l) &= ~(f)) @@ -98,24 +108,21 @@ #define ISL_F_CLR(p, f) ISL_FL_CLR((p)->flags, f) #define ISL_F_ISSET(p, f) ISL_FL_ISSET((p)->flags, f) -/* isl_check_ctx() checks at compile time if 'ctx' is of type 'isl_ctx *' and - * returns the value of 'expr'. It is used to ensure, that always an isl_ctx is - * passed to the following macros, even if they currently do not use it. - */ -#define isl_check_ctx(ctx, expr) ((ctx != (isl_ctx *) 0) ? expr : NULL) - -#define isl_alloc(ctx,type,size) ((type *)isl_check_ctx(ctx,\ - malloc(size))) -#define isl_calloc(ctx,type,size) ((type *)isl_check_ctx(ctx,\ - calloc(1, size))) -#define isl_realloc(ctx,ptr,type,size) ((type *)isl_check_ctx(ctx,\ - realloc(ptr,size))) +void *isl_malloc_or_die(isl_ctx *ctx, size_t size); +void *isl_calloc_or_die(isl_ctx *ctx, size_t nmemb, size_t size); +void *isl_realloc_or_die(isl_ctx *ctx, void *ptr, size_t size); + +#define isl_alloc(ctx,type,size) ((type *)isl_malloc_or_die(ctx, size)) +#define isl_calloc(ctx,type,size) ((type *)isl_calloc_or_die(ctx,\ + 1, size)) +#define isl_realloc(ctx,ptr,type,size) ((type *)isl_realloc_or_die(ctx,\ + ptr, size)) #define isl_alloc_type(ctx,type) isl_alloc(ctx,type,sizeof(type)) #define isl_calloc_type(ctx,type) isl_calloc(ctx,type,sizeof(type)) #define isl_realloc_type(ctx,ptr,type) isl_realloc(ctx,ptr,type,sizeof(type)) #define isl_alloc_array(ctx,type,n) isl_alloc(ctx,type,(n)*sizeof(type)) -#define isl_calloc_array(ctx,type,n) ((type *)isl_check_ctx(ctx,\ - calloc(n, sizeof(type)))) +#define isl_calloc_array(ctx,type,n) ((type *)isl_calloc_or_die(ctx,\ + n, sizeof(type))) #define isl_realloc_array(ctx,ptr,type,n) \ isl_realloc(ctx,ptr,type,(n)*sizeof(type)) @@ -156,6 +163,10 @@ void isl_ctx_resume(isl_ctx *ctx); int isl_ctx_aborted(isl_ctx *ctx); +void isl_ctx_set_max_operations(isl_ctx *ctx, unsigned long max_operations); +unsigned long isl_ctx_get_max_operations(isl_ctx *ctx); +void isl_ctx_reset_operations(isl_ctx *ctx); + #define ISL_ARG_CTX_DECL(prefix,st,args) \ st *isl_ctx_peek_ ## prefix(isl_ctx *ctx); @@ -178,16 +189,16 @@ } #define ISL_CTX_SET_INT_DEF(prefix,st,args,field) \ -int prefix ## _set_ ## field(isl_ctx *ctx, int val) \ +isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ { \ st *options; \ options = isl_ctx_peek_ ## prefix(ctx); \ if (!options) \ isl_die(ctx, isl_error_invalid, \ "isl_ctx does not reference " #prefix, \ - return -1); \ + return isl_stat_error); \ options->field = val; \ - return 0; \ + return isl_stat_ok; \ } #define ISL_CTX_GET_STR_DEF(prefix,st,args,field) \ @@ -203,21 +214,21 @@ } #define ISL_CTX_SET_STR_DEF(prefix,st,args,field) \ -int prefix ## _set_ ## field(isl_ctx *ctx, const char *val) \ +isl_stat prefix ## _set_ ## field(isl_ctx *ctx, const char *val) \ { \ st *options; \ options = isl_ctx_peek_ ## prefix(ctx); \ if (!options) \ isl_die(ctx, isl_error_invalid, \ "isl_ctx does not reference " #prefix, \ - return -1); \ + return isl_stat_error); \ if (!val) \ - return -1; \ + return isl_stat_error; \ free(options->field); \ options->field = strdup(val); \ if (!options->field) \ - return -1; \ - return 0; \ + return isl_stat_error; \ + return isl_stat_ok; \ } #define ISL_CTX_GET_BOOL_DEF(prefix,st,args,field) \ diff -Nru cloog-0.18.2/isl/include/isl/deprecated/aff_int.h cloog-0.18.4/isl/include/isl/deprecated/aff_int.h --- cloog-0.18.2/isl/include/isl/deprecated/aff_int.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/deprecated/aff_int.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,45 @@ +#ifndef ISL_DEPRECATED_AFF_INT_H +#define ISL_DEPRECATED_AFF_INT_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +int isl_aff_get_constant(__isl_keep isl_aff *aff, isl_int *v); +int isl_aff_get_coefficient(__isl_keep isl_aff *aff, + enum isl_dim_type type, int pos, isl_int *v); +int isl_aff_get_denominator(__isl_keep isl_aff *aff, isl_int *v); +__isl_give isl_aff *isl_aff_set_constant(__isl_take isl_aff *aff, isl_int v); +__isl_give isl_aff *isl_aff_set_coefficient(__isl_take isl_aff *aff, + enum isl_dim_type type, int pos, isl_int v); +__isl_give isl_aff *isl_aff_set_denominator(__isl_take isl_aff *aff, isl_int v); +__isl_give isl_aff *isl_aff_add_constant(__isl_take isl_aff *aff, isl_int v); +__isl_give isl_aff *isl_aff_add_constant_num(__isl_take isl_aff *aff, + isl_int v); +__isl_give isl_aff *isl_aff_add_coefficient(__isl_take isl_aff *aff, + enum isl_dim_type type, int pos, isl_int v); + +__isl_give isl_aff *isl_aff_mod(__isl_take isl_aff *aff, isl_int mod); + +__isl_give isl_aff *isl_aff_scale(__isl_take isl_aff *aff, isl_int f); +__isl_give isl_aff *isl_aff_scale_down(__isl_take isl_aff *aff, isl_int f); + +__isl_give isl_pw_aff *isl_pw_aff_mod(__isl_take isl_pw_aff *pwaff, + isl_int mod); + +__isl_give isl_pw_aff *isl_pw_aff_scale(__isl_take isl_pw_aff *pwaff, + isl_int f); +__isl_give isl_pw_aff *isl_pw_aff_scale_down(__isl_take isl_pw_aff *pwaff, + isl_int f); + +__isl_give isl_multi_aff *isl_multi_aff_scale(__isl_take isl_multi_aff *maff, + isl_int f); + +#if defined(__cplusplus) +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/include/isl/deprecated/ast_int.h cloog-0.18.4/isl/include/isl/deprecated/ast_int.h --- cloog-0.18.2/isl/include/isl/deprecated/ast_int.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/deprecated/ast_int.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,17 @@ +#ifndef ISL_DEPRECATED_AST_INT_H +#define ISL_DEPRECATED_AST_INT_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +int isl_ast_expr_get_int(__isl_keep isl_ast_expr *expr, isl_int *v); + +#if defined(__cplusplus) +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/include/isl/deprecated/constraint_int.h cloog-0.18.4/isl/include/isl/deprecated/constraint_int.h --- cloog-0.18.2/isl/include/isl/deprecated/constraint_int.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/deprecated/constraint_int.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,25 @@ +#ifndef ISL_DEPRECATED_CONSTRAINT_INT_H +#define ISL_DEPRECATED_CONSTRAINT_INT_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +void isl_constraint_get_constant(__isl_keep isl_constraint *constraint, + isl_int *v); +void isl_constraint_get_coefficient(__isl_keep isl_constraint *constraint, + enum isl_dim_type type, int pos, isl_int *v); +__isl_give isl_constraint *isl_constraint_set_constant( + __isl_take isl_constraint *constraint, isl_int v); +__isl_give isl_constraint *isl_constraint_set_coefficient( + __isl_take isl_constraint *constraint, + enum isl_dim_type type, int pos, isl_int v); + +#if defined(__cplusplus) +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/include/isl/deprecated/ilp_int.h cloog-0.18.4/isl/include/isl/deprecated/ilp_int.h --- cloog-0.18.2/isl/include/isl/deprecated/ilp_int.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/deprecated/ilp_int.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,23 @@ +#ifndef ISL_DEPRECATED_ILP_INT_H +#define ISL_DEPRECATED_ILP_INT_H + +#include +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +enum isl_lp_result isl_basic_set_max(__isl_keep isl_basic_set *bset, + __isl_keep isl_aff *obj, isl_int *opt); +enum isl_lp_result isl_set_min(__isl_keep isl_set *set, + __isl_keep isl_aff *obj, isl_int *opt); +enum isl_lp_result isl_set_max(__isl_keep isl_set *set, + __isl_keep isl_aff *obj, isl_int *opt); + +#if defined(__cplusplus) +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/include/isl/deprecated/int.h cloog-0.18.4/isl/include/isl/deprecated/int.h --- cloog-0.18.2/isl/include/isl/deprecated/int.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/deprecated/int.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,136 @@ +/* + * Copyright 2008-2009 Katholieke Universiteit Leuven + * + * Use of this software is governed by the MIT license + * + * Written by Sven Verdoolaege, K.U.Leuven, Departement + * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium + */ + +#ifndef ISL_DEPRECATED_INT_H +#define ISL_DEPRECATED_INT_H + +#include +#include +#include +#if defined(__cplusplus) +#include +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + +#ifndef mp_get_memory_functions +void mp_get_memory_functions( + void *(**alloc_func_ptr) (size_t), + void *(**realloc_func_ptr) (void *, size_t, size_t), + void (**free_func_ptr) (void *, size_t)); +#endif + +/* isl_int is the basic integer type. It currently always corresponds + * to a gmp mpz_t, but in the future, different types such as long long + * or cln::cl_I will be supported. + */ +typedef mpz_t isl_int; + +#define isl_int_init(i) mpz_init(i) +#define isl_int_clear(i) mpz_clear(i) + +#define isl_int_set(r,i) mpz_set(r,i) +#define isl_int_set_gmp(r,i) mpz_set(r,i) +#define isl_int_set_si(r,i) mpz_set_si(r,i) +#define isl_int_set_ui(r,i) mpz_set_ui(r,i) +#define isl_int_get_gmp(i,g) mpz_set(g,i) +#define isl_int_get_si(r) mpz_get_si(r) +#define isl_int_get_ui(r) mpz_get_ui(r) +#define isl_int_get_d(r) mpz_get_d(r) +#define isl_int_get_str(r) mpz_get_str(0, 10, r) +typedef void (*isl_int_print_gmp_free_t)(void *, size_t); +#define isl_int_free_str(s) \ + do { \ + isl_int_print_gmp_free_t gmp_free; \ + mp_get_memory_functions(NULL, NULL, &gmp_free); \ + (*gmp_free)(s, strlen(s) + 1); \ + } while (0) +#define isl_int_abs(r,i) mpz_abs(r,i) +#define isl_int_neg(r,i) mpz_neg(r,i) +#define isl_int_swap(i,j) mpz_swap(i,j) +#define isl_int_swap_or_set(i,j) mpz_swap(i,j) +#define isl_int_add_ui(r,i,j) mpz_add_ui(r,i,j) +#define isl_int_sub_ui(r,i,j) mpz_sub_ui(r,i,j) + +#define isl_int_add(r,i,j) mpz_add(r,i,j) +#define isl_int_sub(r,i,j) mpz_sub(r,i,j) +#define isl_int_mul(r,i,j) mpz_mul(r,i,j) +#define isl_int_mul_2exp(r,i,j) mpz_mul_2exp(r,i,j) +#define isl_int_mul_ui(r,i,j) mpz_mul_ui(r,i,j) +#define isl_int_pow_ui(r,i,j) mpz_pow_ui(r,i,j) +#define isl_int_addmul(r,i,j) mpz_addmul(r,i,j) +#define isl_int_submul(r,i,j) mpz_submul(r,i,j) + +#define isl_int_gcd(r,i,j) mpz_gcd(r,i,j) +#define isl_int_lcm(r,i,j) mpz_lcm(r,i,j) +#define isl_int_divexact(r,i,j) mpz_divexact(r,i,j) +#define isl_int_divexact_ui(r,i,j) mpz_divexact_ui(r,i,j) +#define isl_int_tdiv_q(r,i,j) mpz_tdiv_q(r,i,j) +#define isl_int_cdiv_q(r,i,j) mpz_cdiv_q(r,i,j) +#define isl_int_fdiv_q(r,i,j) mpz_fdiv_q(r,i,j) +#define isl_int_fdiv_r(r,i,j) mpz_fdiv_r(r,i,j) +#define isl_int_fdiv_q_ui(r,i,j) mpz_fdiv_q_ui(r,i,j) + +#define isl_int_read(r,s) mpz_set_str(r,s,10) +#define isl_int_print(out,i,width) \ + do { \ + char *s; \ + s = mpz_get_str(0, 10, i); \ + fprintf(out, "%*s", width, s); \ + isl_int_free_str(s); \ + } while (0) + +#define isl_int_sgn(i) mpz_sgn(i) +#define isl_int_cmp(i,j) mpz_cmp(i,j) +#define isl_int_cmp_si(i,si) mpz_cmp_si(i,si) +#define isl_int_eq(i,j) (mpz_cmp(i,j) == 0) +#define isl_int_ne(i,j) (mpz_cmp(i,j) != 0) +#define isl_int_lt(i,j) (mpz_cmp(i,j) < 0) +#define isl_int_le(i,j) (mpz_cmp(i,j) <= 0) +#define isl_int_gt(i,j) (mpz_cmp(i,j) > 0) +#define isl_int_ge(i,j) (mpz_cmp(i,j) >= 0) +#define isl_int_abs_eq(i,j) (mpz_cmpabs(i,j) == 0) +#define isl_int_abs_ne(i,j) (mpz_cmpabs(i,j) != 0) +#define isl_int_abs_lt(i,j) (mpz_cmpabs(i,j) < 0) +#define isl_int_abs_gt(i,j) (mpz_cmpabs(i,j) > 0) +#define isl_int_abs_ge(i,j) (mpz_cmpabs(i,j) >= 0) + + +#define isl_int_is_zero(i) (isl_int_sgn(i) == 0) +#define isl_int_is_one(i) (isl_int_cmp_si(i,1) == 0) +#define isl_int_is_negone(i) (isl_int_cmp_si(i,-1) == 0) +#define isl_int_is_pos(i) (isl_int_sgn(i) > 0) +#define isl_int_is_neg(i) (isl_int_sgn(i) < 0) +#define isl_int_is_nonpos(i) (isl_int_sgn(i) <= 0) +#define isl_int_is_nonneg(i) (isl_int_sgn(i) >= 0) +#define isl_int_is_divisible_by(i,j) mpz_divisible_p(i,j) + +uint32_t isl_gmp_hash(mpz_t v, uint32_t hash); +#define isl_int_hash(v,h) isl_gmp_hash(v,h) + +#if defined(__cplusplus) +} +#endif + +#if defined(__cplusplus) +extern "C" { typedef void (*isl_gmp_free_t)(void *, size_t); } + +static inline std::ostream &operator<<(std::ostream &os, isl_int i) +{ + char *s; + s = mpz_get_str(0, 10, i); + os << s; + isl_int_free_str(s); + return os; +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/include/isl/deprecated/map_int.h cloog-0.18.4/isl/include/isl/deprecated/map_int.h --- cloog-0.18.2/isl/include/isl/deprecated/map_int.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/deprecated/map_int.h 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,25 @@ +#ifndef ISL_DEPRECATED_MAP_INT_H +#define ISL_DEPRECATED_MAP_INT_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +int isl_basic_map_plain_is_fixed(__isl_keep isl_basic_map *bmap, + enum isl_dim_type type, unsigned pos, isl_int *val); + +__isl_give isl_map *isl_map_fix(__isl_take isl_map *map, + enum isl_dim_type type, unsigned pos, isl_int value); +int isl_map_plain_is_fixed(__isl_keep isl_map *map, + enum isl_dim_type type, unsigned pos, isl_int *val); + +__isl_give isl_map *isl_map_fixed_power(__isl_take isl_map *map, isl_int exp); + +#if defined(__cplusplus) +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/include/isl/deprecated/mat_int.h cloog-0.18.4/isl/include/isl/deprecated/mat_int.h --- cloog-0.18.2/isl/include/isl/deprecated/mat_int.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/deprecated/mat_int.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,19 @@ +#ifndef ISL_DEPRECATED_MAT_INT_H +#define ISL_DEPRECATED_MAT_INT_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +int isl_mat_get_element(__isl_keep isl_mat *mat, int row, int col, isl_int *v); +__isl_give isl_mat *isl_mat_set_element(__isl_take isl_mat *mat, + int row, int col, isl_int v); + +#if defined(__cplusplus) +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/include/isl/deprecated/point_int.h cloog-0.18.4/isl/include/isl/deprecated/point_int.h --- cloog-0.18.2/isl/include/isl/deprecated/point_int.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/deprecated/point_int.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,20 @@ +#ifndef ISL_DEPRECATED_POINT_INT_H +#define ISL_DEPRECATED_POINT_INT_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +int isl_point_get_coordinate(__isl_keep isl_point *pnt, + enum isl_dim_type type, int pos, isl_int *v); +__isl_give isl_point *isl_point_set_coordinate(__isl_take isl_point *pnt, + enum isl_dim_type type, int pos, isl_int v); + +#if defined(__cplusplus) +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/include/isl/deprecated/polynomial_int.h cloog-0.18.4/isl/include/isl/deprecated/polynomial_int.h --- cloog-0.18.2/isl/include/isl/deprecated/polynomial_int.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/deprecated/polynomial_int.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,32 @@ +#ifndef ISL_DEPRECATED_POLYNOMIAL_INT_H +#define ISL_DEPRECATED_POLYNOMIAL_INT_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +__isl_give isl_qpolynomial *isl_qpolynomial_rat_cst_on_domain( + __isl_take isl_space *space, const isl_int n, const isl_int d); +int isl_qpolynomial_is_cst(__isl_keep isl_qpolynomial *qp, + isl_int *n, isl_int *d); +__isl_give isl_qpolynomial *isl_qpolynomial_scale( + __isl_take isl_qpolynomial *qp, isl_int v); + +void isl_term_get_num(__isl_keep isl_term *term, isl_int *n); +void isl_term_get_den(__isl_keep isl_term *term, isl_int *d); + +__isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_scale( + __isl_take isl_qpolynomial_fold *fold, isl_int v); + +__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_fix_dim( + __isl_take isl_pw_qpolynomial_fold *pwf, + enum isl_dim_type type, unsigned n, isl_int v); + +#if defined(__cplusplus) +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/include/isl/deprecated/set_int.h cloog-0.18.4/isl/include/isl/deprecated/set_int.h --- cloog-0.18.2/isl/include/isl/deprecated/set_int.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/deprecated/set_int.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,27 @@ +#ifndef ISL_DEPRECATED_SET_INT_H +#define ISL_DEPRECATED_SET_INT_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +__isl_give isl_basic_set *isl_basic_set_fix(__isl_take isl_basic_set *bset, + enum isl_dim_type type, unsigned pos, isl_int value); +__isl_give isl_set *isl_set_lower_bound(__isl_take isl_set *set, + enum isl_dim_type type, unsigned pos, isl_int value); +__isl_give isl_set *isl_set_upper_bound(__isl_take isl_set *set, + enum isl_dim_type type, unsigned pos, isl_int value); +__isl_give isl_set *isl_set_fix(__isl_take isl_set *set, + enum isl_dim_type type, unsigned pos, isl_int value); + +int isl_set_plain_is_fixed(__isl_keep isl_set *set, + enum isl_dim_type type, unsigned pos, isl_int *val); + +#if defined(__cplusplus) +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/include/isl/deprecated/union_map_int.h cloog-0.18.4/isl/include/isl/deprecated/union_map_int.h --- cloog-0.18.2/isl/include/isl/deprecated/union_map_int.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/deprecated/union_map_int.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,18 @@ +#ifndef ISL_DEPRECATED_UNION_MAP_INT_H +#define ISL_DEPRECATED_UNION_MAP_INT_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +__isl_give isl_union_map *isl_union_map_fixed_power( + __isl_take isl_union_map *umap, isl_int exp); + +#if defined(__cplusplus) +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/include/isl/deprecated/val_int.h cloog-0.18.4/isl/include/isl/deprecated/val_int.h --- cloog-0.18.2/isl/include/isl/deprecated/val_int.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/deprecated/val_int.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,18 @@ +#ifndef ISL_DEPRECATED_VAL_INT_H +#define ISL_DEPRECATED_VAL_INT_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +__isl_give isl_val *isl_val_int_from_isl_int(isl_ctx *ctx, isl_int n); +int isl_val_get_num_isl_int(__isl_keep isl_val *v, isl_int *n); + +#if defined(__cplusplus) +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/include/isl/deprecated/vec_int.h cloog-0.18.4/isl/include/isl/deprecated/vec_int.h --- cloog-0.18.2/isl/include/isl/deprecated/vec_int.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/deprecated/vec_int.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,22 @@ +#ifndef ISL_DEPRECATED_VEC_INT_H +#define ISL_DEPRECATED_VEC_INT_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +int isl_vec_get_element(__isl_keep isl_vec *vec, int pos, isl_int *v); +__isl_give isl_vec *isl_vec_set_element(__isl_take isl_vec *vec, + int pos, isl_int v); + +__isl_give isl_vec *isl_vec_set(__isl_take isl_vec *vec, isl_int v); +__isl_give isl_vec *isl_vec_fdiv_r(__isl_take isl_vec *vec, isl_int m); + +#if defined(__cplusplus) +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/include/isl/dim.h cloog-0.18.4/isl/include/isl/dim.h --- cloog-0.18.2/isl/include/isl/dim.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/dim.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -#ifndef ISL_DIM_H -#define ISL_DIM_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(__cplusplus) -extern "C" { -#endif - -#define isl_dim isl_space - -isl_ctx *isl_dim_get_ctx(__isl_keep isl_space *dim); -__isl_give isl_space *isl_dim_alloc(isl_ctx *ctx, - unsigned nparam, unsigned n_in, unsigned n_out); -__isl_give isl_space *isl_dim_set_alloc(isl_ctx *ctx, - unsigned nparam, unsigned dim); -__isl_give isl_space *isl_dim_copy(__isl_keep isl_space *dim); -void isl_dim_free(__isl_take isl_space *dim); - -unsigned isl_dim_size(__isl_keep isl_space *dim, enum isl_dim_type type); - -__isl_give isl_space *isl_dim_set_dim_id(__isl_take isl_space *dim, - enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); -int isl_dim_has_dim_id(__isl_keep isl_space *dim, - enum isl_dim_type type, unsigned pos); -__isl_give isl_id *isl_dim_get_dim_id(__isl_keep isl_space *dim, - enum isl_dim_type type, unsigned pos); - -int isl_dim_find_dim_by_id(__isl_keep isl_space *dim, - enum isl_dim_type type, __isl_keep isl_id *id); - -__isl_give isl_space *isl_dim_set_tuple_id(__isl_take isl_space *dim, - enum isl_dim_type type, __isl_take isl_id *id); -__isl_give isl_space *isl_dim_reset_tuple_id(__isl_take isl_space *dim, - enum isl_dim_type type); -int isl_dim_has_tuple_id(__isl_keep isl_space *dim, enum isl_dim_type type); -__isl_give isl_id *isl_dim_get_tuple_id(__isl_keep isl_space *dim, - enum isl_dim_type type); - -__isl_give isl_space *isl_dim_set_name(__isl_take isl_space *dim, - enum isl_dim_type type, unsigned pos, __isl_keep const char *name); -__isl_keep const char *isl_dim_get_name(__isl_keep isl_space *dim, - enum isl_dim_type type, unsigned pos); - -__isl_give isl_space *isl_dim_set_tuple_name(__isl_take isl_space *dim, - enum isl_dim_type type, const char *s); -const char *isl_dim_get_tuple_name(__isl_keep isl_space *dim, - enum isl_dim_type type); - -int isl_dim_is_wrapping(__isl_keep isl_space *dim); -__isl_give isl_space *isl_dim_wrap(__isl_take isl_space *dim); -__isl_give isl_space *isl_dim_unwrap(__isl_take isl_space *dim); - -__isl_give isl_space *isl_dim_domain(__isl_take isl_space *dim); -__isl_give isl_space *isl_dim_from_domain(__isl_take isl_space *dim); -__isl_give isl_space *isl_dim_range(__isl_take isl_space *dim); -__isl_give isl_space *isl_dim_from_range(__isl_take isl_space *dim); -__isl_give isl_space *isl_dim_reverse(__isl_take isl_space *dim); -__isl_give isl_space *isl_dim_join(__isl_take isl_space *left, - __isl_take isl_space *right); -__isl_give isl_space *isl_dim_align_params(__isl_take isl_space *dim1, - __isl_take isl_space *dim2); -__isl_give isl_space *isl_dim_insert(__isl_take isl_space *dim, - enum isl_dim_type type, unsigned pos, unsigned n); -__isl_give isl_space *isl_dim_add(__isl_take isl_space *dim, - enum isl_dim_type type, unsigned n); -__isl_give isl_space *isl_dim_drop(__isl_take isl_space *dim, - enum isl_dim_type type, unsigned first, unsigned n); -__isl_give isl_space *isl_dim_move(__isl_take isl_space *dim, - enum isl_dim_type dst_type, unsigned dst_pos, - enum isl_dim_type src_type, unsigned src_pos, unsigned n); -__isl_give isl_space *isl_dim_map_from_set( - __isl_take isl_space *dim); -__isl_give isl_space *isl_dim_zip(__isl_take isl_space *dim); - -__isl_give isl_local_space *isl_local_space_from_dim( - __isl_take isl_space *dim); -__isl_give isl_space *isl_local_space_get_dim( - __isl_keep isl_local_space *ls); - -__isl_give isl_space *isl_aff_get_dim(__isl_keep isl_aff *aff); -__isl_give isl_space *isl_pw_aff_get_dim(__isl_keep isl_pw_aff *pwaff); - -__isl_give isl_space *isl_constraint_get_dim( - __isl_keep isl_constraint *constraint); - -__isl_give isl_space *isl_basic_map_get_dim(__isl_keep isl_basic_map *bmap); -__isl_give isl_space *isl_map_get_dim(__isl_keep isl_map *map); -__isl_give isl_space *isl_union_map_get_dim(__isl_keep isl_union_map *umap); - -__isl_give isl_space *isl_basic_set_get_dim(__isl_keep isl_basic_set *bset); -__isl_give isl_space *isl_set_get_dim(__isl_keep isl_set *set); -__isl_give isl_space *isl_union_set_get_dim(__isl_keep isl_union_set *uset); - -__isl_give isl_space *isl_point_get_dim(__isl_keep isl_point *pnt); - -__isl_give isl_space *isl_qpolynomial_get_dim(__isl_keep isl_qpolynomial *qp); -__isl_give isl_space *isl_pw_qpolynomial_get_dim( - __isl_keep isl_pw_qpolynomial *pwqp); -__isl_give isl_space *isl_qpolynomial_fold_get_dim( - __isl_keep isl_qpolynomial_fold *fold); -__isl_give isl_space *isl_pw_qpolynomial_fold_get_dim( - __isl_keep isl_pw_qpolynomial_fold *pwf); -__isl_give isl_space *isl_union_pw_qpolynomial_get_dim( - __isl_keep isl_union_pw_qpolynomial *upwqp); -__isl_give isl_space *isl_union_pw_qpolynomial_fold_get_dim( - __isl_keep isl_union_pw_qpolynomial_fold *upwf); - -#if defined(__cplusplus) -} -#endif - -#endif diff -Nru cloog-0.18.2/isl/include/isl/flow.h cloog-0.18.4/isl/include/isl/flow.h --- cloog-0.18.2/isl/include/isl/flow.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/flow.h 2015-07-24 12:23:09.000000000 +0000 @@ -5,6 +5,7 @@ #include #include #include +#include #if defined(__cplusplus) extern "C" { @@ -19,7 +20,8 @@ struct isl_restriction; typedef struct isl_restriction isl_restriction; -void *isl_restriction_free(__isl_take isl_restriction *restr); +__isl_null isl_restriction *isl_restriction_free( + __isl_take isl_restriction *restr); __isl_give isl_restriction *isl_restriction_empty( __isl_take isl_map *source_map); __isl_give isl_restriction *isl_restriction_none( @@ -47,19 +49,62 @@ __isl_give isl_access_info *isl_access_info_add_source( __isl_take isl_access_info *acc, __isl_take isl_map *source, int must, void *source_user); -void *isl_access_info_free(__isl_take isl_access_info *acc); +__isl_null isl_access_info *isl_access_info_free( + __isl_take isl_access_info *acc); isl_ctx *isl_access_info_get_ctx(__isl_keep isl_access_info *acc); __isl_give isl_flow *isl_access_info_compute_flow(__isl_take isl_access_info *acc); -int isl_flow_foreach(__isl_keep isl_flow *deps, - int (*fn)(__isl_take isl_map *dep, int must, void *dep_user, void *user), +isl_stat isl_flow_foreach(__isl_keep isl_flow *deps, + isl_stat (*fn)(__isl_take isl_map *dep, int must, void *dep_user, + void *user), void *user); __isl_give isl_map *isl_flow_get_no_source(__isl_keep isl_flow *deps, int must); void isl_flow_free(__isl_take isl_flow *deps); isl_ctx *isl_flow_get_ctx(__isl_keep isl_flow *deps); +struct isl_union_access_info; +typedef struct isl_union_access_info isl_union_access_info; +struct isl_union_flow; +typedef struct isl_union_flow isl_union_flow; + +__isl_give isl_union_access_info *isl_union_access_info_from_sink( + __isl_take isl_union_map *sink); +__isl_give isl_union_access_info *isl_union_access_info_set_must_source( + __isl_take isl_union_access_info *access, + __isl_take isl_union_map *must_source); +__isl_give isl_union_access_info *isl_union_access_info_set_may_source( + __isl_take isl_union_access_info *access, + __isl_take isl_union_map *may_source); +__isl_give isl_union_access_info *isl_union_access_info_set_schedule( + __isl_take isl_union_access_info *access, + __isl_take isl_schedule *schedule); +__isl_give isl_union_access_info *isl_union_access_info_set_schedule_map( + __isl_take isl_union_access_info *access, + __isl_take isl_union_map *schedule_map); +__isl_give isl_union_access_info *isl_union_access_info_copy( + __isl_keep isl_union_access_info *access); +__isl_null isl_union_access_info *isl_union_access_info_free( + __isl_take isl_union_access_info *access); + +isl_ctx *isl_union_access_info_get_ctx( + __isl_keep isl_union_access_info *access); + +__isl_give isl_union_flow *isl_union_access_info_compute_flow( + __isl_take isl_union_access_info *access); + +isl_ctx *isl_union_flow_get_ctx(__isl_keep isl_union_flow *flow); +__isl_give isl_union_map *isl_union_flow_get_must_dependence( + __isl_keep isl_union_flow *flow); +__isl_give isl_union_map *isl_union_flow_get_may_dependence( + __isl_keep isl_union_flow *flow); +__isl_give isl_union_map *isl_union_flow_get_must_no_source( + __isl_keep isl_union_flow *flow); +__isl_give isl_union_map *isl_union_flow_get_may_no_source( + __isl_keep isl_union_flow *flow); +__isl_null isl_union_flow *isl_union_flow_free(__isl_take isl_union_flow *flow); + int isl_union_map_compute_flow(__isl_take isl_union_map *sink, __isl_take isl_union_map *must_source, __isl_take isl_union_map *may_source, diff -Nru cloog-0.18.2/isl/include/isl/hash.h cloog-0.18.4/isl/include/isl/hash.h --- cloog-0.18.2/isl/include/isl/hash.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/hash.h 2015-07-24 12:23:09.000000000 +0000 @@ -12,6 +12,7 @@ #include #include +#include #if defined(__cplusplus) extern "C" { @@ -52,8 +53,6 @@ struct isl_hash_table_entry *entries; }; -struct isl_ctx; - struct isl_hash_table *isl_hash_table_alloc(struct isl_ctx *ctx, int min_size); void isl_hash_table_free(struct isl_ctx *ctx, struct isl_hash_table *table); @@ -65,9 +64,8 @@ uint32_t key_hash, int (*eq)(const void *entry, const void *val), const void *val, int reserve); -int isl_hash_table_foreach(struct isl_ctx *ctx, - struct isl_hash_table *table, - int (*fn)(void **entry, void *user), void *user); +isl_stat isl_hash_table_foreach(isl_ctx *ctx, struct isl_hash_table *table, + isl_stat (*fn)(void **entry, void *user), void *user); void isl_hash_table_remove(struct isl_ctx *ctx, struct isl_hash_table *table, struct isl_hash_table_entry *entry); diff -Nru cloog-0.18.2/isl/include/isl/hmap.h cloog-0.18.4/isl/include/isl/hmap.h --- cloog-0.18.2/isl/include/isl/hmap.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/hmap.h 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,58 @@ +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +#define ISL_xCAT(A,B) A ## B +#define ISL_CAT(A,B) ISL_xCAT(A,B) +#define ISL_KEY ISL_CAT(isl_,ISL_KEY_BASE) +#define ISL_VAL ISL_CAT(isl_,ISL_VAL_BASE) +#define ISL_xFN(TYPE,NAME) TYPE ## _ ## NAME +#define ISL_FN(TYPE,NAME) ISL_xFN(TYPE,NAME) +#define ISL_xHMAP(KEY,VAL_BASE) KEY ## _to_ ## VAL_BASE +#define ISL_yHMAP(KEY,VAL_BASE) ISL_xHMAP(KEY,VAL_BASE) +#define ISL_HMAP ISL_yHMAP(ISL_KEY,ISL_VAL_BASE) +#define ISL_HMAP_BASE ISL_yHMAP(ISL_KEY_BASE,ISL_VAL_BASE) + +struct ISL_HMAP; +typedef struct ISL_HMAP ISL_HMAP; + +__isl_give ISL_HMAP *ISL_FN(ISL_HMAP,alloc)(isl_ctx *ctx, int min_size); +__isl_give ISL_HMAP *ISL_FN(ISL_HMAP,copy)(__isl_keep ISL_HMAP *hmap); +__isl_null ISL_HMAP *ISL_FN(ISL_HMAP,free)(__isl_take ISL_HMAP *hmap); + +isl_ctx *ISL_FN(ISL_HMAP,get_ctx)(__isl_keep ISL_HMAP *hmap); + +isl_bool ISL_FN(ISL_HMAP,has)(__isl_keep ISL_HMAP *hmap, + __isl_keep ISL_KEY *key); +__isl_give ISL_VAL *ISL_FN(ISL_HMAP,get)(__isl_keep ISL_HMAP *hmap, + __isl_take ISL_KEY *key); +__isl_give ISL_HMAP *ISL_FN(ISL_HMAP,set)(__isl_take ISL_HMAP *hmap, + __isl_take ISL_KEY *key, __isl_take ISL_VAL *val); +__isl_give ISL_HMAP *ISL_FN(ISL_HMAP,drop)(__isl_take ISL_HMAP *hmap, + __isl_take ISL_KEY *key); + +isl_stat ISL_FN(ISL_HMAP,foreach)(__isl_keep ISL_HMAP *hmap, + isl_stat (*fn)(__isl_take ISL_KEY *key, __isl_take ISL_VAL *val, + void *user), + void *user); + +__isl_give isl_printer *ISL_FN(isl_printer_print,ISL_HMAP_BASE)( + __isl_take isl_printer *p, __isl_keep ISL_HMAP *hmap); +void ISL_FN(ISL_HMAP,dump)(__isl_keep ISL_HMAP *hmap); + +#undef ISL_xCAT +#undef ISL_CAT +#undef ISL_KEY +#undef ISL_VAL +#undef ISL_xFN +#undef ISL_FN +#undef ISL_xHMAP +#undef ISL_yHMAP +#undef ISL_HMAP + +#if defined(__cplusplus) +} +#endif diff -Nru cloog-0.18.2/isl/include/isl/id.h cloog-0.18.4/isl/include/isl/id.h --- cloog-0.18.2/isl/include/isl/id.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/id.h 2015-07-24 12:23:09.000000000 +0000 @@ -4,6 +4,7 @@ #include #include #include +#include #if defined(__cplusplus) extern "C" { @@ -15,11 +16,12 @@ ISL_DECLARE_LIST(id) isl_ctx *isl_id_get_ctx(__isl_keep isl_id *id); +uint32_t isl_id_get_hash(__isl_keep isl_id *id); __isl_give isl_id *isl_id_alloc(isl_ctx *ctx, __isl_keep const char *name, void *user); __isl_give isl_id *isl_id_copy(isl_id *id); -void *isl_id_free(__isl_take isl_id *id); +__isl_null isl_id *isl_id_free(__isl_take isl_id *id); void *isl_id_get_user(__isl_keep isl_id *id); __isl_keep const char *isl_id_get_name(__isl_keep isl_id *id); diff -Nru cloog-0.18.2/isl/include/isl/id_to_ast_expr.h cloog-0.18.4/isl/include/isl/id_to_ast_expr.h --- cloog-0.18.2/isl/include/isl/id_to_ast_expr.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/id_to_ast_expr.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,13 @@ +#ifndef ISL_ID_TO_AST_EXPR_H +#define ISL_ID_TO_AST_EXPR_H + +#include +#include + +#define ISL_KEY_BASE id +#define ISL_VAL_BASE ast_expr +#include +#undef ISL_KEY_BASE +#undef ISL_VAL_BASE + +#endif diff -Nru cloog-0.18.2/isl/include/isl/id_to_pw_aff.h cloog-0.18.4/isl/include/isl/id_to_pw_aff.h --- cloog-0.18.2/isl/include/isl/id_to_pw_aff.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/id_to_pw_aff.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,13 @@ +#ifndef ISL_ID_TO_PW_AFF_H +#define ISL_ID_TO_PW_AFF_H + +#include +#include + +#define ISL_KEY_BASE id +#define ISL_VAL_BASE pw_aff +#include +#undef ISL_KEY_BASE +#undef ISL_VAL_BASE + +#endif diff -Nru cloog-0.18.2/isl/include/isl/ilp.h cloog-0.18.4/isl/include/isl/ilp.h --- cloog-0.18.2/isl/include/isl/ilp.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/ilp.h 2014-10-02 15:33:27.000000000 +0000 @@ -11,24 +11,16 @@ #define ISL_ILP_H #include -#include +#include #include +#include #if defined(__cplusplus) extern "C" { #endif -enum isl_lp_result isl_basic_set_solve_ilp(struct isl_basic_set *bset, int max, - isl_int *f, isl_int *opt, - struct isl_vec **sol_p); -enum isl_lp_result isl_basic_set_max(__isl_keep isl_basic_set *bset, - __isl_keep isl_aff *obj, isl_int *opt); __isl_give isl_val *isl_basic_set_max_val(__isl_keep isl_basic_set *bset, __isl_keep isl_aff *obj); -enum isl_lp_result isl_set_min(__isl_keep isl_set *set, - __isl_keep isl_aff *obj, isl_int *opt); -enum isl_lp_result isl_set_max(__isl_keep isl_set *set, - __isl_keep isl_aff *obj, isl_int *opt); __isl_give isl_val *isl_set_min_val(__isl_keep isl_set *set, __isl_keep isl_aff *obj); __isl_give isl_val *isl_set_max_val(__isl_keep isl_set *set, diff -Nru cloog-0.18.2/isl/include/isl/int.h cloog-0.18.4/isl/include/isl/int.h --- cloog-0.18.2/isl/include/isl/int.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/int.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,136 +0,0 @@ -/* - * Copyright 2008-2009 Katholieke Universiteit Leuven - * - * Use of this software is governed by the MIT license - * - * Written by Sven Verdoolaege, K.U.Leuven, Departement - * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium - */ - -#ifndef ISL_INT_H -#define ISL_INT_H - -#include -#include -#include -#if defined(__cplusplus) -#include -#endif - -#if defined(__cplusplus) -extern "C" { -#endif - -#ifndef mp_get_memory_functions -void mp_get_memory_functions( - void *(**alloc_func_ptr) (size_t), - void *(**realloc_func_ptr) (void *, size_t, size_t), - void (**free_func_ptr) (void *, size_t)); -#endif - -/* isl_int is the basic integer type. It currently always corresponds - * to a gmp mpz_t, but in the future, different types such as long long - * or cln::cl_I will be supported. - */ -typedef mpz_t isl_int; - -#define isl_int_init(i) mpz_init(i) -#define isl_int_clear(i) mpz_clear(i) - -#define isl_int_set(r,i) mpz_set(r,i) -#define isl_int_set_gmp(r,i) mpz_set(r,i) -#define isl_int_set_si(r,i) mpz_set_si(r,i) -#define isl_int_set_ui(r,i) mpz_set_ui(r,i) -#define isl_int_get_gmp(i,g) mpz_set(g,i) -#define isl_int_get_si(r) mpz_get_si(r) -#define isl_int_get_ui(r) mpz_get_ui(r) -#define isl_int_get_d(r) mpz_get_d(r) -#define isl_int_get_str(r) mpz_get_str(0, 10, r) -typedef void (*isl_int_print_gmp_free_t)(void *, size_t); -#define isl_int_free_str(s) \ - do { \ - isl_int_print_gmp_free_t gmp_free; \ - mp_get_memory_functions(NULL, NULL, &gmp_free); \ - (*gmp_free)(s, strlen(s) + 1); \ - } while (0) -#define isl_int_abs(r,i) mpz_abs(r,i) -#define isl_int_neg(r,i) mpz_neg(r,i) -#define isl_int_swap(i,j) mpz_swap(i,j) -#define isl_int_swap_or_set(i,j) mpz_swap(i,j) -#define isl_int_add_ui(r,i,j) mpz_add_ui(r,i,j) -#define isl_int_sub_ui(r,i,j) mpz_sub_ui(r,i,j) - -#define isl_int_add(r,i,j) mpz_add(r,i,j) -#define isl_int_sub(r,i,j) mpz_sub(r,i,j) -#define isl_int_mul(r,i,j) mpz_mul(r,i,j) -#define isl_int_mul_2exp(r,i,j) mpz_mul_2exp(r,i,j) -#define isl_int_mul_ui(r,i,j) mpz_mul_ui(r,i,j) -#define isl_int_pow_ui(r,i,j) mpz_pow_ui(r,i,j) -#define isl_int_addmul(r,i,j) mpz_addmul(r,i,j) -#define isl_int_submul(r,i,j) mpz_submul(r,i,j) - -#define isl_int_gcd(r,i,j) mpz_gcd(r,i,j) -#define isl_int_lcm(r,i,j) mpz_lcm(r,i,j) -#define isl_int_divexact(r,i,j) mpz_divexact(r,i,j) -#define isl_int_divexact_ui(r,i,j) mpz_divexact_ui(r,i,j) -#define isl_int_tdiv_q(r,i,j) mpz_tdiv_q(r,i,j) -#define isl_int_cdiv_q(r,i,j) mpz_cdiv_q(r,i,j) -#define isl_int_fdiv_q(r,i,j) mpz_fdiv_q(r,i,j) -#define isl_int_fdiv_r(r,i,j) mpz_fdiv_r(r,i,j) -#define isl_int_fdiv_q_ui(r,i,j) mpz_fdiv_q_ui(r,i,j) - -#define isl_int_read(r,s) mpz_set_str(r,s,10) -#define isl_int_print(out,i,width) \ - do { \ - char *s; \ - s = mpz_get_str(0, 10, i); \ - fprintf(out, "%*s", width, s); \ - isl_int_free_str(s); \ - } while (0) - -#define isl_int_sgn(i) mpz_sgn(i) -#define isl_int_cmp(i,j) mpz_cmp(i,j) -#define isl_int_cmp_si(i,si) mpz_cmp_si(i,si) -#define isl_int_eq(i,j) (mpz_cmp(i,j) == 0) -#define isl_int_ne(i,j) (mpz_cmp(i,j) != 0) -#define isl_int_lt(i,j) (mpz_cmp(i,j) < 0) -#define isl_int_le(i,j) (mpz_cmp(i,j) <= 0) -#define isl_int_gt(i,j) (mpz_cmp(i,j) > 0) -#define isl_int_ge(i,j) (mpz_cmp(i,j) >= 0) -#define isl_int_abs_eq(i,j) (mpz_cmpabs(i,j) == 0) -#define isl_int_abs_ne(i,j) (mpz_cmpabs(i,j) != 0) -#define isl_int_abs_lt(i,j) (mpz_cmpabs(i,j) < 0) -#define isl_int_abs_gt(i,j) (mpz_cmpabs(i,j) > 0) -#define isl_int_abs_ge(i,j) (mpz_cmpabs(i,j) >= 0) - - -#define isl_int_is_zero(i) (isl_int_sgn(i) == 0) -#define isl_int_is_one(i) (isl_int_cmp_si(i,1) == 0) -#define isl_int_is_negone(i) (isl_int_cmp_si(i,-1) == 0) -#define isl_int_is_pos(i) (isl_int_sgn(i) > 0) -#define isl_int_is_neg(i) (isl_int_sgn(i) < 0) -#define isl_int_is_nonpos(i) (isl_int_sgn(i) <= 0) -#define isl_int_is_nonneg(i) (isl_int_sgn(i) >= 0) -#define isl_int_is_divisible_by(i,j) mpz_divisible_p(i,j) - -uint32_t isl_gmp_hash(mpz_t v, uint32_t hash); -#define isl_int_hash(v,h) isl_gmp_hash(v,h) - -#if defined(__cplusplus) -} -#endif - -#if defined(__cplusplus) -extern "C" { typedef void (*isl_gmp_free_t)(void *, size_t); } - -static inline std::ostream &operator<<(std::ostream &os, isl_int i) -{ - char *s; - s = mpz_get_str(0, 10, i); - os << s; - isl_int_free_str(s); - return os; -} -#endif - -#endif diff -Nru cloog-0.18.2/isl/include/isl/list.h cloog-0.18.4/isl/include/isl/list.h --- cloog-0.18.2/isl/include/isl/list.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/list.h 2015-07-24 12:23:09.000000000 +0000 @@ -28,7 +28,8 @@ __isl_give isl_##EL##_list *isl_##EL##_list_alloc(isl_ctx *ctx, int n); \ __isl_give isl_##EL##_list *isl_##EL##_list_copy( \ __isl_keep isl_##EL##_list *list); \ -void *isl_##EL##_list_free(__isl_take isl_##EL##_list *list); \ +__isl_null isl_##EL##_list *isl_##EL##_list_free( \ + __isl_take isl_##EL##_list *list); \ __isl_give isl_##EL##_list *isl_##EL##_list_add( \ __isl_take isl_##EL##_list *list, \ __isl_take struct isl_##EL *el); \ @@ -46,19 +47,19 @@ __isl_give struct isl_##EL##_list *isl_##EL##_list_set_##EL( \ __isl_take struct isl_##EL##_list *list, int index, \ __isl_take struct isl_##EL *el); \ -int isl_##EL##_list_foreach(__isl_keep isl_##EL##_list *list, \ - int (*fn)(__isl_take struct isl_##EL *el, void *user), \ +isl_stat isl_##EL##_list_foreach(__isl_keep isl_##EL##_list *list, \ + isl_stat (*fn)(__isl_take struct isl_##EL *el, void *user), \ void *user); \ __isl_give isl_##EL##_list *isl_##EL##_list_sort( \ __isl_take isl_##EL##_list *list, \ int (*cmp)(__isl_keep struct isl_##EL *a, \ __isl_keep struct isl_##EL *b, \ void *user), void *user); \ -int isl_##EL##_list_foreach_scc(__isl_keep isl_##EL##_list *list, \ - int (*follows)(__isl_keep struct isl_##EL *a, \ +isl_stat isl_##EL##_list_foreach_scc(__isl_keep isl_##EL##_list *list, \ + isl_bool (*follows)(__isl_keep struct isl_##EL *a, \ __isl_keep struct isl_##EL *b, void *user), \ void *follows_user, \ - int (*fn)(__isl_take isl_##EL##_list *scc, void *user), \ + isl_stat (*fn)(__isl_take isl_##EL##_list *scc, void *user), \ void *fn_user); \ __isl_give isl_printer *isl_printer_print_##EL##_list( \ __isl_take isl_printer *p, __isl_keep isl_##EL##_list *list); \ diff -Nru cloog-0.18.2/isl/include/isl/local_space.h cloog-0.18.4/isl/include/isl/local_space.h --- cloog-0.18.2/isl/include/isl/local_space.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/local_space.h 2015-07-24 12:23:09.000000000 +0000 @@ -19,20 +19,26 @@ __isl_give isl_local_space *isl_local_space_copy( __isl_keep isl_local_space *ls); -void *isl_local_space_free(__isl_take isl_local_space *ls); +__isl_null isl_local_space *isl_local_space_free( + __isl_take isl_local_space *ls); + +isl_bool isl_local_space_is_params(__isl_keep isl_local_space *ls); +isl_bool isl_local_space_is_set(__isl_keep isl_local_space *ls); -int isl_local_space_is_set(__isl_keep isl_local_space *ls); +__isl_give isl_local_space *isl_local_space_set_tuple_id( + __isl_take isl_local_space *ls, + enum isl_dim_type type, __isl_take isl_id *id); int isl_local_space_dim(__isl_keep isl_local_space *ls, enum isl_dim_type type); -int isl_local_space_has_dim_name(__isl_keep isl_local_space *ls, +isl_bool isl_local_space_has_dim_name(__isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos); const char *isl_local_space_get_dim_name(__isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos); __isl_give isl_local_space *isl_local_space_set_dim_name( __isl_take isl_local_space *ls, enum isl_dim_type type, unsigned pos, const char *s); -int isl_local_space_has_dim_id(__isl_keep isl_local_space *ls, +isl_bool isl_local_space_has_dim_id(__isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_local_space_get_dim_id(__isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos); @@ -43,6 +49,9 @@ __isl_give isl_aff *isl_local_space_get_div(__isl_keep isl_local_space *ls, int pos); +int isl_local_space_find_dim_by_name(__isl_keep isl_local_space *ls, + enum isl_dim_type type, const char *name); + __isl_give isl_local_space *isl_local_space_domain( __isl_take isl_local_space *ls); __isl_give isl_local_space *isl_local_space_range( @@ -61,12 +70,20 @@ __isl_give isl_local_space *isl_local_space_intersect( __isl_take isl_local_space *ls1, __isl_take isl_local_space *ls2); -int isl_local_space_is_equal(__isl_keep isl_local_space *ls1, +__isl_give isl_local_space *isl_local_space_wrap( + __isl_take isl_local_space *ls); + +isl_bool isl_local_space_is_equal(__isl_keep isl_local_space *ls1, __isl_keep isl_local_space *ls2); __isl_give isl_basic_map *isl_local_space_lifting( __isl_take isl_local_space *ls); +__isl_give isl_local_space *isl_local_space_flatten_domain( + __isl_take isl_local_space *ls); +__isl_give isl_local_space *isl_local_space_flatten_range( + __isl_take isl_local_space *ls); + __isl_give isl_printer *isl_printer_print_local_space(__isl_take isl_printer *p, __isl_keep isl_local_space *ls); void isl_local_space_dump(__isl_keep isl_local_space *ls); diff -Nru cloog-0.18.2/isl/include/isl/lp.h cloog-0.18.4/isl/include/isl/lp.h --- cloog-0.18.2/isl/include/isl/lp.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/lp.h 2014-10-02 15:33:27.000000000 +0000 @@ -12,9 +12,6 @@ #include #include -#include -#include -#include #include enum isl_lp_result { @@ -28,22 +25,6 @@ extern "C" { #endif -enum isl_lp_result isl_basic_map_solve_lp(struct isl_basic_map *bmap, int max, - isl_int *f, isl_int denom, isl_int *opt, - isl_int *opt_denom, - struct isl_vec **sol); -enum isl_lp_result isl_basic_set_solve_lp(struct isl_basic_set *bset, int max, - isl_int *f, isl_int denom, isl_int *opt, - isl_int *opt_denom, - struct isl_vec **sol); -enum isl_lp_result isl_map_solve_lp(__isl_keep isl_map *map, int max, - isl_int *f, isl_int denom, isl_int *opt, - isl_int *opt_denom, - struct isl_vec **sol); -enum isl_lp_result isl_set_solve_lp(__isl_keep isl_set *set, int max, - isl_int *f, isl_int denom, isl_int *opt, - isl_int *opt_denom, - struct isl_vec **sol); __isl_give isl_val *isl_basic_set_min_lp_val(__isl_keep isl_basic_set *bset, __isl_keep isl_aff *obj); __isl_give isl_val *isl_basic_set_max_lp_val(__isl_keep isl_basic_set *bset, diff -Nru cloog-0.18.2/isl/include/isl/map.h cloog-0.18.4/isl/include/isl/map.h --- cloog-0.18.2/isl/include/isl/map.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/map.h 2015-07-24 12:23:09.000000000 +0000 @@ -12,9 +12,7 @@ #include -#include #include -#include #include #include #include @@ -24,6 +22,7 @@ #include #include #include +#include #if defined(__cplusplus) extern "C" { @@ -71,14 +70,15 @@ __isl_take isl_basic_map *bmap, enum isl_dim_type type, const char *s); const char *isl_basic_map_get_tuple_name(__isl_keep isl_basic_map *bmap, enum isl_dim_type type); -int isl_map_has_tuple_name(__isl_keep isl_map *map, enum isl_dim_type type); +isl_bool isl_map_has_tuple_name(__isl_keep isl_map *map, + enum isl_dim_type type); const char *isl_map_get_tuple_name(__isl_keep isl_map *map, enum isl_dim_type type); __isl_give isl_map *isl_map_set_tuple_name(__isl_take isl_map *map, enum isl_dim_type type, const char *s); const char *isl_basic_map_get_dim_name(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos); -int isl_map_has_dim_name(__isl_keep isl_map *map, +isl_bool isl_map_has_dim_name(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos); const char *isl_map_get_dim_name(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos); @@ -88,11 +88,14 @@ __isl_give isl_map *isl_map_set_dim_name(__isl_take isl_map *map, enum isl_dim_type type, unsigned pos, const char *s); +__isl_give isl_basic_map *isl_basic_map_set_tuple_id( + __isl_take isl_basic_map *bmap, + enum isl_dim_type type, __isl_take isl_id *id); __isl_give isl_map *isl_map_set_dim_id(__isl_take isl_map *map, enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); -int isl_basic_map_has_dim_id(__isl_keep isl_basic_map *bmap, +isl_bool isl_basic_map_has_dim_id(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos); -int isl_map_has_dim_id(__isl_keep isl_map *map, +isl_bool isl_map_has_dim_id(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_map_get_dim_id(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos); @@ -100,10 +103,13 @@ enum isl_dim_type type, __isl_take isl_id *id); __isl_give isl_map *isl_map_reset_tuple_id(__isl_take isl_map *map, enum isl_dim_type type); -int isl_map_has_tuple_id(__isl_keep isl_map *map, enum isl_dim_type type); +isl_bool isl_map_has_tuple_id(__isl_keep isl_map *map, enum isl_dim_type type); __isl_give isl_id *isl_map_get_tuple_id(__isl_keep isl_map *map, enum isl_dim_type type); +__isl_give isl_map *isl_map_reset_user(__isl_take isl_map *map); +int isl_basic_map_find_dim_by_name(__isl_keep isl_basic_map *bmap, + enum isl_dim_type type, const char *name); int isl_map_find_dim_by_id(__isl_keep isl_map *map, enum isl_dim_type type, __isl_keep isl_id *id); int isl_map_find_dim_by_name(__isl_keep isl_map *map, enum isl_dim_type type, @@ -111,19 +117,9 @@ int isl_basic_map_is_rational(__isl_keep isl_basic_map *bmap); -struct isl_basic_map *isl_basic_map_alloc(struct isl_ctx *ctx, - unsigned nparam, unsigned in, unsigned out, unsigned extra, - unsigned n_eq, unsigned n_ineq); __isl_give isl_basic_map *isl_basic_map_identity(__isl_take isl_space *dim); -struct isl_basic_map *isl_basic_map_identity_like(struct isl_basic_map *model); -struct isl_basic_map *isl_basic_map_finalize(struct isl_basic_map *bmap); -void *isl_basic_map_free(__isl_take isl_basic_map *bmap); +__isl_null isl_basic_map *isl_basic_map_free(__isl_take isl_basic_map *bmap); __isl_give isl_basic_map *isl_basic_map_copy(__isl_keep isl_basic_map *bmap); -struct isl_basic_map *isl_basic_map_extend(struct isl_basic_map *base, - unsigned nparam, unsigned n_in, unsigned n_out, unsigned extra, - unsigned n_eq, unsigned n_ineq); -struct isl_basic_map *isl_basic_map_extend_constraints( - struct isl_basic_map *base, unsigned n_eq, unsigned n_ineq); __isl_give isl_basic_map *isl_basic_map_equal( __isl_take isl_space *dim, unsigned n_equal); __isl_give isl_basic_map *isl_basic_map_less_at(__isl_take isl_space *dim, @@ -131,18 +127,16 @@ __isl_give isl_basic_map *isl_basic_map_more_at(__isl_take isl_space *dim, unsigned pos); __isl_give isl_basic_map *isl_basic_map_empty(__isl_take isl_space *dim); -struct isl_basic_map *isl_basic_map_empty_like(struct isl_basic_map *model); -struct isl_basic_map *isl_basic_map_empty_like_map(struct isl_map *model); __isl_give isl_basic_map *isl_basic_map_universe(__isl_take isl_space *dim); __isl_give isl_basic_map *isl_basic_map_nat_universe(__isl_take isl_space *dim); -__isl_give isl_basic_map *isl_basic_map_universe_like( - __isl_keep isl_basic_map *bmap); __isl_give isl_basic_map *isl_basic_map_remove_redundancies( __isl_take isl_basic_map *bmap); __isl_give isl_map *isl_map_remove_redundancies(__isl_take isl_map *map); __isl_give isl_basic_map *isl_map_simple_hull(__isl_take isl_map *map); __isl_give isl_basic_map *isl_map_unshifted_simple_hull( __isl_take isl_map *map); +__isl_give isl_basic_map *isl_map_unshifted_simple_hull_from_map_list( + __isl_take isl_map *map, __isl_take isl_map_list *list); __isl_export __isl_give isl_basic_map *isl_basic_map_intersect_domain( @@ -156,6 +150,8 @@ __isl_give isl_basic_map *isl_basic_map_intersect( __isl_take isl_basic_map *bmap1, __isl_take isl_basic_map *bmap2); +__isl_give isl_basic_map *isl_basic_map_list_intersect( + __isl_take isl_basic_map_list *list); __isl_export __isl_give isl_map *isl_basic_map_union( __isl_take isl_basic_map *bmap1, @@ -171,6 +167,10 @@ __isl_export __isl_give isl_basic_map *isl_basic_map_affine_hull( __isl_take isl_basic_map *bmap); +__isl_give isl_basic_map *isl_basic_map_preimage_domain_multi_aff( + __isl_take isl_basic_map *bmap, __isl_take isl_multi_aff *ma); +__isl_give isl_basic_map *isl_basic_map_preimage_range_multi_aff( + __isl_take isl_basic_map *bmap, __isl_take isl_multi_aff *ma); __isl_export __isl_give isl_basic_map *isl_basic_map_reverse(__isl_take isl_basic_map *bmap); __isl_give isl_basic_set *isl_basic_map_domain(__isl_take isl_basic_map *bmap); @@ -187,10 +187,8 @@ enum isl_dim_type type, unsigned first, unsigned n); __isl_give isl_basic_map *isl_basic_map_from_basic_set( __isl_take isl_basic_set *bset, __isl_take isl_space *dim); -struct isl_basic_set *isl_basic_set_from_basic_map(struct isl_basic_map *bmap); __isl_export __isl_give isl_basic_map *isl_basic_map_sample(__isl_take isl_basic_map *bmap); -struct isl_basic_map *isl_basic_map_simplify(struct isl_basic_map *bmap); __isl_export __isl_give isl_basic_map *isl_basic_map_detect_equalities( __isl_take isl_basic_map *bmap); @@ -203,13 +201,10 @@ __isl_constructor __isl_give isl_map *isl_map_read_from_str(isl_ctx *ctx, const char *str); void isl_basic_map_dump(__isl_keep isl_basic_map *bmap); -void isl_basic_map_print(__isl_keep isl_basic_map *bmap, FILE *out, int indent, - const char *prefix, const char *suffix, unsigned output_format); void isl_map_dump(__isl_keep isl_map *map); -void isl_map_print(__isl_keep isl_map *map, FILE *out, int indent, - unsigned output_format); __isl_give isl_printer *isl_printer_print_basic_map( __isl_take isl_printer *printer, __isl_keep isl_basic_map *bmap); +__isl_give char *isl_map_to_str(__isl_keep isl_map *map); __isl_give isl_printer *isl_printer_print_map(__isl_take isl_printer *printer, __isl_keep isl_map *map); __isl_give isl_basic_map *isl_basic_map_fix_si(__isl_take isl_basic_map *bmap, @@ -226,19 +221,17 @@ struct isl_basic_map *isl_basic_map_sum( struct isl_basic_map *bmap1, struct isl_basic_map *bmap2); struct isl_basic_map *isl_basic_map_neg(struct isl_basic_map *bmap); -struct isl_basic_map *isl_basic_map_floordiv(struct isl_basic_map *bmap, - isl_int d); struct isl_map *isl_map_sum(struct isl_map *map1, struct isl_map *map2); struct isl_map *isl_map_neg(struct isl_map *map); -struct isl_map *isl_map_floordiv(struct isl_map *map, isl_int d); __isl_give isl_map *isl_map_floordiv_val(__isl_take isl_map *map, __isl_take isl_val *d); __isl_export -int isl_basic_map_is_equal( - __isl_keep isl_basic_map *bmap1, - __isl_keep isl_basic_map *bmap2); +isl_bool isl_basic_map_is_equal(__isl_keep isl_basic_map *bmap1, + __isl_keep isl_basic_map *bmap2); +isl_bool isl_basic_map_is_disjoint(__isl_keep isl_basic_map *bmap1, + __isl_keep isl_basic_map *bmap2); __isl_give isl_map *isl_basic_map_partial_lexmax( __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *dom, @@ -280,38 +273,25 @@ __isl_give isl_map *isl_map_drop_basic_map(__isl_take isl_map *map, __isl_keep isl_basic_map *bmap); -int isl_basic_map_plain_is_fixed(__isl_keep isl_basic_map *bmap, - enum isl_dim_type type, unsigned pos, isl_int *val); __isl_give isl_val *isl_basic_map_plain_get_val_if_fixed( __isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos); int isl_basic_map_image_is_bounded(__isl_keep isl_basic_map *bmap); -int isl_basic_map_is_universe(__isl_keep isl_basic_map *bmap); -int isl_basic_map_plain_is_empty(__isl_keep isl_basic_map *bmap); -int isl_basic_map_fast_is_empty(__isl_keep isl_basic_map *bmap); +isl_bool isl_basic_map_is_universe(__isl_keep isl_basic_map *bmap); +isl_bool isl_basic_map_plain_is_empty(__isl_keep isl_basic_map *bmap); __isl_export -int isl_basic_map_is_empty(__isl_keep isl_basic_map *bmap); +isl_bool isl_basic_map_is_empty(__isl_keep isl_basic_map *bmap); __isl_export -int isl_basic_map_is_subset(__isl_keep isl_basic_map *bmap1, +isl_bool isl_basic_map_is_subset(__isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2); -int isl_basic_map_is_strict_subset(__isl_keep isl_basic_map *bmap1, +isl_bool isl_basic_map_is_strict_subset(__isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2); -struct isl_map *isl_map_alloc(struct isl_ctx *ctx, - unsigned nparam, unsigned in, unsigned out, int n, - unsigned flags); __isl_give isl_map *isl_map_universe(__isl_take isl_space *dim); __isl_give isl_map *isl_map_nat_universe(__isl_take isl_space *dim); __isl_give isl_map *isl_map_empty(__isl_take isl_space *dim); -struct isl_map *isl_map_empty_like(struct isl_map *model); -struct isl_map *isl_map_empty_like_basic_map(struct isl_basic_map *model); -struct isl_map *isl_map_dup(struct isl_map *map); -__isl_give isl_map *isl_map_add_basic_map(__isl_take isl_map *map, - __isl_take isl_basic_map *bmap); __isl_give isl_map *isl_map_identity(__isl_take isl_space *dim); -struct isl_map *isl_map_identity_like(struct isl_map *model); -struct isl_map *isl_map_identity_like_basic_map(struct isl_basic_map *model); __isl_give isl_map *isl_map_lex_lt_first(__isl_take isl_space *dim, unsigned n); __isl_give isl_map *isl_map_lex_le_first(__isl_take isl_space *dim, unsigned n); __isl_give isl_map *isl_map_lex_lt(__isl_take isl_space *set_dim); @@ -320,11 +300,8 @@ __isl_give isl_map *isl_map_lex_ge_first(__isl_take isl_space *dim, unsigned n); __isl_give isl_map *isl_map_lex_gt(__isl_take isl_space *set_dim); __isl_give isl_map *isl_map_lex_ge(__isl_take isl_space *set_dim); -struct isl_map *isl_map_finalize(struct isl_map *map); -void *isl_map_free(__isl_take isl_map *map); +__isl_null isl_map *isl_map_free(__isl_take isl_map *map); __isl_give isl_map *isl_map_copy(__isl_keep isl_map *map); -struct isl_map *isl_map_extend(struct isl_map *base, - unsigned nparam, unsigned n_in, unsigned n_out); __isl_export __isl_give isl_map *isl_map_reverse(__isl_take isl_map *map); __isl_export @@ -351,6 +328,14 @@ __isl_take isl_map *map2); __isl_give isl_map *isl_map_preimage_domain_multi_aff(__isl_take isl_map *map, __isl_take isl_multi_aff *ma); +__isl_give isl_map *isl_map_preimage_range_multi_aff(__isl_take isl_map *map, + __isl_take isl_multi_aff *ma); +__isl_give isl_map *isl_map_preimage_domain_pw_multi_aff( + __isl_take isl_map *map, __isl_take isl_pw_multi_aff *pma); +__isl_give isl_map *isl_map_preimage_range_pw_multi_aff( + __isl_take isl_map *map, __isl_take isl_pw_multi_aff *pma); +__isl_give isl_map *isl_map_preimage_domain_multi_pw_aff( + __isl_take isl_map *map, __isl_take isl_multi_pw_aff *mpa); __isl_give isl_basic_map *isl_basic_map_product( __isl_take isl_basic_map *bmap1, __isl_take isl_basic_map *bmap2); __isl_give isl_map *isl_map_product(__isl_take isl_map *map1, @@ -373,6 +358,14 @@ __isl_take isl_map *map2); __isl_give isl_map *isl_map_flat_range_product(__isl_take isl_map *map1, __isl_take isl_map *map2); +isl_bool isl_map_domain_is_wrapping(__isl_keep isl_map *map); +isl_bool isl_map_range_is_wrapping(__isl_keep isl_map *map); +__isl_give isl_map *isl_map_factor_domain(__isl_take isl_map *map); +__isl_give isl_map *isl_map_factor_range(__isl_take isl_map *map); +__isl_give isl_map *isl_map_domain_factor_domain(__isl_take isl_map *map); +__isl_give isl_map *isl_map_domain_factor_range(__isl_take isl_map *map); +__isl_give isl_map *isl_map_range_factor_domain(__isl_take isl_map *map); +__isl_give isl_map *isl_map_range_factor_range(__isl_take isl_map *map); __isl_export __isl_give isl_map *isl_map_intersect(__isl_take isl_map *map1, __isl_take isl_map *map2); @@ -391,8 +384,6 @@ __isl_give isl_map *isl_map_complement(__isl_take isl_map *map); struct isl_map *isl_map_fix_input_si(struct isl_map *map, unsigned input, int value); -__isl_give isl_map *isl_map_fix(__isl_take isl_map *map, - enum isl_dim_type type, unsigned pos, isl_int value); __isl_give isl_map *isl_map_fix_si(__isl_take isl_map *map, enum isl_dim_type type, unsigned pos, int value); __isl_give isl_map *isl_map_fix_val(__isl_take isl_map *map, @@ -415,7 +406,7 @@ __isl_give isl_basic_map *isl_map_convex_hull(__isl_take isl_map *map); __isl_export __isl_give isl_basic_map *isl_map_polyhedral_hull(__isl_take isl_map *map); -__isl_give isl_basic_map *isl_basic_map_add(__isl_take isl_basic_map *bmap, +__isl_give isl_basic_map *isl_basic_map_add_dims(__isl_take isl_basic_map *bmap, enum isl_dim_type type, unsigned n); __isl_give isl_map *isl_map_add_dims(__isl_take isl_map *map, enum isl_dim_type type, unsigned n); @@ -456,6 +447,10 @@ enum isl_dim_type type1, int pos1, enum isl_dim_type type2, int pos2); __isl_give isl_basic_map *isl_basic_map_order_ge(__isl_take isl_basic_map *bmap, enum isl_dim_type type1, int pos1, enum isl_dim_type type2, int pos2); +__isl_give isl_map *isl_map_order_ge(__isl_take isl_map *map, + enum isl_dim_type type1, int pos1, enum isl_dim_type type2, int pos2); +__isl_give isl_map *isl_map_order_le(__isl_take isl_map *map, + enum isl_dim_type type1, int pos1, enum isl_dim_type type2, int pos2); __isl_give isl_map *isl_map_equate(__isl_take isl_map *map, enum isl_dim_type type1, int pos1, enum isl_dim_type type2, int pos2); __isl_give isl_map *isl_map_oppose(__isl_take isl_map *map, @@ -471,9 +466,9 @@ __isl_give isl_map *isl_set_identity(__isl_take isl_set *set); __isl_export -int isl_basic_set_is_wrapping(__isl_keep isl_basic_set *bset); +isl_bool isl_basic_set_is_wrapping(__isl_keep isl_basic_set *bset); __isl_export -int isl_set_is_wrapping(__isl_keep isl_set *set); +isl_bool isl_set_is_wrapping(__isl_keep isl_set *set); __isl_give isl_basic_set *isl_basic_map_wrap(__isl_take isl_basic_map *bmap); __isl_give isl_set *isl_map_wrap(__isl_take isl_map *map); __isl_give isl_basic_map *isl_basic_set_unwrap(__isl_take isl_basic_set *bset); @@ -502,6 +497,7 @@ __isl_give isl_set *isl_map_range(__isl_take isl_map *map); __isl_give isl_map *isl_map_domain_map(__isl_take isl_map *map); __isl_give isl_map *isl_map_range_map(__isl_take isl_map *map); +__isl_give isl_map *isl_set_wrapped_domain_map(__isl_take isl_set *set); __isl_constructor __isl_give isl_map *isl_map_from_basic_map(__isl_take isl_basic_map *bmap); __isl_give isl_map *isl_map_from_domain(__isl_take isl_set *set); @@ -509,54 +505,54 @@ __isl_take isl_basic_set *bset); __isl_give isl_basic_map *isl_basic_map_from_range( __isl_take isl_basic_set *bset); -struct isl_map *isl_map_from_range(struct isl_set *set); +__isl_give isl_map *isl_map_from_range(__isl_take isl_set *set); __isl_give isl_basic_map *isl_basic_map_from_domain_and_range( __isl_take isl_basic_set *domain, __isl_take isl_basic_set *range); __isl_give isl_map *isl_map_from_domain_and_range(__isl_take isl_set *domain, __isl_take isl_set *range); __isl_give isl_map *isl_map_from_set(__isl_take isl_set *set, __isl_take isl_space *dim); -struct isl_set *isl_set_from_map(struct isl_map *map); __isl_export __isl_give isl_basic_map *isl_map_sample(__isl_take isl_map *map); -int isl_map_plain_is_empty(__isl_keep isl_map *map); -int isl_map_fast_is_empty(__isl_keep isl_map *map); -int isl_map_plain_is_universe(__isl_keep isl_map *map); +isl_bool isl_map_plain_is_empty(__isl_keep isl_map *map); +isl_bool isl_map_plain_is_universe(__isl_keep isl_map *map); __isl_export -int isl_map_is_empty(__isl_keep isl_map *map); +isl_bool isl_map_is_empty(__isl_keep isl_map *map); __isl_export -int isl_map_is_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2); +isl_bool isl_map_is_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2); __isl_export -int isl_map_is_strict_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2); +isl_bool isl_map_is_strict_subset(__isl_keep isl_map *map1, + __isl_keep isl_map *map2); __isl_export -int isl_map_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2); +isl_bool isl_map_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2); __isl_export -int isl_map_is_disjoint(__isl_keep isl_map *map1, __isl_keep isl_map *map2); -int isl_basic_map_is_single_valued(__isl_keep isl_basic_map *bmap); -int isl_map_plain_is_single_valued(__isl_keep isl_map *map); +isl_bool isl_map_is_disjoint(__isl_keep isl_map *map1, + __isl_keep isl_map *map2); +isl_bool isl_basic_map_is_single_valued(__isl_keep isl_basic_map *bmap); +isl_bool isl_map_plain_is_single_valued(__isl_keep isl_map *map); __isl_export -int isl_map_is_single_valued(__isl_keep isl_map *map); -int isl_map_plain_is_injective(__isl_keep isl_map *map); +isl_bool isl_map_is_single_valued(__isl_keep isl_map *map); +isl_bool isl_map_plain_is_injective(__isl_keep isl_map *map); __isl_export -int isl_map_is_injective(__isl_keep isl_map *map); +isl_bool isl_map_is_injective(__isl_keep isl_map *map); __isl_export -int isl_map_is_bijective(__isl_keep isl_map *map); +isl_bool isl_map_is_bijective(__isl_keep isl_map *map); int isl_map_is_translation(__isl_keep isl_map *map); int isl_map_has_equal_space(__isl_keep isl_map *map1, __isl_keep isl_map *map2); -int isl_basic_map_can_zip(__isl_keep isl_basic_map *bmap); -int isl_map_can_zip(__isl_keep isl_map *map); +isl_bool isl_basic_map_can_zip(__isl_keep isl_basic_map *bmap); +isl_bool isl_map_can_zip(__isl_keep isl_map *map); __isl_give isl_basic_map *isl_basic_map_zip(__isl_take isl_basic_map *bmap); __isl_give isl_map *isl_map_zip(__isl_take isl_map *map); -int isl_basic_map_can_curry(__isl_keep isl_basic_map *bmap); -int isl_map_can_curry(__isl_keep isl_map *map); +isl_bool isl_basic_map_can_curry(__isl_keep isl_basic_map *bmap); +isl_bool isl_map_can_curry(__isl_keep isl_map *map); __isl_give isl_basic_map *isl_basic_map_curry(__isl_take isl_basic_map *bmap); __isl_give isl_map *isl_map_curry(__isl_take isl_map *map); -int isl_basic_map_can_uncurry(__isl_keep isl_basic_map *bmap); -int isl_map_can_uncurry(__isl_keep isl_map *map); +isl_bool isl_basic_map_can_uncurry(__isl_keep isl_basic_map *bmap); +isl_bool isl_map_can_uncurry(__isl_keep isl_map *map); __isl_give isl_basic_map *isl_basic_map_uncurry(__isl_take isl_basic_map *bmap); __isl_give isl_map *isl_map_uncurry(__isl_take isl_map *map); @@ -572,22 +568,18 @@ __isl_take isl_map *map, enum isl_dim_type type, unsigned first, unsigned n); -int isl_basic_map_involves_dims(__isl_keep isl_basic_map *bmap, +isl_bool isl_basic_map_involves_dims(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned first, unsigned n); -int isl_map_involves_dims(__isl_keep isl_map *map, +isl_bool isl_map_involves_dims(__isl_keep isl_map *map, enum isl_dim_type type, unsigned first, unsigned n); void isl_map_print_internal(__isl_keep isl_map *map, FILE *out, int indent); -int isl_map_plain_input_is_fixed(__isl_keep isl_map *map, - unsigned in, isl_int *val); -int isl_map_plain_is_fixed(__isl_keep isl_map *map, - enum isl_dim_type type, unsigned pos, isl_int *val); -int isl_map_fast_is_fixed(__isl_keep isl_map *map, - enum isl_dim_type type, unsigned pos, isl_int *val); __isl_give isl_val *isl_map_plain_get_val_if_fixed(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos); +__isl_give isl_basic_map *isl_basic_map_gist_domain( + __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *context); __isl_export __isl_give isl_basic_map *isl_basic_map_gist(__isl_take isl_basic_map *bmap, __isl_take isl_basic_map *context); @@ -607,18 +599,18 @@ __isl_export __isl_give isl_map *isl_map_coalesce(__isl_take isl_map *map); -int isl_map_plain_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2); -int isl_map_fast_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2); +isl_bool isl_map_plain_is_equal(__isl_keep isl_map *map1, + __isl_keep isl_map *map2); uint32_t isl_map_get_hash(__isl_keep isl_map *map); +int isl_map_n_basic_map(__isl_keep isl_map *map); __isl_export -int isl_map_foreach_basic_map(__isl_keep isl_map *map, - int (*fn)(__isl_take isl_basic_map *bmap, void *user), void *user); +isl_stat isl_map_foreach_basic_map(__isl_keep isl_map *map, + isl_stat (*fn)(__isl_take isl_basic_map *bmap, void *user), void *user); __isl_give isl_map *isl_set_lifting(__isl_take isl_set *set); -__isl_give isl_map *isl_map_fixed_power(__isl_take isl_map *map, isl_int exp); __isl_give isl_map *isl_map_fixed_power_val(__isl_take isl_map *map, __isl_take isl_val *exp); __isl_give isl_map *isl_map_power(__isl_take isl_map *map, int *exact); @@ -666,10 +658,11 @@ __isl_give isl_pw_aff *isl_map_dim_max(__isl_take isl_map *map, int pos); +ISL_DECLARE_LIST_FN(basic_map) +ISL_DECLARE_LIST_FN(map) + #if defined(__cplusplus) } #endif -#include - #endif diff -Nru cloog-0.18.2/isl/include/isl/map_to_basic_set.h cloog-0.18.4/isl/include/isl/map_to_basic_set.h --- cloog-0.18.2/isl/include/isl/map_to_basic_set.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/map_to_basic_set.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,13 @@ +#ifndef ISL_MAP_TO_BASIC_SET_H +#define ISL_MAP_TO_BASIC_SET_H + +#include +#include + +#define ISL_KEY_BASE map +#define ISL_VAL_BASE basic_set +#include +#undef ISL_KEY_BASE +#undef ISL_VAL_BASE + +#endif diff -Nru cloog-0.18.2/isl/include/isl/map_type.h cloog-0.18.4/isl/include/isl/map_type.h --- cloog-0.18.2/isl/include/isl/map_type.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/map_type.h 2015-07-24 12:23:09.000000000 +0000 @@ -10,8 +10,10 @@ struct __isl_subclass(isl_map) isl_basic_map; typedef struct isl_basic_map isl_basic_map; +ISL_DECLARE_LIST_TYPE(basic_map) struct __isl_subclass(isl_union_map) isl_map; typedef struct isl_map isl_map; +ISL_DECLARE_LIST_TYPE(map) #ifndef isl_basic_set struct __isl_subclass(isl_set) isl_basic_set; diff -Nru cloog-0.18.2/isl/include/isl/mat.h cloog-0.18.4/isl/include/isl/mat.h --- cloog-0.18.2/isl/include/isl/mat.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/mat.h 2014-10-02 15:33:27.000000000 +0000 @@ -12,9 +12,7 @@ #include -#include #include -#include #include #include @@ -35,15 +33,12 @@ struct isl_mat *isl_mat_identity(struct isl_ctx *ctx, unsigned n_row); __isl_give isl_mat *isl_mat_copy(__isl_keep isl_mat *mat); struct isl_mat *isl_mat_cow(struct isl_mat *mat); -void *isl_mat_free(__isl_take isl_mat *mat); +__isl_null isl_mat *isl_mat_free(__isl_take isl_mat *mat); int isl_mat_rows(__isl_keep isl_mat *mat); int isl_mat_cols(__isl_keep isl_mat *mat); -int isl_mat_get_element(__isl_keep isl_mat *mat, int row, int col, isl_int *v); __isl_give isl_val *isl_mat_get_element_val(__isl_keep isl_mat *mat, int row, int col); -__isl_give isl_mat *isl_mat_set_element(__isl_take isl_mat *mat, - int row, int col, isl_int v); __isl_give isl_mat *isl_mat_set_element_si(__isl_take isl_mat *mat, int row, int col, int v); __isl_give isl_mat *isl_mat_set_element_val(__isl_take isl_mat *mat, @@ -71,9 +66,6 @@ __isl_give isl_mat *isl_mat_right_inverse(__isl_take isl_mat *mat); __isl_give isl_mat *isl_mat_right_kernel(__isl_take isl_mat *mat); -__isl_give isl_mat *isl_mat_scale_down_row(__isl_take isl_mat *mat, int row, - isl_int m); - __isl_give isl_mat *isl_mat_normalize(__isl_take isl_mat *mat); __isl_give isl_mat *isl_mat_normalize_row(__isl_take isl_mat *mat, int row); @@ -96,9 +88,6 @@ __isl_give isl_mat *isl_mat_add_zero_rows(__isl_take isl_mat *mat, unsigned n); void isl_mat_col_add(__isl_keep isl_mat *mat, int dst_col, int src_col); -void isl_mat_col_mul(struct isl_mat *mat, int dst_col, isl_int f, int src_col); -void isl_mat_col_submul(struct isl_mat *mat, - int dst_col, isl_int f, int src_col); struct isl_mat *isl_mat_unimodular_complete(struct isl_mat *M, int row); diff -Nru cloog-0.18.2/isl/include/isl/multi.h cloog-0.18.4/isl/include/isl/multi.h --- cloog-0.18.2/isl/include/isl/multi.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/multi.h 2015-07-24 12:23:09.000000000 +0000 @@ -3,6 +3,7 @@ #include #include +#include #if defined(__cplusplus) extern "C" { @@ -17,30 +18,48 @@ __isl_keep isl_multi_##BASE *multi); \ __isl_give isl_space *isl_multi_##BASE##_get_domain_space( \ __isl_keep isl_multi_##BASE *multi); \ +int isl_multi_##BASE##_find_dim_by_name( \ + __isl_keep isl_multi_##BASE *multi, \ + enum isl_dim_type type, const char *name); \ __isl_give isl_multi_##BASE *isl_multi_##BASE##_from_##BASE##_list( \ __isl_take isl_space *space, __isl_take isl_##BASE##_list *list); \ __isl_give isl_multi_##BASE *isl_multi_##BASE##_zero( \ __isl_take isl_space *space); \ __isl_give isl_multi_##BASE *isl_multi_##BASE##_copy( \ __isl_keep isl_multi_##BASE *multi); \ -void *isl_multi_##BASE##_free(__isl_take isl_multi_##BASE *multi); \ +__isl_null isl_multi_##BASE *isl_multi_##BASE##_free( \ + __isl_take isl_multi_##BASE *multi); \ +isl_bool isl_multi_##BASE##_plain_is_equal( \ + __isl_keep isl_multi_##BASE *multi1, \ + __isl_keep isl_multi_##BASE *multi2); \ +int isl_multi_##BASE##_find_dim_by_id( \ + __isl_keep isl_multi_##BASE *multi, enum isl_dim_type type, \ + __isl_keep isl_id *id); \ +__isl_give isl_id *isl_multi_##BASE##_get_dim_id( \ + __isl_take isl_multi_##BASE *multi, \ + enum isl_dim_type type, unsigned pos); \ __isl_give isl_multi_##BASE *isl_multi_##BASE##_set_dim_name( \ __isl_take isl_multi_##BASE *multi, \ enum isl_dim_type type, unsigned pos, const char *s); \ +__isl_give isl_multi_##BASE *isl_multi_##BASE##_set_dim_id( \ + __isl_take isl_multi_##BASE *multi, \ + enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); \ const char *isl_multi_##BASE##_get_tuple_name( \ __isl_keep isl_multi_##BASE *multi, enum isl_dim_type type); \ +isl_bool isl_multi_##BASE##_has_tuple_id( \ + __isl_keep isl_multi_##BASE *multi, enum isl_dim_type type); \ +__isl_give isl_id *isl_multi_##BASE##_get_tuple_id( \ + __isl_keep isl_multi_##BASE *multi, enum isl_dim_type type); \ __isl_give isl_multi_##BASE *isl_multi_##BASE##_set_tuple_name( \ __isl_take isl_multi_##BASE *multi, \ enum isl_dim_type type, const char *s); \ __isl_give isl_multi_##BASE *isl_multi_##BASE##_set_tuple_id( \ __isl_take isl_multi_##BASE *multi, \ enum isl_dim_type type, __isl_take isl_id *id); \ -__isl_give isl_multi_##BASE *isl_multi_##BASE##_insert_dims( \ - __isl_take isl_multi_##BASE *multi, enum isl_dim_type type, \ - unsigned first, unsigned n); \ -__isl_give isl_multi_##BASE *isl_multi_##BASE##_add_dims( \ - __isl_take isl_multi_##BASE *multi, enum isl_dim_type type, \ - unsigned n); \ +__isl_give isl_multi_##BASE *isl_multi_##BASE##_reset_tuple_id( \ + __isl_take isl_multi_##BASE *multi, enum isl_dim_type type); \ +__isl_give isl_multi_##BASE *isl_multi_##BASE##_reset_user( \ + __isl_take isl_multi_##BASE *multi); \ __isl_give isl_multi_##BASE *isl_multi_##BASE##_drop_dims( \ __isl_take isl_multi_##BASE *multi, enum isl_dim_type type, \ unsigned first, unsigned n); \ @@ -52,23 +71,64 @@ __isl_give isl_multi_##BASE *isl_multi_##BASE##_range_splice( \ __isl_take isl_multi_##BASE *multi1, unsigned pos, \ __isl_take isl_multi_##BASE *multi2); \ -__isl_give isl_multi_##BASE *isl_multi_##BASE##_splice( \ - __isl_take isl_multi_##BASE *multi1, unsigned in_pos, \ - unsigned out_pos, __isl_take isl_multi_##BASE *multi2); \ +__isl_give isl_multi_##BASE *isl_multi_##BASE##_flatten_range( \ + __isl_take isl_multi_##BASE *multi); \ __isl_give isl_multi_##BASE *isl_multi_##BASE##_flat_range_product( \ __isl_take isl_multi_##BASE *multi1, \ __isl_take isl_multi_##BASE *multi2); \ __isl_give isl_multi_##BASE *isl_multi_##BASE##_range_product( \ __isl_take isl_multi_##BASE *multi1, \ __isl_take isl_multi_##BASE *multi2); \ +isl_bool isl_multi_##BASE##_range_is_wrapping( \ + __isl_keep isl_multi_##BASE *multi); \ +__isl_give isl_multi_##BASE *isl_multi_##BASE##_range_factor_domain( \ + __isl_take isl_multi_##BASE *multi); \ +__isl_give isl_multi_##BASE *isl_multi_##BASE##_range_factor_range( \ + __isl_take isl_multi_##BASE *multi); \ __isl_give isl_multi_##BASE *isl_multi_##BASE##_scale_val( \ __isl_take isl_multi_##BASE *multi, __isl_take isl_val *v); \ +__isl_give isl_multi_##BASE *isl_multi_##BASE##_scale_down_val( \ + __isl_take isl_multi_##BASE *multi, __isl_take isl_val *v); \ __isl_give isl_multi_##BASE *isl_multi_##BASE##_scale_multi_val( \ __isl_take isl_multi_##BASE *multi, \ __isl_take isl_multi_val *mv); \ +__isl_give isl_multi_##BASE *isl_multi_##BASE##_scale_down_multi_val( \ + __isl_take isl_multi_##BASE *multi, \ + __isl_take isl_multi_val *mv); \ +__isl_give isl_multi_##BASE *isl_multi_##BASE##_mod_multi_val( \ + __isl_take isl_multi_##BASE *multi, \ + __isl_take isl_multi_val *mv); \ +__isl_give isl_multi_##BASE *isl_multi_##BASE##_sub( \ + __isl_take isl_multi_##BASE *multi1, \ + __isl_take isl_multi_##BASE *multi2); \ __isl_give isl_multi_##BASE *isl_multi_##BASE##_align_params( \ __isl_take isl_multi_##BASE *multi, \ - __isl_take isl_space *model); + __isl_take isl_space *model); \ +__isl_give isl_multi_##BASE *isl_multi_##BASE##_from_range( \ + __isl_take isl_multi_##BASE *multi); + +#define ISL_DECLARE_MULTI_NEG(BASE) \ +__isl_give isl_multi_##BASE *isl_multi_##BASE##_neg( \ + __isl_take isl_multi_##BASE *multi); + +#define ISL_DECLARE_MULTI_DIMS(BASE) \ +isl_bool isl_multi_##BASE##_involves_dims( \ + __isl_keep isl_multi_##BASE *multi, enum isl_dim_type type, \ + unsigned first, unsigned n); \ +__isl_give isl_multi_##BASE *isl_multi_##BASE##_insert_dims( \ + __isl_take isl_multi_##BASE *multi, enum isl_dim_type type, \ + unsigned first, unsigned n); \ +__isl_give isl_multi_##BASE *isl_multi_##BASE##_add_dims( \ + __isl_take isl_multi_##BASE *multi, enum isl_dim_type type, \ + unsigned n); + +#define ISL_DECLARE_MULTI_WITH_DOMAIN(BASE) \ +__isl_give isl_multi_##BASE *isl_multi_##BASE##_product( \ + __isl_take isl_multi_##BASE *multi1, \ + __isl_take isl_multi_##BASE *multi2); \ +__isl_give isl_multi_##BASE *isl_multi_##BASE##_splice( \ + __isl_take isl_multi_##BASE *multi1, unsigned in_pos, \ + unsigned out_pos, __isl_take isl_multi_##BASE *multi2); #if defined(__cplusplus) } diff -Nru cloog-0.18.2/isl/include/isl/obj.h cloog-0.18.4/isl/include/isl/obj.h --- cloog-0.18.2/isl/include/isl/obj.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/obj.h 2015-07-24 12:23:09.000000000 +0000 @@ -33,6 +33,8 @@ #define isl_obj_map (&isl_obj_map_vtable) extern struct isl_obj_vtable isl_obj_union_map_vtable; #define isl_obj_union_map (&isl_obj_union_map_vtable) +extern struct isl_obj_vtable isl_obj_pw_multi_aff_vtable; +#define isl_obj_pw_multi_aff (&isl_obj_pw_multi_aff_vtable) extern struct isl_obj_vtable isl_obj_pw_qpolynomial_vtable; #define isl_obj_pw_qpolynomial (&isl_obj_pw_qpolynomial_vtable) extern struct isl_obj_vtable isl_obj_union_pw_qpolynomial_vtable; @@ -41,24 +43,13 @@ #define isl_obj_pw_qpolynomial_fold (&isl_obj_pw_qpolynomial_fold_vtable) extern struct isl_obj_vtable isl_obj_union_pw_qpolynomial_fold_vtable; #define isl_obj_union_pw_qpolynomial_fold (&isl_obj_union_pw_qpolynomial_fold_vtable) +extern struct isl_obj_vtable isl_obj_schedule_vtable; +#define isl_obj_schedule (&isl_obj_schedule_vtable) struct isl_obj { isl_obj_type type; void *v; }; -struct isl_int_obj; -typedef struct isl_int_obj isl_int_obj; - -__isl_give isl_int_obj *isl_int_obj_alloc(isl_ctx *ctx, isl_int v); -void isl_int_obj_free(__isl_take isl_int_obj *i); -__isl_give isl_int_obj *isl_int_obj_add(__isl_take isl_int_obj *i1, - __isl_take isl_int_obj *i2); -__isl_give isl_int_obj *isl_int_obj_sub(__isl_take isl_int_obj *i1, - __isl_take isl_int_obj *i2); -__isl_give isl_int_obj *isl_int_obj_mul(__isl_take isl_int_obj *i1, - __isl_take isl_int_obj *i2); -void isl_int_obj_get_int(__isl_keep isl_int_obj *i, isl_int *v); - #if defined(__cplusplus) } #endif diff -Nru cloog-0.18.2/isl/include/isl/options.h cloog-0.18.4/isl/include/isl/options.h --- cloog-0.18.2/isl/include/isl/options.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/options.h 2015-07-24 12:23:09.000000000 +0000 @@ -23,24 +23,24 @@ #define ISL_BOUND_BERNSTEIN 0 #define ISL_BOUND_RANGE 1 -int isl_options_set_bound(isl_ctx *ctx, int val); +isl_stat isl_options_set_bound(isl_ctx *ctx, int val); int isl_options_get_bound(isl_ctx *ctx); #define ISL_ON_ERROR_WARN 0 #define ISL_ON_ERROR_CONTINUE 1 #define ISL_ON_ERROR_ABORT 2 -int isl_options_set_on_error(isl_ctx *ctx, int val); +isl_stat isl_options_set_on_error(isl_ctx *ctx, int val); int isl_options_get_on_error(isl_ctx *ctx); -int isl_options_set_gbr_only_first(isl_ctx *ctx, int val); +isl_stat isl_options_set_gbr_only_first(isl_ctx *ctx, int val); int isl_options_get_gbr_only_first(isl_ctx *ctx); #define ISL_SCHEDULE_ALGORITHM_ISL 0 #define ISL_SCHEDULE_ALGORITHM_FEAUTRIER 1 -int isl_options_set_schedule_algorithm(isl_ctx *ctx, int val); +isl_stat isl_options_set_schedule_algorithm(isl_ctx *ctx, int val); int isl_options_get_schedule_algorithm(isl_ctx *ctx); -int isl_options_set_coalesce_bounded_wrapping(isl_ctx *ctx, int val); +isl_stat isl_options_set_coalesce_bounded_wrapping(isl_ctx *ctx, int val); int isl_options_get_coalesce_bounded_wrapping(isl_ctx *ctx); #if defined(__cplusplus) diff -Nru cloog-0.18.2/isl/include/isl/point.h cloog-0.18.4/isl/include/isl/point.h --- cloog-0.18.2/isl/include/isl/point.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/point.h 2015-07-24 12:23:09.000000000 +0000 @@ -19,12 +19,8 @@ __isl_give isl_point *isl_point_copy(__isl_keep isl_point *pnt); void isl_point_free(__isl_take isl_point *pnt); -int isl_point_get_coordinate(__isl_keep isl_point *pnt, - enum isl_dim_type type, int pos, isl_int *v); __isl_give isl_val *isl_point_get_coordinate_val(__isl_keep isl_point *pnt, enum isl_dim_type type, int pos); -__isl_give isl_point *isl_point_set_coordinate(__isl_take isl_point *pnt, - enum isl_dim_type type, int pos, isl_int v); __isl_give isl_point *isl_point_set_coordinate_val(__isl_take isl_point *pnt, enum isl_dim_type type, int pos, __isl_take isl_val *v); @@ -34,7 +30,7 @@ enum isl_dim_type type, int pos, unsigned val); __isl_give isl_point *isl_point_void(__isl_take isl_space *dim); -int isl_point_is_void(__isl_keep isl_point *pnt); +isl_bool isl_point_is_void(__isl_keep isl_point *pnt); __isl_give isl_printer *isl_printer_print_point( __isl_take isl_printer *printer, __isl_keep isl_point *pnt); @@ -44,6 +40,4 @@ } #endif -#include - #endif diff -Nru cloog-0.18.2/isl/include/isl/polynomial.h cloog-0.18.4/isl/include/isl/polynomial.h --- cloog-0.18.2/isl/include/isl/polynomial.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/polynomial.h 2015-07-24 12:23:09.000000000 +0000 @@ -22,7 +22,7 @@ __isl_give isl_space *isl_qpolynomial_get_space(__isl_keep isl_qpolynomial *qp); unsigned isl_qpolynomial_dim(__isl_keep isl_qpolynomial *qp, enum isl_dim_type type); -int isl_qpolynomial_involves_dims(__isl_keep isl_qpolynomial *qp, +isl_bool isl_qpolynomial_involves_dims(__isl_keep isl_qpolynomial *qp, enum isl_dim_type type, unsigned first, unsigned n); __isl_give isl_val *isl_qpolynomial_get_constant_val( @@ -37,25 +37,21 @@ __isl_give isl_qpolynomial *isl_qpolynomial_infty_on_domain(__isl_take isl_space *dim); __isl_give isl_qpolynomial *isl_qpolynomial_neginfty_on_domain(__isl_take isl_space *dim); __isl_give isl_qpolynomial *isl_qpolynomial_nan_on_domain(__isl_take isl_space *dim); -__isl_give isl_qpolynomial *isl_qpolynomial_rat_cst_on_domain(__isl_take isl_space *dim, - const isl_int n, const isl_int d); __isl_give isl_qpolynomial *isl_qpolynomial_val_on_domain( __isl_take isl_space *space, __isl_take isl_val *val); __isl_give isl_qpolynomial *isl_qpolynomial_var_on_domain(__isl_take isl_space *dim, enum isl_dim_type type, unsigned pos); __isl_give isl_qpolynomial *isl_qpolynomial_copy(__isl_keep isl_qpolynomial *qp); -void *isl_qpolynomial_free(__isl_take isl_qpolynomial *qp); +__isl_null isl_qpolynomial *isl_qpolynomial_free( + __isl_take isl_qpolynomial *qp); -int isl_qpolynomial_plain_is_equal(__isl_keep isl_qpolynomial *qp1, +isl_bool isl_qpolynomial_plain_is_equal(__isl_keep isl_qpolynomial *qp1, __isl_keep isl_qpolynomial *qp2); -int isl_qpolynomial_is_zero(__isl_keep isl_qpolynomial *qp); -int isl_qpolynomial_is_nan(__isl_keep isl_qpolynomial *qp); -int isl_qpolynomial_is_infty(__isl_keep isl_qpolynomial *qp); -int isl_qpolynomial_is_neginfty(__isl_keep isl_qpolynomial *qp); +isl_bool isl_qpolynomial_is_zero(__isl_keep isl_qpolynomial *qp); +isl_bool isl_qpolynomial_is_nan(__isl_keep isl_qpolynomial *qp); +isl_bool isl_qpolynomial_is_infty(__isl_keep isl_qpolynomial *qp); +isl_bool isl_qpolynomial_is_neginfty(__isl_keep isl_qpolynomial *qp); int isl_qpolynomial_sgn(__isl_keep isl_qpolynomial *qp); -int isl_qpolynomial_is_cst(__isl_keep isl_qpolynomial *qp, - isl_int *n, isl_int *d); -void isl_qpolynomial_get_den(__isl_keep isl_qpolynomial *qp, isl_int *d); __isl_give isl_qpolynomial *isl_qpolynomial_neg(__isl_take isl_qpolynomial *qp); __isl_give isl_qpolynomial *isl_qpolynomial_add(__isl_take isl_qpolynomial *qp1, @@ -66,14 +62,10 @@ __isl_take isl_qpolynomial *qp2); __isl_give isl_qpolynomial *isl_qpolynomial_pow(__isl_take isl_qpolynomial *qp, unsigned power); -__isl_give isl_qpolynomial *isl_qpolynomial_add_isl_int( - __isl_take isl_qpolynomial *qp, isl_int v); -__isl_give isl_qpolynomial *isl_qpolynomial_mul_isl_int( - __isl_take isl_qpolynomial *qp, isl_int v); -__isl_give isl_qpolynomial *isl_qpolynomial_scale( - __isl_take isl_qpolynomial *qp, isl_int v); __isl_give isl_qpolynomial *isl_qpolynomial_scale_val( __isl_take isl_qpolynomial *qp, __isl_take isl_val *v); +__isl_give isl_qpolynomial *isl_qpolynomial_scale_down_val( + __isl_take isl_qpolynomial *qp, __isl_take isl_val *v); __isl_give isl_qpolynomial *isl_qpolynomial_insert_dims( __isl_take isl_qpolynomial *qp, enum isl_dim_type type, @@ -112,18 +104,16 @@ void isl_term_free(__isl_take isl_term *term); unsigned isl_term_dim(__isl_keep isl_term *term, enum isl_dim_type type); -void isl_term_get_num(__isl_keep isl_term *term, isl_int *n); -void isl_term_get_den(__isl_keep isl_term *term, isl_int *d); __isl_give isl_val *isl_term_get_coefficient_val(__isl_keep isl_term *term); int isl_term_get_exp(__isl_keep isl_term *term, enum isl_dim_type type, unsigned pos); __isl_give isl_aff *isl_term_get_div(__isl_keep isl_term *term, unsigned pos); -int isl_qpolynomial_foreach_term(__isl_keep isl_qpolynomial *qp, - int (*fn)(__isl_take isl_term *term, void *user), void *user); +isl_stat isl_qpolynomial_foreach_term(__isl_keep isl_qpolynomial *qp, + isl_stat (*fn)(__isl_take isl_term *term, void *user), void *user); -__isl_give isl_qpolynomial *isl_qpolynomial_eval( - __isl_take isl_qpolynomial *qp, __isl_take isl_point *pnt); +__isl_give isl_val *isl_qpolynomial_eval(__isl_take isl_qpolynomial *qp, + __isl_take isl_point *pnt); __isl_give isl_qpolynomial *isl_qpolynomial_gist_params( __isl_take isl_qpolynomial *qp, __isl_take isl_set *context); @@ -145,7 +135,7 @@ isl_ctx *isl_pw_qpolynomial_get_ctx(__isl_keep isl_pw_qpolynomial *pwqp); -int isl_pw_qpolynomial_plain_is_equal(__isl_keep isl_pw_qpolynomial *pwqp1, +isl_bool isl_pw_qpolynomial_plain_is_equal(__isl_keep isl_pw_qpolynomial *pwqp1, __isl_keep isl_pw_qpolynomial *pwqp2); __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_zero(__isl_take isl_space *dim); @@ -155,9 +145,10 @@ __isl_take isl_qpolynomial *qp); __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_copy( __isl_keep isl_pw_qpolynomial *pwqp); -void *isl_pw_qpolynomial_free(__isl_take isl_pw_qpolynomial *pwqp); +__isl_null isl_pw_qpolynomial *isl_pw_qpolynomial_free( + __isl_take isl_pw_qpolynomial *pwqp); -int isl_pw_qpolynomial_is_zero(__isl_keep isl_pw_qpolynomial *pwqp); +isl_bool isl_pw_qpolynomial_is_zero(__isl_keep isl_pw_qpolynomial *pwqp); __isl_give isl_space *isl_pw_qpolynomial_get_domain_space( __isl_keep isl_pw_qpolynomial *pwqp); @@ -167,7 +158,7 @@ __isl_take isl_pw_qpolynomial *pwqp, __isl_take isl_space *dim); unsigned isl_pw_qpolynomial_dim(__isl_keep isl_pw_qpolynomial *pwqp, enum isl_dim_type type); -int isl_pw_qpolynomial_involves_dims(__isl_keep isl_pw_qpolynomial *pwqp, +isl_bool isl_pw_qpolynomial_involves_dims(__isl_keep isl_pw_qpolynomial *pwqp, enum isl_dim_type type, unsigned first, unsigned n); int isl_pw_qpolynomial_has_equal_space(__isl_keep isl_pw_qpolynomial *pwqp1, __isl_keep isl_pw_qpolynomial *pwqp2); @@ -176,11 +167,19 @@ __isl_take isl_pw_qpolynomial *pwqp, enum isl_dim_type type, unsigned pos, const char *s); +int isl_pw_qpolynomial_find_dim_by_name(__isl_keep isl_pw_qpolynomial *pwqp, + enum isl_dim_type type, const char *name); + +__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_reset_user( + __isl_take isl_pw_qpolynomial *pwqp); + __isl_give isl_set *isl_pw_qpolynomial_domain(__isl_take isl_pw_qpolynomial *pwqp); __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_intersect_domain( __isl_take isl_pw_qpolynomial *pwpq, __isl_take isl_set *set); __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_intersect_params( __isl_take isl_pw_qpolynomial *pwpq, __isl_take isl_set *set); +__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_subtract_domain( + __isl_take isl_pw_qpolynomial *pwpq, __isl_take isl_set *set); __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_project_domain_on_params( __isl_take isl_pw_qpolynomial *pwqp); @@ -205,10 +204,10 @@ __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_mul( __isl_take isl_pw_qpolynomial *pwqp1, __isl_take isl_pw_qpolynomial *pwqp2); -__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_mul_isl_int( - __isl_take isl_pw_qpolynomial *pwqp, isl_int v); __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_scale_val( __isl_take isl_pw_qpolynomial *pwqp, __isl_take isl_val *v); +__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_scale_down_val( + __isl_take isl_pw_qpolynomial *pwqp, __isl_take isl_val *v); __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_pow( __isl_take isl_pw_qpolynomial *pwqp, unsigned exponent); @@ -223,26 +222,22 @@ enum isl_dim_type dst_type, unsigned dst_pos, enum isl_dim_type src_type, unsigned src_pos, unsigned n); -__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_fix_dim( - __isl_take isl_pw_qpolynomial *pwqp, - enum isl_dim_type type, unsigned n, isl_int v); __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_fix_val( __isl_take isl_pw_qpolynomial *pwqp, enum isl_dim_type type, unsigned n, __isl_take isl_val *v); -__isl_give isl_qpolynomial *isl_pw_qpolynomial_eval( +__isl_give isl_val *isl_pw_qpolynomial_eval( __isl_take isl_pw_qpolynomial *pwqp, __isl_take isl_point *pnt); -__isl_give isl_qpolynomial *isl_pw_qpolynomial_max( - __isl_take isl_pw_qpolynomial *pwqp); -__isl_give isl_qpolynomial *isl_pw_qpolynomial_min( - __isl_take isl_pw_qpolynomial *pwqp); +__isl_give isl_val *isl_pw_qpolynomial_max(__isl_take isl_pw_qpolynomial *pwqp); +__isl_give isl_val *isl_pw_qpolynomial_min(__isl_take isl_pw_qpolynomial *pwqp); -int isl_pw_qpolynomial_foreach_piece(__isl_keep isl_pw_qpolynomial *pwqp, - int (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, +isl_stat isl_pw_qpolynomial_foreach_piece(__isl_keep isl_pw_qpolynomial *pwqp, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, void *user), void *user); -int isl_pw_qpolynomial_foreach_lifted_piece(__isl_keep isl_pw_qpolynomial *pwqp, - int (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, +isl_stat isl_pw_qpolynomial_foreach_lifted_piece( + __isl_keep isl_pw_qpolynomial *pwqp, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, void *user), void *user); __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_from_pw_aff( @@ -285,6 +280,7 @@ void isl_qpolynomial_fold_free(__isl_take isl_qpolynomial_fold *fold); int isl_qpolynomial_fold_is_empty(__isl_keep isl_qpolynomial_fold *fold); +isl_bool isl_qpolynomial_fold_is_nan(__isl_keep isl_qpolynomial_fold *fold); int isl_qpolynomial_fold_plain_is_equal(__isl_keep isl_qpolynomial_fold *fold1, __isl_keep isl_qpolynomial_fold *fold2); @@ -295,12 +291,10 @@ __isl_take isl_qpolynomial_fold *fold1, __isl_take isl_qpolynomial_fold *fold2); -__isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_mul_isl_int( - __isl_take isl_qpolynomial_fold *fold, isl_int v); -__isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_scale( - __isl_take isl_qpolynomial_fold *fold, isl_int v); __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_scale_val( __isl_take isl_qpolynomial_fold *fold, __isl_take isl_val *v); +__isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_scale_down_val( + __isl_take isl_qpolynomial_fold *fold, __isl_take isl_val *v); __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_move_dims( __isl_take isl_qpolynomial_fold *fold, @@ -312,7 +306,7 @@ enum isl_dim_type type, unsigned first, unsigned n, __isl_keep isl_qpolynomial **subs); -__isl_give isl_qpolynomial *isl_qpolynomial_fold_eval( +__isl_give isl_val *isl_qpolynomial_fold_eval( __isl_take isl_qpolynomial_fold *fold, __isl_take isl_point *pnt); __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_gist_params( @@ -320,9 +314,9 @@ __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_gist( __isl_take isl_qpolynomial_fold *fold, __isl_take isl_set *context); -int isl_qpolynomial_fold_foreach_qpolynomial( +isl_stat isl_qpolynomial_fold_foreach_qpolynomial( __isl_keep isl_qpolynomial_fold *fold, - int (*fn)(__isl_take isl_qpolynomial *qp, void *user), void *user); + isl_stat (*fn)(__isl_take isl_qpolynomial *qp, void *user), void *user); __isl_give isl_printer *isl_printer_print_qpolynomial_fold( __isl_take isl_printer *p, __isl_keep isl_qpolynomial_fold *fold); @@ -332,7 +326,7 @@ isl_ctx *isl_pw_qpolynomial_fold_get_ctx(__isl_keep isl_pw_qpolynomial_fold *pwf); -int isl_pw_qpolynomial_fold_plain_is_equal( +isl_bool isl_pw_qpolynomial_fold_plain_is_equal( __isl_keep isl_pw_qpolynomial_fold *pwf1, __isl_keep isl_pw_qpolynomial_fold *pwf2); @@ -344,9 +338,11 @@ __isl_take isl_set *set, __isl_take isl_qpolynomial_fold *fold); __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_copy( __isl_keep isl_pw_qpolynomial_fold *pwf); -void *isl_pw_qpolynomial_fold_free(__isl_take isl_pw_qpolynomial_fold *pwf); +__isl_null isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_free( + __isl_take isl_pw_qpolynomial_fold *pwf); -int isl_pw_qpolynomial_fold_is_zero(__isl_keep isl_pw_qpolynomial_fold *pwf); +isl_bool isl_pw_qpolynomial_fold_is_zero( + __isl_keep isl_pw_qpolynomial_fold *pwf); __isl_give isl_space *isl_pw_qpolynomial_fold_get_domain_space( __isl_keep isl_pw_qpolynomial_fold *pwf); @@ -369,12 +365,21 @@ __isl_take isl_pw_qpolynomial_fold *pwf, enum isl_dim_type type, unsigned pos, const char *s); +int isl_pw_qpolynomial_fold_find_dim_by_name( + __isl_keep isl_pw_qpolynomial_fold *pwf, + enum isl_dim_type type, const char *name); + +__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_reset_user( + __isl_take isl_pw_qpolynomial_fold *pwf); + __isl_give isl_set *isl_pw_qpolynomial_fold_domain( __isl_take isl_pw_qpolynomial_fold *pwf); __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_intersect_domain( __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_set *set); __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_intersect_params( __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_set *set); +__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_subtract_domain( + __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_set *set); __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_add( __isl_take isl_pw_qpolynomial_fold *pwf1, @@ -385,10 +390,10 @@ __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_add_disjoint( __isl_take isl_pw_qpolynomial_fold *pwf1, __isl_take isl_pw_qpolynomial_fold *pwf2); -__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_mul_isl_int( - __isl_take isl_pw_qpolynomial_fold *pwf, isl_int v); __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_scale_val( __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_val *v); +__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_scale_down_val( + __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_val *v); __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_project_domain_on_params( __isl_take isl_pw_qpolynomial_fold *pwf); @@ -400,21 +405,17 @@ enum isl_dim_type dst_type, unsigned dst_pos, enum isl_dim_type src_type, unsigned src_pos, unsigned n); -__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_fix_dim( - __isl_take isl_pw_qpolynomial_fold *pwf, - enum isl_dim_type type, unsigned n, isl_int v); - -__isl_give isl_qpolynomial *isl_pw_qpolynomial_fold_eval( +__isl_give isl_val *isl_pw_qpolynomial_fold_eval( __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_point *pnt); -int isl_pw_qpolynomial_fold_foreach_piece( +isl_stat isl_pw_qpolynomial_fold_foreach_piece( __isl_keep isl_pw_qpolynomial_fold *pwf, - int (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial_fold *fold, - void *user), void *user); -int isl_pw_qpolynomial_fold_foreach_lifted_piece( + isl_stat (*fn)(__isl_take isl_set *set, + __isl_take isl_qpolynomial_fold *fold, void *user), void *user); +isl_stat isl_pw_qpolynomial_fold_foreach_lifted_piece( __isl_keep isl_pw_qpolynomial_fold *pwf, - int (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial_fold *fold, - void *user), void *user); + isl_stat (*fn)(__isl_take isl_set *set, + __isl_take isl_qpolynomial_fold *fold, void *user), void *user); __isl_give isl_printer *isl_printer_print_pw_qpolynomial_fold( __isl_take isl_printer *p, __isl_keep isl_pw_qpolynomial_fold *pwf); @@ -429,9 +430,9 @@ __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_gist_params( __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_set *context); -__isl_give isl_qpolynomial *isl_pw_qpolynomial_fold_max( +__isl_give isl_val *isl_pw_qpolynomial_fold_max( __isl_take isl_pw_qpolynomial_fold *pwf); -__isl_give isl_qpolynomial *isl_pw_qpolynomial_fold_min( +__isl_give isl_val *isl_pw_qpolynomial_fold_min( __isl_take isl_pw_qpolynomial_fold *pwf); __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_bound( @@ -451,7 +452,10 @@ isl_ctx *isl_union_pw_qpolynomial_get_ctx( __isl_keep isl_union_pw_qpolynomial *upwqp); -int isl_union_pw_qpolynomial_plain_is_equal( +unsigned isl_union_pw_qpolynomial_dim( + __isl_keep isl_union_pw_qpolynomial *upwqp, enum isl_dim_type type); + +isl_bool isl_union_pw_qpolynomial_plain_is_equal( __isl_keep isl_union_pw_qpolynomial *upwqp1, __isl_keep isl_union_pw_qpolynomial *upwqp2); @@ -463,12 +467,16 @@ __isl_take isl_pw_qpolynomial *pwqp); __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_copy( __isl_keep isl_union_pw_qpolynomial *upwqp); -void *isl_union_pw_qpolynomial_free(__isl_take isl_union_pw_qpolynomial *upwqp); +__isl_null isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_free( + __isl_take isl_union_pw_qpolynomial *upwqp); __isl_constructor __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_read_from_str( isl_ctx *ctx, const char *str); +__isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_neg( + __isl_take isl_union_pw_qpolynomial *upwqp); + __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_add( __isl_take isl_union_pw_qpolynomial *upwqp1, __isl_take isl_union_pw_qpolynomial *upwqp2); @@ -478,10 +486,10 @@ __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_mul( __isl_take isl_union_pw_qpolynomial *upwqp1, __isl_take isl_union_pw_qpolynomial *upwqp2); -__isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_mul_isl_int( - __isl_take isl_union_pw_qpolynomial *upwqp, isl_int v); __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_scale_val( __isl_take isl_union_pw_qpolynomial *upwqp, __isl_take isl_val *v); +__isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_scale_down_val( + __isl_take isl_union_pw_qpolynomial *upwqp, __isl_take isl_val *v); __isl_give isl_union_set *isl_union_pw_qpolynomial_domain( __isl_take isl_union_pw_qpolynomial *upwqp); @@ -491,11 +499,28 @@ __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_intersect_params( __isl_take isl_union_pw_qpolynomial *upwpq, __isl_take isl_set *set); +__isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_subtract_domain( + __isl_take isl_union_pw_qpolynomial *upwpq, + __isl_take isl_union_set *uset); __isl_give isl_space *isl_union_pw_qpolynomial_get_space( __isl_keep isl_union_pw_qpolynomial *upwqp); -__isl_give isl_qpolynomial *isl_union_pw_qpolynomial_eval( +__isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_set_dim_name( + __isl_take isl_union_pw_qpolynomial *upwqp, + enum isl_dim_type type, unsigned pos, const char *s); + +int isl_union_pw_qpolynomial_find_dim_by_name( + __isl_keep isl_union_pw_qpolynomial *upwqp, + enum isl_dim_type type, const char *name); + +__isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_drop_dims( + __isl_take isl_union_pw_qpolynomial *upwqp, + enum isl_dim_type type, unsigned first, unsigned n); +__isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_reset_user( + __isl_take isl_union_pw_qpolynomial *upwqp); + +__isl_give isl_val *isl_union_pw_qpolynomial_eval( __isl_take isl_union_pw_qpolynomial *upwqp, __isl_take isl_point *pnt); __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_coalesce( @@ -511,9 +536,12 @@ __isl_take isl_union_pw_qpolynomial *upwqp, __isl_take isl_space *model); -int isl_union_pw_qpolynomial_foreach_pw_qpolynomial( +int isl_union_pw_qpolynomial_n_pw_qpolynomial( + __isl_keep isl_union_pw_qpolynomial *upwqp); +isl_stat isl_union_pw_qpolynomial_foreach_pw_qpolynomial( __isl_keep isl_union_pw_qpolynomial *upwqp, - int (*fn)(__isl_take isl_pw_qpolynomial *pwqp, void *user), void *user); + isl_stat (*fn)(__isl_take isl_pw_qpolynomial *pwqp, void *user), + void *user); __isl_give isl_pw_qpolynomial *isl_union_pw_qpolynomial_extract_pw_qpolynomial( __isl_keep isl_union_pw_qpolynomial *upwqp, __isl_take isl_space *dim); @@ -523,7 +551,10 @@ isl_ctx *isl_union_pw_qpolynomial_fold_get_ctx( __isl_keep isl_union_pw_qpolynomial_fold *upwf); -int isl_union_pw_qpolynomial_fold_plain_is_equal( +unsigned isl_union_pw_qpolynomial_fold_dim( + __isl_keep isl_union_pw_qpolynomial_fold *upwf, enum isl_dim_type type); + +isl_bool isl_union_pw_qpolynomial_fold_plain_is_equal( __isl_keep isl_union_pw_qpolynomial_fold *upwf1, __isl_keep isl_union_pw_qpolynomial_fold *upwf2); @@ -533,7 +564,7 @@ __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_fold_pw_qpolynomial_fold( __isl_take isl_union_pw_qpolynomial_fold *upwqp, __isl_take isl_pw_qpolynomial_fold *pwqp); -void *isl_union_pw_qpolynomial_fold_free( +__isl_null isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_free( __isl_take isl_union_pw_qpolynomial_fold *upwf); __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_copy( __isl_keep isl_union_pw_qpolynomial_fold *upwf); @@ -544,11 +575,12 @@ __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_add_union_pw_qpolynomial( __isl_take isl_union_pw_qpolynomial_fold *upwf, __isl_take isl_union_pw_qpolynomial *upwqp); -__isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_mul_isl_int( - __isl_take isl_union_pw_qpolynomial_fold *upwf, isl_int v); __isl_give isl_union_pw_qpolynomial_fold * isl_union_pw_qpolynomial_fold_scale_val( __isl_take isl_union_pw_qpolynomial_fold *upwf, __isl_take isl_val *v); +__isl_give isl_union_pw_qpolynomial_fold * +isl_union_pw_qpolynomial_fold_scale_down_val( + __isl_take isl_union_pw_qpolynomial_fold *upwf, __isl_take isl_val *v); __isl_give isl_union_set *isl_union_pw_qpolynomial_fold_domain( __isl_take isl_union_pw_qpolynomial_fold *upwf); @@ -559,13 +591,34 @@ isl_union_pw_qpolynomial_fold_intersect_params( __isl_take isl_union_pw_qpolynomial_fold *upwf, __isl_take isl_set *set); +__isl_give isl_union_pw_qpolynomial_fold * +isl_union_pw_qpolynomial_fold_subtract_domain( + __isl_take isl_union_pw_qpolynomial_fold *upwf, + __isl_take isl_union_set *uset); enum isl_fold isl_union_pw_qpolynomial_fold_get_type( __isl_keep isl_union_pw_qpolynomial_fold *upwf); __isl_give isl_space *isl_union_pw_qpolynomial_fold_get_space( __isl_keep isl_union_pw_qpolynomial_fold *upwf); -__isl_give isl_qpolynomial *isl_union_pw_qpolynomial_fold_eval( +__isl_give isl_union_pw_qpolynomial_fold * +isl_union_pw_qpolynomial_fold_set_dim_name( + __isl_take isl_union_pw_qpolynomial_fold *upwf, + enum isl_dim_type type, unsigned pos, const char *s); + +int isl_union_pw_qpolynomial_fold_find_dim_by_name( + __isl_keep isl_union_pw_qpolynomial_fold *upwf, + enum isl_dim_type type, const char *name); + +__isl_give isl_union_pw_qpolynomial_fold * + isl_union_pw_qpolynomial_fold_drop_dims( + __isl_take isl_union_pw_qpolynomial_fold *upwf, + enum isl_dim_type type, unsigned first, unsigned n); +__isl_give isl_union_pw_qpolynomial_fold * +isl_union_pw_qpolynomial_fold_reset_user( + __isl_take isl_union_pw_qpolynomial_fold *upwf); + +__isl_give isl_val *isl_union_pw_qpolynomial_fold_eval( __isl_take isl_union_pw_qpolynomial_fold *upwf, __isl_take isl_point *pnt); @@ -583,9 +636,11 @@ __isl_take isl_union_pw_qpolynomial_fold *upwf, __isl_take isl_space *model); -int isl_union_pw_qpolynomial_fold_foreach_pw_qpolynomial_fold( +int isl_union_pw_qpolynomial_fold_n_pw_qpolynomial_fold( + __isl_keep isl_union_pw_qpolynomial_fold *upwf); +isl_stat isl_union_pw_qpolynomial_fold_foreach_pw_qpolynomial_fold( __isl_keep isl_union_pw_qpolynomial_fold *upwf, - int (*fn)(__isl_take isl_pw_qpolynomial_fold *pwf, + isl_stat (*fn)(__isl_take isl_pw_qpolynomial_fold *pwf, void *user), void *user); __isl_give isl_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_extract_pw_qpolynomial_fold( __isl_keep isl_union_pw_qpolynomial_fold *upwf, __isl_take isl_space *dim); @@ -611,6 +666,4 @@ } #endif -#include - #endif diff -Nru cloog-0.18.2/isl/include/isl/printer.h cloog-0.18.4/isl/include/isl/printer.h --- cloog-0.18.2/isl/include/isl/printer.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/printer.h 2015-07-24 12:23:09.000000000 +0000 @@ -13,7 +13,7 @@ __isl_give isl_printer *isl_printer_to_file(isl_ctx *ctx, FILE *file); __isl_give isl_printer *isl_printer_to_str(isl_ctx *ctx); -void *isl_printer_free(__isl_take isl_printer *printer); +__isl_null isl_printer *isl_printer_free(__isl_take isl_printer *printer); isl_ctx *isl_printer_get_ctx(__isl_keep isl_printer *printer); FILE *isl_printer_get_file(__isl_keep isl_printer *printer); @@ -36,6 +36,14 @@ int output_format); int isl_printer_get_output_format(__isl_keep isl_printer *p); +#define ISL_YAML_STYLE_BLOCK 0 +#define ISL_YAML_STYLE_FLOW 1 +__isl_give isl_printer *isl_printer_set_yaml_style(__isl_take isl_printer *p, + int yaml_style); +int isl_printer_get_yaml_style(__isl_keep isl_printer *p); + +__isl_give isl_printer *isl_printer_set_indent_prefix(__isl_take isl_printer *p, + const char *prefix); __isl_give isl_printer *isl_printer_set_prefix(__isl_take isl_printer *p, const char *prefix); __isl_give isl_printer *isl_printer_set_suffix(__isl_take isl_printer *p, @@ -48,11 +56,19 @@ __isl_give isl_printer *isl_printer_print_double(__isl_take isl_printer *p, double d); __isl_give isl_printer *isl_printer_print_int(__isl_take isl_printer *p, int i); -__isl_give isl_printer *isl_printer_print_isl_int(__isl_take isl_printer *p, - isl_int i); __isl_give isl_printer *isl_printer_print_str(__isl_take isl_printer *p, const char *s); +__isl_give isl_printer *isl_printer_yaml_start_mapping( + __isl_take isl_printer *p); +__isl_give isl_printer *isl_printer_yaml_end_mapping( + __isl_take isl_printer *p); +__isl_give isl_printer *isl_printer_yaml_start_sequence( + __isl_take isl_printer *p); +__isl_give isl_printer *isl_printer_yaml_end_sequence( + __isl_take isl_printer *p); +__isl_give isl_printer *isl_printer_yaml_next(__isl_take isl_printer *p); + __isl_give isl_printer *isl_printer_flush(__isl_take isl_printer *p); #if defined(__cplusplus) diff -Nru cloog-0.18.2/isl/include/isl/schedule.h cloog-0.18.4/isl/include/isl/schedule.h --- cloog-0.18.2/isl/include/isl/schedule.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/schedule.h 2015-07-24 12:23:09.000000000 +0000 @@ -3,51 +3,139 @@ #include #include +#include +#include #include +#include +#include #include #if defined(__cplusplus) extern "C" { #endif -struct isl_schedule; -typedef struct isl_schedule isl_schedule; +struct isl_schedule_constraints; +typedef struct isl_schedule_constraints isl_schedule_constraints; -int isl_options_set_schedule_max_coefficient(isl_ctx *ctx, int val); +isl_stat isl_options_set_schedule_max_coefficient(isl_ctx *ctx, int val); int isl_options_get_schedule_max_coefficient(isl_ctx *ctx); -int isl_options_set_schedule_max_constant_term(isl_ctx *ctx, int val); +isl_stat isl_options_set_schedule_max_constant_term(isl_ctx *ctx, int val); int isl_options_get_schedule_max_constant_term(isl_ctx *ctx); -int isl_options_set_schedule_maximize_band_depth(isl_ctx *ctx, int val); +isl_stat isl_options_set_schedule_maximize_band_depth(isl_ctx *ctx, int val); int isl_options_get_schedule_maximize_band_depth(isl_ctx *ctx); -int isl_options_set_schedule_outer_zero_distance(isl_ctx *ctx, int val); -int isl_options_get_schedule_outer_zero_distance(isl_ctx *ctx); +isl_stat isl_options_set_schedule_outer_coincidence(isl_ctx *ctx, int val); +int isl_options_get_schedule_outer_coincidence(isl_ctx *ctx); -int isl_options_set_schedule_split_scaled(isl_ctx *ctx, int val); +isl_stat isl_options_set_schedule_split_scaled(isl_ctx *ctx, int val); int isl_options_get_schedule_split_scaled(isl_ctx *ctx); -int isl_options_set_schedule_separate_components(isl_ctx *ctx, int val); +isl_stat isl_options_set_schedule_separate_components(isl_ctx *ctx, int val); int isl_options_get_schedule_separate_components(isl_ctx *ctx); -#define ISL_SCHEDULE_FUSE_MAX 0 -#define ISL_SCHEDULE_FUSE_MIN 1 -int isl_options_set_schedule_fuse(isl_ctx *ctx, int val); -int isl_options_get_schedule_fuse(isl_ctx *ctx); +isl_stat isl_options_set_schedule_serialize_sccs(isl_ctx *ctx, int val); +int isl_options_get_schedule_serialize_sccs(isl_ctx *ctx); + +__isl_give isl_schedule_constraints *isl_schedule_constraints_copy( + __isl_keep isl_schedule_constraints *sc); +__isl_give isl_schedule_constraints *isl_schedule_constraints_on_domain( + __isl_take isl_union_set *domain); +__isl_give isl_schedule_constraints *isl_schedule_constraints_set_context( + __isl_take isl_schedule_constraints *sc, __isl_take isl_set *context); +__isl_give isl_schedule_constraints *isl_schedule_constraints_set_validity( + __isl_take isl_schedule_constraints *sc, + __isl_take isl_union_map *validity); +__isl_give isl_schedule_constraints *isl_schedule_constraints_set_coincidence( + __isl_take isl_schedule_constraints *sc, + __isl_take isl_union_map *coincidence); +__isl_give isl_schedule_constraints *isl_schedule_constraints_set_proximity( + __isl_take isl_schedule_constraints *sc, + __isl_take isl_union_map *proximity); +__isl_give isl_schedule_constraints * +isl_schedule_constraints_set_conditional_validity( + __isl_take isl_schedule_constraints *sc, + __isl_take isl_union_map *condition, + __isl_take isl_union_map *validity); +__isl_null isl_schedule_constraints *isl_schedule_constraints_free( + __isl_take isl_schedule_constraints *sc); + +isl_ctx *isl_schedule_constraints_get_ctx( + __isl_keep isl_schedule_constraints *sc); +__isl_give isl_union_map *isl_schedule_constraints_get_validity( + __isl_keep isl_schedule_constraints *sc); +__isl_give isl_union_map *isl_schedule_constraints_get_coincidence( + __isl_keep isl_schedule_constraints *sc); +__isl_give isl_union_map *isl_schedule_constraints_get_conditional_validity( + __isl_keep isl_schedule_constraints *sc); +__isl_give isl_union_map * +isl_schedule_constraints_get_conditional_validity_condition( + __isl_keep isl_schedule_constraints *sc); + +void isl_schedule_constraints_dump(__isl_keep isl_schedule_constraints *sc); + +__isl_give isl_schedule *isl_schedule_constraints_compute_schedule( + __isl_take isl_schedule_constraints *sc); __isl_give isl_schedule *isl_union_set_compute_schedule( __isl_take isl_union_set *domain, __isl_take isl_union_map *validity, __isl_take isl_union_map *proximity); -void *isl_schedule_free(__isl_take isl_schedule *sched); + +__isl_give isl_schedule *isl_schedule_empty(__isl_take isl_space *space); +__isl_give isl_schedule *isl_schedule_from_domain( + __isl_take isl_union_set *domain); +__isl_give isl_schedule *isl_schedule_copy(__isl_keep isl_schedule *sched); +__isl_null isl_schedule *isl_schedule_free(__isl_take isl_schedule *sched); __isl_give isl_union_map *isl_schedule_get_map(__isl_keep isl_schedule *sched); isl_ctx *isl_schedule_get_ctx(__isl_keep isl_schedule *sched); +isl_bool isl_schedule_plain_is_equal(__isl_keep isl_schedule *schedule1, + __isl_keep isl_schedule *schedule2); + +__isl_give isl_schedule_node *isl_schedule_get_root( + __isl_keep isl_schedule *schedule); +__isl_give isl_union_set *isl_schedule_get_domain( + __isl_keep isl_schedule *schedule); + +isl_stat isl_schedule_foreach_schedule_node_top_down( + __isl_keep isl_schedule *sched, + isl_bool (*fn)(__isl_keep isl_schedule_node *node, void *user), + void *user); +__isl_give isl_schedule *isl_schedule_map_schedule_node_bottom_up( + __isl_take isl_schedule *schedule, + __isl_give isl_schedule_node *(*fn)( + __isl_take isl_schedule_node *node, void *user), void *user); + +__isl_give isl_schedule *isl_schedule_insert_context( + __isl_take isl_schedule *schedule, __isl_take isl_set *context); +__isl_give isl_schedule *isl_schedule_insert_partial_schedule( + __isl_take isl_schedule *schedule, + __isl_take isl_multi_union_pw_aff *partial); +__isl_give isl_schedule *isl_schedule_insert_guard( + __isl_take isl_schedule *schedule, __isl_take isl_set *guard); +__isl_give isl_schedule *isl_schedule_sequence( + __isl_take isl_schedule *schedule1, __isl_take isl_schedule *schedule2); +__isl_give isl_schedule *isl_schedule_set( + __isl_take isl_schedule *schedule1, __isl_take isl_schedule *schedule2); +__isl_give isl_schedule *isl_schedule_intersect_domain( + __isl_take isl_schedule *schedule, __isl_take isl_union_set *domain); + +__isl_give isl_schedule *isl_schedule_reset_user( + __isl_take isl_schedule *schedule); +__isl_give isl_schedule *isl_schedule_align_params( + __isl_take isl_schedule *schedule, __isl_take isl_space *space); +__isl_give isl_schedule *isl_schedule_pullback_union_pw_multi_aff( + __isl_take isl_schedule *schedule, + __isl_take isl_union_pw_multi_aff *upma); __isl_give isl_band_list *isl_schedule_get_band_forest( __isl_keep isl_schedule *schedule); +__isl_give isl_schedule *isl_schedule_read_from_file(isl_ctx *ctx, FILE *input); +__isl_give isl_schedule *isl_schedule_read_from_str(isl_ctx *ctx, + const char *str); __isl_give isl_printer *isl_printer_print_schedule(__isl_take isl_printer *p, __isl_keep isl_schedule *schedule); void isl_schedule_dump(__isl_keep isl_schedule *schedule); diff -Nru cloog-0.18.2/isl/include/isl/schedule_node.h cloog-0.18.4/isl/include/isl/schedule_node.h --- cloog-0.18.2/isl/include/isl/schedule_node.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/schedule_node.h 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,218 @@ +#ifndef ISL_SCHEDULE_NODE_H +#define ISL_SCHEDULE_NODE_H + +#include +#include +#include +#include +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +__isl_give isl_schedule_node *isl_schedule_node_from_domain( + __isl_take isl_union_set *domain); +__isl_give isl_schedule_node *isl_schedule_node_from_extension( + __isl_take isl_union_map *extension); +__isl_give isl_schedule_node *isl_schedule_node_copy( + __isl_keep isl_schedule_node *node); +__isl_null isl_schedule_node *isl_schedule_node_free( + __isl_take isl_schedule_node *node); + +isl_bool isl_schedule_node_is_equal(__isl_keep isl_schedule_node *node1, + __isl_keep isl_schedule_node *node2); + +isl_ctx *isl_schedule_node_get_ctx(__isl_keep isl_schedule_node *node); +enum isl_schedule_node_type isl_schedule_node_get_type( + __isl_keep isl_schedule_node *node); +enum isl_schedule_node_type isl_schedule_node_get_parent_type( + __isl_keep isl_schedule_node *node); +__isl_give isl_schedule *isl_schedule_node_get_schedule( + __isl_keep isl_schedule_node *node); + +isl_stat isl_schedule_node_foreach_descendant_top_down( + __isl_keep isl_schedule_node *node, + isl_bool (*fn)(__isl_keep isl_schedule_node *node, void *user), + void *user); +isl_stat isl_schedule_node_foreach_ancestor_top_down( + __isl_keep isl_schedule_node *node, + isl_stat (*fn)(__isl_keep isl_schedule_node *node, void *user), + void *user); +__isl_give isl_schedule_node *isl_schedule_node_map_descendant_bottom_up( + __isl_take isl_schedule_node *node, + __isl_give isl_schedule_node *(*fn)(__isl_take isl_schedule_node *node, + void *user), void *user); + +int isl_schedule_node_get_tree_depth(__isl_keep isl_schedule_node *node); +isl_bool isl_schedule_node_has_parent(__isl_keep isl_schedule_node *node); +isl_bool isl_schedule_node_has_children(__isl_keep isl_schedule_node *node); +isl_bool isl_schedule_node_has_previous_sibling( + __isl_keep isl_schedule_node *node); +isl_bool isl_schedule_node_has_next_sibling(__isl_keep isl_schedule_node *node); +int isl_schedule_node_n_children(__isl_keep isl_schedule_node *node); +int isl_schedule_node_get_child_position(__isl_keep isl_schedule_node *node); +int isl_schedule_node_get_ancestor_child_position( + __isl_keep isl_schedule_node *node, + __isl_keep isl_schedule_node *ancestor); +__isl_give isl_schedule_node *isl_schedule_node_get_child( + __isl_keep isl_schedule_node *node, int pos); +__isl_give isl_schedule_node *isl_schedule_node_get_shared_ancestor( + __isl_keep isl_schedule_node *node1, + __isl_keep isl_schedule_node *node2); + +__isl_give isl_schedule_node *isl_schedule_node_root( + __isl_take isl_schedule_node *node); +__isl_give isl_schedule_node *isl_schedule_node_parent( + __isl_take isl_schedule_node *node); +__isl_give isl_schedule_node *isl_schedule_node_ancestor( + __isl_take isl_schedule_node *node, int generation); +__isl_give isl_schedule_node *isl_schedule_node_child( + __isl_take isl_schedule_node *node, int pos); +__isl_give isl_schedule_node *isl_schedule_node_first_child( + __isl_take isl_schedule_node *node); +__isl_give isl_schedule_node *isl_schedule_node_previous_sibling( + __isl_take isl_schedule_node *node); +__isl_give isl_schedule_node *isl_schedule_node_next_sibling( + __isl_take isl_schedule_node *node); + +isl_bool isl_schedule_node_is_subtree_anchored( + __isl_keep isl_schedule_node *node); + +__isl_give isl_schedule_node *isl_schedule_node_group( + __isl_take isl_schedule_node *node, __isl_take isl_id *group_id); + +__isl_give isl_space *isl_schedule_node_band_get_space( + __isl_keep isl_schedule_node *node); +__isl_give isl_multi_union_pw_aff *isl_schedule_node_band_get_partial_schedule( + __isl_keep isl_schedule_node *node); +__isl_give isl_union_map *isl_schedule_node_band_get_partial_schedule_union_map( + __isl_keep isl_schedule_node *node); +enum isl_ast_loop_type isl_schedule_node_band_member_get_ast_loop_type( + __isl_keep isl_schedule_node *node, int pos); +__isl_give isl_schedule_node *isl_schedule_node_band_member_set_ast_loop_type( + __isl_take isl_schedule_node *node, int pos, + enum isl_ast_loop_type type); +enum isl_ast_loop_type isl_schedule_node_band_member_get_isolate_ast_loop_type( + __isl_keep isl_schedule_node *node, int pos); +__isl_give isl_schedule_node * +isl_schedule_node_band_member_set_isolate_ast_loop_type( + __isl_take isl_schedule_node *node, int pos, + enum isl_ast_loop_type type); +__isl_give isl_union_set *isl_schedule_node_band_get_ast_build_options( + __isl_keep isl_schedule_node *node); +__isl_give isl_schedule_node *isl_schedule_node_band_set_ast_build_options( + __isl_take isl_schedule_node *node, __isl_take isl_union_set *options); +unsigned isl_schedule_node_band_n_member(__isl_keep isl_schedule_node *node); +isl_bool isl_schedule_node_band_member_get_coincident( + __isl_keep isl_schedule_node *node, int pos); +__isl_give isl_schedule_node *isl_schedule_node_band_member_set_coincident( + __isl_take isl_schedule_node *node, int pos, int coincident); +isl_bool isl_schedule_node_band_get_permutable( + __isl_keep isl_schedule_node *node); +__isl_give isl_schedule_node *isl_schedule_node_band_set_permutable( + __isl_take isl_schedule_node *node, int permutable); + +isl_stat isl_options_set_tile_scale_tile_loops(isl_ctx *ctx, int val); +int isl_options_get_tile_scale_tile_loops(isl_ctx *ctx); +isl_stat isl_options_set_tile_shift_point_loops(isl_ctx *ctx, int val); +int isl_options_get_tile_shift_point_loops(isl_ctx *ctx); + +__isl_give isl_schedule_node *isl_schedule_node_band_scale( + __isl_take isl_schedule_node *node, __isl_take isl_multi_val *mv); +__isl_give isl_schedule_node *isl_schedule_node_band_scale_down( + __isl_take isl_schedule_node *node, __isl_take isl_multi_val *mv); +__isl_give isl_schedule_node *isl_schedule_node_band_tile( + __isl_take isl_schedule_node *node, __isl_take isl_multi_val *sizes); +__isl_give isl_schedule_node *isl_schedule_node_band_sink( + __isl_take isl_schedule_node *node); +__isl_give isl_schedule_node *isl_schedule_node_band_split( + __isl_take isl_schedule_node *node, int pos); + +__isl_give isl_set *isl_schedule_node_context_get_context( + __isl_keep isl_schedule_node *node); +__isl_give isl_union_set *isl_schedule_node_domain_get_domain( + __isl_keep isl_schedule_node *node); +__isl_give isl_union_map *isl_schedule_node_expansion_get_expansion( + __isl_keep isl_schedule_node *node); +__isl_give isl_union_pw_multi_aff *isl_schedule_node_expansion_get_contraction( + __isl_keep isl_schedule_node *node); +__isl_give isl_union_map *isl_schedule_node_extension_get_extension( + __isl_keep isl_schedule_node *node); +__isl_give isl_union_set *isl_schedule_node_filter_get_filter( + __isl_keep isl_schedule_node *node); +__isl_give isl_set *isl_schedule_node_guard_get_guard( + __isl_keep isl_schedule_node *node); +__isl_give isl_id *isl_schedule_node_mark_get_id( + __isl_keep isl_schedule_node *node); + +int isl_schedule_node_get_schedule_depth(__isl_keep isl_schedule_node *node); +__isl_give isl_union_set *isl_schedule_node_get_domain( + __isl_keep isl_schedule_node *node); +__isl_give isl_union_set *isl_schedule_node_get_universe_domain( + __isl_keep isl_schedule_node *node); +__isl_give isl_multi_union_pw_aff * +isl_schedule_node_get_prefix_schedule_multi_union_pw_aff( + __isl_keep isl_schedule_node *node); +__isl_give isl_union_pw_multi_aff * +isl_schedule_node_get_prefix_schedule_union_pw_multi_aff( + __isl_keep isl_schedule_node *node); +__isl_give isl_union_map *isl_schedule_node_get_prefix_schedule_union_map( + __isl_keep isl_schedule_node *node); +__isl_give isl_union_map *isl_schedule_node_get_prefix_schedule_relation( + __isl_keep isl_schedule_node *node); +__isl_give isl_union_map *isl_schedule_node_get_subtree_schedule_union_map( + __isl_keep isl_schedule_node *node); +__isl_give isl_union_map *isl_schedule_node_get_subtree_expansion( + __isl_keep isl_schedule_node *node); +__isl_give isl_union_pw_multi_aff *isl_schedule_node_get_subtree_contraction( + __isl_keep isl_schedule_node *node); + +__isl_give isl_schedule_node *isl_schedule_node_insert_context( + __isl_take isl_schedule_node *node, __isl_take isl_set *context); +__isl_give isl_schedule_node *isl_schedule_node_insert_partial_schedule( + __isl_take isl_schedule_node *node, + __isl_take isl_multi_union_pw_aff *schedule); +__isl_give isl_schedule_node *isl_schedule_node_insert_filter( + __isl_take isl_schedule_node *node, __isl_take isl_union_set *filter); +__isl_give isl_schedule_node *isl_schedule_node_insert_guard( + __isl_take isl_schedule_node *node, __isl_take isl_set *context); +__isl_give isl_schedule_node *isl_schedule_node_insert_mark( + __isl_take isl_schedule_node *node, __isl_take isl_id *mark); +__isl_give isl_schedule_node *isl_schedule_node_insert_sequence( + __isl_take isl_schedule_node *node, + __isl_take isl_union_set_list *filters); +__isl_give isl_schedule_node *isl_schedule_node_insert_set( + __isl_take isl_schedule_node *node, + __isl_take isl_union_set_list *filters); + +__isl_give isl_schedule_node *isl_schedule_node_cut( + __isl_take isl_schedule_node *node); +__isl_give isl_schedule_node *isl_schedule_node_delete( + __isl_take isl_schedule_node *node); + +__isl_give isl_schedule_node *isl_schedule_node_order_after( + __isl_take isl_schedule_node *node, __isl_take isl_union_set *filter); + +__isl_give isl_schedule_node *isl_schedule_node_graft_before( + __isl_take isl_schedule_node *node, + __isl_take isl_schedule_node *graft); +__isl_give isl_schedule_node *isl_schedule_node_graft_after( + __isl_take isl_schedule_node *node, + __isl_take isl_schedule_node *graft); + +__isl_give isl_schedule_node *isl_schedule_node_reset_user( + __isl_take isl_schedule_node *node); +__isl_give isl_schedule_node *isl_schedule_node_align_params( + __isl_take isl_schedule_node *node, __isl_take isl_space *space); + +__isl_give isl_printer *isl_printer_print_schedule_node( + __isl_take isl_printer *p, __isl_keep isl_schedule_node *node); +void isl_schedule_node_dump(__isl_keep isl_schedule_node *node); + +#if defined(__cplusplus) +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/include/isl/schedule_type.h cloog-0.18.4/isl/include/isl/schedule_type.h --- cloog-0.18.2/isl/include/isl/schedule_type.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/schedule_type.h 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,33 @@ +#ifndef ISL_SCHEDULE_TYPE_H +#define ISL_SCHEDULE_TYPE_H + +#if defined(__cplusplus) +extern "C" { +#endif + +enum isl_schedule_node_type { + isl_schedule_node_error = -1, + isl_schedule_node_band, + isl_schedule_node_context, + isl_schedule_node_domain, + isl_schedule_node_expansion, + isl_schedule_node_extension, + isl_schedule_node_filter, + isl_schedule_node_leaf, + isl_schedule_node_guard, + isl_schedule_node_mark, + isl_schedule_node_sequence, + isl_schedule_node_set +}; + +struct isl_schedule_node; +typedef struct isl_schedule_node isl_schedule_node; + +struct isl_schedule; +typedef struct isl_schedule isl_schedule; + +#if defined(__cplusplus) +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/include/isl/seq.h cloog-0.18.4/isl/include/isl/seq.h --- cloog-0.18.2/isl/include/isl/seq.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/seq.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright 2008-2009 Katholieke Universiteit Leuven - * - * Use of this software is governed by the MIT license - * - * Written by Sven Verdoolaege, K.U.Leuven, Departement - * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium - */ - -#ifndef ISL_SEQ_H -#define ISL_SEQ_H - -#include -#include -#include - -#if defined(__cplusplus) -extern "C" { -#endif - -/* Some common operations on sequences of isl_int's */ - -void isl_seq_clr(isl_int *p, unsigned len); -void isl_seq_set(isl_int *p, isl_int v, unsigned len); -void isl_seq_set_si(isl_int *p, int v, unsigned len); -void isl_seq_neg(isl_int *dat, isl_int *src, unsigned len); -void isl_seq_cpy(isl_int *dst, isl_int *src, unsigned len); -void isl_seq_addmul(isl_int *dst, isl_int f, isl_int *src, unsigned len); -void isl_seq_submul(isl_int *dst, isl_int f, isl_int *src, unsigned len); -void isl_seq_swp_or_cpy(isl_int *dst, isl_int *src, unsigned len); -void isl_seq_scale(isl_int *dst, isl_int *src, isl_int f, unsigned len); -void isl_seq_scale_down(isl_int *dst, isl_int *src, isl_int f, unsigned len); -void isl_seq_cdiv_q(isl_int *dst, isl_int *src, isl_int m, unsigned len); -void isl_seq_fdiv_q(isl_int *dst, isl_int *src, isl_int m, unsigned len); -void isl_seq_fdiv_r(isl_int *dst, isl_int *src, isl_int m, unsigned len); -void isl_seq_combine(isl_int *dst, isl_int m1, isl_int *src1, - isl_int m2, isl_int *src2, unsigned len); -void isl_seq_elim(isl_int *dst, isl_int *src, unsigned pos, unsigned len, - isl_int *m); -void isl_seq_abs_max(isl_int *p, unsigned len, isl_int *max); -void isl_seq_gcd(isl_int *p, unsigned len, isl_int *gcd); -void isl_seq_lcm(isl_int *p, unsigned len, isl_int *lcm); -void isl_seq_normalize(struct isl_ctx *ctx, isl_int *p, unsigned len); -void isl_seq_inner_product(isl_int *p1, isl_int *p2, unsigned len, - isl_int *prod); -int isl_seq_first_non_zero(isl_int *p, unsigned len); -int isl_seq_last_non_zero(isl_int *p, unsigned len); -int isl_seq_abs_min_non_zero(isl_int *p, unsigned len); -int isl_seq_eq(isl_int *p1, isl_int *p2, unsigned len); -int isl_seq_cmp(isl_int *p1, isl_int *p2, unsigned len); -int isl_seq_is_neg(isl_int *p1, isl_int *p2, unsigned len); - -uint32_t isl_seq_get_hash(isl_int *p, unsigned len); -uint32_t isl_seq_get_hash_bits(isl_int *p, unsigned len, unsigned bits); - -#if defined(__cplusplus) -} -#endif - -#endif diff -Nru cloog-0.18.2/isl/include/isl/set.h cloog-0.18.4/isl/include/isl/set.h --- cloog-0.18.2/isl/include/isl/set.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/set.h 2015-07-24 12:23:09.000000000 +0000 @@ -17,6 +17,7 @@ #include #include #include +#include #if defined(__cplusplus) extern "C" { @@ -46,7 +47,7 @@ __isl_keep isl_basic_set *bset); const char *isl_basic_set_get_tuple_name(__isl_keep isl_basic_set *bset); -int isl_set_has_tuple_name(__isl_keep isl_set *set); +isl_bool isl_set_has_tuple_name(__isl_keep isl_set *set); const char *isl_set_get_tuple_name(__isl_keep isl_set *set); __isl_give isl_basic_set *isl_basic_set_set_tuple_name( __isl_take isl_basic_set *set, const char *s); @@ -57,7 +58,7 @@ __isl_give isl_basic_set *isl_basic_set_set_dim_name( __isl_take isl_basic_set *bset, enum isl_dim_type type, unsigned pos, const char *s); -int isl_set_has_dim_name(__isl_keep isl_set *set, +isl_bool isl_set_has_dim_name(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); const char *isl_set_get_dim_name(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); @@ -66,17 +67,20 @@ __isl_give isl_id *isl_basic_set_get_dim_id(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned pos); +__isl_give isl_basic_set *isl_basic_set_set_tuple_id( + __isl_take isl_basic_set *bset, __isl_take isl_id *id); __isl_give isl_set *isl_set_set_dim_id(__isl_take isl_set *set, enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); -int isl_set_has_dim_id(__isl_keep isl_set *set, +isl_bool isl_set_has_dim_id(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_set_get_dim_id(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); __isl_give isl_set *isl_set_set_tuple_id(__isl_take isl_set *set, __isl_take isl_id *id); __isl_give isl_set *isl_set_reset_tuple_id(__isl_take isl_set *set); -int isl_set_has_tuple_id(__isl_keep isl_set *set); +isl_bool isl_set_has_tuple_id(__isl_keep isl_set *set); __isl_give isl_id *isl_set_get_tuple_id(__isl_keep isl_set *set); +__isl_give isl_set *isl_set_reset_user(__isl_take isl_set *set); int isl_set_find_dim_by_id(__isl_keep isl_set *set, enum isl_dim_type type, __isl_keep isl_id *id); @@ -85,27 +89,11 @@ int isl_basic_set_is_rational(__isl_keep isl_basic_set *bset); -struct isl_basic_set *isl_basic_set_alloc(struct isl_ctx *ctx, - unsigned nparam, unsigned dim, unsigned extra, - unsigned n_eq, unsigned n_ineq); -struct isl_basic_set *isl_basic_set_extend(struct isl_basic_set *base, - unsigned nparam, unsigned dim, unsigned extra, - unsigned n_eq, unsigned n_ineq); -struct isl_basic_set *isl_basic_set_extend_constraints( - struct isl_basic_set *base, unsigned n_eq, unsigned n_ineq); -struct isl_basic_set *isl_basic_set_finalize(struct isl_basic_set *bset); -void *isl_basic_set_free(__isl_take isl_basic_set *bset); +__isl_null isl_basic_set *isl_basic_set_free(__isl_take isl_basic_set *bset); __isl_give isl_basic_set *isl_basic_set_copy(__isl_keep isl_basic_set *bset); -struct isl_basic_set *isl_basic_set_dup(struct isl_basic_set *bset); __isl_give isl_basic_set *isl_basic_set_empty(__isl_take isl_space *dim); -struct isl_basic_set *isl_basic_set_empty_like(struct isl_basic_set *bset); __isl_give isl_basic_set *isl_basic_set_universe(__isl_take isl_space *dim); __isl_give isl_basic_set *isl_basic_set_nat_universe(__isl_take isl_space *dim); -struct isl_basic_set *isl_basic_set_universe_like(struct isl_basic_set *bset); -__isl_give isl_basic_set *isl_basic_set_universe_like_set( - __isl_keep isl_set *model); -struct isl_basic_set *isl_basic_set_interval(struct isl_ctx *ctx, - isl_int min, isl_int max); __isl_give isl_basic_set *isl_basic_set_positive_orthant( __isl_take isl_space *space); void isl_basic_set_print_internal(__isl_keep isl_basic_set *bset, @@ -131,13 +119,14 @@ enum isl_dim_type type, unsigned first, unsigned n); __isl_export __isl_give isl_basic_set *isl_basic_set_sample(__isl_take isl_basic_set *bset); -struct isl_basic_set *isl_basic_set_simplify(struct isl_basic_set *bset); __isl_export __isl_give isl_basic_set *isl_basic_set_detect_equalities( __isl_take isl_basic_set *bset); __isl_give isl_basic_set *isl_basic_set_remove_redundancies( __isl_take isl_basic_set *bset); __isl_give isl_set *isl_set_remove_redundancies(__isl_take isl_set *set); +__isl_give isl_basic_set *isl_basic_set_list_intersect( + __isl_take struct isl_basic_set_list *list); __isl_give isl_basic_set *isl_basic_set_list_product( __isl_take struct isl_basic_set_list *list); @@ -155,12 +144,6 @@ __isl_take isl_printer *printer, __isl_keep isl_basic_set *bset); __isl_give isl_printer *isl_printer_print_set(__isl_take isl_printer *printer, __isl_keep isl_set *map); -void isl_basic_set_print(__isl_keep isl_basic_set *bset, FILE *out, int indent, - const char *prefix, const char *suffix, unsigned output_format); -void isl_set_print(__isl_keep struct isl_set *set, FILE *out, int indent, - unsigned output_format); -__isl_give isl_basic_set *isl_basic_set_fix(__isl_take isl_basic_set *bset, - enum isl_dim_type type, unsigned pos, isl_int value); __isl_give isl_basic_set *isl_basic_set_fix_si(__isl_take isl_basic_set *bset, enum isl_dim_type type, unsigned pos, int value); __isl_give isl_basic_set *isl_basic_set_fix_val(__isl_take isl_basic_set *bset, @@ -169,29 +152,21 @@ enum isl_dim_type type, unsigned pos, int value); __isl_give isl_set *isl_set_lower_bound_si(__isl_take isl_set *set, enum isl_dim_type type, unsigned pos, int value); -__isl_give isl_set *isl_set_lower_bound(__isl_take isl_set *set, - enum isl_dim_type type, unsigned pos, isl_int value); __isl_give isl_set *isl_set_lower_bound_val(__isl_take isl_set *set, enum isl_dim_type type, unsigned pos, __isl_take isl_val *value); __isl_give isl_set *isl_set_upper_bound_si(__isl_take isl_set *set, enum isl_dim_type type, unsigned pos, int value); -__isl_give isl_set *isl_set_upper_bound(__isl_take isl_set *set, - enum isl_dim_type type, unsigned pos, isl_int value); __isl_give isl_set *isl_set_upper_bound_val(__isl_take isl_set *set, enum isl_dim_type type, unsigned pos, __isl_take isl_val *value); __isl_give isl_set *isl_set_equate(__isl_take isl_set *set, enum isl_dim_type type1, int pos1, enum isl_dim_type type2, int pos2); -struct isl_basic_set *isl_basic_set_from_underlying_set( - struct isl_basic_set *bset, struct isl_basic_set *like); -struct isl_set *isl_set_from_underlying_set( - struct isl_set *set, struct isl_basic_set *like); -struct isl_set *isl_set_to_underlying_set(struct isl_set *set); - __isl_export -int isl_basic_set_is_equal( - struct isl_basic_set *bset1, struct isl_basic_set *bset2); +isl_bool isl_basic_set_is_equal(__isl_keep isl_basic_set *bset1, + __isl_keep isl_basic_set *bset2); +isl_bool isl_basic_set_is_disjoint(__isl_keep isl_basic_set *bset1, + __isl_keep isl_basic_set *bset2); __isl_give isl_set *isl_basic_set_partial_lexmin( __isl_take isl_basic_set *bset, __isl_take isl_basic_set *dom, @@ -243,31 +218,22 @@ int isl_basic_set_dims_get_sign(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned pos, unsigned n, int *signs); -int isl_basic_set_is_universe(__isl_keep isl_basic_set *bset); -int isl_basic_set_plain_is_empty(__isl_keep isl_basic_set *bset); -int isl_basic_set_fast_is_empty(__isl_keep isl_basic_set *bset); +isl_bool isl_basic_set_is_universe(__isl_keep isl_basic_set *bset); +isl_bool isl_basic_set_plain_is_empty(__isl_keep isl_basic_set *bset); __isl_export -int isl_basic_set_is_empty(__isl_keep isl_basic_set *bset); +isl_bool isl_basic_set_is_empty(__isl_keep isl_basic_set *bset); int isl_basic_set_is_bounded(__isl_keep isl_basic_set *bset); __isl_export -int isl_basic_set_is_subset(__isl_keep isl_basic_set *bset1, +isl_bool isl_basic_set_is_subset(__isl_keep isl_basic_set *bset1, + __isl_keep isl_basic_set *bset2); +isl_bool isl_basic_set_plain_is_equal(__isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2); -struct isl_set *isl_set_alloc(struct isl_ctx *ctx, - unsigned nparam, unsigned dim, int n, unsigned flags); -struct isl_set *isl_set_extend(struct isl_set *base, - unsigned nparam, unsigned dim); __isl_give isl_set *isl_set_empty(__isl_take isl_space *dim); -struct isl_set *isl_set_empty_like(struct isl_set *set); __isl_give isl_set *isl_set_universe(__isl_take isl_space *dim); __isl_give isl_set *isl_set_nat_universe(__isl_take isl_space *dim); -__isl_give isl_set *isl_set_universe_like(__isl_keep isl_set *model); -__isl_give isl_set *isl_set_add_basic_set(__isl_take isl_set *set, - __isl_take isl_basic_set *bset); -struct isl_set *isl_set_finalize(struct isl_set *set); __isl_give isl_set *isl_set_copy(__isl_keep isl_set *set); -void *isl_set_free(__isl_take isl_set *set); -struct isl_set *isl_set_dup(struct isl_set *set); +__isl_null isl_set *isl_set_free(__isl_take isl_set *set); __isl_constructor __isl_give isl_set *isl_set_from_basic_set(__isl_take isl_basic_set *bset); __isl_export @@ -284,6 +250,8 @@ __isl_give isl_basic_set *isl_set_simple_hull(__isl_take isl_set *set); __isl_give isl_basic_set *isl_set_unshifted_simple_hull( __isl_take isl_set *set); +__isl_give isl_basic_set *isl_set_unshifted_simple_hull_from_set_list( + __isl_take isl_set *set, __isl_take isl_set_list *list); struct isl_basic_set *isl_set_bounded_simple_hull(struct isl_set *set); __isl_give isl_set *isl_set_recession_cone(__isl_take isl_set *set); @@ -320,14 +288,12 @@ __isl_take isl_multi_aff *ma); __isl_give isl_set *isl_set_preimage_pw_multi_aff(__isl_take isl_set *set, __isl_take isl_pw_multi_aff *pma); -__isl_give isl_set *isl_set_fix(__isl_take isl_set *set, - enum isl_dim_type type, unsigned pos, isl_int value); +__isl_give isl_set *isl_set_preimage_multi_pw_aff(__isl_take isl_set *set, + __isl_take isl_multi_pw_aff *mpa); __isl_give isl_set *isl_set_fix_val(__isl_take isl_set *set, enum isl_dim_type type, unsigned pos, __isl_take isl_val *v); struct isl_set *isl_set_fix_dim_si(struct isl_set *set, unsigned dim, int value); -struct isl_set *isl_set_lower_bound_dim(struct isl_set *set, - unsigned dim, isl_int value); __isl_give isl_basic_set *isl_basic_set_insert_dims( __isl_take isl_basic_set *bset, enum isl_dim_type type, unsigned pos, unsigned n); @@ -335,7 +301,7 @@ enum isl_dim_type type, unsigned pos, unsigned n); __isl_give isl_basic_set *isl_basic_set_add_dims(__isl_take isl_basic_set *bset, enum isl_dim_type type, unsigned n); -/* deprecated */ +ISL_DEPRECATED __isl_give isl_basic_set *isl_basic_set_add(__isl_take isl_basic_set *bset, enum isl_dim_type type, unsigned n); __isl_give isl_set *isl_set_add_dims(__isl_take isl_set *set, @@ -384,29 +350,29 @@ __isl_take isl_set *set, enum isl_dim_type type, unsigned first, unsigned n); -int isl_basic_set_involves_dims(__isl_keep isl_basic_set *bset, +isl_bool isl_basic_set_involves_dims(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned first, unsigned n); -int isl_set_involves_dims(__isl_keep isl_set *set, +isl_bool isl_set_involves_dims(__isl_keep isl_set *set, enum isl_dim_type type, unsigned first, unsigned n); void isl_set_print_internal(__isl_keep isl_set *set, FILE *out, int indent); -int isl_set_plain_is_empty(__isl_keep isl_set *set); -int isl_set_fast_is_empty(__isl_keep isl_set *set); -int isl_set_plain_is_universe(__isl_keep isl_set *set); -int isl_set_fast_is_universe(__isl_keep isl_set *set); -int isl_set_is_params(__isl_keep isl_set *set); +isl_bool isl_set_plain_is_empty(__isl_keep isl_set *set); +isl_bool isl_set_plain_is_universe(__isl_keep isl_set *set); +isl_bool isl_set_is_params(__isl_keep isl_set *set); __isl_export -int isl_set_is_empty(__isl_keep isl_set *set); +isl_bool isl_set_is_empty(__isl_keep isl_set *set); int isl_set_is_bounded(__isl_keep isl_set *set); __isl_export -int isl_set_is_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2); +isl_bool isl_set_is_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2); __isl_export -int isl_set_is_strict_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2); +isl_bool isl_set_is_strict_subset(__isl_keep isl_set *set1, + __isl_keep isl_set *set2); __isl_export -int isl_set_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2); +isl_bool isl_set_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2); __isl_export -int isl_set_is_disjoint(__isl_keep isl_set *set1, __isl_keep isl_set *set2); -int isl_set_is_singleton(__isl_keep isl_set *set); +isl_bool isl_set_is_disjoint(__isl_keep isl_set *set1, + __isl_keep isl_set *set2); +isl_bool isl_set_is_singleton(__isl_keep isl_set *set); int isl_set_is_box(__isl_keep isl_set *set); int isl_set_has_equal_space(__isl_keep isl_set *set1, __isl_keep isl_set *set2); @@ -424,28 +390,17 @@ struct isl_set *isl_set_drop_basic_set(struct isl_set *set, struct isl_basic_set *bset); -int isl_basic_set_plain_dim_is_fixed(__isl_keep isl_basic_set *bset, - unsigned dim, isl_int *val); - -int isl_set_plain_is_fixed(__isl_keep isl_set *set, - enum isl_dim_type type, unsigned pos, isl_int *val); -int isl_set_plain_dim_is_fixed(__isl_keep isl_set *set, - unsigned dim, isl_int *val); -int isl_set_fast_dim_is_fixed(__isl_keep isl_set *set, - unsigned dim, isl_int *val); __isl_give isl_val *isl_set_plain_get_val_if_fixed(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); -int isl_set_plain_dim_has_fixed_lower_bound(__isl_keep isl_set *set, - unsigned dim, isl_int *val); int isl_set_dim_is_bounded(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); -int isl_set_dim_has_lower_bound(__isl_keep isl_set *set, +isl_bool isl_set_dim_has_lower_bound(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); -int isl_set_dim_has_upper_bound(__isl_keep isl_set *set, +isl_bool isl_set_dim_has_upper_bound(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); -int isl_set_dim_has_any_lower_bound(__isl_keep isl_set *set, +isl_bool isl_set_dim_has_any_lower_bound(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); -int isl_set_dim_has_any_upper_bound(__isl_keep isl_set *set, +isl_bool isl_set_dim_has_any_upper_bound(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); __isl_export @@ -458,22 +413,16 @@ __isl_take isl_set *context); __isl_give isl_set *isl_set_gist_params(__isl_take isl_set *set, __isl_take isl_set *context); -int isl_basic_set_dim_residue_class(struct isl_basic_set *bset, - int pos, isl_int *modulo, isl_int *residue); -int isl_set_dim_residue_class(struct isl_set *set, - int pos, isl_int *modulo, isl_int *residue); -int isl_set_dim_residue_class_val(__isl_keep isl_set *set, +isl_stat isl_set_dim_residue_class_val(__isl_keep isl_set *set, int pos, __isl_give isl_val **modulo, __isl_give isl_val **residue); __isl_export __isl_give isl_set *isl_set_coalesce(__isl_take isl_set *set); int isl_set_plain_cmp(__isl_keep isl_set *set1, __isl_keep isl_set *set2); -int isl_set_plain_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2); -int isl_set_fast_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2); -int isl_set_plain_is_disjoint(__isl_keep isl_set *set1, +isl_bool isl_set_plain_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2); -int isl_set_fast_is_disjoint(__isl_keep isl_set *set1, +isl_bool isl_set_plain_is_disjoint(__isl_keep isl_set *set1, __isl_keep isl_set *set2); uint32_t isl_set_get_hash(struct isl_set *set); @@ -482,16 +431,12 @@ int isl_set_n_basic_set(__isl_keep isl_set *set); __isl_export -int isl_set_foreach_basic_set(__isl_keep isl_set *set, - int (*fn)(__isl_take isl_basic_set *bset, void *user), void *user); +isl_stat isl_set_foreach_basic_set(__isl_keep isl_set *set, + isl_stat (*fn)(__isl_take isl_basic_set *bset, void *user), void *user); -int isl_set_foreach_point(__isl_keep isl_set *set, - int (*fn)(__isl_take isl_point *pnt, void *user), void *user); -int isl_set_count(__isl_keep isl_set *set, isl_int *count); +isl_stat isl_set_foreach_point(__isl_keep isl_set *set, + isl_stat (*fn)(__isl_take isl_point *pnt, void *user), void *user); __isl_give isl_val *isl_set_count_val(__isl_keep isl_set *set); -int isl_basic_set_count_upto(__isl_keep isl_basic_set *bset, - isl_int max, isl_int *count); -int isl_set_count_upto(__isl_keep isl_set *set, isl_int max, isl_int *count); __isl_give isl_basic_set *isl_basic_set_from_point(__isl_take isl_point *pnt); __isl_give isl_set *isl_set_from_point(__isl_take isl_point *pnt); @@ -548,6 +493,4 @@ } #endif -#include - #endif diff -Nru cloog-0.18.2/isl/include/isl/space.h cloog-0.18.4/isl/include/isl/space.h --- cloog-0.18.2/isl/include/isl/space.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/space.h 2015-07-24 12:23:09.000000000 +0000 @@ -38,15 +38,15 @@ unsigned nparam, unsigned dim); __isl_give isl_space *isl_space_params_alloc(isl_ctx *ctx, unsigned nparam); __isl_give isl_space *isl_space_copy(__isl_keep isl_space *dim); -void *isl_space_free(__isl_take isl_space *dim); +__isl_null isl_space *isl_space_free(__isl_take isl_space *space); -int isl_space_is_params(__isl_keep isl_space *space); -int isl_space_is_set(__isl_keep isl_space *space); -int isl_space_is_map(__isl_keep isl_space *space); +isl_bool isl_space_is_params(__isl_keep isl_space *space); +isl_bool isl_space_is_set(__isl_keep isl_space *space); +isl_bool isl_space_is_map(__isl_keep isl_space *space); __isl_give isl_space *isl_space_set_tuple_name(__isl_take isl_space *dim, enum isl_dim_type type, const char *s); -int isl_space_has_tuple_name(__isl_keep isl_space *space, +isl_bool isl_space_has_tuple_name(__isl_keep isl_space *space, enum isl_dim_type type); const char *isl_space_get_tuple_name(__isl_keep isl_space *dim, enum isl_dim_type type); @@ -54,13 +54,15 @@ enum isl_dim_type type, __isl_take isl_id *id); __isl_give isl_space *isl_space_reset_tuple_id(__isl_take isl_space *dim, enum isl_dim_type type); -int isl_space_has_tuple_id(__isl_keep isl_space *dim, enum isl_dim_type type); +isl_bool isl_space_has_tuple_id(__isl_keep isl_space *dim, + enum isl_dim_type type); __isl_give isl_id *isl_space_get_tuple_id(__isl_keep isl_space *dim, enum isl_dim_type type); +__isl_give isl_space *isl_space_reset_user(__isl_take isl_space *space); __isl_give isl_space *isl_space_set_dim_id(__isl_take isl_space *dim, enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); -int isl_space_has_dim_id(__isl_keep isl_space *dim, +isl_bool isl_space_has_dim_id(__isl_keep isl_space *dim, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_space_get_dim_id(__isl_keep isl_space *dim, enum isl_dim_type type, unsigned pos); @@ -70,7 +72,7 @@ int isl_space_find_dim_by_name(__isl_keep isl_space *space, enum isl_dim_type type, const char *name); -int isl_space_has_dim_name(__isl_keep isl_space *space, +isl_bool isl_space_has_dim_name(__isl_keep isl_space *space, enum isl_dim_type type, unsigned pos); __isl_give isl_space *isl_space_set_dim_name(__isl_take isl_space *dim, enum isl_dim_type type, unsigned pos, @@ -95,6 +97,16 @@ __isl_take isl_space *right); __isl_give isl_space *isl_space_range_product(__isl_take isl_space *left, __isl_take isl_space *right); +__isl_give isl_space *isl_space_factor_domain(__isl_take isl_space *space); +__isl_give isl_space *isl_space_factor_range(__isl_take isl_space *space); +__isl_give isl_space *isl_space_domain_factor_domain( + __isl_take isl_space *space); +__isl_give isl_space *isl_space_domain_factor_range( + __isl_take isl_space *space); +__isl_give isl_space *isl_space_range_factor_domain( + __isl_take isl_space *space); +__isl_give isl_space *isl_space_range_factor_range( + __isl_take isl_space *space); __isl_give isl_space *isl_space_map_from_set(__isl_take isl_space *dim); __isl_give isl_space *isl_space_map_from_domain_and_range( __isl_take isl_space *domain, __isl_take isl_space *range); @@ -109,39 +121,48 @@ __isl_give isl_space *isl_space_from_domain(__isl_take isl_space *dim); __isl_give isl_space *isl_space_range(__isl_take isl_space *dim); __isl_give isl_space *isl_space_from_range(__isl_take isl_space *dim); +__isl_give isl_space *isl_space_domain_map(__isl_take isl_space *space); +__isl_give isl_space *isl_space_range_map(__isl_take isl_space *space); __isl_give isl_space *isl_space_params(__isl_take isl_space *space); __isl_give isl_space *isl_space_set_from_params(__isl_take isl_space *space); __isl_give isl_space *isl_space_align_params(__isl_take isl_space *dim1, __isl_take isl_space *dim2); -int isl_space_is_wrapping(__isl_keep isl_space *dim); +isl_bool isl_space_is_wrapping(__isl_keep isl_space *dim); +isl_bool isl_space_domain_is_wrapping(__isl_keep isl_space *space); +isl_bool isl_space_range_is_wrapping(__isl_keep isl_space *space); __isl_give isl_space *isl_space_wrap(__isl_take isl_space *dim); __isl_give isl_space *isl_space_unwrap(__isl_take isl_space *dim); -int isl_space_can_zip(__isl_keep isl_space *dim); +isl_bool isl_space_can_zip(__isl_keep isl_space *dim); __isl_give isl_space *isl_space_zip(__isl_take isl_space *dim); -int isl_space_can_curry(__isl_keep isl_space *space); +isl_bool isl_space_can_curry(__isl_keep isl_space *space); __isl_give isl_space *isl_space_curry(__isl_take isl_space *space); -int isl_space_can_uncurry(__isl_keep isl_space *space); +isl_bool isl_space_can_uncurry(__isl_keep isl_space *space); __isl_give isl_space *isl_space_uncurry(__isl_take isl_space *space); -int isl_space_is_domain(__isl_keep isl_space *space1, +isl_bool isl_space_is_domain(__isl_keep isl_space *space1, __isl_keep isl_space *space2); -int isl_space_is_range(__isl_keep isl_space *space1, +isl_bool isl_space_is_range(__isl_keep isl_space *space1, __isl_keep isl_space *space2); -int isl_space_is_equal(__isl_keep isl_space *space1, +isl_bool isl_space_is_equal(__isl_keep isl_space *space1, __isl_keep isl_space *space2); +isl_bool isl_space_tuple_is_equal(__isl_keep isl_space *space1, + enum isl_dim_type type1, __isl_keep isl_space *space2, + enum isl_dim_type type2); int isl_space_match(__isl_keep isl_space *dim1, enum isl_dim_type dim1_type, __isl_keep isl_space *dim2, enum isl_dim_type dim2_type); -int isl_space_tuple_match(__isl_keep isl_space *dim1, enum isl_dim_type dim1_type, - __isl_keep isl_space *dim2, enum isl_dim_type dim2_type); +ISL_DEPRECATED +int isl_space_tuple_match(__isl_keep isl_space *space1, enum isl_dim_type type1, + __isl_keep isl_space *space2, enum isl_dim_type type2); int isl_space_compatible(__isl_keep isl_space *dim1, __isl_keep isl_space *dim2); unsigned isl_space_dim(__isl_keep isl_space *dim, enum isl_dim_type type); +__isl_give char *isl_space_to_str(__isl_keep isl_space *space); __isl_give isl_printer *isl_printer_print_space(__isl_take isl_printer *p, __isl_keep isl_space *dim); void isl_space_dump(__isl_keep isl_space *dim); diff -Nru cloog-0.18.2/isl/include/isl/stream.h cloog-0.18.4/isl/include/isl/stream.h --- cloog-0.18.2/isl/include/isl/stream.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/stream.h 2015-07-24 12:23:09.000000000 +0000 @@ -15,6 +15,7 @@ #include #include #include +#include #if defined(__cplusplus) extern "C" { @@ -39,76 +40,54 @@ ISL_TOKEN_IMPLIES, ISL_TOKEN_LAST }; -struct isl_token { - int type; - - unsigned int on_new_line : 1; - unsigned is_keyword : 1; - int line; - int col; - - union { - isl_int v; - char *s; - isl_map *map; - isl_pw_aff *pwaff; - } u; -}; +struct isl_token; __isl_give isl_val *isl_token_get_val(isl_ctx *ctx, struct isl_token *tok); __isl_give char *isl_token_get_str(isl_ctx *ctx, struct isl_token *tok); int isl_token_get_type(struct isl_token *tok); void isl_token_free(struct isl_token *tok); -struct isl_stream { - struct isl_ctx *ctx; - FILE *file; - const char *str; - int line; - int col; - int eof; - - char *buffer; - size_t size; - size_t len; - int c; - int un[5]; - int n_un; - - struct isl_token *tokens[5]; - int n_token; - - struct isl_hash_table *keywords; - enum isl_token_type next_type; -}; - -struct isl_stream* isl_stream_new_file(struct isl_ctx *ctx, FILE *file); -struct isl_stream* isl_stream_new_str(struct isl_ctx *ctx, const char *str); -void isl_stream_free(struct isl_stream *s); - -void isl_stream_error(struct isl_stream *s, struct isl_token *tok, char *msg); - -struct isl_token *isl_stream_next_token(struct isl_stream *s); -struct isl_token *isl_stream_next_token_on_same_line(struct isl_stream *s); -int isl_stream_next_token_is(struct isl_stream *s, int type); -void isl_stream_push_token(struct isl_stream *s, struct isl_token *tok); -void isl_stream_flush_tokens(struct isl_stream *s); -int isl_stream_eat_if_available(struct isl_stream *s, int type); -char *isl_stream_read_ident_if_available(struct isl_stream *s); -int isl_stream_eat(struct isl_stream *s, int type); -int isl_stream_is_empty(struct isl_stream *s); -int isl_stream_skip_line(struct isl_stream *s); +struct isl_stream; +typedef struct isl_stream isl_stream; + +__isl_give isl_stream *isl_stream_new_file(isl_ctx *ctx, FILE *file); +__isl_give isl_stream *isl_stream_new_str(isl_ctx *ctx, const char *str); +void isl_stream_free(__isl_take isl_stream *s); + +isl_ctx *isl_stream_get_ctx(__isl_keep isl_stream *s); + +void isl_stream_error(__isl_keep isl_stream *s, struct isl_token *tok, + char *msg); + +struct isl_token *isl_stream_next_token(__isl_keep isl_stream *s); +struct isl_token *isl_stream_next_token_on_same_line(__isl_keep isl_stream *s); +int isl_stream_next_token_is(__isl_keep isl_stream *s, int type); +void isl_stream_push_token(__isl_keep isl_stream *s, struct isl_token *tok); +void isl_stream_flush_tokens(__isl_keep isl_stream *s); +int isl_stream_eat_if_available(__isl_keep isl_stream *s, int type); +char *isl_stream_read_ident_if_available(__isl_keep isl_stream *s); +int isl_stream_eat(__isl_keep isl_stream *s, int type); +int isl_stream_is_empty(__isl_keep isl_stream *s); +int isl_stream_skip_line(__isl_keep isl_stream *s); -enum isl_token_type isl_stream_register_keyword(struct isl_stream *s, +enum isl_token_type isl_stream_register_keyword(__isl_keep isl_stream *s, const char *name); -struct isl_obj isl_stream_read_obj(struct isl_stream *s); -__isl_give isl_multi_aff *isl_stream_read_multi_aff(struct isl_stream *s); -__isl_give isl_map *isl_stream_read_map(struct isl_stream *s); -__isl_give isl_set *isl_stream_read_set(struct isl_stream *s); +struct isl_obj isl_stream_read_obj(__isl_keep isl_stream *s); +__isl_give isl_val *isl_stream_read_val(__isl_keep isl_stream *s); +__isl_give isl_multi_aff *isl_stream_read_multi_aff(__isl_keep isl_stream *s); +__isl_give isl_map *isl_stream_read_map(__isl_keep isl_stream *s); +__isl_give isl_set *isl_stream_read_set(__isl_keep isl_stream *s); __isl_give isl_pw_qpolynomial *isl_stream_read_pw_qpolynomial( - struct isl_stream *s); -__isl_give isl_union_map *isl_stream_read_union_map(struct isl_stream *s); + __isl_keep isl_stream *s); +__isl_give isl_union_map *isl_stream_read_union_map(__isl_keep isl_stream *s); +__isl_give isl_schedule *isl_stream_read_schedule(isl_stream *s); + +int isl_stream_yaml_read_start_mapping(__isl_keep isl_stream *s); +int isl_stream_yaml_read_end_mapping(__isl_keep isl_stream *s); +int isl_stream_yaml_read_start_sequence(__isl_keep isl_stream *s); +int isl_stream_yaml_read_end_sequence(__isl_keep isl_stream *s); +int isl_stream_yaml_next(__isl_keep isl_stream *s); #if defined(__cplusplus) } diff -Nru cloog-0.18.2/isl/include/isl/union_map.h cloog-0.18.4/isl/include/isl/union_map.h --- cloog-0.18.2/isl/include/isl/union_map.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/union_map.h 2015-07-24 12:23:09.000000000 +0000 @@ -2,6 +2,7 @@ #define ISL_UNION_MAP_H #include +#include #include #include #include @@ -11,6 +12,13 @@ extern "C" { #endif +unsigned isl_union_map_dim(__isl_keep isl_union_map *umap, + enum isl_dim_type type); +isl_bool isl_union_map_involves_dims(__isl_keep isl_union_map *umap, + enum isl_dim_type type, unsigned first, unsigned n); +__isl_give isl_id *isl_union_map_get_dim_id(__isl_keep isl_union_map *umap, + enum isl_dim_type type, unsigned pos); + __isl_constructor __isl_give isl_union_map *isl_union_map_from_basic_map( __isl_take isl_basic_map *bmap); @@ -18,11 +26,17 @@ __isl_give isl_union_map *isl_union_map_from_map(__isl_take isl_map *map); __isl_give isl_union_map *isl_union_map_empty(__isl_take isl_space *dim); __isl_give isl_union_map *isl_union_map_copy(__isl_keep isl_union_map *umap); -void *isl_union_map_free(__isl_take isl_union_map *umap); +__isl_null isl_union_map *isl_union_map_free(__isl_take isl_union_map *umap); isl_ctx *isl_union_map_get_ctx(__isl_keep isl_union_map *umap); __isl_give isl_space *isl_union_map_get_space(__isl_keep isl_union_map *umap); +__isl_give isl_union_map *isl_union_map_reset_user( + __isl_take isl_union_map *umap); + +int isl_union_map_find_dim_by_name(__isl_keep isl_union_map *umap, + enum isl_dim_type type, const char *name); + __isl_give isl_union_map *isl_union_map_universe( __isl_take isl_union_map *umap); __isl_give isl_set *isl_union_map_params(__isl_take isl_union_map *umap); @@ -30,8 +44,12 @@ __isl_give isl_union_set *isl_union_map_range(__isl_take isl_union_map *umap); __isl_give isl_union_map *isl_union_map_domain_map( __isl_take isl_union_map *umap); +__isl_give isl_union_pw_multi_aff *isl_union_map_domain_map_union_pw_multi_aff( + __isl_take isl_union_map *umap); __isl_give isl_union_map *isl_union_map_range_map( __isl_take isl_union_map *umap); +__isl_give isl_union_map *isl_union_set_wrapped_domain_map( + __isl_take isl_union_set *uset); __isl_give isl_union_map *isl_union_map_from_domain( __isl_take isl_union_set *uset); __isl_give isl_union_map *isl_union_map_from_range( @@ -43,6 +61,8 @@ __isl_export __isl_give isl_union_map *isl_union_map_polyhedral_hull( __isl_take isl_union_map *umap); +__isl_give isl_union_map *isl_union_map_remove_redundancies( + __isl_take isl_union_map *umap); __isl_give isl_union_map *isl_union_map_simple_hull( __isl_take isl_union_map *umap); __isl_export @@ -73,10 +93,22 @@ __isl_take isl_union_map *umap2); __isl_give isl_union_map *isl_union_map_domain_product( __isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2); +__isl_give isl_union_map *isl_union_map_flat_domain_product( + __isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2); __isl_give isl_union_map *isl_union_map_range_product( __isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2); __isl_give isl_union_map *isl_union_map_flat_range_product( __isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2); +__isl_give isl_union_map *isl_union_map_domain_factor_domain( + __isl_take isl_union_map *umap); +__isl_give isl_union_map *isl_union_map_domain_factor_range( + __isl_take isl_union_map *umap); +__isl_give isl_union_map *isl_union_map_range_factor_range( + __isl_take isl_union_map *umap); +__isl_give isl_union_map *isl_union_map_factor_domain( + __isl_take isl_union_map *umap); +__isl_give isl_union_map *isl_union_map_factor_range( + __isl_take isl_union_map *umap); __isl_export __isl_give isl_union_map *isl_union_map_gist(__isl_take isl_union_map *umap, __isl_take isl_union_map *context); @@ -112,6 +144,20 @@ __isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2); __isl_give isl_union_map *isl_union_map_preimage_domain_multi_aff( __isl_take isl_union_map *umap, __isl_take isl_multi_aff *ma); +__isl_give isl_union_map *isl_union_map_preimage_range_multi_aff( + __isl_take isl_union_map *umap, __isl_take isl_multi_aff *ma); +__isl_give isl_union_map *isl_union_map_preimage_domain_pw_multi_aff( + __isl_take isl_union_map *umap, __isl_take isl_pw_multi_aff *pma); +__isl_give isl_union_map *isl_union_map_preimage_range_pw_multi_aff( + __isl_take isl_union_map *umap, __isl_take isl_pw_multi_aff *pma); +__isl_give isl_union_map *isl_union_map_preimage_domain_multi_pw_aff( + __isl_take isl_union_map *umap, __isl_take isl_multi_pw_aff *mpa); +__isl_give isl_union_map *isl_union_map_preimage_domain_union_pw_multi_aff( + __isl_take isl_union_map *umap, + __isl_take isl_union_pw_multi_aff *upma); +__isl_give isl_union_map *isl_union_map_preimage_range_union_pw_multi_aff( + __isl_take isl_union_map *umap, + __isl_take isl_union_pw_multi_aff *upma); __isl_export __isl_give isl_union_map *isl_union_map_reverse(__isl_take isl_union_map *umap); __isl_give isl_union_map *isl_union_map_from_domain_and_range( @@ -127,30 +173,36 @@ __isl_export __isl_give isl_union_map *isl_union_set_identity(__isl_take isl_union_set *uset); +__isl_give isl_union_map *isl_union_map_project_out( + __isl_take isl_union_map *umap, + enum isl_dim_type type, unsigned first, unsigned n); + __isl_export -int isl_union_map_is_empty(__isl_keep isl_union_map *umap); +isl_bool isl_union_map_is_empty(__isl_keep isl_union_map *umap); __isl_export -int isl_union_map_is_single_valued(__isl_keep isl_union_map *umap); -int isl_union_map_plain_is_injective(__isl_keep isl_union_map *umap); +isl_bool isl_union_map_is_single_valued(__isl_keep isl_union_map *umap); +isl_bool isl_union_map_plain_is_injective(__isl_keep isl_union_map *umap); __isl_export -int isl_union_map_is_injective(__isl_keep isl_union_map *umap); +isl_bool isl_union_map_is_injective(__isl_keep isl_union_map *umap); __isl_export -int isl_union_map_is_bijective(__isl_keep isl_union_map *umap); +isl_bool isl_union_map_is_bijective(__isl_keep isl_union_map *umap); __isl_export -int isl_union_map_is_subset(__isl_keep isl_union_map *umap1, +isl_bool isl_union_map_is_subset(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2); __isl_export -int isl_union_map_is_equal(__isl_keep isl_union_map *umap1, +isl_bool isl_union_map_is_equal(__isl_keep isl_union_map *umap1, + __isl_keep isl_union_map *umap2); +isl_bool isl_union_map_is_disjoint(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2); __isl_export -int isl_union_map_is_strict_subset(__isl_keep isl_union_map *umap1, +isl_bool isl_union_map_is_strict_subset(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2); int isl_union_map_n_map(__isl_keep isl_union_map *umap); __isl_export -int isl_union_map_foreach_map(__isl_keep isl_union_map *umap, - int (*fn)(__isl_take isl_map *map, void *user), void *user); +isl_stat isl_union_map_foreach_map(__isl_keep isl_union_map *umap, + isl_stat (*fn)(__isl_take isl_map *map, void *user), void *user); __isl_give int isl_union_map_contains(__isl_keep isl_union_map *umap, __isl_keep isl_space *dim); __isl_give isl_map *isl_union_map_extract_map(__isl_keep isl_union_map *umap, @@ -159,8 +211,6 @@ __isl_give isl_basic_map *isl_union_map_sample(__isl_take isl_union_map *umap); -__isl_give isl_union_map *isl_union_map_fixed_power( - __isl_take isl_union_map *umap, isl_int exp); __isl_give isl_union_map *isl_union_map_fixed_power_val( __isl_take isl_union_map *umap, __isl_take isl_val *exp); __isl_give isl_union_map *isl_union_map_power(__isl_take isl_union_map *umap, @@ -177,11 +227,22 @@ __isl_give isl_union_map *isl_union_map_lex_ge_union_map( __isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2); +__isl_give isl_union_map *isl_union_map_eq_at_multi_union_pw_aff( + __isl_take isl_union_map *umap, + __isl_take isl_multi_union_pw_aff *mupa); +__isl_give isl_union_map *isl_union_map_lex_lt_at_multi_union_pw_aff( + __isl_take isl_union_map *umap, + __isl_take isl_multi_union_pw_aff *mupa); +__isl_give isl_union_map *isl_union_map_lex_gt_at_multi_union_pw_aff( + __isl_take isl_union_map *umap, + __isl_take isl_multi_union_pw_aff *mupa); + __isl_give isl_union_map *isl_union_map_read_from_file(isl_ctx *ctx, FILE *input); __isl_constructor __isl_give isl_union_map *isl_union_map_read_from_str(isl_ctx *ctx, const char *str); +__isl_give char *isl_union_map_to_str(__isl_keep isl_union_map *umap); __isl_give isl_printer *isl_printer_print_union_map(__isl_take isl_printer *p, __isl_keep isl_union_map *umap); void isl_union_map_dump(__isl_keep isl_union_map *umap); @@ -198,10 +259,10 @@ __isl_give isl_union_set *isl_union_set_align_params( __isl_take isl_union_set *uset, __isl_take isl_space *model); +ISL_DECLARE_LIST_FN(union_map) + #if defined(__cplusplus) } #endif -#include - #endif diff -Nru cloog-0.18.2/isl/include/isl/union_map_type.h cloog-0.18.4/isl/include/isl/union_map_type.h --- cloog-0.18.2/isl/include/isl/union_map_type.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/union_map_type.h 2015-07-24 12:23:09.000000000 +0000 @@ -2,6 +2,7 @@ #define ISL_UNION_MAP_TYPE_H #include +#include #if defined(__cplusplus) extern "C" { @@ -9,9 +10,11 @@ struct __isl_export isl_union_map; typedef struct isl_union_map isl_union_map; +ISL_DECLARE_LIST_TYPE(union_map) #ifndef isl_union_set struct __isl_export isl_union_set; typedef struct isl_union_set isl_union_set; +ISL_DECLARE_LIST_TYPE(union_set) #endif #if defined(__cplusplus) diff -Nru cloog-0.18.2/isl/include/isl/union_set.h cloog-0.18.4/isl/include/isl/union_set.h --- cloog-0.18.2/isl/include/isl/union_set.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/union_set.h 2015-07-24 12:23:09.000000000 +0000 @@ -8,6 +8,9 @@ extern "C" { #endif +unsigned isl_union_set_dim(__isl_keep isl_union_set *uset, + enum isl_dim_type type); + __isl_constructor __isl_give isl_union_set *isl_union_set_from_basic_set( __isl_take isl_basic_set *bset); @@ -15,11 +18,14 @@ __isl_give isl_union_set *isl_union_set_from_set(__isl_take isl_set *set); __isl_give isl_union_set *isl_union_set_empty(__isl_take isl_space *dim); __isl_give isl_union_set *isl_union_set_copy(__isl_keep isl_union_set *uset); -void *isl_union_set_free(__isl_take isl_union_set *uset); +__isl_null isl_union_set *isl_union_set_free(__isl_take isl_union_set *uset); isl_ctx *isl_union_set_get_ctx(__isl_keep isl_union_set *uset); __isl_give isl_space *isl_union_set_get_space(__isl_keep isl_union_set *uset); +__isl_give isl_union_set *isl_union_set_reset_user( + __isl_take isl_union_set *uset); + __isl_give isl_union_set *isl_union_set_universe( __isl_take isl_union_set *uset); __isl_give isl_set *isl_union_set_params(__isl_take isl_union_set *uset); @@ -33,6 +39,8 @@ __isl_export __isl_give isl_union_set *isl_union_set_polyhedral_hull( __isl_take isl_union_set *uset); +__isl_give isl_union_set *isl_union_set_remove_redundancies( + __isl_take isl_union_set *uset); __isl_give isl_union_set *isl_union_set_simple_hull( __isl_take isl_union_set *uset); __isl_export @@ -70,32 +78,45 @@ __isl_export __isl_give isl_union_set *isl_union_set_apply( __isl_take isl_union_set *uset, __isl_take isl_union_map *umap); +__isl_give isl_union_set *isl_union_set_preimage_multi_aff( + __isl_take isl_union_set *uset, __isl_take isl_multi_aff *ma); +__isl_give isl_union_set *isl_union_set_preimage_pw_multi_aff( + __isl_take isl_union_set *uset, __isl_take isl_pw_multi_aff *pma); +__isl_give isl_union_set *isl_union_set_preimage_union_pw_multi_aff( + __isl_take isl_union_set *uset, + __isl_take isl_union_pw_multi_aff *upma); + +__isl_give isl_union_set *isl_union_set_project_out( + __isl_take isl_union_set *uset, + enum isl_dim_type type, unsigned first, unsigned n); -int isl_union_set_is_params(__isl_keep isl_union_set *uset); +isl_bool isl_union_set_is_params(__isl_keep isl_union_set *uset); __isl_export -int isl_union_set_is_empty(__isl_keep isl_union_set *uset); +isl_bool isl_union_set_is_empty(__isl_keep isl_union_set *uset); __isl_export -int isl_union_set_is_subset(__isl_keep isl_union_set *uset1, +isl_bool isl_union_set_is_subset(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2); __isl_export -int isl_union_set_is_equal(__isl_keep isl_union_set *uset1, +isl_bool isl_union_set_is_equal(__isl_keep isl_union_set *uset1, + __isl_keep isl_union_set *uset2); +isl_bool isl_union_set_is_disjoint(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2); __isl_export -int isl_union_set_is_strict_subset(__isl_keep isl_union_set *uset1, +isl_bool isl_union_set_is_strict_subset(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2); int isl_union_set_n_set(__isl_keep isl_union_set *uset); __isl_export -int isl_union_set_foreach_set(__isl_keep isl_union_set *uset, - int (*fn)(__isl_take isl_set *set, void *user), void *user); +isl_stat isl_union_set_foreach_set(__isl_keep isl_union_set *uset, + isl_stat (*fn)(__isl_take isl_set *set, void *user), void *user); __isl_give int isl_union_set_contains(__isl_keep isl_union_set *uset, __isl_keep isl_space *dim); __isl_give isl_set *isl_union_set_extract_set(__isl_keep isl_union_set *uset, __isl_take isl_space *dim); __isl_give isl_set *isl_set_from_union_set(__isl_take isl_union_set *uset); -int isl_union_set_foreach_point(__isl_keep isl_union_set *uset, - int (*fn)(__isl_take isl_point *pnt, void *user), void *user); +isl_stat isl_union_set_foreach_point(__isl_keep isl_union_set *uset, + isl_stat (*fn)(__isl_take isl_point *pnt, void *user), void *user); __isl_give isl_basic_set *isl_union_set_sample(__isl_take isl_union_set *uset); @@ -120,14 +141,18 @@ __isl_constructor __isl_give isl_union_set *isl_union_set_read_from_str(isl_ctx *ctx, const char *str); +__isl_give char *isl_union_set_to_str(__isl_keep isl_union_set *uset); __isl_give isl_printer *isl_printer_print_union_set(__isl_take isl_printer *p, __isl_keep isl_union_set *uset); void isl_union_set_dump(__isl_keep isl_union_set *uset); +ISL_DECLARE_LIST_FN(union_set) + +__isl_give isl_union_set *isl_union_set_list_union( + __isl_take isl_union_set_list *list); + #if defined(__cplusplus) } #endif -#include - #endif diff -Nru cloog-0.18.2/isl/include/isl/val_gmp.h cloog-0.18.4/isl/include/isl/val_gmp.h --- cloog-0.18.2/isl/include/isl/val_gmp.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/val_gmp.h 2014-10-02 15:33:27.000000000 +0000 @@ -4,10 +4,18 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + __isl_give isl_val *isl_val_int_from_gmp(isl_ctx *ctx, mpz_t z); __isl_give isl_val *isl_val_from_gmp(isl_ctx *ctx, const mpz_t n, const mpz_t d); int isl_val_get_num_gmp(__isl_keep isl_val *v, mpz_t z); int isl_val_get_den_gmp(__isl_keep isl_val *v, mpz_t z); +#if defined(__cplusplus) +} +#endif + #endif diff -Nru cloog-0.18.2/isl/include/isl/val.h cloog-0.18.4/isl/include/isl/val.h --- cloog-0.18.2/isl/include/isl/val.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/val.h 2015-07-24 12:23:09.000000000 +0000 @@ -19,9 +19,13 @@ typedef struct isl_multi_val isl_multi_val; ISL_DECLARE_MULTI(val) +ISL_DECLARE_MULTI_NEG(val) +ISL_DECLARE_MULTI_DIMS(val) +ISL_DECLARE_MULTI_WITH_DOMAIN(val) __isl_give isl_val *isl_val_zero(isl_ctx *ctx); __isl_give isl_val *isl_val_one(isl_ctx *ctx); +__isl_give isl_val *isl_val_negone(isl_ctx *ctx); __isl_give isl_val *isl_val_nan(isl_ctx *ctx); __isl_give isl_val *isl_val_infty(isl_ctx *ctx); __isl_give isl_val *isl_val_neginfty(isl_ctx *ctx); @@ -31,7 +35,7 @@ size_t size, const void *chunks); __isl_give isl_val *isl_val_copy(__isl_keep isl_val *v); -void *isl_val_free(__isl_take isl_val *v); +__isl_null isl_val *isl_val_free(__isl_take isl_val *v); isl_ctx *isl_val_get_ctx(__isl_keep isl_val *val); long isl_val_get_num_si(__isl_keep isl_val *v); @@ -45,6 +49,7 @@ __isl_give isl_val *isl_val_abs(__isl_take isl_val *v); __isl_give isl_val *isl_val_neg(__isl_take isl_val *v); +__isl_give isl_val *isl_val_inv(__isl_take isl_val *v); __isl_give isl_val *isl_val_floor(__isl_take isl_val *v); __isl_give isl_val *isl_val_ceil(__isl_take isl_val *v); __isl_give isl_val *isl_val_trunc(__isl_take isl_val *v); @@ -64,29 +69,31 @@ __isl_take isl_val *v2, __isl_give isl_val **x, __isl_give isl_val **y); int isl_val_sgn(__isl_keep isl_val *v); -int isl_val_is_zero(__isl_keep isl_val *v); -int isl_val_is_one(__isl_keep isl_val *v); -int isl_val_is_negone(__isl_keep isl_val *v); -int isl_val_is_nonneg(__isl_keep isl_val *v); -int isl_val_is_nonpos(__isl_keep isl_val *v); -int isl_val_is_pos(__isl_keep isl_val *v); -int isl_val_is_neg(__isl_keep isl_val *v); -int isl_val_is_int(__isl_keep isl_val *v); -int isl_val_is_rat(__isl_keep isl_val *v); -int isl_val_is_nan(__isl_keep isl_val *v); -int isl_val_is_infty(__isl_keep isl_val *v); -int isl_val_is_neginfty(__isl_keep isl_val *v); +isl_bool isl_val_is_zero(__isl_keep isl_val *v); +isl_bool isl_val_is_one(__isl_keep isl_val *v); +isl_bool isl_val_is_negone(__isl_keep isl_val *v); +isl_bool isl_val_is_nonneg(__isl_keep isl_val *v); +isl_bool isl_val_is_nonpos(__isl_keep isl_val *v); +isl_bool isl_val_is_pos(__isl_keep isl_val *v); +isl_bool isl_val_is_neg(__isl_keep isl_val *v); +isl_bool isl_val_is_int(__isl_keep isl_val *v); +isl_bool isl_val_is_rat(__isl_keep isl_val *v); +isl_bool isl_val_is_nan(__isl_keep isl_val *v); +isl_bool isl_val_is_infty(__isl_keep isl_val *v); +isl_bool isl_val_is_neginfty(__isl_keep isl_val *v); int isl_val_cmp_si(__isl_keep isl_val *v, long i); -int isl_val_lt(__isl_keep isl_val *v1, __isl_keep isl_val *v2); -int isl_val_le(__isl_keep isl_val *v1, __isl_keep isl_val *v2); -int isl_val_gt(__isl_keep isl_val *v1, __isl_keep isl_val *v2); -int isl_val_ge(__isl_keep isl_val *v1, __isl_keep isl_val *v2); -int isl_val_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2); -int isl_val_ne(__isl_keep isl_val *v1, __isl_keep isl_val *v2); +isl_bool isl_val_lt(__isl_keep isl_val *v1, __isl_keep isl_val *v2); +isl_bool isl_val_le(__isl_keep isl_val *v1, __isl_keep isl_val *v2); +isl_bool isl_val_gt(__isl_keep isl_val *v1, __isl_keep isl_val *v2); +isl_bool isl_val_ge(__isl_keep isl_val *v1, __isl_keep isl_val *v2); +isl_bool isl_val_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2); +isl_bool isl_val_ne(__isl_keep isl_val *v1, __isl_keep isl_val *v2); +isl_bool isl_val_abs_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2); -int isl_val_is_divisible_by(__isl_keep isl_val *v1, __isl_keep isl_val *v2); +isl_bool isl_val_is_divisible_by(__isl_keep isl_val *v1, + __isl_keep isl_val *v2); __isl_give isl_val *isl_val_read_from_str(isl_ctx *ctx, const char *str); __isl_give isl_printer *isl_printer_print_val(__isl_take isl_printer *p, @@ -99,6 +106,13 @@ __isl_give isl_multi_val *isl_multi_val_mod_val(__isl_take isl_multi_val *mv, __isl_take isl_val *v); +__isl_give isl_multi_val *isl_multi_val_read_from_str(isl_ctx *ctx, + const char *str); +__isl_give isl_printer *isl_printer_print_multi_val(__isl_take isl_printer *p, + __isl_keep isl_multi_val *mv); +void isl_multi_val_dump(__isl_keep isl_multi_val *mv); +__isl_give char *isl_multi_val_to_str(__isl_keep isl_multi_val *mv); + #if defined(__cplusplus) } #endif diff -Nru cloog-0.18.2/isl/include/isl/val_int.h cloog-0.18.4/isl/include/isl/val_int.h --- cloog-0.18.2/isl/include/isl/val_int.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/val_int.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -#ifndef ISL_VAL_INT_H -#define ISL_VAL_INT_H - -#include -#include - -__isl_give isl_val *isl_val_int_from_isl_int(isl_ctx *ctx, isl_int n); -int isl_val_get_num_isl_int(__isl_keep isl_val *v, isl_int *n); - -#endif diff -Nru cloog-0.18.2/isl/include/isl/vec.h cloog-0.18.4/isl/include/isl/vec.h --- cloog-0.18.2/isl/include/isl/vec.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/vec.h 2015-07-24 12:23:09.000000000 +0000 @@ -12,9 +12,7 @@ #include -#include #include -#include #include #include @@ -22,36 +20,23 @@ extern "C" { #endif -struct isl_vec { - int ref; - - struct isl_ctx *ctx; - - unsigned size; - isl_int *el; - - struct isl_blk block; -}; +struct isl_vec; typedef struct isl_vec isl_vec; __isl_give isl_vec *isl_vec_alloc(isl_ctx *ctx, unsigned size); __isl_give isl_vec *isl_vec_copy(__isl_keep isl_vec *vec); -struct isl_vec *isl_vec_cow(struct isl_vec *vec); -void *isl_vec_free(__isl_take isl_vec *vec); +__isl_null isl_vec *isl_vec_free(__isl_take isl_vec *vec); isl_ctx *isl_vec_get_ctx(__isl_keep isl_vec *vec); int isl_vec_size(__isl_keep isl_vec *vec); -int isl_vec_get_element(__isl_keep isl_vec *vec, int pos, isl_int *v); __isl_give isl_val *isl_vec_get_element_val(__isl_keep isl_vec *vec, int pos); -__isl_give isl_vec *isl_vec_set_element(__isl_take isl_vec *vec, - int pos, isl_int v); __isl_give isl_vec *isl_vec_set_element_si(__isl_take isl_vec *vec, int pos, int v); __isl_give isl_vec *isl_vec_set_element_val(__isl_take isl_vec *vec, int pos, __isl_take isl_val *v); -int isl_vec_is_equal(__isl_keep isl_vec *vec1, __isl_keep isl_vec *vec2); +isl_bool isl_vec_is_equal(__isl_keep isl_vec *vec1, __isl_keep isl_vec *vec2); int isl_vec_cmp_element(__isl_keep isl_vec *vec1, __isl_keep isl_vec *vec2, int pos); @@ -59,17 +44,13 @@ __isl_give isl_printer *isl_printer_print_vec(__isl_take isl_printer *printer, __isl_keep isl_vec *vec); -void isl_vec_lcm(struct isl_vec *vec, isl_int *lcm); struct isl_vec *isl_vec_ceil(struct isl_vec *vec); struct isl_vec *isl_vec_normalize(struct isl_vec *vec); -__isl_give isl_vec *isl_vec_set(__isl_take isl_vec *vec, isl_int v); __isl_give isl_vec *isl_vec_set_si(__isl_take isl_vec *vec, int v); __isl_give isl_vec *isl_vec_set_val(__isl_take isl_vec *vec, __isl_take isl_val *v); __isl_give isl_vec *isl_vec_clr(__isl_take isl_vec *vec); __isl_give isl_vec *isl_vec_neg(__isl_take isl_vec *vec); -__isl_give isl_vec *isl_vec_scale(__isl_take isl_vec *vec, isl_int m); -__isl_give isl_vec *isl_vec_fdiv_r(__isl_take isl_vec *vec, isl_int m); __isl_give isl_vec *isl_vec_add(__isl_take isl_vec *vec1, __isl_take isl_vec *vec2); __isl_give isl_vec *isl_vec_extend(__isl_take isl_vec *vec, unsigned size); @@ -87,6 +68,8 @@ unsigned pos, unsigned n); __isl_give isl_vec *isl_vec_insert_zero_els(__isl_take isl_vec *vec, unsigned pos, unsigned n); +__isl_give isl_vec *isl_vec_move_els(__isl_take isl_vec *vec, + unsigned dst_col, unsigned src_col, unsigned n); #if defined(__cplusplus) } diff -Nru cloog-0.18.2/isl/include/isl/vertices.h cloog-0.18.4/isl/include/isl/vertices.h --- cloog-0.18.2/isl/include/isl/vertices.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/include/isl/vertices.h 2015-07-24 12:23:09.000000000 +0000 @@ -1,6 +1,7 @@ #ifndef ISL_VERTICES_H #define ISL_VERTICES_H +#include #include #if defined(__cplusplus) @@ -19,25 +20,25 @@ isl_ctx *isl_vertex_get_ctx(__isl_keep isl_vertex *vertex); int isl_vertex_get_id(__isl_keep isl_vertex *vertex); __isl_give isl_basic_set *isl_vertex_get_domain(__isl_keep isl_vertex *vertex); -__isl_give isl_basic_set *isl_vertex_get_expr(__isl_keep isl_vertex *vertex); +__isl_give isl_multi_aff *isl_vertex_get_expr(__isl_keep isl_vertex *vertex); void isl_vertex_free(__isl_take isl_vertex *vertex); __isl_give isl_vertices *isl_basic_set_compute_vertices( __isl_keep isl_basic_set *bset); isl_ctx *isl_vertices_get_ctx(__isl_keep isl_vertices *vertices); int isl_vertices_get_n_vertices(__isl_keep isl_vertices *vertices); -int isl_vertices_foreach_vertex(__isl_keep isl_vertices *vertices, - int (*fn)(__isl_take isl_vertex *vertex, void *user), void *user); +isl_stat isl_vertices_foreach_vertex(__isl_keep isl_vertices *vertices, + isl_stat (*fn)(__isl_take isl_vertex *vertex, void *user), void *user); void isl_vertices_free(__isl_take isl_vertices *vertices); isl_ctx *isl_cell_get_ctx(__isl_keep isl_cell *cell); __isl_give isl_basic_set *isl_cell_get_domain(__isl_keep isl_cell *cell); -int isl_cell_foreach_vertex(__isl_keep isl_cell *cell, - int (*fn)(__isl_take isl_vertex *vertex, void *user), void *user); +isl_stat isl_cell_foreach_vertex(__isl_keep isl_cell *cell, + isl_stat (*fn)(__isl_take isl_vertex *vertex, void *user), void *user); void isl_cell_free(__isl_take isl_cell *cell); -int isl_vertices_foreach_cell(__isl_keep isl_vertices *vertices, - int (*fn)(__isl_take isl_cell *cell, void *user), void *user); +isl_stat isl_vertices_foreach_cell(__isl_keep isl_vertices *vertices, + isl_stat (*fn)(__isl_take isl_cell *cell, void *user), void *user); #if defined(__cplusplus) } diff -Nru cloog-0.18.2/isl/isl_aff.c cloog-0.18.4/isl/isl_aff.c --- cloog-0.18.2/isl/isl_aff.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_aff.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,7 +1,8 @@ /* * Copyright 2011 INRIA Saclay * Copyright 2011 Sven Verdoolaege - * Copyright 2012-2013 Ecole Normale Superieure + * Copyright 2012-2014 Ecole Normale Superieure + * Copyright 2014 INRIA Rocquencourt * * Use of this software is governed by the MIT license * @@ -9,6 +10,8 @@ * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, * 91893 Orsay, France * and Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France + * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, + * B.P. 105 - 78153 Le Chesnay, France */ #include @@ -18,11 +21,13 @@ #include #include #include +#include #include #include -#include +#include #include #include +#include #include #undef BASE @@ -35,6 +40,16 @@ #include +#undef BASE +#define BASE union_pw_aff + +#include + +#undef BASE +#define BASE union_pw_multi_aff + +#include + __isl_give isl_aff *isl_aff_alloc_vec(__isl_take isl_local_space *ls, __isl_take isl_vec *v) { @@ -106,6 +121,61 @@ return isl_pw_aff_from_aff(isl_aff_zero_on_domain(ls)); } +/* Return an affine expression defined on the specified domain + * that represents NaN. + */ +__isl_give isl_aff *isl_aff_nan_on_domain(__isl_take isl_local_space *ls) +{ + isl_aff *aff; + + aff = isl_aff_alloc(ls); + if (!aff) + return NULL; + + isl_seq_clr(aff->v->el, aff->v->size); + + return aff; +} + +/* Return a piecewise affine expression defined on the specified domain + * that represents NaN. + */ +__isl_give isl_pw_aff *isl_pw_aff_nan_on_domain(__isl_take isl_local_space *ls) +{ + return isl_pw_aff_from_aff(isl_aff_nan_on_domain(ls)); +} + +/* Return an affine expression that is equal to "val" on + * domain local space "ls". + */ +__isl_give isl_aff *isl_aff_val_on_domain(__isl_take isl_local_space *ls, + __isl_take isl_val *val) +{ + isl_aff *aff; + + if (!ls || !val) + goto error; + if (!isl_val_is_rat(val)) + isl_die(isl_val_get_ctx(val), isl_error_invalid, + "expecting rational value", goto error); + + aff = isl_aff_alloc(isl_local_space_copy(ls)); + if (!aff) + goto error; + + isl_seq_clr(aff->v->el + 2, aff->v->size - 2); + isl_int_set(aff->v->el[1], val->n); + isl_int_set(aff->v->el[0], val->d); + + isl_local_space_free(ls); + isl_val_free(val); + return aff; +error: + isl_local_space_free(ls); + isl_val_free(val); + return NULL; +} + /* Return an affine expression that is equal to the specified dimension * in "ls". */ @@ -184,7 +254,7 @@ return isl_aff_dup(aff); } -void *isl_aff_free(__isl_take isl_aff *aff) +__isl_null isl_aff *isl_aff_free(__isl_take isl_aff *aff) { if (!aff) return NULL; @@ -219,6 +289,22 @@ return isl_local_space_dim(aff->ls, type); } +/* Return the position of the dimension of the given type and name + * in "aff". + * Return -1 if no such dimension can be found. + */ +int isl_aff_find_dim_by_name(__isl_keep isl_aff *aff, enum isl_dim_type type, + const char *name) +{ + if (!aff) + return -1; + if (type == isl_dim_out) + return -1; + if (type == isl_dim_in) + type = isl_dim_set; + return isl_local_space_find_dim_by_name(aff->ls, type, name); +} + __isl_give isl_space *isl_aff_get_domain_space(__isl_keep isl_aff *aff) { return aff ? isl_local_space_get_space(aff->ls) : NULL; @@ -379,20 +465,64 @@ return NULL; } -int isl_aff_plain_is_zero(__isl_keep isl_aff *aff) +/* Is "aff" obviously equal to zero? + * + * If the denominator is zero, then "aff" is not equal to zero. + */ +isl_bool isl_aff_plain_is_zero(__isl_keep isl_aff *aff) { if (!aff) - return -1; + return isl_bool_error; + if (isl_int_is_zero(aff->v->el[0])) + return isl_bool_false; return isl_seq_first_non_zero(aff->v->el + 1, aff->v->size - 1) < 0; } -int isl_aff_plain_is_equal(__isl_keep isl_aff *aff1, __isl_keep isl_aff *aff2) +/* Does "aff" represent NaN? + */ +isl_bool isl_aff_is_nan(__isl_keep isl_aff *aff) { - int equal; + if (!aff) + return isl_bool_error; + + return isl_seq_first_non_zero(aff->v->el, 2) < 0; +} + +/* Does "pa" involve any NaNs? + */ +isl_bool isl_pw_aff_involves_nan(__isl_keep isl_pw_aff *pa) +{ + int i; + + if (!pa) + return isl_bool_error; + if (pa->n == 0) + return isl_bool_false; + + for (i = 0; i < pa->n; ++i) { + isl_bool is_nan = isl_aff_is_nan(pa->p[i].aff); + if (is_nan < 0 || is_nan) + return is_nan; + } + + return isl_bool_false; +} + +/* Are "aff1" and "aff2" obviously equal? + * + * NaN is not equal to anything, not even to another NaN. + */ +isl_bool isl_aff_plain_is_equal(__isl_keep isl_aff *aff1, + __isl_keep isl_aff *aff2) +{ + isl_bool equal; if (!aff1 || !aff2) - return -1; + return isl_bool_error; + + if (isl_aff_is_nan(aff1) || isl_aff_is_nan(aff2)) + return isl_bool_false; equal = isl_local_space_is_equal(aff1->ls, aff2->ls); if (equal < 0 || !equal) @@ -401,10 +531,17 @@ return isl_vec_is_equal(aff1->v, aff2->v); } +/* Return the common denominator of "aff" in "v". + * + * We cannot return anything meaningful in case of a NaN. + */ int isl_aff_get_denominator(__isl_keep isl_aff *aff, isl_int *v) { if (!aff) return -1; + if (isl_aff_is_nan(aff)) + isl_die(isl_aff_get_ctx(aff), isl_error_invalid, + "cannot get denominator of NaN", return -1); isl_int_set(*v, aff->v->el[0]); return 0; } @@ -419,13 +556,22 @@ return NULL; ctx = isl_aff_get_ctx(aff); + if (isl_aff_is_nan(aff)) + return isl_val_nan(ctx); return isl_val_int_from_isl_int(ctx, aff->v->el[0]); } +/* Return the constant term of "aff" in "v". + * + * We cannot return anything meaningful in case of a NaN. + */ int isl_aff_get_constant(__isl_keep isl_aff *aff, isl_int *v) { if (!aff) return -1; + if (isl_aff_is_nan(aff)) + isl_die(isl_aff_get_ctx(aff), isl_error_invalid, + "cannot get constant term of NaN", return -1); isl_int_set(*v, aff->v->el[1]); return 0; } @@ -441,10 +587,17 @@ return NULL; ctx = isl_aff_get_ctx(aff); + if (isl_aff_is_nan(aff)) + return isl_val_nan(ctx); v = isl_val_rat_from_isl_int(ctx, aff->v->el[1], aff->v->el[0]); return isl_val_normalize(v); } +/* Return the coefficient of the variable of type "type" at position "pos" + * of "aff" in "v". + * + * We cannot return anything meaningful in case of a NaN. + */ int isl_aff_get_coefficient(__isl_keep isl_aff *aff, enum isl_dim_type type, int pos, isl_int *v) { @@ -462,6 +615,9 @@ isl_die(aff->v->ctx, isl_error_invalid, "position out of bounds", return -1); + if (isl_aff_is_nan(aff)) + isl_die(isl_aff_get_ctx(aff), isl_error_invalid, + "cannot get coefficient of NaN", return -1); pos += isl_local_space_offset(aff->ls, type); isl_int_set(*v, aff->v->el[1 + pos]); @@ -492,13 +648,50 @@ isl_die(ctx, isl_error_invalid, "position out of bounds", return NULL); + if (isl_aff_is_nan(aff)) + return isl_val_nan(ctx); pos += isl_local_space_offset(aff->ls, type); v = isl_val_rat_from_isl_int(ctx, aff->v->el[1 + pos], aff->v->el[0]); return isl_val_normalize(v); } +/* Return the sign of the coefficient of the variable of type "type" + * at position "pos" of "aff". + */ +int isl_aff_coefficient_sgn(__isl_keep isl_aff *aff, enum isl_dim_type type, + int pos) +{ + isl_ctx *ctx; + + if (!aff) + return 0; + + ctx = isl_aff_get_ctx(aff); + if (type == isl_dim_out) + isl_die(ctx, isl_error_invalid, + "output/set dimension does not have a coefficient", + return 0); + if (type == isl_dim_in) + type = isl_dim_set; + + if (pos >= isl_local_space_dim(aff->ls, type)) + isl_die(ctx, isl_error_invalid, + "position out of bounds", return 0); + + pos += isl_local_space_offset(aff->ls, type); + return isl_int_sgn(aff->v->el[1 + pos]); +} + +/* Replace the denominator of "aff" by "v". + * + * A NaN is unaffected by this operation. + */ __isl_give isl_aff *isl_aff_set_denominator(__isl_take isl_aff *aff, isl_int v) { + if (!aff) + return NULL; + if (isl_aff_is_nan(aff)) + return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; @@ -512,8 +705,16 @@ return aff; } +/* Replace the numerator of the constant term of "aff" by "v". + * + * A NaN is unaffected by this operation. + */ __isl_give isl_aff *isl_aff_set_constant(__isl_take isl_aff *aff, isl_int v) { + if (!aff) + return NULL; + if (isl_aff_is_nan(aff)) + return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; @@ -528,6 +729,8 @@ } /* Replace the constant term of "aff" by "v". + * + * A NaN is unaffected by this operation. */ __isl_give isl_aff *isl_aff_set_constant_val(__isl_take isl_aff *aff, __isl_take isl_val *v) @@ -535,6 +738,11 @@ if (!aff || !v) goto error; + if (isl_aff_is_nan(aff)) { + isl_val_free(v); + return aff; + } + if (!isl_val_is_rat(v)) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "expecting rational value", goto error); @@ -574,11 +782,19 @@ return NULL; } +/* Add "v" to the constant term of "aff". + * + * A NaN is unaffected by this operation. + */ __isl_give isl_aff *isl_aff_add_constant(__isl_take isl_aff *aff, isl_int v) { if (isl_int_is_zero(v)) return aff; + if (!aff) + return NULL; + if (isl_aff_is_nan(aff)) + return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; @@ -593,6 +809,8 @@ } /* Add "v" to the constant term of "aff". + * + * A NaN is unaffected by this operation. */ __isl_give isl_aff *isl_aff_add_constant_val(__isl_take isl_aff *aff, __isl_take isl_val *v) @@ -600,7 +818,7 @@ if (!aff || !v) goto error; - if (isl_val_is_zero(v)) { + if (isl_aff_is_nan(aff) || isl_val_is_zero(v)) { isl_val_free(v); return aff; } @@ -655,12 +873,18 @@ } /* Add "v" to the numerator of the constant term of "aff". + * + * A NaN is unaffected by this operation. */ __isl_give isl_aff *isl_aff_add_constant_num(__isl_take isl_aff *aff, isl_int v) { if (isl_int_is_zero(v)) return aff; + if (!aff) + return NULL; + if (isl_aff_is_nan(aff)) + return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; @@ -675,6 +899,8 @@ } /* Add "v" to the numerator of the constant term of "aff". + * + * A NaN is unaffected by this operation. */ __isl_give isl_aff *isl_aff_add_constant_num_si(__isl_take isl_aff *aff, int v) { @@ -691,8 +917,16 @@ return aff; } +/* Replace the numerator of the constant term of "aff" by "v". + * + * A NaN is unaffected by this operation. + */ __isl_give isl_aff *isl_aff_set_constant_si(__isl_take isl_aff *aff, int v) { + if (!aff) + return NULL; + if (isl_aff_is_nan(aff)) + return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; @@ -706,6 +940,11 @@ return aff; } +/* Replace the numerator of the coefficient of the variable of type "type" + * at position "pos" of "aff" by "v". + * + * A NaN is unaffected by this operation. + */ __isl_give isl_aff *isl_aff_set_coefficient(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, isl_int v) { @@ -723,6 +962,8 @@ isl_die(aff->v->ctx, isl_error_invalid, "position out of bounds", return isl_aff_free(aff)); + if (isl_aff_is_nan(aff)) + return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; @@ -737,6 +978,11 @@ return aff; } +/* Replace the numerator of the coefficient of the variable of type "type" + * at position "pos" of "aff" by "v". + * + * A NaN is unaffected by this operation. + */ __isl_give isl_aff *isl_aff_set_coefficient_si(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, int v) { @@ -750,10 +996,16 @@ if (type == isl_dim_in) type = isl_dim_set; - if (pos >= isl_local_space_dim(aff->ls, type)) + if (pos < 0 || pos >= isl_local_space_dim(aff->ls, type)) isl_die(aff->v->ctx, isl_error_invalid, "position out of bounds", return isl_aff_free(aff)); + if (isl_aff_is_nan(aff)) + return aff; + pos += isl_local_space_offset(aff->ls, type); + if (isl_int_cmp_si(aff->v->el[1 + pos], v) == 0) + return aff; + aff = isl_aff_cow(aff); if (!aff) return NULL; @@ -762,7 +1014,6 @@ if (!aff->v) return isl_aff_free(aff); - pos += isl_local_space_offset(aff->ls, type); isl_int_set_si(aff->v->el[1 + pos], v); return aff; @@ -770,6 +1021,8 @@ /* Replace the coefficient of the variable of type "type" at position "pos" * of "aff" by "v". + * + * A NaN is unaffected by this operation. */ __isl_give isl_aff *isl_aff_set_coefficient_val(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, __isl_take isl_val *v) @@ -788,6 +1041,10 @@ isl_die(aff->v->ctx, isl_error_invalid, "position out of bounds", goto error); + if (isl_aff_is_nan(aff)) { + isl_val_free(v); + return aff; + } if (!isl_val_is_rat(v)) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "expecting rational value", goto error); @@ -828,6 +1085,11 @@ return NULL; } +/* Add "v" to the coefficient of the variable of type "type" + * at position "pos" of "aff". + * + * A NaN is unaffected by this operation. + */ __isl_give isl_aff *isl_aff_add_coefficient(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, isl_int v) { @@ -845,6 +1107,8 @@ isl_die(aff->v->ctx, isl_error_invalid, "position out of bounds", return isl_aff_free(aff)); + if (isl_aff_is_nan(aff)) + return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; @@ -861,6 +1125,8 @@ /* Add "v" to the coefficient of the variable of type "type" * at position "pos" of "aff". + * + * A NaN is unaffected by this operation. */ __isl_give isl_aff *isl_aff_add_coefficient_val(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, __isl_take isl_val *v) @@ -884,6 +1150,10 @@ isl_die(aff->v->ctx, isl_error_invalid, "position out of bounds", goto error); + if (isl_aff_is_nan(aff)) { + isl_val_free(v); + return aff; + } if (!isl_val_is_rat(v)) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "expecting rational value", goto error); @@ -943,8 +1213,16 @@ return isl_local_space_get_div(aff->ls, pos); } +/* Return the negation of "aff". + * + * As a special case, -NaN = NaN. + */ __isl_give isl_aff *isl_aff_neg(__isl_take isl_aff *aff) { + if (!aff) + return NULL; + if (isl_aff_is_nan(aff)) + return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; @@ -1182,12 +1460,10 @@ static __isl_give isl_aff *sort_divs(__isl_take isl_aff *aff) { int i, j, n; - unsigned off; if (!aff) return NULL; - off = isl_local_space_offset(aff->ls, isl_dim_div); n = isl_aff_dim(aff, isl_dim_div); for (i = 1; i < n; ++i) { for (j = i - 1; j >= 0; --j) { @@ -1232,6 +1508,8 @@ * Otherwise, if f = g/m, write g = q m + r, * create a new div d = [r/m] and return the expression q + d. * The coefficients in r are taken to lie between -m/2 and m/2. + * + * As a special case, floor(NaN) = NaN. */ __isl_give isl_aff *isl_aff_floor(__isl_take isl_aff *aff) { @@ -1243,6 +1521,8 @@ if (!aff) return NULL; + if (isl_aff_is_nan(aff)) + return aff; if (isl_int_is_one(aff->v->el[0])) return aff; @@ -1389,12 +1669,16 @@ * then return * * floor((e + m - 1)/m) + * + * As a special case, ceil(NaN) = NaN. */ __isl_give isl_aff *isl_aff_ceil(__isl_take isl_aff *aff) { if (!aff) return NULL; + if (isl_aff_is_nan(aff)) + return aff; if (isl_int_is_one(aff->v->el[0])) return aff; @@ -1496,6 +1780,10 @@ return NULL; } +/* Return the sum of "aff1" and "aff2". + * + * If either of the two is NaN, then the result is NaN. + */ __isl_give isl_aff *isl_aff_add(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { @@ -1513,6 +1801,15 @@ isl_die(ctx, isl_error_invalid, "spaces don't match", goto error); + if (isl_aff_is_nan(aff1)) { + isl_aff_free(aff2); + return aff1; + } + if (isl_aff_is_nan(aff2)) { + isl_aff_free(aff1); + return aff2; + } + n_div1 = isl_aff_dim(aff1, isl_dim_div); n_div2 = isl_aff_dim(aff2, isl_dim_div); if (n_div1 == 0 && n_div2 == 0) @@ -1544,10 +1841,19 @@ return isl_aff_add(aff1, isl_aff_neg(aff2)); } +/* Return the result of scaling "aff" by a factor of "f". + * + * As a special case, f * NaN = NaN. + */ __isl_give isl_aff *isl_aff_scale(__isl_take isl_aff *aff, isl_int f) { isl_int gcd; + if (!aff) + return NULL; + if (isl_aff_is_nan(aff)) + return aff; + if (isl_int_is_one(f)) return aff; @@ -1601,10 +1907,19 @@ return NULL; } +/* Return the result of scaling "aff" down by a factor of "f". + * + * As a special case, NaN/f = NaN. + */ __isl_give isl_aff *isl_aff_scale_down(__isl_take isl_aff *aff, isl_int f) { isl_int gcd; + if (!aff) + return NULL; + if (isl_aff_is_nan(aff)) + return aff; + if (isl_int_is_one(f)) return aff; @@ -1701,7 +2016,7 @@ { aff = isl_aff_cow(aff); if (!aff) - return isl_id_free(id); + goto error; if (type == isl_dim_out) isl_die(aff->v->ctx, isl_error_invalid, "cannot set name of output/set dimension", @@ -1719,6 +2034,29 @@ return NULL; } +/* Replace the identifier of the input tuple of "aff" by "id". + * type is currently required to be equal to isl_dim_in + */ +__isl_give isl_aff *isl_aff_set_tuple_id(__isl_take isl_aff *aff, + enum isl_dim_type type, __isl_take isl_id *id) +{ + aff = isl_aff_cow(aff); + if (!aff) + goto error; + if (type != isl_dim_out) + isl_die(aff->v->ctx, isl_error_invalid, + "cannot only set id of input tuple", goto error); + aff->ls = isl_local_space_set_tuple_id(aff->ls, isl_dim_set, id); + if (!aff->ls) + return isl_aff_free(aff); + + return aff; +error: + isl_id_free(id); + isl_aff_free(aff); + return NULL; +} + /* Exploit the equalities in "eq" to simplify the affine expression * and the expressions of the integer divisions in the local space. * The integer divisions in this local space are assumed to appear @@ -1771,8 +2109,8 @@ /* Exploit the equalities in "eq" to simplify the affine expression * and the expressions of the integer divisions in the local space. */ -static __isl_give isl_aff *isl_aff_substitute_equalities( - __isl_take isl_aff *aff, __isl_take isl_basic_set *eq) +__isl_give isl_aff *isl_aff_substitute_equalities(__isl_take isl_aff *aff, + __isl_take isl_basic_set *eq) { int n_div; @@ -1831,8 +2169,46 @@ } /* Return a basic set containing those elements in the space + * of aff where it is positive. "rational" should not be set. + * + * If "aff" is NaN, then it is not positive. + */ +static __isl_give isl_basic_set *aff_pos_basic_set(__isl_take isl_aff *aff, + int rational) +{ + isl_constraint *ineq; + isl_basic_set *bset; + isl_val *c; + + if (!aff) + return NULL; + if (isl_aff_is_nan(aff)) { + isl_space *space = isl_aff_get_domain_space(aff); + isl_aff_free(aff); + return isl_basic_set_empty(space); + } + if (rational) + isl_die(isl_aff_get_ctx(aff), isl_error_unsupported, + "rational sets not supported", goto error); + + ineq = isl_inequality_from_aff(aff); + c = isl_constraint_get_constant_val(ineq); + c = isl_val_sub_ui(c, 1); + ineq = isl_constraint_set_constant_val(ineq, c); + + bset = isl_basic_set_from_constraint(ineq); + bset = isl_basic_set_simplify(bset); + return bset; +error: + isl_aff_free(aff); + return NULL; +} + +/* Return a basic set containing those elements in the space * of aff where it is non-negative. * If "rational" is set, then return a rational basic set. + * + * If "aff" is NaN, then it is not non-negative (it's not negative either). */ static __isl_give isl_basic_set *aff_nonneg_basic_set( __isl_take isl_aff *aff, int rational) @@ -1840,6 +2216,14 @@ isl_constraint *ineq; isl_basic_set *bset; + if (!aff) + return NULL; + if (isl_aff_is_nan(aff)) { + isl_space *space = isl_aff_get_domain_space(aff); + isl_aff_free(aff); + return isl_basic_set_empty(space); + } + ineq = isl_inequality_from_aff(aff); bset = isl_basic_set_from_constraint(ineq); @@ -1870,6 +2254,8 @@ /* Return a basic set containing those elements in the space * of aff where it is zero. * If "rational" is set, then return a rational basic set. + * + * If "aff" is NaN, then it is not zero. */ static __isl_give isl_basic_set *aff_zero_basic_set(__isl_take isl_aff *aff, int rational) @@ -1877,6 +2263,14 @@ isl_constraint *ineq; isl_basic_set *bset; + if (!aff) + return NULL; + if (isl_aff_is_nan(aff)) { + isl_space *space = isl_aff_get_domain_space(aff); + isl_aff_free(aff); + return isl_basic_set_empty(space); + } + ineq = isl_equality_from_aff(aff); bset = isl_basic_set_from_constraint(ineq); @@ -1935,23 +2329,23 @@ * appear with non-zero coefficients in any of the integer divisions * involved in the affine expression. */ -int isl_aff_involves_dims(__isl_keep isl_aff *aff, +isl_bool isl_aff_involves_dims(__isl_keep isl_aff *aff, enum isl_dim_type type, unsigned first, unsigned n) { int i; isl_ctx *ctx; int *active = NULL; - int involves = 0; + isl_bool involves = isl_bool_false; if (!aff) - return -1; + return isl_bool_error; if (n == 0) - return 0; + return isl_bool_false; ctx = isl_aff_get_ctx(aff); if (first + n > isl_aff_dim(aff, type)) isl_die(ctx, isl_error_invalid, - "range out of bounds", return -1); + "range out of bounds", return isl_bool_error); active = isl_local_space_get_active(aff->ls, aff->v->el + 2); if (!active) @@ -1960,7 +2354,7 @@ first += isl_local_space_offset(aff->ls, type) - 1; for (i = 0; i < n; ++i) if (active[first + i]) { - involves = 1; + involves = isl_bool_true; break; } @@ -1969,7 +2363,7 @@ return involves; error: free(active); - return -1; + return isl_bool_error; } __isl_give isl_aff *isl_aff_drop_dims(__isl_take isl_aff *aff, @@ -2090,15 +2484,74 @@ return isl_pw_aff_insert_dims(pwaff, type, pos, n); } -__isl_give isl_pw_aff *isl_pw_aff_from_aff(__isl_take isl_aff *aff) +/* Move the "n" dimensions of "src_type" starting at "src_pos" of "aff" + * to dimensions of "dst_type" at "dst_pos". + * + * We only support moving input dimensions to parameters and vice versa. + */ +__isl_give isl_aff *isl_aff_move_dims(__isl_take isl_aff *aff, + enum isl_dim_type dst_type, unsigned dst_pos, + enum isl_dim_type src_type, unsigned src_pos, unsigned n) { - isl_set *dom = isl_set_universe(isl_aff_get_domain_space(aff)); - return isl_pw_aff_alloc(dom, aff); -} + unsigned g_dst_pos; + unsigned g_src_pos; -#undef PW -#define PW isl_pw_aff -#undef EL + if (!aff) + return NULL; + if (n == 0 && + !isl_local_space_is_named_or_nested(aff->ls, src_type) && + !isl_local_space_is_named_or_nested(aff->ls, dst_type)) + return aff; + + if (dst_type == isl_dim_out || src_type == isl_dim_out) + isl_die(isl_aff_get_ctx(aff), isl_error_invalid, + "cannot move output/set dimension", + return isl_aff_free(aff)); + if (dst_type == isl_dim_div || src_type == isl_dim_div) + isl_die(isl_aff_get_ctx(aff), isl_error_invalid, + "cannot move divs", return isl_aff_free(aff)); + if (dst_type == isl_dim_in) + dst_type = isl_dim_set; + if (src_type == isl_dim_in) + src_type = isl_dim_set; + + if (src_pos + n > isl_local_space_dim(aff->ls, src_type)) + isl_die(isl_aff_get_ctx(aff), isl_error_invalid, + "range out of bounds", return isl_aff_free(aff)); + if (dst_type == src_type) + isl_die(isl_aff_get_ctx(aff), isl_error_unsupported, + "moving dims within the same type not supported", + return isl_aff_free(aff)); + + aff = isl_aff_cow(aff); + if (!aff) + return NULL; + + g_src_pos = 1 + isl_local_space_offset(aff->ls, src_type) + src_pos; + g_dst_pos = 1 + isl_local_space_offset(aff->ls, dst_type) + dst_pos; + if (dst_type > src_type) + g_dst_pos -= n; + + aff->v = isl_vec_move_els(aff->v, g_dst_pos, g_src_pos, n); + aff->ls = isl_local_space_move_dims(aff->ls, dst_type, dst_pos, + src_type, src_pos, n); + if (!aff->v || !aff->ls) + return isl_aff_free(aff); + + aff = sort_divs(aff); + + return aff; +} + +__isl_give isl_pw_aff *isl_pw_aff_from_aff(__isl_take isl_aff *aff) +{ + isl_set *dom = isl_set_universe(isl_aff_get_domain_space(aff)); + return isl_pw_aff_alloc(dom, aff); +} + +#undef PW +#define PW isl_pw_aff +#undef EL #define EL isl_aff #undef EL_IS_ZERO #define EL_IS_ZERO is_empty @@ -2113,12 +2566,22 @@ #define NO_EVAL #define NO_OPT -#define NO_MOVE_DIMS #define NO_LIFT #define NO_MORPH #include +#undef UNION +#define UNION isl_union_pw_aff +#undef PART +#define PART isl_pw_aff +#undef PARTS +#define PARTS pw_aff + +#define NO_EVAL + +#include + static __isl_give isl_set *align_params_pw_pw_set_and( __isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2, __isl_give isl_set *(*fn)(__isl_take isl_pw_aff *pwaff1, @@ -2142,6 +2605,31 @@ return NULL; } +/* Align the parameters of the to isl_pw_aff arguments and + * then apply a function "fn" on them that returns an isl_map. + */ +static __isl_give isl_map *align_params_pw_pw_map_and( + __isl_take isl_pw_aff *pa1, __isl_take isl_pw_aff *pa2, + __isl_give isl_map *(*fn)(__isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2)) +{ + if (!pa1 || !pa2) + goto error; + if (isl_space_match(pa1->dim, isl_dim_param, pa2->dim, isl_dim_param)) + return fn(pa1, pa2); + if (!isl_space_has_named_params(pa1->dim) || + !isl_space_has_named_params(pa2->dim)) + isl_die(isl_pw_aff_get_ctx(pa1), isl_error_invalid, + "unaligned unnamed parameters", goto error); + pa1 = isl_pw_aff_align_params(pa1, isl_pw_aff_get_space(pa2)); + pa2 = isl_pw_aff_align_params(pa2, isl_pw_aff_get_space(pa1)); + return fn(pa1, pa2); +error: + isl_pw_aff_free(pa1); + isl_pw_aff_free(pa2); + return NULL; +} + /* Compute a piecewise quasi-affine expression with a domain that * is the union of those of pwaff1 and pwaff2 and such that on each * cell, the quasi-affine expression is the better (according to cmp) @@ -2312,9 +2800,11 @@ return NULL; if (isl_space_is_set(pwaff->dim)) isl_die(isl_pw_aff_get_ctx(pwaff), isl_error_invalid, - "space of input is not a map", - return isl_pw_aff_free(pwaff)); + "space of input is not a map", goto error); return map_from_pw_aff(pwaff); +error: + isl_pw_aff_free(pwaff); + return NULL; } /* Construct a one-dimensional set with as parameter domain @@ -2327,15 +2817,23 @@ return NULL; if (!isl_space_is_set(pwaff->dim)) isl_die(isl_pw_aff_get_ctx(pwaff), isl_error_invalid, - "space of input is not a set", - return isl_pw_aff_free(pwaff)); + "space of input is not a set", goto error); return map_from_pw_aff(pwaff); +error: + isl_pw_aff_free(pwaff); + return NULL; } /* Return a set containing those elements in the domain - * of pwaff where it is non-negative. + * of "pwaff" where it satisfies "fn" (if complement is 0) or + * does not satisfy "fn" (if complement is 1). + * + * The pieces with a NaN never belong to the result since + * NaN does not satisfy any property. */ -__isl_give isl_set *isl_pw_aff_nonneg_set(__isl_take isl_pw_aff *pwaff) +static __isl_give isl_set *pw_aff_locus(__isl_take isl_pw_aff *pwaff, + __isl_give isl_basic_set *(*fn)(__isl_take isl_aff *aff, int rational), + int complement) { int i; isl_set *set; @@ -2347,14 +2845,20 @@ for (i = 0; i < pwaff->n; ++i) { isl_basic_set *bset; - isl_set *set_i; + isl_set *set_i, *locus; int rational; + if (isl_aff_is_nan(pwaff->p[i].aff)) + continue; + rational = isl_set_has_rational(pwaff->p[i].set); - bset = aff_nonneg_basic_set(isl_aff_copy(pwaff->p[i].aff), - rational); - set_i = isl_set_from_basic_set(bset); - set_i = isl_set_intersect(set_i, isl_set_copy(pwaff->p[i].set)); + bset = fn(isl_aff_copy(pwaff->p[i].aff), rational); + locus = isl_set_from_basic_set(bset); + set_i = isl_set_copy(pwaff->p[i].set); + if (complement) + set_i = isl_set_subtract(set_i, locus); + else + set_i = isl_set_intersect(set_i, locus); set = isl_set_union_disjoint(set, set_i); } @@ -2364,40 +2868,19 @@ } /* Return a set containing those elements in the domain - * of pwaff where it is zero (if complement is 0) or not zero - * (if complement is 1). + * of "pa" where it is positive. */ -static __isl_give isl_set *pw_aff_zero_set(__isl_take isl_pw_aff *pwaff, - int complement) +__isl_give isl_set *isl_pw_aff_pos_set(__isl_take isl_pw_aff *pa) { - int i; - isl_set *set; - - if (!pwaff) - return NULL; - - set = isl_set_empty(isl_pw_aff_get_domain_space(pwaff)); - - for (i = 0; i < pwaff->n; ++i) { - isl_basic_set *bset; - isl_set *set_i, *zero; - int rational; - - rational = isl_set_has_rational(pwaff->p[i].set); - bset = aff_zero_basic_set(isl_aff_copy(pwaff->p[i].aff), - rational); - zero = isl_set_from_basic_set(bset); - set_i = isl_set_copy(pwaff->p[i].set); - if (complement) - set_i = isl_set_subtract(set_i, zero); - else - set_i = isl_set_intersect(set_i, zero); - set = isl_set_union_disjoint(set, set_i); - } - - isl_pw_aff_free(pwaff); + return pw_aff_locus(pa, &aff_pos_basic_set, 0); +} - return set; +/* Return a set containing those elements in the domain + * of pwaff where it is non-negative. + */ +__isl_give isl_set *isl_pw_aff_nonneg_set(__isl_take isl_pw_aff *pwaff) +{ + return pw_aff_locus(pwaff, &aff_nonneg_basic_set, 0); } /* Return a set containing those elements in the domain @@ -2405,7 +2888,7 @@ */ __isl_give isl_set *isl_pw_aff_zero_set(__isl_take isl_pw_aff *pwaff) { - return pw_aff_zero_set(pwaff, 0); + return pw_aff_locus(pwaff, &aff_zero_basic_set, 0); } /* Return a set containing those elements in the domain @@ -2413,7 +2896,7 @@ */ __isl_give isl_set *isl_pw_aff_non_zero_set(__isl_take isl_pw_aff *pwaff) { - return pw_aff_zero_set(pwaff, 1); + return pw_aff_locus(pwaff, &aff_zero_basic_set, 1); } /* Return a set containing those elements in the shared domain @@ -2508,6 +2991,97 @@ return isl_pw_aff_gt_set(pwaff2, pwaff1); } +/* Return a map containing pairs of elements in the domains of "pa1" and "pa2" + * where the function values are ordered in the same way as "order", + * which returns a set in the shared domain of its two arguments. + * The parameters of "pa1" and "pa2" are assumed to have been aligned. + * + * Let "pa1" and "pa2" be defined on domains A and B respectively. + * We first pull back the two functions such that they are defined on + * the domain [A -> B]. Then we apply "order", resulting in a set + * in the space [A -> B]. Finally, we unwrap this set to obtain + * a map in the space A -> B. + */ +static __isl_give isl_map *isl_pw_aff_order_map_aligned( + __isl_take isl_pw_aff *pa1, __isl_take isl_pw_aff *pa2, + __isl_give isl_set *(*order)(__isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2)) +{ + isl_space *space1, *space2; + isl_multi_aff *ma; + isl_set *set; + + space1 = isl_space_domain(isl_pw_aff_get_space(pa1)); + space2 = isl_space_domain(isl_pw_aff_get_space(pa2)); + space1 = isl_space_map_from_domain_and_range(space1, space2); + ma = isl_multi_aff_domain_map(isl_space_copy(space1)); + pa1 = isl_pw_aff_pullback_multi_aff(pa1, ma); + ma = isl_multi_aff_range_map(space1); + pa2 = isl_pw_aff_pullback_multi_aff(pa2, ma); + set = order(pa1, pa2); + + return isl_set_unwrap(set); +} + +/* Return a map containing pairs of elements in the domains of "pa1" and "pa2" + * where the function values are equal. + * The parameters of "pa1" and "pa2" are assumed to have been aligned. + */ +static __isl_give isl_map *isl_pw_aff_eq_map_aligned(__isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2) +{ + return isl_pw_aff_order_map_aligned(pa1, pa2, &isl_pw_aff_eq_set); +} + +/* Return a map containing pairs of elements in the domains of "pa1" and "pa2" + * where the function values are equal. + */ +__isl_give isl_map *isl_pw_aff_eq_map(__isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2) +{ + return align_params_pw_pw_map_and(pa1, pa2, &isl_pw_aff_eq_map_aligned); +} + +/* Return a map containing pairs of elements in the domains of "pa1" and "pa2" + * where the function value of "pa1" is less than the function value of "pa2". + * The parameters of "pa1" and "pa2" are assumed to have been aligned. + */ +static __isl_give isl_map *isl_pw_aff_lt_map_aligned(__isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2) +{ + return isl_pw_aff_order_map_aligned(pa1, pa2, &isl_pw_aff_lt_set); +} + +/* Return a map containing pairs of elements in the domains of "pa1" and "pa2" + * where the function value of "pa1" is less than the function value of "pa2". + */ +__isl_give isl_map *isl_pw_aff_lt_map(__isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2) +{ + return align_params_pw_pw_map_and(pa1, pa2, &isl_pw_aff_lt_map_aligned); +} + +/* Return a map containing pairs of elements in the domains of "pa1" and "pa2" + * where the function value of "pa1" is greater than the function value + * of "pa2". + * The parameters of "pa1" and "pa2" are assumed to have been aligned. + */ +static __isl_give isl_map *isl_pw_aff_gt_map_aligned(__isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2) +{ + return isl_pw_aff_order_map_aligned(pa1, pa2, &isl_pw_aff_gt_set); +} + +/* Return a map containing pairs of elements in the domains of "pa1" and "pa2" + * where the function value of "pa1" is greater than the function value + * of "pa2". + */ +__isl_give isl_map *isl_pw_aff_gt_map(__isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2) +{ + return align_params_pw_pw_map_and(pa1, pa2, &isl_pw_aff_gt_map_aligned); +} + /* Return a set containing those elements in the shared domain * of the elements of list1 and list2 where each element in list1 * has the relation specified by "fn" with each element in list2. @@ -2639,49 +3213,6 @@ return pwaff; } -/* Divide "pa" by "f". - */ -__isl_give isl_pw_aff *isl_pw_aff_scale_down_val(__isl_take isl_pw_aff *pa, - __isl_take isl_val *f) -{ - int i; - - if (!pa || !f) - goto error; - - if (isl_val_is_one(f)) { - isl_val_free(f); - return pa; - } - - if (!isl_val_is_rat(f)) - isl_die(isl_pw_aff_get_ctx(pa), isl_error_invalid, - "expecting rational factor", goto error); - if (!isl_val_is_pos(f)) - isl_die(isl_pw_aff_get_ctx(pa), isl_error_invalid, - "factor needs to be positive", goto error); - - pa = isl_pw_aff_cow(pa); - if (!pa) - return NULL; - if (pa->n == 0) - return pa; - - for (i = 0; i < pa->n; ++i) { - pa->p[i].aff = isl_aff_scale_down_val(pa->p[i].aff, - isl_val_copy(f)); - if (!pa->p[i].aff) - goto error; - } - - isl_val_free(f); - return pa; -error: - isl_pw_aff_free(pa); - isl_val_free(f); - return NULL; -} - __isl_give isl_pw_aff *isl_pw_aff_floor(__isl_take isl_pw_aff *pwaff) { int i; @@ -2738,47 +3269,85 @@ * where "cond" is non-zero and to pwaff_false for elements where "cond" * is zero. * That is, return cond ? pwaff_true : pwaff_false; + * + * If "cond" involves and NaN, then we conservatively return a NaN + * on its entire domain. In principle, we could consider the pieces + * where it is NaN separately from those where it is not. */ __isl_give isl_pw_aff *isl_pw_aff_cond(__isl_take isl_pw_aff *cond, __isl_take isl_pw_aff *pwaff_true, __isl_take isl_pw_aff *pwaff_false) { isl_set *cond_true, *cond_false; + if (!cond) + goto error; + if (isl_pw_aff_involves_nan(cond)) { + isl_space *space = isl_pw_aff_get_domain_space(cond); + isl_local_space *ls = isl_local_space_from_space(space); + isl_pw_aff_free(cond); + isl_pw_aff_free(pwaff_true); + isl_pw_aff_free(pwaff_false); + return isl_pw_aff_nan_on_domain(ls); + } + cond_true = isl_pw_aff_non_zero_set(isl_pw_aff_copy(cond)); cond_false = isl_pw_aff_zero_set(cond); return isl_pw_aff_select(cond_true, pwaff_true, cond_false, pwaff_false); +error: + isl_pw_aff_free(cond); + isl_pw_aff_free(pwaff_true); + isl_pw_aff_free(pwaff_false); + return NULL; } -int isl_aff_is_cst(__isl_keep isl_aff *aff) +isl_bool isl_aff_is_cst(__isl_keep isl_aff *aff) { if (!aff) - return -1; + return isl_bool_error; return isl_seq_first_non_zero(aff->v->el + 2, aff->v->size - 2) == -1; } /* Check whether pwaff is a piecewise constant. */ -int isl_pw_aff_is_cst(__isl_keep isl_pw_aff *pwaff) +isl_bool isl_pw_aff_is_cst(__isl_keep isl_pw_aff *pwaff) { int i; if (!pwaff) - return -1; + return isl_bool_error; for (i = 0; i < pwaff->n; ++i) { - int is_cst = isl_aff_is_cst(pwaff->p[i].aff); + isl_bool is_cst = isl_aff_is_cst(pwaff->p[i].aff); if (is_cst < 0 || !is_cst) return is_cst; } - return 1; + return isl_bool_true; } +/* Return the product of "aff1" and "aff2". + * + * If either of the two is NaN, then the result is NaN. + * + * Otherwise, at least one of "aff1" or "aff2" needs to be a constant. + */ __isl_give isl_aff *isl_aff_mul(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { + if (!aff1 || !aff2) + goto error; + + if (isl_aff_is_nan(aff1)) { + isl_aff_free(aff2); + return aff1; + } + if (isl_aff_is_nan(aff2)) { + isl_aff_free(aff1); + return aff2; + } + if (!isl_aff_is_cst(aff2) && isl_aff_is_cst(aff1)) return isl_aff_mul(aff2, aff1); @@ -2802,7 +3371,9 @@ return NULL; } -/* Divide "aff1" by "aff2", assuming "aff2" is a piecewise constant. +/* Divide "aff1" by "aff2", assuming "aff2" is a constant. + * + * If either of the two is NaN, then the result is NaN. */ __isl_give isl_aff *isl_aff_div(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) @@ -2810,6 +3381,18 @@ int is_cst; int neg; + if (!aff1 || !aff2) + goto error; + + if (isl_aff_is_nan(aff1)) { + isl_aff_free(aff2); + return aff1; + } + if (isl_aff_is_nan(aff2)) { + isl_aff_free(aff1); + return aff2; + } + is_cst = isl_aff_is_cst(aff2); if (is_cst < 0) goto error; @@ -3022,8 +3605,7 @@ ctx = isl_pw_aff_list_get_ctx(list); if (list->n < 1) isl_die(ctx, isl_error_invalid, - "list should contain at least one element", - return isl_pw_aff_list_free(list)); + "list should contain at least one element", goto error); res = isl_pw_aff_copy(list->p[0]); for (i = 1; i < list->n; ++i) @@ -3031,6 +3613,9 @@ isl_pw_aff_list_free(list); return res; +error: + isl_pw_aff_list_free(list); + return NULL; } /* Return an isl_pw_aff that maps each element in the intersection of the @@ -3096,6 +3681,25 @@ return list; } +/* Do the parameters of "aff" match those of "space"? + */ +int isl_aff_matching_params(__isl_keep isl_aff *aff, + __isl_keep isl_space *space) +{ + isl_space *aff_space; + int match; + + if (!aff || !space) + return -1; + + aff_space = isl_aff_get_domain_space(aff); + + match = isl_space_match(space, isl_dim_param, aff_space, isl_dim_param); + + isl_space_free(aff_space); + return match; +} + /* Check that the domain space of "aff" matches "space". * * Return 0 on success and -1 on error. @@ -3117,7 +3721,7 @@ if (!match) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "parameters don't match", goto error); - match = isl_space_tuple_match(space, isl_dim_in, + match = isl_space_tuple_is_equal(space, isl_dim_in, aff_space, isl_dim_set); if (match < 0) goto error; @@ -3133,92 +3737,247 @@ #undef BASE #define BASE aff +#undef DOMBASE +#define DOMBASE set +#define NO_DOMAIN #include +#include +#include +#include -/* Create an isl_pw_multi_aff with the given isl_multi_aff on a universe - * domain. +#undef NO_DOMAIN + +/* Remove any internal structure of the domain of "ma". + * If there is any such internal structure in the input, + * then the name of the corresponding space is also removed. */ -__isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_multi_aff( +__isl_give isl_multi_aff *isl_multi_aff_flatten_domain( __isl_take isl_multi_aff *ma) { - isl_set *dom = isl_set_universe(isl_multi_aff_get_domain_space(ma)); - return isl_pw_multi_aff_alloc(dom, ma); -} + isl_space *space; -/* Create a piecewise multi-affine expression in the given space that maps each - * input dimension to the corresponding output dimension. - */ -__isl_give isl_pw_multi_aff *isl_pw_multi_aff_identity( - __isl_take isl_space *space) -{ - return isl_pw_multi_aff_from_multi_aff(isl_multi_aff_identity(space)); -} + if (!ma) + return NULL; -__isl_give isl_multi_aff *isl_multi_aff_add(__isl_take isl_multi_aff *maff1, - __isl_take isl_multi_aff *maff2) -{ - return isl_multi_aff_bin_op(maff1, maff2, &isl_aff_add); -} + if (!ma->space->nested[0]) + return ma; -/* Subtract "ma2" from "ma1" and return the result. - */ -__isl_give isl_multi_aff *isl_multi_aff_sub(__isl_take isl_multi_aff *ma1, - __isl_take isl_multi_aff *ma2) -{ - return isl_multi_aff_bin_op(ma1, ma2, &isl_aff_sub); + space = isl_multi_aff_get_space(ma); + space = isl_space_flatten_domain(space); + ma = isl_multi_aff_reset_space(ma, space); + + return ma; } -/* Given two multi-affine expressions A -> B and C -> D, - * construct a multi-affine expression [A -> C] -> [B -> D]. +/* Given a map space, return an isl_multi_aff that maps a wrapped copy + * of the space to its domain. */ -__isl_give isl_multi_aff *isl_multi_aff_product( - __isl_take isl_multi_aff *ma1, __isl_take isl_multi_aff *ma2) +__isl_give isl_multi_aff *isl_multi_aff_domain_map(__isl_take isl_space *space) { - int i; - isl_aff *aff; - isl_space *space; - isl_multi_aff *res; - int in1, in2, out1, out2; + int i, n_in; + isl_local_space *ls; + isl_multi_aff *ma; - in1 = isl_multi_aff_dim(ma1, isl_dim_in); - in2 = isl_multi_aff_dim(ma2, isl_dim_in); - out1 = isl_multi_aff_dim(ma1, isl_dim_out); - out2 = isl_multi_aff_dim(ma2, isl_dim_out); - space = isl_space_product(isl_multi_aff_get_space(ma1), - isl_multi_aff_get_space(ma2)); - res = isl_multi_aff_alloc(isl_space_copy(space)); - space = isl_space_domain(space); + if (!space) + return NULL; + if (!isl_space_is_map(space)) + isl_die(isl_space_get_ctx(space), isl_error_invalid, + "not a map space", goto error); - for (i = 0; i < out1; ++i) { - aff = isl_multi_aff_get_aff(ma1, i); - aff = isl_aff_insert_dims(aff, isl_dim_in, in1, in2); - aff = isl_aff_reset_domain_space(aff, isl_space_copy(space)); - res = isl_multi_aff_set_aff(res, i, aff); - } + n_in = isl_space_dim(space, isl_dim_in); + space = isl_space_domain_map(space); - for (i = 0; i < out2; ++i) { - aff = isl_multi_aff_get_aff(ma2, i); - aff = isl_aff_insert_dims(aff, isl_dim_in, 0, in1); - aff = isl_aff_reset_domain_space(aff, isl_space_copy(space)); - res = isl_multi_aff_set_aff(res, out1 + i, aff); + ma = isl_multi_aff_alloc(isl_space_copy(space)); + if (n_in == 0) { + isl_space_free(space); + return ma; } + space = isl_space_domain(space); + ls = isl_local_space_from_space(space); + for (i = 0; i < n_in; ++i) { + isl_aff *aff; + + aff = isl_aff_var_on_domain(isl_local_space_copy(ls), + isl_dim_set, i); + ma = isl_multi_aff_set_aff(ma, i, aff); + } + isl_local_space_free(ls); + return ma; +error: isl_space_free(space); - isl_multi_aff_free(ma1); - isl_multi_aff_free(ma2); - return res; + return NULL; } -/* Exploit the equalities in "eq" to simplify the affine expressions. +/* Given a map space, return an isl_multi_aff that maps a wrapped copy + * of the space to its range. */ -static __isl_give isl_multi_aff *isl_multi_aff_substitute_equalities( - __isl_take isl_multi_aff *maff, __isl_take isl_basic_set *eq) +__isl_give isl_multi_aff *isl_multi_aff_range_map(__isl_take isl_space *space) { - int i; + int i, n_in, n_out; + isl_local_space *ls; + isl_multi_aff *ma; - maff = isl_multi_aff_cow(maff); - if (!maff || !eq) + if (!space) + return NULL; + if (!isl_space_is_map(space)) + isl_die(isl_space_get_ctx(space), isl_error_invalid, + "not a map space", goto error); + + n_in = isl_space_dim(space, isl_dim_in); + n_out = isl_space_dim(space, isl_dim_out); + space = isl_space_range_map(space); + + ma = isl_multi_aff_alloc(isl_space_copy(space)); + if (n_out == 0) { + isl_space_free(space); + return ma; + } + + space = isl_space_domain(space); + ls = isl_local_space_from_space(space); + for (i = 0; i < n_out; ++i) { + isl_aff *aff; + + aff = isl_aff_var_on_domain(isl_local_space_copy(ls), + isl_dim_set, n_in + i); + ma = isl_multi_aff_set_aff(ma, i, aff); + } + isl_local_space_free(ls); + return ma; +error: + isl_space_free(space); + return NULL; +} + +/* Given a map space, return an isl_pw_multi_aff that maps a wrapped copy + * of the space to its range. + */ +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_range_map( + __isl_take isl_space *space) +{ + return isl_pw_multi_aff_from_multi_aff(isl_multi_aff_range_map(space)); +} + +/* Given the space of a set and a range of set dimensions, + * construct an isl_multi_aff that projects out those dimensions. + */ +__isl_give isl_multi_aff *isl_multi_aff_project_out_map( + __isl_take isl_space *space, enum isl_dim_type type, + unsigned first, unsigned n) +{ + int i, dim; + isl_local_space *ls; + isl_multi_aff *ma; + + if (!space) + return NULL; + if (!isl_space_is_set(space)) + isl_die(isl_space_get_ctx(space), isl_error_unsupported, + "expecting set space", goto error); + if (type != isl_dim_set) + isl_die(isl_space_get_ctx(space), isl_error_invalid, + "only set dimensions can be projected out", goto error); + + dim = isl_space_dim(space, isl_dim_set); + if (first + n > dim) + isl_die(isl_space_get_ctx(space), isl_error_invalid, + "range out of bounds", goto error); + + space = isl_space_from_domain(space); + space = isl_space_add_dims(space, isl_dim_out, dim - n); + + if (dim == n) + return isl_multi_aff_alloc(space); + + ma = isl_multi_aff_alloc(isl_space_copy(space)); + space = isl_space_domain(space); + ls = isl_local_space_from_space(space); + + for (i = 0; i < first; ++i) { + isl_aff *aff; + + aff = isl_aff_var_on_domain(isl_local_space_copy(ls), + isl_dim_set, i); + ma = isl_multi_aff_set_aff(ma, i, aff); + } + + for (i = 0; i < dim - (first + n); ++i) { + isl_aff *aff; + + aff = isl_aff_var_on_domain(isl_local_space_copy(ls), + isl_dim_set, first + n + i); + ma = isl_multi_aff_set_aff(ma, first + i, aff); + } + + isl_local_space_free(ls); + return ma; +error: + isl_space_free(space); + return NULL; +} + +/* Given the space of a set and a range of set dimensions, + * construct an isl_pw_multi_aff that projects out those dimensions. + */ +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_project_out_map( + __isl_take isl_space *space, enum isl_dim_type type, + unsigned first, unsigned n) +{ + isl_multi_aff *ma; + + ma = isl_multi_aff_project_out_map(space, type, first, n); + return isl_pw_multi_aff_from_multi_aff(ma); +} + +/* Create an isl_pw_multi_aff with the given isl_multi_aff on a universe + * domain. + */ +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_multi_aff( + __isl_take isl_multi_aff *ma) +{ + isl_set *dom = isl_set_universe(isl_multi_aff_get_domain_space(ma)); + return isl_pw_multi_aff_alloc(dom, ma); +} + +/* Create a piecewise multi-affine expression in the given space that maps each + * input dimension to the corresponding output dimension. + */ +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_identity( + __isl_take isl_space *space) +{ + return isl_pw_multi_aff_from_multi_aff(isl_multi_aff_identity(space)); +} + +/* Add "ma2" to "ma1" and return the result. + * + * The parameters of "ma1" and "ma2" are assumed to have been aligned. + */ +static __isl_give isl_multi_aff *isl_multi_aff_add_aligned( + __isl_take isl_multi_aff *maff1, __isl_take isl_multi_aff *maff2) +{ + return isl_multi_aff_bin_op(maff1, maff2, &isl_aff_add); +} + +/* Add "ma2" to "ma1" and return the result. + */ +__isl_give isl_multi_aff *isl_multi_aff_add(__isl_take isl_multi_aff *ma1, + __isl_take isl_multi_aff *ma2) +{ + return isl_multi_aff_align_params_multi_multi_and(ma1, ma2, + &isl_multi_aff_add_aligned); +} + +/* Exploit the equalities in "eq" to simplify the affine expressions. + */ +static __isl_give isl_multi_aff *isl_multi_aff_substitute_equalities( + __isl_take isl_multi_aff *maff, __isl_take isl_basic_set *eq) +{ + int i; + + maff = isl_multi_aff_cow(maff); + if (!maff || !eq) goto error; for (i = 0; i < maff->n; ++i) { @@ -3270,29 +4029,6 @@ return 0; } -int isl_multi_aff_plain_is_equal(__isl_keep isl_multi_aff *maff1, - __isl_keep isl_multi_aff *maff2) -{ - int i; - int equal; - - if (!maff1 || !maff2) - return -1; - if (maff1->n != maff2->n) - return 0; - equal = isl_space_is_equal(maff1->space, maff2->space); - if (equal < 0 || !equal) - return equal; - - for (i = 0; i < maff1->n; ++i) { - equal = isl_aff_plain_is_equal(maff1->p[i], maff2->p[i]); - if (equal < 0 || !equal) - return equal; - } - - return 1; -} - /* Return the set of domain elements where "ma1" is lexicographically * smaller than or equal to "ma2". */ @@ -3338,24 +4074,24 @@ #undef DEFAULT_IS_ZERO #define DEFAULT_IS_ZERO 0 -#define NO_NEG +#define NO_SUB #define NO_EVAL #define NO_OPT #define NO_INVOLVES_DIMS -#define NO_MOVE_DIMS #define NO_INSERT_DIMS #define NO_LIFT #define NO_MORPH #include +#undef NO_SUB + #undef UNION #define UNION isl_union_pw_multi_aff #undef PART #define PART isl_pw_multi_aff #undef PARTS #define PARTS pw_multi_aff -#define ALIGN_DOMAIN #define NO_EVAL @@ -3549,6 +4285,27 @@ return isl_pw_multi_aff_union_add_(pma1, pma2); } +/* Compute the sum of "upa1" and "upa2" on the union of their domains, + * with the actual sum on the shared domain and + * the defined expression on the symmetric difference of the domains. + */ +__isl_give isl_union_pw_aff *isl_union_pw_aff_union_add( + __isl_take isl_union_pw_aff *upa1, __isl_take isl_union_pw_aff *upa2) +{ + return isl_union_pw_aff_union_add_(upa1, upa2); +} + +/* Compute the sum of "upma1" and "upma2" on the union of their domains, + * with the actual sum on the shared domain and + * the defined expression on the symmetric difference of the domains. + */ +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_union_add( + __isl_take isl_union_pw_multi_aff *upma1, + __isl_take isl_union_pw_multi_aff *upma2) +{ + return isl_union_pw_multi_aff_union_add_(upma1, upma2); +} + /* Given two piecewise multi-affine expressions A -> B and C -> D, * construct a piecewise multi-affine expression [A -> C] -> [B -> D]. */ @@ -3636,19 +4393,20 @@ if (!isl_space_is_set(pma->dim)) isl_die(isl_pw_multi_aff_get_ctx(pma), isl_error_invalid, "isl_pw_multi_aff cannot be converted into an isl_set", - return isl_pw_multi_aff_free(pma)); + goto error); return isl_map_from_pw_multi_aff(pma); +error: + isl_pw_multi_aff_free(pma); + return NULL; } /* Given a basic map with a single output dimension that is defined * in terms of the parameters and input dimensions using an equality, * extract an isl_aff that expresses the output dimension in terms * of the parameters and input dimensions. - * - * Since some applications expect the result of isl_pw_multi_aff_from_map - * to only contain integer affine expressions, we compute the floor - * of the expression before returning. + * Note that this expression may involve integer divisions defined + * in terms of parameters and input dimensions. * * This function shares some similarities with * isl_basic_map_has_defining_equality and isl_constraint_get_bound. @@ -3656,9 +4414,9 @@ static __isl_give isl_aff *extract_isl_aff_from_basic_map( __isl_take isl_basic_map *bmap) { - int i; + int eq; unsigned offset; - unsigned total; + unsigned n_div; isl_local_space *ls; isl_aff *aff; @@ -3668,33 +4426,29 @@ isl_die(isl_basic_map_get_ctx(bmap), isl_error_invalid, "basic map should have a single output dimension", goto error); - offset = isl_basic_map_offset(bmap, isl_dim_out); - total = isl_basic_map_total_dim(bmap); - for (i = 0; i < bmap->n_eq; ++i) { - if (isl_int_is_zero(bmap->eq[i][offset])) - continue; - if (isl_seq_first_non_zero(bmap->eq[i] + offset + 1, - 1 + total - (offset + 1)) != -1) - continue; - break; - } - if (i >= bmap->n_eq) + eq = isl_basic_map_output_defining_equality(bmap, 0); + if (eq >= bmap->n_eq) isl_die(isl_basic_map_get_ctx(bmap), isl_error_invalid, "unable to find suitable equality", goto error); ls = isl_basic_map_get_local_space(bmap); aff = isl_aff_alloc(isl_local_space_domain(ls)); if (!aff) goto error; - if (isl_int_is_neg(bmap->eq[i][offset])) - isl_seq_cpy(aff->v->el + 1, bmap->eq[i], offset); - else - isl_seq_neg(aff->v->el + 1, bmap->eq[i], offset); - isl_seq_clr(aff->v->el + 1 + offset, aff->v->size - (1 + offset)); - isl_int_abs(aff->v->el[0], bmap->eq[i][offset]); + offset = isl_basic_map_offset(bmap, isl_dim_out); + n_div = isl_basic_map_dim(bmap, isl_dim_div); + if (isl_int_is_neg(bmap->eq[eq][offset])) { + isl_seq_cpy(aff->v->el + 1, bmap->eq[eq], offset); + isl_seq_cpy(aff->v->el + 1 + offset, bmap->eq[eq] + offset + 1, + n_div); + } else { + isl_seq_neg(aff->v->el + 1, bmap->eq[eq], offset); + isl_seq_neg(aff->v->el + 1 + offset, bmap->eq[eq] + offset + 1, + n_div); + } + isl_int_abs(aff->v->el[0], bmap->eq[eq][offset]); isl_basic_map_free(bmap); aff = isl_aff_remove_unused_divs(aff); - aff = isl_aff_floor(aff); return aff; error: isl_basic_map_free(bmap); @@ -3736,10 +4490,25 @@ return ma; } +/* Given a basic set where each set dimension is defined + * in terms of the parameters using an equality, + * extract an isl_multi_aff that expresses the set dimensions in terms + * of the parameters. + */ +__isl_give isl_multi_aff *isl_multi_aff_from_basic_set_equalities( + __isl_take isl_basic_set *bset) +{ + return extract_isl_multi_aff_from_basic_map(bset); +} + /* Create an isl_pw_multi_aff that is equivalent to * isl_map_intersect_domain(isl_map_from_basic_map(bmap), domain). * The given basic map is such that each output dimension is defined * in terms of the parameters and input dimensions using an equality. + * + * Since some applications expect the result of isl_pw_multi_aff_from_map + * to only contain integer affine expressions, we compute the floor + * of the expression before returning. */ static __isl_give isl_pw_multi_aff *plain_pw_multi_aff_from_map( __isl_take isl_set *domain, __isl_take isl_basic_map *bmap) @@ -3747,6 +4516,7 @@ isl_multi_aff *ma; ma = extract_isl_multi_aff_from_basic_map(bmap); + ma = isl_multi_aff_floor(ma); return isl_pw_multi_aff_alloc(domain, ma); } @@ -4138,7 +4908,7 @@ map = set; else map = isl_set_unwrap(set); - pma = isl_pw_multi_aff_from_map(set); + pma = isl_pw_multi_aff_from_map(map); if (!is_set) { space = isl_pw_multi_aff_get_domain_space(pma); @@ -4250,7 +5020,7 @@ /* Convert "map" into an isl_pw_multi_aff (if possible) and * add it to *user. */ -static int pw_multi_aff_from_map(__isl_take isl_map *map, void *user) +static isl_stat pw_multi_aff_from_map(__isl_take isl_map *map, void *user) { isl_union_pw_multi_aff **upma = user; isl_pw_multi_aff *pma; @@ -4258,7 +5028,21 @@ pma = isl_pw_multi_aff_from_map(map); *upma = isl_union_pw_multi_aff_add_pw_multi_aff(*upma, pma); - return *upma ? 0 : -1; + return *upma ? isl_stat_ok : isl_stat_error; +} + +/* Create an isl_union_pw_multi_aff with the given isl_aff on a universe + * domain. + */ +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_from_aff( + __isl_take isl_aff *aff) +{ + isl_multi_aff *ma; + isl_pw_multi_aff *pma; + + ma = isl_multi_aff_from_aff(aff); + pma = isl_pw_multi_aff_from_multi_aff(ma); + return isl_union_pw_multi_aff_from_pw_multi_aff(pma); } /* Try and create an isl_union_pw_multi_aff that is equivalent @@ -4617,10 +5401,28 @@ return NULL; } +/* Compute the pullback of "aff1" by the function represented by "aff2". + * In other words, plug in "aff2" in "aff1". The result is an affine expression + * defined over the domain space of "aff1". + * + * The domain of "aff1" should match the range of "aff2", which means + * that it should be single-dimensional. + */ +__isl_give isl_aff *isl_aff_pullback_aff(__isl_take isl_aff *aff1, + __isl_take isl_aff *aff2) +{ + isl_multi_aff *ma; + + ma = isl_multi_aff_from_aff(aff2); + return isl_aff_pullback_multi_aff(aff1, ma); +} + /* Compute the pullback of "ma1" by the function represented by "ma2". * In other words, plug in "ma2" in "ma1". + * + * The parameters of "ma1" and "ma2" are assumed to have been aligned. */ -__isl_give isl_multi_aff *isl_multi_aff_pullback_multi_aff( +static __isl_give isl_multi_aff *isl_multi_aff_pullback_multi_aff_aligned( __isl_take isl_multi_aff *ma1, __isl_take isl_multi_aff *ma2) { int i; @@ -4651,6 +5453,16 @@ return NULL; } +/* Compute the pullback of "ma1" by the function represented by "ma2". + * In other words, plug in "ma2" in "ma1". + */ +__isl_give isl_multi_aff *isl_multi_aff_pullback_multi_aff( + __isl_take isl_multi_aff *ma1, __isl_take isl_multi_aff *ma2) +{ + return isl_multi_aff_align_params_multi_multi_and(ma1, ma2, + &isl_multi_aff_pullback_multi_aff_aligned); +} + /* Extend the local space of "dst" to include the divs * in the local space of "src". */ @@ -4844,7 +5656,8 @@ /* Add an isl_pw_multi_aff with the given "set" as domain and * an unnamed zero-dimensional range to *user. */ -static int add_pw_multi_aff_from_domain(__isl_take isl_set *set, void *user) +static isl_stat add_pw_multi_aff_from_domain(__isl_take isl_set *set, + void *user) { isl_union_pw_multi_aff **upma = user; isl_pw_multi_aff *pma; @@ -4852,7 +5665,7 @@ pma = isl_pw_multi_aff_from_domain(set); *upma = isl_union_pw_multi_aff_add_pw_multi_aff(*upma, pma); - return 0; + return isl_stat_ok; } /* Return an isl_union_pw_multi_aff with the given "uset" as domain and @@ -4884,7 +5697,8 @@ /* Convert "pma" to an isl_map and add it to *umap. */ -static int map_from_pw_multi_aff(__isl_take isl_pw_multi_aff *pma, void *user) +static isl_stat map_from_pw_multi_aff(__isl_take isl_pw_multi_aff *pma, + void *user) { isl_union_map **umap = user; isl_map *map; @@ -4892,7 +5706,7 @@ map = isl_map_from_pw_multi_aff(pma); *umap = isl_union_map_add_map(*umap, map); - return 0; + return isl_stat_ok; } /* Construct a union map mapping the domain of the union @@ -4929,23 +5743,23 @@ isl_union_pw_multi_aff *upma2; isl_union_pw_multi_aff *res; isl_pw_multi_aff *pma; - int (*fn)(void **entry, void *user); + isl_stat (*fn)(void **entry, void *user); }; /* Given an isl_pw_multi_aff from upma1, store it in data->pma * and call data->fn for each isl_pw_multi_aff in data->upma2. */ -static int bin_entry(void **entry, void *user) +static isl_stat bin_entry(void **entry, void *user) { struct isl_union_pw_multi_aff_bin_data *data = user; isl_pw_multi_aff *pma = *entry; data->pma = pma; - if (isl_hash_table_foreach(data->upma2->dim->ctx, &data->upma2->table, + if (isl_hash_table_foreach(data->upma2->space->ctx, &data->upma2->table, data->fn, data) < 0) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Call "fn" on each pair of isl_pw_multi_affs in "upma1" and "upma2". @@ -4956,7 +5770,7 @@ static __isl_give isl_union_pw_multi_aff *bin_op( __isl_take isl_union_pw_multi_aff *upma1, __isl_take isl_union_pw_multi_aff *upma2, - int (*fn)(void **entry, void *user)) + isl_stat (*fn)(void **entry, void *user)) { isl_space *space; struct isl_union_pw_multi_aff_bin_data data = { NULL, NULL, NULL, fn }; @@ -4970,9 +5784,9 @@ goto error; data.upma2 = upma2; - data.res = isl_union_pw_multi_aff_alloc(isl_space_copy(upma1->dim), + data.res = isl_union_pw_multi_aff_alloc(isl_space_copy(upma1->space), upma1->table.n); - if (isl_hash_table_foreach(upma1->dim->ctx, &upma1->table, + if (isl_hash_table_foreach(upma1->space->ctx, &upma1->table, &bin_entry, &data) < 0) goto error; @@ -5038,14 +5852,14 @@ /* If data->pma and *entry have the same domain space, then compute * their flat range product and the result to data->res. */ -static int flat_range_product_entry(void **entry, void *user) +static isl_stat flat_range_product_entry(void **entry, void *user) { struct isl_union_pw_multi_aff_bin_data *data = user; isl_pw_multi_aff *pma2 = *entry; - if (!isl_space_tuple_match(data->pma->dim, isl_dim_in, + if (!isl_space_tuple_is_equal(data->pma->dim, isl_dim_in, pma2->dim, isl_dim_in)) - return 0; + return isl_stat_ok; pma2 = isl_pw_multi_aff_flat_range_product( isl_pw_multi_aff_copy(data->pma), @@ -5053,7 +5867,7 @@ data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, pma2); - return 0; + return isl_stat_ok; } /* Given two isl_union_pw_multi_affs A -> B and C -> D, @@ -5082,7 +5896,8 @@ if (!pma || !pa) goto error; - if (!isl_space_tuple_match(pma->dim, isl_dim_in, pa->dim, isl_dim_in)) + if (!isl_space_tuple_is_equal(pma->dim, isl_dim_in, + pa->dim, isl_dim_in)) isl_die(isl_pw_multi_aff_get_ctx(pma), isl_error_invalid, "domains don't match", goto error); if (pos >= isl_pw_multi_aff_dim(pma, isl_dim_out)) @@ -5150,6 +5965,25 @@ return NULL; } +/* Do the parameters of "pa" match those of "space"? + */ +int isl_pw_aff_matching_params(__isl_keep isl_pw_aff *pa, + __isl_keep isl_space *space) +{ + isl_space *pa_space; + int match; + + if (!pa || !space) + return -1; + + pa_space = isl_pw_aff_get_space(pa); + + match = isl_space_match(space, isl_dim_param, pa_space, isl_dim_param); + + isl_space_free(pa_space); + return match; +} + /* Check that the domain space of "pa" matches "space". * * Return 0 on success and -1 on error. @@ -5171,7 +6005,8 @@ if (!match) isl_die(isl_pw_aff_get_ctx(pa), isl_error_invalid, "parameters don't match", goto error); - match = isl_space_tuple_match(space, isl_dim_in, pa_space, isl_dim_in); + match = isl_space_tuple_is_equal(space, isl_dim_in, + pa_space, isl_dim_in); if (match < 0) goto error; if (!match) @@ -5186,8 +6021,13 @@ #undef BASE #define BASE pw_aff +#undef DOMBASE +#define DOMBASE set #include +#include +#include +#include /* Scale the elements of "pma" by the corresponding elements of "mv". */ @@ -5199,7 +6039,7 @@ pma = isl_pw_multi_aff_cow(pma); if (!pma || !mv) goto error; - if (!isl_space_tuple_match(pma->dim, isl_dim_out, + if (!isl_space_tuple_is_equal(pma->dim, isl_dim_out, mv->space, isl_dim_set)) isl_die(isl_pw_multi_aff_get_ctx(pma), isl_error_invalid, "spaces don't match", goto error); @@ -5242,25 +6082,26 @@ * then apply isl_pw_multi_aff_scale_multi_val and add the result * to data->res. */ -static int union_pw_multi_aff_scale_multi_val_entry(void **entry, void *user) +static isl_stat union_pw_multi_aff_scale_multi_val_entry(void **entry, + void *user) { struct isl_union_pw_multi_aff_scale_multi_val_data *data = user; isl_pw_multi_aff *pma = *entry; if (!pma) - return -1; - if (!isl_space_tuple_match(pma->dim, isl_dim_out, + return isl_stat_error; + if (!isl_space_tuple_is_equal(pma->dim, isl_dim_out, data->mv->space, isl_dim_set)) - return 0; + return isl_stat_ok; pma = isl_pw_multi_aff_copy(pma); pma = isl_pw_multi_aff_scale_multi_val(pma, isl_multi_val_copy(data->mv)); data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, pma); if (!data->res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Scale the elements of "upma" by the corresponding elements of "mv", @@ -5279,9 +6120,9 @@ goto error; data.mv = mv; - data.res = isl_union_pw_multi_aff_alloc(isl_space_copy(upma->dim), + data.res = isl_union_pw_multi_aff_alloc(isl_space_copy(upma->space), upma->table.n); - if (isl_hash_table_foreach(upma->dim->ctx, &upma->table, + if (isl_hash_table_foreach(upma->space->ctx, &upma->table, &union_pw_multi_aff_scale_multi_val_entry, &data) < 0) goto error; @@ -5293,3 +6134,2570 @@ isl_union_pw_multi_aff_free(upma); return NULL; } + +/* Construct and return a piecewise multi affine expression + * in the given space with value zero in each of the output dimensions and + * a universe domain. + */ +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_zero(__isl_take isl_space *space) +{ + return isl_pw_multi_aff_from_multi_aff(isl_multi_aff_zero(space)); +} + +/* Construct and return a piecewise multi affine expression + * that is equal to the given piecewise affine expression. + */ +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_pw_aff( + __isl_take isl_pw_aff *pa) +{ + int i; + isl_space *space; + isl_pw_multi_aff *pma; + + if (!pa) + return NULL; + + space = isl_pw_aff_get_space(pa); + pma = isl_pw_multi_aff_alloc_size(space, pa->n); + + for (i = 0; i < pa->n; ++i) { + isl_set *set; + isl_multi_aff *ma; + + set = isl_set_copy(pa->p[i].set); + ma = isl_multi_aff_from_aff(isl_aff_copy(pa->p[i].aff)); + pma = isl_pw_multi_aff_add_piece(pma, set, ma); + } + + isl_pw_aff_free(pa); + return pma; +} + +/* Construct a set or map mapping the shared (parameter) domain + * of the piecewise affine expressions to the range of "mpa" + * with each dimension in the range equated to the + * corresponding piecewise affine expression. + */ +static __isl_give isl_map *map_from_multi_pw_aff( + __isl_take isl_multi_pw_aff *mpa) +{ + int i; + isl_space *space; + isl_map *map; + + if (!mpa) + return NULL; + + if (isl_space_dim(mpa->space, isl_dim_out) != mpa->n) + isl_die(isl_multi_pw_aff_get_ctx(mpa), isl_error_internal, + "invalid space", goto error); + + space = isl_multi_pw_aff_get_domain_space(mpa); + map = isl_map_universe(isl_space_from_domain(space)); + + for (i = 0; i < mpa->n; ++i) { + isl_pw_aff *pa; + isl_map *map_i; + + pa = isl_pw_aff_copy(mpa->p[i]); + map_i = map_from_pw_aff(pa); + + map = isl_map_flat_range_product(map, map_i); + } + + map = isl_map_reset_space(map, isl_multi_pw_aff_get_space(mpa)); + + isl_multi_pw_aff_free(mpa); + return map; +error: + isl_multi_pw_aff_free(mpa); + return NULL; +} + +/* Construct a map mapping the shared domain + * of the piecewise affine expressions to the range of "mpa" + * with each dimension in the range equated to the + * corresponding piecewise affine expression. + */ +__isl_give isl_map *isl_map_from_multi_pw_aff(__isl_take isl_multi_pw_aff *mpa) +{ + if (!mpa) + return NULL; + if (isl_space_is_set(mpa->space)) + isl_die(isl_multi_pw_aff_get_ctx(mpa), isl_error_internal, + "space of input is not a map", goto error); + + return map_from_multi_pw_aff(mpa); +error: + isl_multi_pw_aff_free(mpa); + return NULL; +} + +/* Construct a set mapping the shared parameter domain + * of the piecewise affine expressions to the space of "mpa" + * with each dimension in the range equated to the + * corresponding piecewise affine expression. + */ +__isl_give isl_set *isl_set_from_multi_pw_aff(__isl_take isl_multi_pw_aff *mpa) +{ + if (!mpa) + return NULL; + if (!isl_space_is_set(mpa->space)) + isl_die(isl_multi_pw_aff_get_ctx(mpa), isl_error_internal, + "space of input is not a set", goto error); + + return map_from_multi_pw_aff(mpa); +error: + isl_multi_pw_aff_free(mpa); + return NULL; +} + +/* Construct and return a piecewise multi affine expression + * that is equal to the given multi piecewise affine expression + * on the shared domain of the piecewise affine expressions. + */ +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_multi_pw_aff( + __isl_take isl_multi_pw_aff *mpa) +{ + int i; + isl_space *space; + isl_pw_aff *pa; + isl_pw_multi_aff *pma; + + if (!mpa) + return NULL; + + space = isl_multi_pw_aff_get_space(mpa); + + if (mpa->n == 0) { + isl_multi_pw_aff_free(mpa); + return isl_pw_multi_aff_zero(space); + } + + pa = isl_multi_pw_aff_get_pw_aff(mpa, 0); + pma = isl_pw_multi_aff_from_pw_aff(pa); + + for (i = 1; i < mpa->n; ++i) { + isl_pw_multi_aff *pma_i; + + pa = isl_multi_pw_aff_get_pw_aff(mpa, i); + pma_i = isl_pw_multi_aff_from_pw_aff(pa); + pma = isl_pw_multi_aff_range_product(pma, pma_i); + } + + pma = isl_pw_multi_aff_reset_space(pma, space); + + isl_multi_pw_aff_free(mpa); + return pma; +} + +/* Construct and return a multi piecewise affine expression + * that is equal to the given multi affine expression. + */ +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_from_multi_aff( + __isl_take isl_multi_aff *ma) +{ + int i, n; + isl_multi_pw_aff *mpa; + + if (!ma) + return NULL; + + n = isl_multi_aff_dim(ma, isl_dim_out); + mpa = isl_multi_pw_aff_alloc(isl_multi_aff_get_space(ma)); + + for (i = 0; i < n; ++i) { + isl_pw_aff *pa; + + pa = isl_pw_aff_from_aff(isl_multi_aff_get_aff(ma, i)); + mpa = isl_multi_pw_aff_set_pw_aff(mpa, i, pa); + } + + isl_multi_aff_free(ma); + return mpa; +} + +/* Construct and return a multi piecewise affine expression + * that is equal to the given piecewise multi affine expression. + */ +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_from_pw_multi_aff( + __isl_take isl_pw_multi_aff *pma) +{ + int i, n; + isl_space *space; + isl_multi_pw_aff *mpa; + + if (!pma) + return NULL; + + n = isl_pw_multi_aff_dim(pma, isl_dim_out); + space = isl_pw_multi_aff_get_space(pma); + mpa = isl_multi_pw_aff_alloc(space); + + for (i = 0; i < n; ++i) { + isl_pw_aff *pa; + + pa = isl_pw_multi_aff_get_pw_aff(pma, i); + mpa = isl_multi_pw_aff_set_pw_aff(mpa, i, pa); + } + + isl_pw_multi_aff_free(pma); + return mpa; +} + +/* Do "pa1" and "pa2" represent the same function? + * + * We first check if they are obviously equal. + * If not, we convert them to maps and check if those are equal. + */ +int isl_pw_aff_is_equal(__isl_keep isl_pw_aff *pa1, __isl_keep isl_pw_aff *pa2) +{ + int equal; + isl_map *map1, *map2; + + if (!pa1 || !pa2) + return -1; + + equal = isl_pw_aff_plain_is_equal(pa1, pa2); + if (equal < 0 || equal) + return equal; + + map1 = map_from_pw_aff(isl_pw_aff_copy(pa1)); + map2 = map_from_pw_aff(isl_pw_aff_copy(pa2)); + equal = isl_map_is_equal(map1, map2); + isl_map_free(map1); + isl_map_free(map2); + + return equal; +} + +/* Do "mpa1" and "mpa2" represent the same function? + * + * Note that we cannot convert the entire isl_multi_pw_aff + * to a map because the domains of the piecewise affine expressions + * may not be the same. + */ +isl_bool isl_multi_pw_aff_is_equal(__isl_keep isl_multi_pw_aff *mpa1, + __isl_keep isl_multi_pw_aff *mpa2) +{ + int i; + isl_bool equal; + + if (!mpa1 || !mpa2) + return isl_bool_error; + + if (!isl_space_match(mpa1->space, isl_dim_param, + mpa2->space, isl_dim_param)) { + if (!isl_space_has_named_params(mpa1->space)) + return isl_bool_false; + if (!isl_space_has_named_params(mpa2->space)) + return isl_bool_false; + mpa1 = isl_multi_pw_aff_copy(mpa1); + mpa2 = isl_multi_pw_aff_copy(mpa2); + mpa1 = isl_multi_pw_aff_align_params(mpa1, + isl_multi_pw_aff_get_space(mpa2)); + mpa2 = isl_multi_pw_aff_align_params(mpa2, + isl_multi_pw_aff_get_space(mpa1)); + equal = isl_multi_pw_aff_is_equal(mpa1, mpa2); + isl_multi_pw_aff_free(mpa1); + isl_multi_pw_aff_free(mpa2); + return equal; + } + + equal = isl_space_is_equal(mpa1->space, mpa2->space); + if (equal < 0 || !equal) + return equal; + + for (i = 0; i < mpa1->n; ++i) { + equal = isl_pw_aff_is_equal(mpa1->p[i], mpa2->p[i]); + if (equal < 0 || !equal) + return equal; + } + + return isl_bool_true; +} + +/* Coalesce the elements of "mpa". + * + * Note that such coalescing does not change the meaning of "mpa" + * so there is no need to cow. We do need to be careful not to + * destroy any other copies of "mpa" in case of failure. + */ +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_coalesce( + __isl_take isl_multi_pw_aff *mpa) +{ + int i; + + if (!mpa) + return NULL; + + for (i = 0; i < mpa->n; ++i) { + isl_pw_aff *pa = isl_pw_aff_copy(mpa->p[i]); + pa = isl_pw_aff_coalesce(pa); + if (!pa) + return isl_multi_pw_aff_free(mpa); + isl_pw_aff_free(mpa->p[i]); + mpa->p[i] = pa; + } + + return mpa; +} + +/* Compute the pullback of "mpa" by the function represented by "ma". + * In other words, plug in "ma" in "mpa". + * + * The parameters of "mpa" and "ma" are assumed to have been aligned. + */ +static __isl_give isl_multi_pw_aff *isl_multi_pw_aff_pullback_multi_aff_aligned( + __isl_take isl_multi_pw_aff *mpa, __isl_take isl_multi_aff *ma) +{ + int i; + isl_space *space = NULL; + + mpa = isl_multi_pw_aff_cow(mpa); + if (!mpa || !ma) + goto error; + + space = isl_space_join(isl_multi_aff_get_space(ma), + isl_multi_pw_aff_get_space(mpa)); + if (!space) + goto error; + + for (i = 0; i < mpa->n; ++i) { + mpa->p[i] = isl_pw_aff_pullback_multi_aff(mpa->p[i], + isl_multi_aff_copy(ma)); + if (!mpa->p[i]) + goto error; + } + + isl_multi_aff_free(ma); + isl_space_free(mpa->space); + mpa->space = space; + return mpa; +error: + isl_space_free(space); + isl_multi_pw_aff_free(mpa); + isl_multi_aff_free(ma); + return NULL; +} + +/* Compute the pullback of "mpa" by the function represented by "ma". + * In other words, plug in "ma" in "mpa". + */ +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_pullback_multi_aff( + __isl_take isl_multi_pw_aff *mpa, __isl_take isl_multi_aff *ma) +{ + if (!mpa || !ma) + goto error; + if (isl_space_match(mpa->space, isl_dim_param, + ma->space, isl_dim_param)) + return isl_multi_pw_aff_pullback_multi_aff_aligned(mpa, ma); + mpa = isl_multi_pw_aff_align_params(mpa, isl_multi_aff_get_space(ma)); + ma = isl_multi_aff_align_params(ma, isl_multi_pw_aff_get_space(mpa)); + return isl_multi_pw_aff_pullback_multi_aff_aligned(mpa, ma); +error: + isl_multi_pw_aff_free(mpa); + isl_multi_aff_free(ma); + return NULL; +} + +/* Compute the pullback of "mpa" by the function represented by "pma". + * In other words, plug in "pma" in "mpa". + * + * The parameters of "mpa" and "mpa" are assumed to have been aligned. + */ +static __isl_give isl_multi_pw_aff * +isl_multi_pw_aff_pullback_pw_multi_aff_aligned( + __isl_take isl_multi_pw_aff *mpa, __isl_take isl_pw_multi_aff *pma) +{ + int i; + isl_space *space = NULL; + + mpa = isl_multi_pw_aff_cow(mpa); + if (!mpa || !pma) + goto error; + + space = isl_space_join(isl_pw_multi_aff_get_space(pma), + isl_multi_pw_aff_get_space(mpa)); + + for (i = 0; i < mpa->n; ++i) { + mpa->p[i] = isl_pw_aff_pullback_pw_multi_aff_aligned(mpa->p[i], + isl_pw_multi_aff_copy(pma)); + if (!mpa->p[i]) + goto error; + } + + isl_pw_multi_aff_free(pma); + isl_space_free(mpa->space); + mpa->space = space; + return mpa; +error: + isl_space_free(space); + isl_multi_pw_aff_free(mpa); + isl_pw_multi_aff_free(pma); + return NULL; +} + +/* Compute the pullback of "mpa" by the function represented by "pma". + * In other words, plug in "pma" in "mpa". + */ +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_pullback_pw_multi_aff( + __isl_take isl_multi_pw_aff *mpa, __isl_take isl_pw_multi_aff *pma) +{ + if (!mpa || !pma) + goto error; + if (isl_space_match(mpa->space, isl_dim_param, pma->dim, isl_dim_param)) + return isl_multi_pw_aff_pullback_pw_multi_aff_aligned(mpa, pma); + mpa = isl_multi_pw_aff_align_params(mpa, + isl_pw_multi_aff_get_space(pma)); + pma = isl_pw_multi_aff_align_params(pma, + isl_multi_pw_aff_get_space(mpa)); + return isl_multi_pw_aff_pullback_pw_multi_aff_aligned(mpa, pma); +error: + isl_multi_pw_aff_free(mpa); + isl_pw_multi_aff_free(pma); + return NULL; +} + +/* Apply "aff" to "mpa". The range of "mpa" needs to be compatible + * with the domain of "aff". The domain of the result is the same + * as that of "mpa". + * "mpa" and "aff" are assumed to have been aligned. + * + * We first extract the parametric constant from "aff", defined + * over the correct domain. + * Then we add the appropriate combinations of the members of "mpa". + * Finally, we add the integer divisions through recursive calls. + */ +static __isl_give isl_pw_aff *isl_multi_pw_aff_apply_aff_aligned( + __isl_take isl_multi_pw_aff *mpa, __isl_take isl_aff *aff) +{ + int i, n_in, n_div; + isl_space *space; + isl_val *v; + isl_pw_aff *pa; + isl_aff *tmp; + + n_in = isl_aff_dim(aff, isl_dim_in); + n_div = isl_aff_dim(aff, isl_dim_div); + + space = isl_space_domain(isl_multi_pw_aff_get_space(mpa)); + tmp = isl_aff_copy(aff); + tmp = isl_aff_drop_dims(tmp, isl_dim_div, 0, n_div); + tmp = isl_aff_drop_dims(tmp, isl_dim_in, 0, n_in); + tmp = isl_aff_add_dims(tmp, isl_dim_in, + isl_space_dim(space, isl_dim_set)); + tmp = isl_aff_reset_domain_space(tmp, space); + pa = isl_pw_aff_from_aff(tmp); + + for (i = 0; i < n_in; ++i) { + isl_pw_aff *pa_i; + + if (!isl_aff_involves_dims(aff, isl_dim_in, i, 1)) + continue; + v = isl_aff_get_coefficient_val(aff, isl_dim_in, i); + pa_i = isl_multi_pw_aff_get_pw_aff(mpa, i); + pa_i = isl_pw_aff_scale_val(pa_i, v); + pa = isl_pw_aff_add(pa, pa_i); + } + + for (i = 0; i < n_div; ++i) { + isl_aff *div; + isl_pw_aff *pa_i; + + if (!isl_aff_involves_dims(aff, isl_dim_div, i, 1)) + continue; + div = isl_aff_get_div(aff, i); + pa_i = isl_multi_pw_aff_apply_aff_aligned( + isl_multi_pw_aff_copy(mpa), div); + pa_i = isl_pw_aff_floor(pa_i); + v = isl_aff_get_coefficient_val(aff, isl_dim_div, i); + pa_i = isl_pw_aff_scale_val(pa_i, v); + pa = isl_pw_aff_add(pa, pa_i); + } + + isl_multi_pw_aff_free(mpa); + isl_aff_free(aff); + + return pa; +} + +/* Apply "aff" to "mpa". The range of "mpa" needs to be compatible + * with the domain of "aff". The domain of the result is the same + * as that of "mpa". + */ +__isl_give isl_pw_aff *isl_multi_pw_aff_apply_aff( + __isl_take isl_multi_pw_aff *mpa, __isl_take isl_aff *aff) +{ + if (!aff || !mpa) + goto error; + if (isl_space_match(aff->ls->dim, isl_dim_param, + mpa->space, isl_dim_param)) + return isl_multi_pw_aff_apply_aff_aligned(mpa, aff); + + aff = isl_aff_align_params(aff, isl_multi_pw_aff_get_space(mpa)); + mpa = isl_multi_pw_aff_align_params(mpa, isl_aff_get_space(aff)); + + return isl_multi_pw_aff_apply_aff_aligned(mpa, aff); +error: + isl_aff_free(aff); + isl_multi_pw_aff_free(mpa); + return NULL; +} + +/* Apply "pa" to "mpa". The range of "mpa" needs to be compatible + * with the domain of "pa". The domain of the result is the same + * as that of "mpa". + * "mpa" and "pa" are assumed to have been aligned. + * + * We consider each piece in turn. Note that the domains of the + * pieces are assumed to be disjoint and they remain disjoint + * after taking the preimage (over the same function). + */ +static __isl_give isl_pw_aff *isl_multi_pw_aff_apply_pw_aff_aligned( + __isl_take isl_multi_pw_aff *mpa, __isl_take isl_pw_aff *pa) +{ + isl_space *space; + isl_pw_aff *res; + int i; + + if (!mpa || !pa) + goto error; + + space = isl_space_join(isl_multi_pw_aff_get_space(mpa), + isl_pw_aff_get_space(pa)); + res = isl_pw_aff_empty(space); + + for (i = 0; i < pa->n; ++i) { + isl_pw_aff *pa_i; + isl_set *domain; + + pa_i = isl_multi_pw_aff_apply_aff_aligned( + isl_multi_pw_aff_copy(mpa), + isl_aff_copy(pa->p[i].aff)); + domain = isl_set_copy(pa->p[i].set); + domain = isl_set_preimage_multi_pw_aff(domain, + isl_multi_pw_aff_copy(mpa)); + pa_i = isl_pw_aff_intersect_domain(pa_i, domain); + res = isl_pw_aff_add_disjoint(res, pa_i); + } + + isl_pw_aff_free(pa); + isl_multi_pw_aff_free(mpa); + return res; +error: + isl_pw_aff_free(pa); + isl_multi_pw_aff_free(mpa); + return NULL; +} + +/* Apply "pa" to "mpa". The range of "mpa" needs to be compatible + * with the domain of "pa". The domain of the result is the same + * as that of "mpa". + */ +__isl_give isl_pw_aff *isl_multi_pw_aff_apply_pw_aff( + __isl_take isl_multi_pw_aff *mpa, __isl_take isl_pw_aff *pa) +{ + if (!pa || !mpa) + goto error; + if (isl_space_match(pa->dim, isl_dim_param, mpa->space, isl_dim_param)) + return isl_multi_pw_aff_apply_pw_aff_aligned(mpa, pa); + + pa = isl_pw_aff_align_params(pa, isl_multi_pw_aff_get_space(mpa)); + mpa = isl_multi_pw_aff_align_params(mpa, isl_pw_aff_get_space(pa)); + + return isl_multi_pw_aff_apply_pw_aff_aligned(mpa, pa); +error: + isl_pw_aff_free(pa); + isl_multi_pw_aff_free(mpa); + return NULL; +} + +/* Compute the pullback of "pa" by the function represented by "mpa". + * In other words, plug in "mpa" in "pa". + * "pa" and "mpa" are assumed to have been aligned. + * + * The pullback is computed by applying "pa" to "mpa". + */ +static __isl_give isl_pw_aff *isl_pw_aff_pullback_multi_pw_aff_aligned( + __isl_take isl_pw_aff *pa, __isl_take isl_multi_pw_aff *mpa) +{ + return isl_multi_pw_aff_apply_pw_aff_aligned(mpa, pa); +} + +/* Compute the pullback of "pa" by the function represented by "mpa". + * In other words, plug in "mpa" in "pa". + * + * The pullback is computed by applying "pa" to "mpa". + */ +__isl_give isl_pw_aff *isl_pw_aff_pullback_multi_pw_aff( + __isl_take isl_pw_aff *pa, __isl_take isl_multi_pw_aff *mpa) +{ + return isl_multi_pw_aff_apply_pw_aff(mpa, pa); +} + +/* Compute the pullback of "mpa1" by the function represented by "mpa2". + * In other words, plug in "mpa2" in "mpa1". + * + * The parameters of "mpa1" and "mpa2" are assumed to have been aligned. + * + * We pullback each member of "mpa1" in turn. + */ +static __isl_give isl_multi_pw_aff * +isl_multi_pw_aff_pullback_multi_pw_aff_aligned( + __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2) +{ + int i; + isl_space *space = NULL; + + mpa1 = isl_multi_pw_aff_cow(mpa1); + if (!mpa1 || !mpa2) + goto error; + + space = isl_space_join(isl_multi_pw_aff_get_space(mpa2), + isl_multi_pw_aff_get_space(mpa1)); + + for (i = 0; i < mpa1->n; ++i) { + mpa1->p[i] = isl_pw_aff_pullback_multi_pw_aff_aligned( + mpa1->p[i], isl_multi_pw_aff_copy(mpa2)); + if (!mpa1->p[i]) + goto error; + } + + mpa1 = isl_multi_pw_aff_reset_space(mpa1, space); + + isl_multi_pw_aff_free(mpa2); + return mpa1; +error: + isl_space_free(space); + isl_multi_pw_aff_free(mpa1); + isl_multi_pw_aff_free(mpa2); + return NULL; +} + +/* Compute the pullback of "mpa1" by the function represented by "mpa2". + * In other words, plug in "mpa2" in "mpa1". + */ +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_pullback_multi_pw_aff( + __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2) +{ + return isl_multi_pw_aff_align_params_multi_multi_and(mpa1, mpa2, + &isl_multi_pw_aff_pullback_multi_pw_aff_aligned); +} + +/* Align the parameters of "mpa1" and "mpa2", check that the ranges + * of "mpa1" and "mpa2" live in the same space, construct map space + * between the domain spaces of "mpa1" and "mpa2" and call "order" + * with this map space as extract argument. + */ +static __isl_give isl_map *isl_multi_pw_aff_order_map( + __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2, + __isl_give isl_map *(*order)(__isl_keep isl_multi_pw_aff *mpa1, + __isl_keep isl_multi_pw_aff *mpa2, __isl_take isl_space *space)) +{ + int match; + isl_space *space1, *space2; + isl_map *res; + + mpa1 = isl_multi_pw_aff_align_params(mpa1, + isl_multi_pw_aff_get_space(mpa2)); + mpa2 = isl_multi_pw_aff_align_params(mpa2, + isl_multi_pw_aff_get_space(mpa1)); + if (!mpa1 || !mpa2) + goto error; + match = isl_space_tuple_is_equal(mpa1->space, isl_dim_out, + mpa2->space, isl_dim_out); + if (match < 0) + goto error; + if (!match) + isl_die(isl_multi_pw_aff_get_ctx(mpa1), isl_error_invalid, + "range spaces don't match", goto error); + space1 = isl_space_domain(isl_multi_pw_aff_get_space(mpa1)); + space2 = isl_space_domain(isl_multi_pw_aff_get_space(mpa2)); + space1 = isl_space_map_from_domain_and_range(space1, space2); + + res = order(mpa1, mpa2, space1); + isl_multi_pw_aff_free(mpa1); + isl_multi_pw_aff_free(mpa2); + return res; +error: + isl_multi_pw_aff_free(mpa1); + isl_multi_pw_aff_free(mpa2); + return NULL; +} + +/* Return a map containing pairs of elements in the domains of "mpa1" and "mpa2" + * where the function values are equal. "space" is the space of the result. + * The parameters of "mpa1" and "mpa2" are assumed to have been aligned. + * + * "mpa1" and "mpa2" are equal when each of the pairs of elements + * in the sequences are equal. + */ +static __isl_give isl_map *isl_multi_pw_aff_eq_map_on_space( + __isl_keep isl_multi_pw_aff *mpa1, __isl_keep isl_multi_pw_aff *mpa2, + __isl_take isl_space *space) +{ + int i, n; + isl_map *res; + + res = isl_map_universe(space); + + n = isl_multi_pw_aff_dim(mpa1, isl_dim_out); + for (i = 0; i < n; ++i) { + isl_pw_aff *pa1, *pa2; + isl_map *map; + + pa1 = isl_multi_pw_aff_get_pw_aff(mpa1, i); + pa2 = isl_multi_pw_aff_get_pw_aff(mpa2, i); + map = isl_pw_aff_eq_map(pa1, pa2); + res = isl_map_intersect(res, map); + } + + return res; +} + +/* Return a map containing pairs of elements in the domains of "mpa1" and "mpa2" + * where the function values are equal. + */ +__isl_give isl_map *isl_multi_pw_aff_eq_map(__isl_take isl_multi_pw_aff *mpa1, + __isl_take isl_multi_pw_aff *mpa2) +{ + return isl_multi_pw_aff_order_map(mpa1, mpa2, + &isl_multi_pw_aff_eq_map_on_space); +} + +/* Return a map containing pairs of elements in the domains of "mpa1" and "mpa2" + * where the function values of "mpa1" is lexicographically satisfies "base" + * compared to that of "mpa2". "space" is the space of the result. + * The parameters of "mpa1" and "mpa2" are assumed to have been aligned. + * + * "mpa1" lexicographically satisfies "base" compared to "mpa2" + * if its i-th element satisfies "base" when compared to + * the i-th element of "mpa2" while all previous elements are + * pairwise equal. + */ +static __isl_give isl_map *isl_multi_pw_aff_lex_map_on_space( + __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2, + __isl_give isl_map *(*base)(__isl_take isl_pw_aff *pa1, + __isl_take isl_pw_aff *pa2), + __isl_take isl_space *space) +{ + int i, n; + isl_map *res, *rest; + + res = isl_map_empty(isl_space_copy(space)); + rest = isl_map_universe(space); + + n = isl_multi_pw_aff_dim(mpa1, isl_dim_out); + for (i = 0; i < n; ++i) { + isl_pw_aff *pa1, *pa2; + isl_map *map; + + pa1 = isl_multi_pw_aff_get_pw_aff(mpa1, i); + pa2 = isl_multi_pw_aff_get_pw_aff(mpa2, i); + map = base(pa1, pa2); + map = isl_map_intersect(map, isl_map_copy(rest)); + res = isl_map_union(res, map); + + if (i == n - 1) + continue; + + pa1 = isl_multi_pw_aff_get_pw_aff(mpa1, i); + pa2 = isl_multi_pw_aff_get_pw_aff(mpa2, i); + map = isl_pw_aff_eq_map(pa1, pa2); + rest = isl_map_intersect(rest, map); + } + + isl_map_free(rest); + return res; +} + +/* Return a map containing pairs of elements in the domains of "mpa1" and "mpa2" + * where the function value of "mpa1" is lexicographically less than that + * of "mpa2". "space" is the space of the result. + * The parameters of "mpa1" and "mpa2" are assumed to have been aligned. + * + * "mpa1" is less than "mpa2" if its i-th element is smaller + * than the i-th element of "mpa2" while all previous elements are + * pairwise equal. + */ +__isl_give isl_map *isl_multi_pw_aff_lex_lt_map_on_space( + __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2, + __isl_take isl_space *space) +{ + return isl_multi_pw_aff_lex_map_on_space(mpa1, mpa2, + &isl_pw_aff_lt_map, space); +} + +/* Return a map containing pairs of elements in the domains of "mpa1" and "mpa2" + * where the function value of "mpa1" is lexicographically less than that + * of "mpa2". + */ +__isl_give isl_map *isl_multi_pw_aff_lex_lt_map( + __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2) +{ + return isl_multi_pw_aff_order_map(mpa1, mpa2, + &isl_multi_pw_aff_lex_lt_map_on_space); +} + +/* Return a map containing pairs of elements in the domains of "mpa1" and "mpa2" + * where the function value of "mpa1" is lexicographically greater than that + * of "mpa2". "space" is the space of the result. + * The parameters of "mpa1" and "mpa2" are assumed to have been aligned. + * + * "mpa1" is greater than "mpa2" if its i-th element is greater + * than the i-th element of "mpa2" while all previous elements are + * pairwise equal. + */ +__isl_give isl_map *isl_multi_pw_aff_lex_gt_map_on_space( + __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2, + __isl_take isl_space *space) +{ + return isl_multi_pw_aff_lex_map_on_space(mpa1, mpa2, + &isl_pw_aff_gt_map, space); +} + +/* Return a map containing pairs of elements in the domains of "mpa1" and "mpa2" + * where the function value of "mpa1" is lexicographically greater than that + * of "mpa2". + */ +__isl_give isl_map *isl_multi_pw_aff_lex_gt_map( + __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2) +{ + return isl_multi_pw_aff_order_map(mpa1, mpa2, + &isl_multi_pw_aff_lex_gt_map_on_space); +} + +/* Compare two isl_affs. + * + * Return -1 if "aff1" is "smaller" than "aff2", 1 if "aff1" is "greater" + * than "aff2" and 0 if they are equal. + * + * The order is fairly arbitrary. We do consider expressions that only involve + * earlier dimensions as "smaller". + */ +int isl_aff_plain_cmp(__isl_keep isl_aff *aff1, __isl_keep isl_aff *aff2) +{ + int cmp; + int last1, last2; + + if (aff1 == aff2) + return 0; + + if (!aff1) + return -1; + if (!aff2) + return 1; + + cmp = isl_local_space_cmp(aff1->ls, aff2->ls); + if (cmp != 0) + return cmp; + + last1 = isl_seq_last_non_zero(aff1->v->el + 1, aff1->v->size - 1); + last2 = isl_seq_last_non_zero(aff2->v->el + 1, aff1->v->size - 1); + if (last1 != last2) + return last1 - last2; + + return isl_seq_cmp(aff1->v->el, aff2->v->el, aff1->v->size); +} + +/* Compare two isl_pw_affs. + * + * Return -1 if "pa1" is "smaller" than "pa2", 1 if "pa1" is "greater" + * than "pa2" and 0 if they are equal. + * + * The order is fairly arbitrary. We do consider expressions that only involve + * earlier dimensions as "smaller". + */ +int isl_pw_aff_plain_cmp(__isl_keep isl_pw_aff *pa1, + __isl_keep isl_pw_aff *pa2) +{ + int i; + int cmp; + + if (pa1 == pa2) + return 0; + + if (!pa1) + return -1; + if (!pa2) + return 1; + + cmp = isl_space_cmp(pa1->dim, pa2->dim); + if (cmp != 0) + return cmp; + + if (pa1->n != pa2->n) + return pa1->n - pa2->n; + + for (i = 0; i < pa1->n; ++i) { + cmp = isl_set_plain_cmp(pa1->p[i].set, pa2->p[i].set); + if (cmp != 0) + return cmp; + cmp = isl_aff_plain_cmp(pa1->p[i].aff, pa2->p[i].aff); + if (cmp != 0) + return cmp; + } + + return 0; +} + +/* Return a piecewise affine expression that is equal to "v" on "domain". + */ +__isl_give isl_pw_aff *isl_pw_aff_val_on_domain(__isl_take isl_set *domain, + __isl_take isl_val *v) +{ + isl_space *space; + isl_local_space *ls; + isl_aff *aff; + + space = isl_set_get_space(domain); + ls = isl_local_space_from_space(space); + aff = isl_aff_val_on_domain(ls, v); + + return isl_pw_aff_alloc(domain, aff); +} + +/* Return a multi affine expression that is equal to "mv" on domain + * space "space". + */ +__isl_give isl_multi_aff *isl_multi_aff_multi_val_on_space( + __isl_take isl_space *space, __isl_take isl_multi_val *mv) +{ + int i, n; + isl_space *space2; + isl_local_space *ls; + isl_multi_aff *ma; + + if (!space || !mv) + goto error; + + n = isl_multi_val_dim(mv, isl_dim_set); + space2 = isl_multi_val_get_space(mv); + space2 = isl_space_align_params(space2, isl_space_copy(space)); + space = isl_space_align_params(space, isl_space_copy(space2)); + space = isl_space_map_from_domain_and_range(space, space2); + ma = isl_multi_aff_alloc(isl_space_copy(space)); + ls = isl_local_space_from_space(isl_space_domain(space)); + for (i = 0; i < n; ++i) { + isl_val *v; + isl_aff *aff; + + v = isl_multi_val_get_val(mv, i); + aff = isl_aff_val_on_domain(isl_local_space_copy(ls), v); + ma = isl_multi_aff_set_aff(ma, i, aff); + } + isl_local_space_free(ls); + + isl_multi_val_free(mv); + return ma; +error: + isl_space_free(space); + isl_multi_val_free(mv); + return NULL; +} + +/* Return a piecewise multi-affine expression + * that is equal to "mv" on "domain". + */ +__isl_give isl_pw_multi_aff *isl_pw_multi_aff_multi_val_on_domain( + __isl_take isl_set *domain, __isl_take isl_multi_val *mv) +{ + isl_space *space; + isl_multi_aff *ma; + + space = isl_set_get_space(domain); + ma = isl_multi_aff_multi_val_on_space(space, mv); + + return isl_pw_multi_aff_alloc(domain, ma); +} + +/* Internal data structure for isl_union_pw_multi_aff_multi_val_on_domain. + * mv is the value that should be attained on each domain set + * res collects the results + */ +struct isl_union_pw_multi_aff_multi_val_on_domain_data { + isl_multi_val *mv; + isl_union_pw_multi_aff *res; +}; + +/* Create an isl_pw_multi_aff equal to data->mv on "domain" + * and add it to data->res. + */ +static isl_stat pw_multi_aff_multi_val_on_domain(__isl_take isl_set *domain, + void *user) +{ + struct isl_union_pw_multi_aff_multi_val_on_domain_data *data = user; + isl_pw_multi_aff *pma; + isl_multi_val *mv; + + mv = isl_multi_val_copy(data->mv); + pma = isl_pw_multi_aff_multi_val_on_domain(domain, mv); + data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, pma); + + return data->res ? isl_stat_ok : isl_stat_error; +} + +/* Return a union piecewise multi-affine expression + * that is equal to "mv" on "domain". + */ +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_multi_val_on_domain( + __isl_take isl_union_set *domain, __isl_take isl_multi_val *mv) +{ + struct isl_union_pw_multi_aff_multi_val_on_domain_data data; + isl_space *space; + + space = isl_union_set_get_space(domain); + data.res = isl_union_pw_multi_aff_empty(space); + data.mv = mv; + if (isl_union_set_foreach_set(domain, + &pw_multi_aff_multi_val_on_domain, &data) < 0) + data.res = isl_union_pw_multi_aff_free(data.res); + isl_union_set_free(domain); + isl_multi_val_free(mv); + return data.res; +} + +/* Compute the pullback of data->pma by the function represented by "pma2", + * provided the spaces match, and add the results to data->res. + */ +static isl_stat pullback_entry(void **entry, void *user) +{ + struct isl_union_pw_multi_aff_bin_data *data = user; + isl_pw_multi_aff *pma2 = *entry; + + if (!isl_space_tuple_is_equal(data->pma->dim, isl_dim_in, + pma2->dim, isl_dim_out)) + return isl_stat_ok; + + pma2 = isl_pw_multi_aff_pullback_pw_multi_aff( + isl_pw_multi_aff_copy(data->pma), + isl_pw_multi_aff_copy(pma2)); + + data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, pma2); + if (!data->res) + return isl_stat_error; + + return isl_stat_ok; +} + +/* Compute the pullback of "upma1" by the function represented by "upma2". + */ +__isl_give isl_union_pw_multi_aff * +isl_union_pw_multi_aff_pullback_union_pw_multi_aff( + __isl_take isl_union_pw_multi_aff *upma1, + __isl_take isl_union_pw_multi_aff *upma2) +{ + return bin_op(upma1, upma2, &pullback_entry); +} + +/* Check that the domain space of "upa" matches "space". + * + * Return 0 on success and -1 on error. + * + * This function is called from isl_multi_union_pw_aff_set_union_pw_aff and + * can in principle never fail since the space "space" is that + * of the isl_multi_union_pw_aff and is a set space such that + * there is no domain space to match. + * + * We check the parameters and double-check that "space" is + * indeed that of a set. + */ +static int isl_union_pw_aff_check_match_domain_space( + __isl_keep isl_union_pw_aff *upa, __isl_keep isl_space *space) +{ + isl_space *upa_space; + int match; + + if (!upa || !space) + return -1; + + match = isl_space_is_set(space); + if (match < 0) + return -1; + if (!match) + isl_die(isl_space_get_ctx(space), isl_error_invalid, + "expecting set space", return -1); + + upa_space = isl_union_pw_aff_get_space(upa); + match = isl_space_match(space, isl_dim_param, upa_space, isl_dim_param); + if (match < 0) + goto error; + if (!match) + isl_die(isl_space_get_ctx(space), isl_error_invalid, + "parameters don't match", goto error); + + isl_space_free(upa_space); + return 0; +error: + isl_space_free(upa_space); + return -1; +} + +/* Do the parameters of "upa" match those of "space"? + */ +static int isl_union_pw_aff_matching_params(__isl_keep isl_union_pw_aff *upa, + __isl_keep isl_space *space) +{ + isl_space *upa_space; + int match; + + if (!upa || !space) + return -1; + + upa_space = isl_union_pw_aff_get_space(upa); + + match = isl_space_match(space, isl_dim_param, upa_space, isl_dim_param); + + isl_space_free(upa_space); + return match; +} + +/* Internal data structure for isl_union_pw_aff_reset_domain_space. + * space represents the new parameters. + * res collects the results. + */ +struct isl_union_pw_aff_reset_params_data { + isl_space *space; + isl_union_pw_aff *res; +}; + +/* Replace the parameters of "pa" by data->space and + * add the result to data->res. + */ +static isl_stat reset_params(__isl_take isl_pw_aff *pa, void *user) +{ + struct isl_union_pw_aff_reset_params_data *data = user; + isl_space *space; + + space = isl_pw_aff_get_space(pa); + space = isl_space_replace(space, isl_dim_param, data->space); + pa = isl_pw_aff_reset_space(pa, space); + data->res = isl_union_pw_aff_add_pw_aff(data->res, pa); + + return data->res ? isl_stat_ok : isl_stat_error; +} + +/* Replace the domain space of "upa" by "space". + * Since a union expression does not have a (single) domain space, + * "space" is necessarily a parameter space. + * + * Since the order and the names of the parameters determine + * the hash value, we need to create a new hash table. + */ +static __isl_give isl_union_pw_aff *isl_union_pw_aff_reset_domain_space( + __isl_take isl_union_pw_aff *upa, __isl_take isl_space *space) +{ + struct isl_union_pw_aff_reset_params_data data = { space }; + int match; + + match = isl_union_pw_aff_matching_params(upa, space); + if (match < 0) + upa = isl_union_pw_aff_free(upa); + else if (match) { + isl_space_free(space); + return upa; + } + + data.res = isl_union_pw_aff_empty(isl_space_copy(space)); + if (isl_union_pw_aff_foreach_pw_aff(upa, &reset_params, &data) < 0) + data.res = isl_union_pw_aff_free(data.res); + + isl_union_pw_aff_free(upa); + isl_space_free(space); + return data.res; +} + +/* Replace the entry of isl_union_pw_aff to which "entry" points + * by its floor. + */ +static isl_stat floor_entry(void **entry, void *user) +{ + isl_pw_aff **pa = (isl_pw_aff **) entry; + + *pa = isl_pw_aff_floor(*pa); + if (!*pa) + return isl_stat_error; + + return isl_stat_ok; +} + +/* Given f, return floor(f). + */ +__isl_give isl_union_pw_aff *isl_union_pw_aff_floor( + __isl_take isl_union_pw_aff *upa) +{ + isl_ctx *ctx; + + upa = isl_union_pw_aff_cow(upa); + if (!upa) + return NULL; + + ctx = isl_union_pw_aff_get_ctx(upa); + if (isl_hash_table_foreach(ctx, &upa->table, &floor_entry, NULL) < 0) + upa = isl_union_pw_aff_free(upa); + + return upa; +} + +/* Compute + * + * upa mod m = upa - m * floor(upa/m) + * + * with m an integer value. + */ +__isl_give isl_union_pw_aff *isl_union_pw_aff_mod_val( + __isl_take isl_union_pw_aff *upa, __isl_take isl_val *m) +{ + isl_union_pw_aff *res; + + if (!upa || !m) + goto error; + + if (!isl_val_is_int(m)) + isl_die(isl_val_get_ctx(m), isl_error_invalid, + "expecting integer modulo", goto error); + if (!isl_val_is_pos(m)) + isl_die(isl_val_get_ctx(m), isl_error_invalid, + "expecting positive modulo", goto error); + + res = isl_union_pw_aff_copy(upa); + upa = isl_union_pw_aff_scale_down_val(upa, isl_val_copy(m)); + upa = isl_union_pw_aff_floor(upa); + upa = isl_union_pw_aff_scale_val(upa, m); + res = isl_union_pw_aff_sub(res, upa); + + return res; +error: + isl_val_free(m); + isl_union_pw_aff_free(upa); + return NULL; +} + +/* Internal data structure for isl_union_pw_aff_aff_on_domain. + * "aff" is the symbolic value that the resulting isl_union_pw_aff + * needs to attain. + * "res" collects the results. + */ +struct isl_union_pw_aff_aff_on_domain_data { + isl_aff *aff; + isl_union_pw_aff *res; +}; + +/* Construct a piecewise affine expression that is equal to data->aff + * on "domain" and add the result to data->res. + */ +static isl_stat pw_aff_aff_on_domain(__isl_take isl_set *domain, void *user) +{ + struct isl_union_pw_aff_aff_on_domain_data *data = user; + isl_pw_aff *pa; + isl_aff *aff; + int dim; + + aff = isl_aff_copy(data->aff); + dim = isl_set_dim(domain, isl_dim_set); + aff = isl_aff_add_dims(aff, isl_dim_in, dim); + aff = isl_aff_reset_domain_space(aff, isl_set_get_space(domain)); + pa = isl_pw_aff_alloc(domain, aff); + data->res = isl_union_pw_aff_add_pw_aff(data->res, pa); + + return data->res ? isl_stat_ok : isl_stat_error; +} + +/* Internal data structure for isl_union_pw_multi_aff_get_union_pw_aff. + * pos is the output position that needs to be extracted. + * res collects the results. + */ +struct isl_union_pw_multi_aff_get_union_pw_aff_data { + int pos; + isl_union_pw_aff *res; +}; + +/* Extract an isl_pw_aff corresponding to output dimension "pos" of "pma" + * (assuming it has such a dimension) and add it to data->res. + */ +static isl_stat get_union_pw_aff(__isl_take isl_pw_multi_aff *pma, void *user) +{ + struct isl_union_pw_multi_aff_get_union_pw_aff_data *data = user; + int n_out; + isl_pw_aff *pa; + + if (!pma) + return isl_stat_error; + + n_out = isl_pw_multi_aff_dim(pma, isl_dim_out); + if (data->pos >= n_out) { + isl_pw_multi_aff_free(pma); + return isl_stat_ok; + } + + pa = isl_pw_multi_aff_get_pw_aff(pma, data->pos); + isl_pw_multi_aff_free(pma); + + data->res = isl_union_pw_aff_add_pw_aff(data->res, pa); + + return data->res ? isl_stat_ok : isl_stat_error; +} + +/* Extract an isl_union_pw_aff corresponding to + * output dimension "pos" of "upma". + */ +__isl_give isl_union_pw_aff *isl_union_pw_multi_aff_get_union_pw_aff( + __isl_keep isl_union_pw_multi_aff *upma, int pos) +{ + struct isl_union_pw_multi_aff_get_union_pw_aff_data data; + isl_space *space; + + if (!upma) + return NULL; + + if (pos < 0) + isl_die(isl_union_pw_multi_aff_get_ctx(upma), isl_error_invalid, + "cannot extract at negative position", return NULL); + + space = isl_union_pw_multi_aff_get_space(upma); + data.res = isl_union_pw_aff_empty(space); + data.pos = pos; + if (isl_union_pw_multi_aff_foreach_pw_multi_aff(upma, + &get_union_pw_aff, &data) < 0) + data.res = isl_union_pw_aff_free(data.res); + + return data.res; +} + +/* Return a union piecewise affine expression + * that is equal to "aff" on "domain". + * + * Construct an isl_pw_aff on each of the sets in "domain" and + * collect the results. + */ +__isl_give isl_union_pw_aff *isl_union_pw_aff_aff_on_domain( + __isl_take isl_union_set *domain, __isl_take isl_aff *aff) +{ + struct isl_union_pw_aff_aff_on_domain_data data; + isl_space *space; + + if (!domain || !aff) + goto error; + if (!isl_local_space_is_params(aff->ls)) + isl_die(isl_aff_get_ctx(aff), isl_error_invalid, + "expecting parametric expression", goto error); + + space = isl_union_set_get_space(domain); + data.res = isl_union_pw_aff_empty(space); + data.aff = aff; + if (isl_union_set_foreach_set(domain, &pw_aff_aff_on_domain, &data) < 0) + data.res = isl_union_pw_aff_free(data.res); + isl_union_set_free(domain); + isl_aff_free(aff); + return data.res; +error: + isl_union_set_free(domain); + isl_aff_free(aff); + return NULL; +} + +/* Internal data structure for isl_union_pw_aff_val_on_domain. + * "v" is the value that the resulting isl_union_pw_aff needs to attain. + * "res" collects the results. + */ +struct isl_union_pw_aff_val_on_domain_data { + isl_val *v; + isl_union_pw_aff *res; +}; + +/* Construct a piecewise affine expression that is equal to data->v + * on "domain" and add the result to data->res. + */ +static isl_stat pw_aff_val_on_domain(__isl_take isl_set *domain, void *user) +{ + struct isl_union_pw_aff_val_on_domain_data *data = user; + isl_pw_aff *pa; + isl_val *v; + + v = isl_val_copy(data->v); + pa = isl_pw_aff_val_on_domain(domain, v); + data->res = isl_union_pw_aff_add_pw_aff(data->res, pa); + + return data->res ? isl_stat_ok : isl_stat_error; +} + +/* Return a union piecewise affine expression + * that is equal to "v" on "domain". + * + * Construct an isl_pw_aff on each of the sets in "domain" and + * collect the results. + */ +__isl_give isl_union_pw_aff *isl_union_pw_aff_val_on_domain( + __isl_take isl_union_set *domain, __isl_take isl_val *v) +{ + struct isl_union_pw_aff_val_on_domain_data data; + isl_space *space; + + space = isl_union_set_get_space(domain); + data.res = isl_union_pw_aff_empty(space); + data.v = v; + if (isl_union_set_foreach_set(domain, &pw_aff_val_on_domain, &data) < 0) + data.res = isl_union_pw_aff_free(data.res); + isl_union_set_free(domain); + isl_val_free(v); + return data.res; +} + +/* Construct a piecewise multi affine expression + * that is equal to "pa" and add it to upma. + */ +static isl_stat pw_multi_aff_from_pw_aff_entry(__isl_take isl_pw_aff *pa, + void *user) +{ + isl_union_pw_multi_aff **upma = user; + isl_pw_multi_aff *pma; + + pma = isl_pw_multi_aff_from_pw_aff(pa); + *upma = isl_union_pw_multi_aff_add_pw_multi_aff(*upma, pma); + + return *upma ? isl_stat_ok : isl_stat_error; +} + +/* Construct and return a union piecewise multi affine expression + * that is equal to the given union piecewise affine expression. + */ +__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_from_union_pw_aff( + __isl_take isl_union_pw_aff *upa) +{ + isl_space *space; + isl_union_pw_multi_aff *upma; + + if (!upa) + return NULL; + + space = isl_union_pw_aff_get_space(upa); + upma = isl_union_pw_multi_aff_empty(space); + + if (isl_union_pw_aff_foreach_pw_aff(upa, + &pw_multi_aff_from_pw_aff_entry, &upma) < 0) + upma = isl_union_pw_multi_aff_free(upma); + + isl_union_pw_aff_free(upa); + return upma; +} + +/* Compute the set of elements in the domain of "pa" where it is zero and + * add this set to "uset". + */ +static isl_stat zero_union_set(__isl_take isl_pw_aff *pa, void *user) +{ + isl_union_set **uset = (isl_union_set **)user; + + *uset = isl_union_set_add_set(*uset, isl_pw_aff_zero_set(pa)); + + return *uset ? isl_stat_ok : isl_stat_error; +} + +/* Return a union set containing those elements in the domain + * of "upa" where it is zero. + */ +__isl_give isl_union_set *isl_union_pw_aff_zero_union_set( + __isl_take isl_union_pw_aff *upa) +{ + isl_union_set *zero; + + zero = isl_union_set_empty(isl_union_pw_aff_get_space(upa)); + if (isl_union_pw_aff_foreach_pw_aff(upa, &zero_union_set, &zero) < 0) + zero = isl_union_set_free(zero); + + isl_union_pw_aff_free(upa); + return zero; +} + +/* Convert "pa" to an isl_map and add it to *umap. + */ +static isl_stat map_from_pw_aff_entry(__isl_take isl_pw_aff *pa, void *user) +{ + isl_union_map **umap = user; + isl_map *map; + + map = isl_map_from_pw_aff(pa); + *umap = isl_union_map_add_map(*umap, map); + + return *umap ? isl_stat_ok : isl_stat_error; +} + +/* Construct a union map mapping the domain of the union + * piecewise affine expression to its range, with the single output dimension + * equated to the corresponding affine expressions on their cells. + */ +__isl_give isl_union_map *isl_union_map_from_union_pw_aff( + __isl_take isl_union_pw_aff *upa) +{ + isl_space *space; + isl_union_map *umap; + + if (!upa) + return NULL; + + space = isl_union_pw_aff_get_space(upa); + umap = isl_union_map_empty(space); + + if (isl_union_pw_aff_foreach_pw_aff(upa, &map_from_pw_aff_entry, + &umap) < 0) + umap = isl_union_map_free(umap); + + isl_union_pw_aff_free(upa); + return umap; +} + +/* Internal data structure for isl_union_pw_aff_pullback_union_pw_multi_aff. + * upma is the function that is plugged in. + * pa is the current part of the function in which upma is plugged in. + * res collects the results. + */ +struct isl_union_pw_aff_pullback_upma_data { + isl_union_pw_multi_aff *upma; + isl_pw_aff *pa; + isl_union_pw_aff *res; +}; + +/* Check if "pma" can be plugged into data->pa. + * If so, perform the pullback and add the result to data->res. + */ +static isl_stat pa_pb_pma(void **entry, void *user) +{ + struct isl_union_pw_aff_pullback_upma_data *data = user; + isl_pw_multi_aff *pma = *entry; + isl_pw_aff *pa; + + if (!isl_space_tuple_is_equal(data->pa->dim, isl_dim_in, + pma->dim, isl_dim_out)) + return isl_stat_ok; + + pma = isl_pw_multi_aff_copy(pma); + pa = isl_pw_aff_copy(data->pa); + pa = isl_pw_aff_pullback_pw_multi_aff(pa, pma); + + data->res = isl_union_pw_aff_add_pw_aff(data->res, pa); + + return data->res ? isl_stat_ok : isl_stat_error; +} + +/* Check if any of the elements of data->upma can be plugged into pa, + * add if so add the result to data->res. + */ +static isl_stat upa_pb_upma(void **entry, void *user) +{ + struct isl_union_pw_aff_pullback_upma_data *data = user; + isl_ctx *ctx; + isl_pw_aff *pa = *entry; + + data->pa = pa; + ctx = isl_union_pw_multi_aff_get_ctx(data->upma); + if (isl_hash_table_foreach(ctx, &data->upma->table, + &pa_pb_pma, data) < 0) + return isl_stat_error; + + return isl_stat_ok; +} + +/* Compute the pullback of "upa" by the function represented by "upma". + * In other words, plug in "upma" in "upa". The result contains + * expressions defined over the domain space of "upma". + * + * Run over all pairs of elements in "upa" and "upma", perform + * the pullback when appropriate and collect the results. + * If the hash value were based on the domain space rather than + * the function space, then we could run through all elements + * of "upma" and directly pick out the corresponding element of "upa". + */ +__isl_give isl_union_pw_aff *isl_union_pw_aff_pullback_union_pw_multi_aff( + __isl_take isl_union_pw_aff *upa, + __isl_take isl_union_pw_multi_aff *upma) +{ + struct isl_union_pw_aff_pullback_upma_data data = { NULL, NULL }; + isl_ctx *ctx; + isl_space *space; + + space = isl_union_pw_multi_aff_get_space(upma); + upa = isl_union_pw_aff_align_params(upa, space); + space = isl_union_pw_aff_get_space(upa); + upma = isl_union_pw_multi_aff_align_params(upma, space); + + if (!upa || !upma) + goto error; + + ctx = isl_union_pw_aff_get_ctx(upa); + data.upma = upma; + space = isl_union_pw_aff_get_space(upa); + data.res = isl_union_pw_aff_alloc(space, upa->table.n); + if (isl_hash_table_foreach(ctx, &upa->table, &upa_pb_upma, &data) < 0) + data.res = isl_union_pw_aff_free(data.res); + + isl_union_pw_aff_free(upa); + isl_union_pw_multi_aff_free(upma); + return data.res; +error: + isl_union_pw_aff_free(upa); + isl_union_pw_multi_aff_free(upma); + return NULL; +} + +#undef BASE +#define BASE union_pw_aff +#undef DOMBASE +#define DOMBASE union_set + +#define NO_MOVE_DIMS +#define NO_DIMS +#define NO_DOMAIN +#define NO_PRODUCT +#define NO_SPLICE +#define NO_ZERO +#define NO_IDENTITY +#define NO_GIST + +#include +#include +#include +#include +#include +#include + +/* Construct a multiple union piecewise affine expression + * in the given space with value zero in each of the output dimensions. + * + * Since there is no canonical zero value for + * a union piecewise affine expression, we can only construct + * zero-dimensional "zero" value. + */ +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_zero( + __isl_take isl_space *space) +{ + if (!space) + return NULL; + + if (!isl_space_is_set(space)) + isl_die(isl_space_get_ctx(space), isl_error_invalid, + "expecting set space", goto error); + if (isl_space_dim(space , isl_dim_out) != 0) + isl_die(isl_space_get_ctx(space), isl_error_invalid, + "expecting 0D space", goto error); + + return isl_multi_union_pw_aff_alloc(space); +error: + isl_space_free(space); + return NULL; +} + +/* Compute the sum of "mupa1" and "mupa2" on the union of their domains, + * with the actual sum on the shared domain and + * the defined expression on the symmetric difference of the domains. + * + * We simply iterate over the elements in both arguments and + * call isl_union_pw_aff_union_add on each of them. + */ +static __isl_give isl_multi_union_pw_aff * +isl_multi_union_pw_aff_union_add_aligned( + __isl_take isl_multi_union_pw_aff *mupa1, + __isl_take isl_multi_union_pw_aff *mupa2) +{ + return isl_multi_union_pw_aff_bin_op(mupa1, mupa2, + &isl_union_pw_aff_union_add); +} + +/* Compute the sum of "mupa1" and "mupa2" on the union of their domains, + * with the actual sum on the shared domain and + * the defined expression on the symmetric difference of the domains. + */ +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_union_add( + __isl_take isl_multi_union_pw_aff *mupa1, + __isl_take isl_multi_union_pw_aff *mupa2) +{ + return isl_multi_union_pw_aff_align_params_multi_multi_and(mupa1, mupa2, + &isl_multi_union_pw_aff_union_add_aligned); +} + +/* Construct and return a multi union piecewise affine expression + * that is equal to the given multi affine expression. + */ +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_from_multi_aff( + __isl_take isl_multi_aff *ma) +{ + isl_multi_pw_aff *mpa; + + mpa = isl_multi_pw_aff_from_multi_aff(ma); + return isl_multi_union_pw_aff_from_multi_pw_aff(mpa); +} + +/* Construct and return a multi union piecewise affine expression + * that is equal to the given multi piecewise affine expression. + */ +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_from_multi_pw_aff( + __isl_take isl_multi_pw_aff *mpa) +{ + int i, n; + isl_space *space; + isl_multi_union_pw_aff *mupa; + + if (!mpa) + return NULL; + + space = isl_multi_pw_aff_get_space(mpa); + space = isl_space_range(space); + mupa = isl_multi_union_pw_aff_alloc(space); + + n = isl_multi_pw_aff_dim(mpa, isl_dim_out); + for (i = 0; i < n; ++i) { + isl_pw_aff *pa; + isl_union_pw_aff *upa; + + pa = isl_multi_pw_aff_get_pw_aff(mpa, i); + upa = isl_union_pw_aff_from_pw_aff(pa); + mupa = isl_multi_union_pw_aff_set_union_pw_aff(mupa, i, upa); + } + + isl_multi_pw_aff_free(mpa); + + return mupa; +} + +/* Extract the range space of "pma" and assign it to *space. + * If *space has already been set (through a previous call to this function), + * then check that the range space is the same. + */ +static isl_stat extract_space(__isl_take isl_pw_multi_aff *pma, void *user) +{ + isl_space **space = user; + isl_space *pma_space; + isl_bool equal; + + pma_space = isl_space_range(isl_pw_multi_aff_get_space(pma)); + isl_pw_multi_aff_free(pma); + + if (!pma_space) + return isl_stat_error; + if (!*space) { + *space = pma_space; + return isl_stat_ok; + } + + equal = isl_space_is_equal(pma_space, *space); + isl_space_free(pma_space); + + if (equal < 0) + return isl_stat_error; + if (!equal) + isl_die(isl_space_get_ctx(*space), isl_error_invalid, + "range spaces not the same", return isl_stat_error); + return isl_stat_ok; +} + +/* Construct and return a multi union piecewise affine expression + * that is equal to the given union piecewise multi affine expression. + * + * In order to be able to perform the conversion, the input + * needs to be non-empty and may only involve a single range space. + */ +__isl_give isl_multi_union_pw_aff * +isl_multi_union_pw_aff_from_union_pw_multi_aff( + __isl_take isl_union_pw_multi_aff *upma) +{ + isl_space *space = NULL; + isl_multi_union_pw_aff *mupa; + int i, n; + + if (!upma) + return NULL; + if (isl_union_pw_multi_aff_n_pw_multi_aff(upma) == 0) + isl_die(isl_union_pw_multi_aff_get_ctx(upma), isl_error_invalid, + "cannot extract range space from empty input", + goto error); + if (isl_union_pw_multi_aff_foreach_pw_multi_aff(upma, &extract_space, + &space) < 0) + goto error; + + if (!space) + goto error; + + n = isl_space_dim(space, isl_dim_set); + mupa = isl_multi_union_pw_aff_alloc(space); + + for (i = 0; i < n; ++i) { + isl_union_pw_aff *upa; + + upa = isl_union_pw_multi_aff_get_union_pw_aff(upma, i); + mupa = isl_multi_union_pw_aff_set_union_pw_aff(mupa, i, upa); + } + + isl_union_pw_multi_aff_free(upma); + return mupa; +error: + isl_space_free(space); + isl_union_pw_multi_aff_free(upma); + return NULL; +} + +/* Try and create an isl_multi_union_pw_aff that is equivalent + * to the given isl_union_map. + * The isl_union_map is required to be single-valued in each space. + * Moreover, it cannot be empty and all range spaces need to be the same. + * Otherwise, an error is produced. + */ +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_from_union_map( + __isl_take isl_union_map *umap) +{ + isl_union_pw_multi_aff *upma; + + upma = isl_union_pw_multi_aff_from_union_map(umap); + return isl_multi_union_pw_aff_from_union_pw_multi_aff(upma); +} + +/* Return a multiple union piecewise affine expression + * that is equal to "mv" on "domain", assuming "domain" and "mv" + * have been aligned. + */ +static __isl_give isl_multi_union_pw_aff * +isl_multi_union_pw_aff_multi_val_on_domain_aligned( + __isl_take isl_union_set *domain, __isl_take isl_multi_val *mv) +{ + int i, n; + isl_space *space; + isl_multi_union_pw_aff *mupa; + + if (!domain || !mv) + goto error; + + n = isl_multi_val_dim(mv, isl_dim_set); + space = isl_multi_val_get_space(mv); + mupa = isl_multi_union_pw_aff_alloc(space); + for (i = 0; i < n; ++i) { + isl_val *v; + isl_union_pw_aff *upa; + + v = isl_multi_val_get_val(mv, i); + upa = isl_union_pw_aff_val_on_domain(isl_union_set_copy(domain), + v); + mupa = isl_multi_union_pw_aff_set_union_pw_aff(mupa, i, upa); + } + + isl_union_set_free(domain); + isl_multi_val_free(mv); + return mupa; +error: + isl_union_set_free(domain); + isl_multi_val_free(mv); + return NULL; +} + +/* Return a multiple union piecewise affine expression + * that is equal to "mv" on "domain". + */ +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_multi_val_on_domain( + __isl_take isl_union_set *domain, __isl_take isl_multi_val *mv) +{ + if (!domain || !mv) + goto error; + if (isl_space_match(domain->dim, isl_dim_param, + mv->space, isl_dim_param)) + return isl_multi_union_pw_aff_multi_val_on_domain_aligned( + domain, mv); + domain = isl_union_set_align_params(domain, + isl_multi_val_get_space(mv)); + mv = isl_multi_val_align_params(mv, isl_union_set_get_space(domain)); + return isl_multi_union_pw_aff_multi_val_on_domain_aligned(domain, mv); +error: + isl_union_set_free(domain); + isl_multi_val_free(mv); + return NULL; +} + +/* Return a multiple union piecewise affine expression + * that is equal to "ma" on "domain", assuming "domain" and "ma" + * have been aligned. + */ +static __isl_give isl_multi_union_pw_aff * +isl_multi_union_pw_aff_multi_aff_on_domain_aligned( + __isl_take isl_union_set *domain, __isl_take isl_multi_aff *ma) +{ + int i, n; + isl_space *space; + isl_multi_union_pw_aff *mupa; + + if (!domain || !ma) + goto error; + + n = isl_multi_aff_dim(ma, isl_dim_set); + space = isl_multi_aff_get_space(ma); + mupa = isl_multi_union_pw_aff_alloc(space); + for (i = 0; i < n; ++i) { + isl_aff *aff; + isl_union_pw_aff *upa; + + aff = isl_multi_aff_get_aff(ma, i); + upa = isl_union_pw_aff_aff_on_domain(isl_union_set_copy(domain), + aff); + mupa = isl_multi_union_pw_aff_set_union_pw_aff(mupa, i, upa); + } + + isl_union_set_free(domain); + isl_multi_aff_free(ma); + return mupa; +error: + isl_union_set_free(domain); + isl_multi_aff_free(ma); + return NULL; +} + +/* Return a multiple union piecewise affine expression + * that is equal to "ma" on "domain". + */ +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_multi_aff_on_domain( + __isl_take isl_union_set *domain, __isl_take isl_multi_aff *ma) +{ + if (!domain || !ma) + goto error; + if (isl_space_match(domain->dim, isl_dim_param, + ma->space, isl_dim_param)) + return isl_multi_union_pw_aff_multi_aff_on_domain_aligned( + domain, ma); + domain = isl_union_set_align_params(domain, + isl_multi_aff_get_space(ma)); + ma = isl_multi_aff_align_params(ma, isl_union_set_get_space(domain)); + return isl_multi_union_pw_aff_multi_aff_on_domain_aligned(domain, ma); +error: + isl_union_set_free(domain); + isl_multi_aff_free(ma); + return NULL; +} + +/* Return a union set containing those elements in the domains + * of the elements of "mupa" where they are all zero. + */ +__isl_give isl_union_set *isl_multi_union_pw_aff_zero_union_set( + __isl_take isl_multi_union_pw_aff *mupa) +{ + int i, n; + isl_union_pw_aff *upa; + isl_union_set *zero; + + if (!mupa) + return NULL; + + n = isl_multi_union_pw_aff_dim(mupa, isl_dim_set); + if (n == 0) + isl_die(isl_multi_union_pw_aff_get_ctx(mupa), isl_error_invalid, + "cannot determine zero set " + "of zero-dimensional function", goto error); + + upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, 0); + zero = isl_union_pw_aff_zero_union_set(upa); + + for (i = 1; i < n; ++i) { + isl_union_set *zero_i; + + upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, i); + zero_i = isl_union_pw_aff_zero_union_set(upa); + + zero = isl_union_set_intersect(zero, zero_i); + } + + isl_multi_union_pw_aff_free(mupa); + return zero; +error: + isl_multi_union_pw_aff_free(mupa); + return NULL; +} + +/* Construct a union map mapping the shared domain + * of the union piecewise affine expressions to the range of "mupa" + * with each dimension in the range equated to the + * corresponding union piecewise affine expression. + * + * The input cannot be zero-dimensional as there is + * no way to extract a domain from a zero-dimensional isl_multi_union_pw_aff. + */ +__isl_give isl_union_map *isl_union_map_from_multi_union_pw_aff( + __isl_take isl_multi_union_pw_aff *mupa) +{ + int i, n; + isl_space *space; + isl_union_map *umap; + isl_union_pw_aff *upa; + + if (!mupa) + return NULL; + + n = isl_multi_union_pw_aff_dim(mupa, isl_dim_set); + if (n == 0) + isl_die(isl_multi_union_pw_aff_get_ctx(mupa), isl_error_invalid, + "cannot determine domain of zero-dimensional " + "isl_multi_union_pw_aff", goto error); + + upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, 0); + umap = isl_union_map_from_union_pw_aff(upa); + + for (i = 1; i < n; ++i) { + isl_union_map *umap_i; + + upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, i); + umap_i = isl_union_map_from_union_pw_aff(upa); + umap = isl_union_map_flat_range_product(umap, umap_i); + } + + space = isl_multi_union_pw_aff_get_space(mupa); + umap = isl_union_map_reset_range_space(umap, space); + + isl_multi_union_pw_aff_free(mupa); + return umap; +error: + isl_multi_union_pw_aff_free(mupa); + return NULL; +} + +/* Internal data structure for isl_union_pw_multi_aff_reset_range_space. + * "range" is the space from which to set the range space. + * "res" collects the results. + */ +struct isl_union_pw_multi_aff_reset_range_space_data { + isl_space *range; + isl_union_pw_multi_aff *res; +}; + +/* Replace the range space of "pma" by the range space of data->range and + * add the result to data->res. + */ +static isl_stat reset_range_space(__isl_take isl_pw_multi_aff *pma, void *user) +{ + struct isl_union_pw_multi_aff_reset_range_space_data *data = user; + isl_space *space; + + space = isl_pw_multi_aff_get_space(pma); + space = isl_space_domain(space); + space = isl_space_extend_domain_with_range(space, + isl_space_copy(data->range)); + pma = isl_pw_multi_aff_reset_space(pma, space); + data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, pma); + + return data->res ? isl_stat_ok : isl_stat_error; +} + +/* Replace the range space of all the piecewise affine expressions in "upma" by + * the range space of "space". + * + * This assumes that all these expressions have the same output dimension. + * + * Since the spaces of the expressions change, so do their hash values. + * We therefore need to create a new isl_union_pw_multi_aff. + * Note that the hash value is currently computed based on the entire + * space even though there can only be a single expression with a given + * domain space. + */ +static __isl_give isl_union_pw_multi_aff * +isl_union_pw_multi_aff_reset_range_space( + __isl_take isl_union_pw_multi_aff *upma, __isl_take isl_space *space) +{ + struct isl_union_pw_multi_aff_reset_range_space_data data = { space }; + isl_space *space_upma; + + space_upma = isl_union_pw_multi_aff_get_space(upma); + data.res = isl_union_pw_multi_aff_empty(space_upma); + if (isl_union_pw_multi_aff_foreach_pw_multi_aff(upma, + &reset_range_space, &data) < 0) + data.res = isl_union_pw_multi_aff_free(data.res); + + isl_space_free(space); + isl_union_pw_multi_aff_free(upma); + return data.res; +} + +/* Construct and return a union piecewise multi affine expression + * that is equal to the given multi union piecewise affine expression. + * + * In order to be able to perform the conversion, the input + * needs to have a least one output dimension. + */ +__isl_give isl_union_pw_multi_aff * +isl_union_pw_multi_aff_from_multi_union_pw_aff( + __isl_take isl_multi_union_pw_aff *mupa) +{ + int i, n; + isl_space *space; + isl_union_pw_multi_aff *upma; + isl_union_pw_aff *upa; + + if (!mupa) + return NULL; + + space = isl_multi_union_pw_aff_get_space(mupa); + + n = isl_multi_union_pw_aff_dim(mupa, isl_dim_set); + if (n == 0) + isl_die(isl_multi_union_pw_aff_get_ctx(mupa), isl_error_invalid, + "cannot determine domain of zero-dimensional " + "isl_multi_union_pw_aff", goto error); + + upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, 0); + upma = isl_union_pw_multi_aff_from_union_pw_aff(upa); + + for (i = 1; i < n; ++i) { + isl_union_pw_multi_aff *upma_i; + + upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, i); + upma_i = isl_union_pw_multi_aff_from_union_pw_aff(upa); + upma = isl_union_pw_multi_aff_flat_range_product(upma, upma_i); + } + + upma = isl_union_pw_multi_aff_reset_range_space(upma, space); + + isl_multi_union_pw_aff_free(mupa); + return upma; +error: + isl_multi_union_pw_aff_free(mupa); + return NULL; +} + +/* Intersect the range of "mupa" with "range". + * That is, keep only those domain elements that have a function value + * in "range". + */ +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_intersect_range( + __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_set *range) +{ + isl_union_pw_multi_aff *upma; + isl_union_set *domain; + isl_space *space; + int n; + int match; + + if (!mupa || !range) + goto error; + + space = isl_set_get_space(range); + match = isl_space_tuple_is_equal(mupa->space, isl_dim_set, + space, isl_dim_set); + isl_space_free(space); + if (match < 0) + goto error; + if (!match) + isl_die(isl_multi_union_pw_aff_get_ctx(mupa), isl_error_invalid, + "space don't match", goto error); + n = isl_multi_union_pw_aff_dim(mupa, isl_dim_set); + if (n == 0) + isl_die(isl_multi_union_pw_aff_get_ctx(mupa), isl_error_invalid, + "cannot intersect range of zero-dimensional " + "isl_multi_union_pw_aff", goto error); + + upma = isl_union_pw_multi_aff_from_multi_union_pw_aff( + isl_multi_union_pw_aff_copy(mupa)); + domain = isl_union_set_from_set(range); + domain = isl_union_set_preimage_union_pw_multi_aff(domain, upma); + mupa = isl_multi_union_pw_aff_intersect_domain(mupa, domain); + + return mupa; +error: + isl_multi_union_pw_aff_free(mupa); + isl_set_free(range); + return NULL; +} + +/* Return the shared domain of the elements of "mupa". + */ +__isl_give isl_union_set *isl_multi_union_pw_aff_domain( + __isl_take isl_multi_union_pw_aff *mupa) +{ + int i, n; + isl_union_pw_aff *upa; + isl_union_set *dom; + + if (!mupa) + return NULL; + + n = isl_multi_union_pw_aff_dim(mupa, isl_dim_set); + if (n == 0) + isl_die(isl_multi_union_pw_aff_get_ctx(mupa), isl_error_invalid, + "cannot determine domain", goto error); + + upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, 0); + dom = isl_union_pw_aff_domain(upa); + for (i = 1; i < n; ++i) { + isl_union_set *dom_i; + + upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, i); + dom_i = isl_union_pw_aff_domain(upa); + dom = isl_union_set_intersect(dom, dom_i); + } + + isl_multi_union_pw_aff_free(mupa); + return dom; +error: + isl_multi_union_pw_aff_free(mupa); + return NULL; +} + +/* Apply "aff" to "mupa". The space of "mupa" is equal to the domain of "aff". + * In particular, the spaces have been aligned. + * The result is defined over the shared domain of the elements of "mupa" + * + * We first extract the parametric constant part of "aff" and + * define that over the shared domain. + * Then we iterate over all input dimensions of "aff" and add the corresponding + * multiples of the elements of "mupa". + * Finally, we consider the integer divisions, calling the function + * recursively to obtain an isl_union_pw_aff corresponding to the + * integer division argument. + */ +static __isl_give isl_union_pw_aff *multi_union_pw_aff_apply_aff( + __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_aff *aff) +{ + int i, n_in, n_div; + isl_union_pw_aff *upa; + isl_union_set *uset; + isl_val *v; + isl_aff *cst; + + n_in = isl_aff_dim(aff, isl_dim_in); + n_div = isl_aff_dim(aff, isl_dim_div); + + uset = isl_multi_union_pw_aff_domain(isl_multi_union_pw_aff_copy(mupa)); + cst = isl_aff_copy(aff); + cst = isl_aff_drop_dims(cst, isl_dim_div, 0, n_div); + cst = isl_aff_drop_dims(cst, isl_dim_in, 0, n_in); + cst = isl_aff_project_domain_on_params(cst); + upa = isl_union_pw_aff_aff_on_domain(uset, cst); + + for (i = 0; i < n_in; ++i) { + isl_union_pw_aff *upa_i; + + if (!isl_aff_involves_dims(aff, isl_dim_in, i, 1)) + continue; + v = isl_aff_get_coefficient_val(aff, isl_dim_in, i); + upa_i = isl_multi_union_pw_aff_get_union_pw_aff(mupa, i); + upa_i = isl_union_pw_aff_scale_val(upa_i, v); + upa = isl_union_pw_aff_add(upa, upa_i); + } + + for (i = 0; i < n_div; ++i) { + isl_aff *div; + isl_union_pw_aff *upa_i; + + if (!isl_aff_involves_dims(aff, isl_dim_div, i, 1)) + continue; + div = isl_aff_get_div(aff, i); + upa_i = multi_union_pw_aff_apply_aff( + isl_multi_union_pw_aff_copy(mupa), div); + upa_i = isl_union_pw_aff_floor(upa_i); + v = isl_aff_get_coefficient_val(aff, isl_dim_div, i); + upa_i = isl_union_pw_aff_scale_val(upa_i, v); + upa = isl_union_pw_aff_add(upa, upa_i); + } + + isl_multi_union_pw_aff_free(mupa); + isl_aff_free(aff); + + return upa; +} + +/* Apply "aff" to "mupa". The space of "mupa" needs to be compatible + * with the domain of "aff". + * Furthermore, the dimension of this space needs to be greater than zero. + * The result is defined over the shared domain of the elements of "mupa" + * + * We perform these checks and then hand over control to + * multi_union_pw_aff_apply_aff. + */ +__isl_give isl_union_pw_aff *isl_multi_union_pw_aff_apply_aff( + __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_aff *aff) +{ + isl_space *space1, *space2; + int equal; + + mupa = isl_multi_union_pw_aff_align_params(mupa, + isl_aff_get_space(aff)); + aff = isl_aff_align_params(aff, isl_multi_union_pw_aff_get_space(mupa)); + if (!mupa || !aff) + goto error; + + space1 = isl_multi_union_pw_aff_get_space(mupa); + space2 = isl_aff_get_domain_space(aff); + equal = isl_space_is_equal(space1, space2); + isl_space_free(space1); + isl_space_free(space2); + if (equal < 0) + goto error; + if (!equal) + isl_die(isl_aff_get_ctx(aff), isl_error_invalid, + "spaces don't match", goto error); + if (isl_aff_dim(aff, isl_dim_in) == 0) + isl_die(isl_aff_get_ctx(aff), isl_error_invalid, + "cannot determine domains", goto error); + + return multi_union_pw_aff_apply_aff(mupa, aff); +error: + isl_multi_union_pw_aff_free(mupa); + isl_aff_free(aff); + return NULL; +} + +/* Apply "ma" to "mupa". The space of "mupa" needs to be compatible + * with the domain of "ma". + * Furthermore, the dimension of this space needs to be greater than zero, + * unless the dimension of the target space of "ma" is also zero. + * The result is defined over the shared domain of the elements of "mupa" + */ +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_apply_multi_aff( + __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_multi_aff *ma) +{ + isl_space *space1, *space2; + isl_multi_union_pw_aff *res; + int equal; + int i, n_out; + + mupa = isl_multi_union_pw_aff_align_params(mupa, + isl_multi_aff_get_space(ma)); + ma = isl_multi_aff_align_params(ma, + isl_multi_union_pw_aff_get_space(mupa)); + if (!mupa || !ma) + goto error; + + space1 = isl_multi_union_pw_aff_get_space(mupa); + space2 = isl_multi_aff_get_domain_space(ma); + equal = isl_space_is_equal(space1, space2); + isl_space_free(space1); + isl_space_free(space2); + if (equal < 0) + goto error; + if (!equal) + isl_die(isl_multi_aff_get_ctx(ma), isl_error_invalid, + "spaces don't match", goto error); + n_out = isl_multi_aff_dim(ma, isl_dim_out); + if (isl_multi_aff_dim(ma, isl_dim_in) == 0 && n_out != 0) + isl_die(isl_multi_aff_get_ctx(ma), isl_error_invalid, + "cannot determine domains", goto error); + + space1 = isl_space_range(isl_multi_aff_get_space(ma)); + res = isl_multi_union_pw_aff_alloc(space1); + + for (i = 0; i < n_out; ++i) { + isl_aff *aff; + isl_union_pw_aff *upa; + + aff = isl_multi_aff_get_aff(ma, i); + upa = multi_union_pw_aff_apply_aff( + isl_multi_union_pw_aff_copy(mupa), aff); + res = isl_multi_union_pw_aff_set_union_pw_aff(res, i, upa); + } + + isl_multi_aff_free(ma); + isl_multi_union_pw_aff_free(mupa); + return res; +error: + isl_multi_union_pw_aff_free(mupa); + isl_multi_aff_free(ma); + return NULL; +} + +/* Apply "pa" to "mupa". The space of "mupa" needs to be compatible + * with the domain of "pa". + * Furthermore, the dimension of this space needs to be greater than zero. + * The result is defined over the shared domain of the elements of "mupa" + */ +__isl_give isl_union_pw_aff *isl_multi_union_pw_aff_apply_pw_aff( + __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_pw_aff *pa) +{ + int i; + int equal; + isl_space *space, *space2; + isl_union_pw_aff *upa; + + mupa = isl_multi_union_pw_aff_align_params(mupa, + isl_pw_aff_get_space(pa)); + pa = isl_pw_aff_align_params(pa, + isl_multi_union_pw_aff_get_space(mupa)); + if (!mupa || !pa) + goto error; + + space = isl_multi_union_pw_aff_get_space(mupa); + space2 = isl_pw_aff_get_domain_space(pa); + equal = isl_space_is_equal(space, space2); + isl_space_free(space); + isl_space_free(space2); + if (equal < 0) + goto error; + if (!equal) + isl_die(isl_pw_aff_get_ctx(pa), isl_error_invalid, + "spaces don't match", goto error); + if (isl_pw_aff_dim(pa, isl_dim_in) == 0) + isl_die(isl_pw_aff_get_ctx(pa), isl_error_invalid, + "cannot determine domains", goto error); + + space = isl_space_params(isl_multi_union_pw_aff_get_space(mupa)); + upa = isl_union_pw_aff_empty(space); + + for (i = 0; i < pa->n; ++i) { + isl_aff *aff; + isl_set *domain; + isl_multi_union_pw_aff *mupa_i; + isl_union_pw_aff *upa_i; + + mupa_i = isl_multi_union_pw_aff_copy(mupa); + domain = isl_set_copy(pa->p[i].set); + mupa_i = isl_multi_union_pw_aff_intersect_range(mupa_i, domain); + aff = isl_aff_copy(pa->p[i].aff); + upa_i = multi_union_pw_aff_apply_aff(mupa_i, aff); + upa = isl_union_pw_aff_union_add(upa, upa_i); + } + + isl_multi_union_pw_aff_free(mupa); + isl_pw_aff_free(pa); + return upa; +error: + isl_multi_union_pw_aff_free(mupa); + isl_pw_aff_free(pa); + return NULL; +} + +/* Apply "pma" to "mupa". The space of "mupa" needs to be compatible + * with the domain of "pma". + * Furthermore, the dimension of this space needs to be greater than zero, + * unless the dimension of the target space of "pma" is also zero. + * The result is defined over the shared domain of the elements of "mupa" + */ +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_apply_pw_multi_aff( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_pw_multi_aff *pma) +{ + isl_space *space1, *space2; + isl_multi_union_pw_aff *res; + int equal; + int i, n_out; + + mupa = isl_multi_union_pw_aff_align_params(mupa, + isl_pw_multi_aff_get_space(pma)); + pma = isl_pw_multi_aff_align_params(pma, + isl_multi_union_pw_aff_get_space(mupa)); + if (!mupa || !pma) + goto error; + + space1 = isl_multi_union_pw_aff_get_space(mupa); + space2 = isl_pw_multi_aff_get_domain_space(pma); + equal = isl_space_is_equal(space1, space2); + isl_space_free(space1); + isl_space_free(space2); + if (equal < 0) + goto error; + if (!equal) + isl_die(isl_pw_multi_aff_get_ctx(pma), isl_error_invalid, + "spaces don't match", goto error); + n_out = isl_pw_multi_aff_dim(pma, isl_dim_out); + if (isl_pw_multi_aff_dim(pma, isl_dim_in) == 0 && n_out != 0) + isl_die(isl_pw_multi_aff_get_ctx(pma), isl_error_invalid, + "cannot determine domains", goto error); + + space1 = isl_space_range(isl_pw_multi_aff_get_space(pma)); + res = isl_multi_union_pw_aff_alloc(space1); + + for (i = 0; i < n_out; ++i) { + isl_pw_aff *pa; + isl_union_pw_aff *upa; + + pa = isl_pw_multi_aff_get_pw_aff(pma, i); + upa = isl_multi_union_pw_aff_apply_pw_aff( + isl_multi_union_pw_aff_copy(mupa), pa); + res = isl_multi_union_pw_aff_set_union_pw_aff(res, i, upa); + } + + isl_pw_multi_aff_free(pma); + isl_multi_union_pw_aff_free(mupa); + return res; +error: + isl_multi_union_pw_aff_free(mupa); + isl_pw_multi_aff_free(pma); + return NULL; +} + +/* Compute the pullback of "mupa" by the function represented by "upma". + * In other words, plug in "upma" in "mupa". The result contains + * expressions defined over the domain space of "upma". + * + * Run over all elements of "mupa" and plug in "upma" in each of them. + */ +__isl_give isl_multi_union_pw_aff * +isl_multi_union_pw_aff_pullback_union_pw_multi_aff( + __isl_take isl_multi_union_pw_aff *mupa, + __isl_take isl_union_pw_multi_aff *upma) +{ + int i, n; + + mupa = isl_multi_union_pw_aff_align_params(mupa, + isl_union_pw_multi_aff_get_space(upma)); + upma = isl_union_pw_multi_aff_align_params(upma, + isl_multi_union_pw_aff_get_space(mupa)); + if (!mupa || !upma) + goto error; + + n = isl_multi_union_pw_aff_dim(mupa, isl_dim_set); + for (i = 0; i < n; ++i) { + isl_union_pw_aff *upa; + + upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, i); + upa = isl_union_pw_aff_pullback_union_pw_multi_aff(upa, + isl_union_pw_multi_aff_copy(upma)); + mupa = isl_multi_union_pw_aff_set_union_pw_aff(mupa, i, upa); + } + + isl_union_pw_multi_aff_free(upma); + return mupa; +error: + isl_multi_union_pw_aff_free(mupa); + isl_union_pw_multi_aff_free(upma); + return NULL; +} + +/* Extract the sequence of elements in "mupa" with domain space "space" + * (ignoring parameters). + * + * For the elements of "mupa" that are not defined on the specified space, + * the corresponding element in the result is empty. + */ +__isl_give isl_multi_pw_aff *isl_multi_union_pw_aff_extract_multi_pw_aff( + __isl_keep isl_multi_union_pw_aff *mupa, __isl_take isl_space *space) +{ + int i, n; + isl_space *space_mpa = NULL; + isl_multi_pw_aff *mpa; + + if (!mupa || !space) + goto error; + + space_mpa = isl_multi_union_pw_aff_get_space(mupa); + if (!isl_space_match(space_mpa, isl_dim_param, space, isl_dim_param)) { + space = isl_space_drop_dims(space, isl_dim_param, + 0, isl_space_dim(space, isl_dim_param)); + space = isl_space_align_params(space, + isl_space_copy(space_mpa)); + if (!space) + goto error; + } + space_mpa = isl_space_map_from_domain_and_range(isl_space_copy(space), + space_mpa); + mpa = isl_multi_pw_aff_alloc(space_mpa); + + space = isl_space_from_domain(space); + space = isl_space_add_dims(space, isl_dim_out, 1); + n = isl_multi_union_pw_aff_dim(mupa, isl_dim_set); + for (i = 0; i < n; ++i) { + isl_union_pw_aff *upa; + isl_pw_aff *pa; + + upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, i); + pa = isl_union_pw_aff_extract_pw_aff(upa, + isl_space_copy(space)); + mpa = isl_multi_pw_aff_set_pw_aff(mpa, i, pa); + isl_union_pw_aff_free(upa); + } + + isl_space_free(space); + return mpa; +error: + isl_space_free(space_mpa); + isl_space_free(space); + return NULL; +} diff -Nru cloog-0.18.2/isl/isl_affine_hull.c cloog-0.18.4/isl/isl_affine_hull.c --- cloog-0.18.2/isl/isl_affine_hull.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_affine_hull.c 2015-07-24 12:23:09.000000000 +0000 @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include #include @@ -22,6 +22,7 @@ #include "isl_sample.h" #include "isl_tab.h" #include +#include struct isl_basic_map *isl_basic_map_implicit_equalities( struct isl_basic_map *bmap) @@ -473,10 +474,9 @@ } if (j == hull->n_eq) break; - if (tab->samples) - tab = isl_tab_add_sample(tab, isl_vec_copy(sample)); - if (!tab) - goto error; + if (tab->samples && + isl_tab_add_sample(tab, isl_vec_copy(sample)) < 0) + hull = isl_basic_set_free(hull); if (bset) hull = add_adjacent_points(hull, isl_vec_copy(sample), bset); @@ -520,6 +520,7 @@ isl_basic_map_drop_inequality(bmap, i); } + bmap = isl_basic_map_add_known_div_constraints(bmap); return bmap; } @@ -542,8 +543,11 @@ int i; unsigned dim; - if (n == 0) - return isl_basic_map_set_to_empty(bmap); + if (n == 0) { + isl_space *space = isl_basic_map_get_space(bmap); + isl_basic_map_free(bmap); + return isl_basic_map_universe(space); + } bmap = isl_basic_map_cow(bmap); if (!bmap) return NULL; @@ -567,6 +571,7 @@ isl_basic_map_drop_inequality(bmap, i); } + bmap = isl_basic_map_add_known_div_constraints(bmap); return bmap; } @@ -1000,11 +1005,11 @@ if (!cone) goto error; if (cone->n_eq == 0) { - struct isl_basic_set *hull; + isl_space *space; + space = isl_basic_set_get_space(bset); isl_basic_set_free(cone); - hull = isl_basic_set_universe_like(bset); isl_basic_set_free(bset); - return hull; + return isl_basic_set_universe(space); } if (cone->n_eq < isl_basic_set_total_dim(cone)) @@ -1142,6 +1147,19 @@ return (isl_set *)isl_map_detect_equalities((isl_map *)set); } +/* Return the superset of "bmap" described by the equalities + * satisfied by "bmap" that are already known. + */ +__isl_give isl_basic_map *isl_basic_map_plain_affine_hull( + __isl_take isl_basic_map *bmap) +{ + bmap = isl_basic_map_cow(bmap); + if (bmap) + isl_basic_map_free_inequality(bmap, bmap->n_ineq); + bmap = isl_basic_map_finalize(bmap); + return bmap; +} + /* After computing the rational affine hull (by detecting the implicit * equalities), we compute the additional equalities satisfied by * the integer points (if any) and add the original equalities back in. @@ -1149,10 +1167,7 @@ struct isl_basic_map *isl_basic_map_affine_hull(struct isl_basic_map *bmap) { bmap = isl_basic_map_detect_equalities(bmap); - bmap = isl_basic_map_cow(bmap); - if (bmap) - isl_basic_map_free_inequality(bmap, bmap->n_ineq); - bmap = isl_basic_map_finalize(bmap); + bmap = isl_basic_map_plain_affine_hull(bmap); return bmap; } @@ -1331,6 +1346,18 @@ return isl_map_local_affine_hull(set); } +/* Return an empty basic map living in the same space as "map". + */ +static __isl_give isl_basic_map *replace_map_by_empty_basic_map( + __isl_take isl_map *map) +{ + isl_space *space; + + space = isl_map_get_space(map); + isl_map_free(map); + return isl_basic_map_empty(space); +} + /* Compute the affine hull of "map". * * We first compute the affine hull of each basic map separately. @@ -1366,11 +1393,8 @@ if (!map) return NULL; - if (map->n == 0) { - hull = isl_basic_map_empty_like_map(map); - isl_map_free(map); - return hull; - } + if (map->n == 0) + return replace_map_by_empty_basic_map(map); model = isl_basic_map_copy(map->p[0]); set = isl_map_underlying_set(map); diff -Nru cloog-0.18.2/isl/isl_aff_private.h cloog-0.18.4/isl/isl_aff_private.h --- cloog-0.18.2/isl/isl_aff_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_aff_private.h 2015-07-24 12:23:09.000000000 +0000 @@ -5,9 +5,13 @@ #include #include #include +#include #include /* ls represents the domain space. + * + * If the first two elements of "v" (the denominator and the constant term) + * are zero, then the isl_aff represents NaN. */ struct isl_aff { int ref; @@ -58,6 +62,8 @@ struct isl_pw_multi_aff_piece p[1]; }; +__isl_give isl_aff *isl_aff_alloc_vec(__isl_take isl_local_space *ls, + __isl_take isl_vec *v); __isl_give isl_aff *isl_aff_alloc(__isl_take isl_local_space *ls); __isl_give isl_aff *isl_aff_reset_space_and_domain(__isl_take isl_aff *aff, @@ -67,6 +73,12 @@ __isl_give isl_aff *isl_aff_realign_domain(__isl_take isl_aff *aff, __isl_take isl_reordering *r); +int isl_aff_get_constant(__isl_keep isl_aff *aff, isl_int *v); +__isl_give isl_aff *isl_aff_set_constant(__isl_take isl_aff *aff, isl_int v); +__isl_give isl_aff *isl_aff_set_coefficient(__isl_take isl_aff *aff, + enum isl_dim_type type, int pos, isl_int v); +__isl_give isl_aff *isl_aff_add_constant(__isl_take isl_aff *aff, isl_int v); + __isl_give isl_aff *isl_aff_normalize(__isl_take isl_aff *aff); __isl_give isl_aff *isl_aff_expand_divs( __isl_take isl_aff *aff, @@ -88,6 +100,13 @@ __isl_give isl_pw_aff_list *isl_pw_aff_list_set_rational( __isl_take isl_pw_aff_list *list); +__isl_give isl_pw_aff *isl_pw_aff_scale(__isl_take isl_pw_aff *pwaff, + isl_int f); +__isl_give isl_pw_aff *isl_pw_aff_scale_down(__isl_take isl_pw_aff *pwaff, + isl_int f); + +int isl_aff_matching_params(__isl_keep isl_aff *aff, + __isl_keep isl_space *space); int isl_aff_check_match_domain_space(__isl_keep isl_aff *aff, __isl_keep isl_space *space); @@ -101,6 +120,9 @@ __isl_give isl_multi_aff *isl_multi_aff_align_divs( __isl_take isl_multi_aff *maff); +__isl_give isl_multi_aff *isl_multi_aff_from_basic_set_equalities( + __isl_take isl_basic_set *bset); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_reset_domain_space( __isl_take isl_pw_multi_aff *pwmaff, __isl_take isl_space *space); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_reset_space( @@ -119,10 +141,14 @@ int n_div_ma, int n_div_bmap, isl_int f, isl_int c1, isl_int c2, isl_int g, int has_denom); +__isl_give isl_aff *isl_aff_substitute_equalities(__isl_take isl_aff *aff, + __isl_take isl_basic_set *eq); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_substitute( __isl_take isl_pw_multi_aff *pma, enum isl_dim_type type, unsigned pos, __isl_keep isl_pw_aff *subs); +int isl_pw_aff_matching_params(__isl_keep isl_pw_aff *pa, + __isl_keep isl_space *space); int isl_pw_aff_check_match_domain_space(__isl_keep isl_pw_aff *pa, __isl_keep isl_space *space); @@ -131,4 +157,19 @@ #include +#undef EL +#define EL isl_union_pw_aff + +#include + +#undef BASE +#define BASE union_pw_aff + +#include + +#undef EL +#define EL isl_union_pw_multi_aff + +#include + #endif diff -Nru cloog-0.18.2/isl/isl_arg.c cloog-0.18.4/isl/isl_arg.c --- cloog-0.18.2/isl/isl_arg.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_arg.c 2015-07-24 12:23:09.000000000 +0000 @@ -20,6 +20,8 @@ static void set_default_choice(struct isl_arg *arg, void *opt) { + if (arg->offset == (size_t) -1) + return; *(unsigned *)(((char *)opt) + arg->offset) = arg->u.choice.default_value; } @@ -202,7 +204,89 @@ free(opt); } -static int print_arg_help(struct isl_arg *decl, const char *prefix, int no) +/* Data structure for collecting the prefixes of ancestor nodes. + * + * n is the number of prefixes. + * prefix[i] for i < n is a prefix of an ancestor. + * len[i] for i < n is the length of prefix[i]. + */ +struct isl_prefixes { + int n; + const char *prefix[10]; + size_t len[10]; +}; + +/* Add "prefix" to the list of prefixes and return the updated + * number of prefixes. + */ +static int add_prefix(struct isl_prefixes *prefixes, const char *prefix) +{ + int n = prefixes->n; + + if (!prefix) + return n; + + if (prefixes->n >= 10) { + fprintf(stderr, "too many prefixes\n"); + exit(EXIT_FAILURE); + } + prefixes->len[prefixes->n] = strlen(prefix); + prefixes->prefix[prefixes->n] = prefix; + prefixes->n++; + + return n; +} + +/* Drop all prefixes starting at "first". + */ +static void drop_prefix(struct isl_prefixes *prefixes, int first) +{ + prefixes->n = first; +} + +/* Print the prefixes in "prefixes". + */ +static int print_prefixes(struct isl_prefixes *prefixes) +{ + int i; + int len = 0; + + if (!prefixes) + return 0; + + for (i = 0; i < prefixes->n; ++i) { + printf("%s-", prefixes->prefix[i]); + len += strlen(prefixes->prefix[i]) + 1; + } + + return len; +} + +/* Check if "name" starts with one or more of the prefixes in "prefixes", + * starting at *first. If so, advance the pointer beyond the prefixes + * and return the updated pointer. Additionally, update *first to + * the index after the last prefix found. + */ +static const char *skip_prefixes(const char *name, + struct isl_prefixes *prefixes, int *first) +{ + int i; + + for (i = first ? *first : 0; i < prefixes->n; ++i) { + size_t len = prefixes->len[i]; + const char *prefix = prefixes->prefix[i]; + if (strncmp(name, prefix, len) == 0 && name[len] == '-') { + name += len + 1; + if (first) + *first = i + 1; + } + } + + return name; +} + +static int print_arg_help(struct isl_arg *decl, struct isl_prefixes *prefixes, + int no) { int len = 0; @@ -222,14 +306,11 @@ len += 8; } - if (prefix) { - printf("%s-", prefix); - len += strlen(prefix) + 1; - } if (no) { printf("no-"); len += 3; } + len += print_prefixes(prefixes); printf("%s", decl->long_name); len += strlen(decl->long_name); @@ -307,7 +388,6 @@ printf("\n%30s", ""); else printf("%*s", 30 - pos, ""); - pos = 0; } else { if (pos + len >= 48) printf("\n%30s", ""); @@ -333,13 +413,13 @@ print_default(decl, s, pos); } -static void print_choice_help(struct isl_arg *decl, const char *prefix, - void *opt) +static void print_choice_help(struct isl_arg *decl, + struct isl_prefixes *prefixes, void *opt) { int i; int pos; - pos = print_arg_help(decl, prefix, 0); + pos = print_arg_help(decl, prefixes, 0); printf("="); pos++; @@ -377,7 +457,6 @@ printf("\n%30s", ""); else printf("%*s", 30 - pos, ""); - pos = 0; } else { if (pos + len >= 48) printf("\n%30s", ""); @@ -398,13 +477,13 @@ printf("%s", default_suffix); } -static void print_flags_help(struct isl_arg *decl, const char *prefix, - void *opt) +static void print_flags_help(struct isl_arg *decl, + struct isl_prefixes *prefixes, void *opt) { int i, j; int pos; - pos = print_arg_help(decl, prefix, 0); + pos = print_arg_help(decl, prefixes, 0); printf("="); pos++; @@ -432,12 +511,13 @@ printf("\n"); } -static void print_bool_help(struct isl_arg *decl, const char *prefix, void *opt) +static void print_bool_help(struct isl_arg *decl, + struct isl_prefixes *prefixes, void *opt) { int pos; unsigned *p = opt ? (unsigned *)(((char *) opt) + decl->offset) : NULL; int no = p ? *p == 1 : 0; - pos = print_arg_help(decl, prefix, no); + pos = print_arg_help(decl, prefixes, no); pos = print_help_msg(decl, pos); if (decl->offset != (size_t) -1) print_default(decl, no ? "yes" : "no", pos); @@ -450,12 +530,13 @@ return pos + 3 + strlen(name); } -static void print_int_help(struct isl_arg *decl, const char *prefix, void *opt) +static void print_int_help(struct isl_arg *decl, + struct isl_prefixes *prefixes, void *opt) { int pos; char val[20]; int *p = (int *)(((char *) opt) + decl->offset); - pos = print_arg_help(decl, prefix, 0); + pos = print_arg_help(decl, prefixes, 0); pos = print_argument_name(decl, decl->argument_name, pos); pos = print_help_msg(decl, pos); snprintf(val, sizeof(val), "%d", *p); @@ -463,11 +544,12 @@ printf("\n"); } -static void print_long_help(struct isl_arg *decl, const char *prefix, void *opt) +static void print_long_help(struct isl_arg *decl, + struct isl_prefixes *prefixes, void *opt) { int pos; long *p = (long *)(((char *) opt) + decl->offset); - pos = print_arg_help(decl, prefix, 0); + pos = print_arg_help(decl, prefixes, 0); if (*p != decl->u.l.default_selected) { printf("["); pos++; @@ -482,22 +564,24 @@ printf("\n"); } -static void print_ulong_help(struct isl_arg *decl, const char *prefix) +static void print_ulong_help(struct isl_arg *decl, + struct isl_prefixes *prefixes) { int pos; - pos = print_arg_help(decl, prefix, 0); + pos = print_arg_help(decl, prefixes, 0); printf("=ulong"); pos += 6; print_help_msg(decl, pos); printf("\n"); } -static void print_str_help(struct isl_arg *decl, const char *prefix, void *opt) +static void print_str_help(struct isl_arg *decl, + struct isl_prefixes *prefixes, void *opt) { int pos; const char *a = decl->argument_name ? decl->argument_name : "string"; const char **p = (const char **)(((char *) opt) + decl->offset); - pos = print_arg_help(decl, prefix, 0); + pos = print_arg_help(decl, prefixes, 0); pos = print_argument_name(decl, a, pos); pos = print_help_msg(decl, pos); if (*p) @@ -505,17 +589,19 @@ printf("\n"); } -static void print_str_list_help(struct isl_arg *decl, const char *prefix) +static void print_str_list_help(struct isl_arg *decl, + struct isl_prefixes *prefixes) { int pos; const char *a = decl->argument_name ? decl->argument_name : "string"; - pos = print_arg_help(decl, prefix, 0); + pos = print_arg_help(decl, prefixes, 0); pos = print_argument_name(decl, a, pos); pos = print_help_msg(decl, pos); printf("\n"); } -static void print_help(struct isl_arg *arg, const char *prefix, void *opt) +static void print_help(struct isl_arg *arg, + struct isl_prefixes *prefixes, void *opt) { int i; int any = 0; @@ -525,35 +611,35 @@ continue; switch (arg[i].type) { case isl_arg_flags: - print_flags_help(&arg[i], prefix, opt); + print_flags_help(&arg[i], prefixes, opt); any = 1; break; case isl_arg_choice: - print_choice_help(&arg[i], prefix, opt); + print_choice_help(&arg[i], prefixes, opt); any = 1; break; case isl_arg_bool: - print_bool_help(&arg[i], prefix, opt); + print_bool_help(&arg[i], prefixes, opt); any = 1; break; case isl_arg_int: - print_int_help(&arg[i], prefix, opt); + print_int_help(&arg[i], prefixes, opt); any = 1; break; case isl_arg_long: - print_long_help(&arg[i], prefix, opt); + print_long_help(&arg[i], prefixes, opt); any = 1; break; case isl_arg_ulong: - print_ulong_help(&arg[i], prefix); + print_ulong_help(&arg[i], prefixes); any = 1; break; case isl_arg_str: - print_str_help(&arg[i], prefix, opt); + print_str_help(&arg[i], prefixes, opt); any = 1; break; case isl_arg_str_list: - print_str_list_help(&arg[i], prefix); + print_str_list_help(&arg[i], prefixes); any = 1; break; case isl_arg_alias: @@ -569,6 +655,7 @@ for (i = 0; arg[i].type != isl_arg_end; ++i) { void *child; + int first; if (arg[i].type != isl_arg_child) continue; @@ -583,7 +670,9 @@ child = opt; else child = *(void **)(((char *) opt) + arg[i].offset); - print_help(arg[i].u.child.child->args, arg[i].long_name, child); + first = add_prefix(prefixes, arg[i].long_name); + print_help(arg[i].u.child.child->args, prefixes, child); + drop_prefix(prefixes, first); any = 1; } } @@ -625,6 +714,7 @@ void *opt) { int i; + struct isl_prefixes prefixes = { 0 }; printf("Usage: %s [OPTION...]", prog_name(prog)); @@ -634,7 +724,7 @@ printf("\n\n"); - print_help(arg, NULL, opt); + print_help(arg, &prefixes, opt); printf("\n"); if (any_version(arg)) printf(" -V, --version\n"); @@ -672,7 +762,7 @@ } static const char *skip_name(struct isl_arg *decl, const char *arg, - const char *prefix, int need_argument, int *has_argument) + struct isl_prefixes *prefixes, int need_argument, int *has_argument) { const char *equal; const char *name; @@ -700,12 +790,7 @@ *has_argument = !!equal; end = equal ? equal : name + strlen(name); - if (prefix) { - size_t prefix_len = strlen(prefix); - if (strncmp(name, prefix, prefix_len) == 0 && - name[prefix_len] == '-') - name += prefix_len + 1; - } + name = skip_prefixes(name, prefixes, NULL); if (!match_long_name(decl, name, end)) return NULL; @@ -714,13 +799,13 @@ } static int parse_choice_option(struct isl_arg *decl, char **arg, - const char *prefix, void *opt) + struct isl_prefixes *prefixes, void *opt) { int i; int has_argument; const char *choice; - choice = skip_name(decl, arg[0], prefix, 0, &has_argument); + choice = skip_name(decl, arg[0], prefixes, 0, &has_argument); if (!choice) return 0; @@ -772,14 +857,14 @@ } static int parse_flags_option(struct isl_arg *decl, char **arg, - const char *prefix, void *opt) + struct isl_prefixes *prefixes, void *opt) { int has_argument; const char *flags; const char *comma; unsigned val; - flags = skip_name(decl, arg[0], prefix, 0, &has_argument); + flags = skip_name(decl, arg[0], prefixes, 0, &has_argument); if (!flags) return 0; @@ -805,12 +890,13 @@ } static int parse_bool_option(struct isl_arg *decl, char **arg, - const char *prefix, void *opt) + struct isl_prefixes *prefixes, void *opt) { const char *name; unsigned *p = (unsigned *)(((char *)opt) + decl->offset); + int next_prefix; - if (skip_name(decl, arg[0], prefix, 0, NULL)) { + if (skip_name(decl, arg[0], prefixes, 0, NULL)) { if ((decl->flags & ISL_ARG_BOOL_ARG) && arg[1]) { char *endptr; int val = strtol(arg[1], &endptr, 0); @@ -837,25 +923,14 @@ if (!name) return 0; - if (prefix) { - size_t prefix_len = strlen(prefix); - if (strncmp(name, prefix, prefix_len) == 0 && - name[prefix_len] == '-') { - name += prefix_len + 1; - prefix = NULL; - } - } + next_prefix = 0; + name = skip_prefixes(name, prefixes, &next_prefix); if (strncmp(name, "no-", 3)) return 0; name += 3; - if (prefix) { - size_t prefix_len = strlen(prefix); - if (strncmp(name, prefix, prefix_len) == 0 && - name[prefix_len] == '-') - name += prefix_len + 1; - } + name = skip_prefixes(name, prefixes, &next_prefix); if (match_long_name(decl, name, name + strlen(name))) { if (decl->offset != (size_t) -1) @@ -870,13 +945,13 @@ } static int parse_str_option(struct isl_arg *decl, char **arg, - const char *prefix, void *opt) + struct isl_prefixes *prefixes, void *opt) { int has_argument; const char *s; char **p = (char **)(((char *)opt) + decl->offset); - s = skip_name(decl, arg[0], prefix, 0, &has_argument); + s = skip_name(decl, arg[0], prefixes, 0, &has_argument); if (!s) return 0; @@ -911,12 +986,12 @@ } static int parse_str_list_option(struct isl_arg *decl, char **arg, - const char *prefix, void *opt) + struct isl_prefixes *prefixes, void *opt) { int has_argument; const char *s; - s = skip_name(decl, arg[0], prefix, 0, &has_argument); + s = skip_name(decl, arg[0], prefixes, 0, &has_argument); if (!s) return 0; @@ -934,14 +1009,14 @@ } static int parse_int_option(struct isl_arg *decl, char **arg, - const char *prefix, void *opt) + struct isl_prefixes *prefixes, void *opt) { int has_argument; const char *val; char *endptr; int *p = (int *)(((char *)opt) + decl->offset); - val = skip_name(decl, arg[0], prefix, 0, &has_argument); + val = skip_name(decl, arg[0], prefixes, 0, &has_argument); if (!val) return 0; @@ -962,14 +1037,14 @@ } static int parse_long_option(struct isl_arg *decl, char **arg, - const char *prefix, void *opt) + struct isl_prefixes *prefixes, void *opt) { int has_argument; const char *val; char *endptr; long *p = (long *)(((char *)opt) + decl->offset); - val = skip_name(decl, arg[0], prefix, 0, &has_argument); + val = skip_name(decl, arg[0], prefixes, 0, &has_argument); if (!val) return 0; @@ -1002,14 +1077,14 @@ } static int parse_ulong_option(struct isl_arg *decl, char **arg, - const char *prefix, void *opt) + struct isl_prefixes *prefixes, void *opt) { int has_argument; const char *val; char *endptr; unsigned long *p = (unsigned long *)(((char *)opt) + decl->offset); - val = skip_name(decl, arg[0], prefix, 0, &has_argument); + val = skip_name(decl, arg[0], prefixes, 0, &has_argument); if (!val) return 0; @@ -1030,24 +1105,28 @@ } static int parse_option(struct isl_arg *decl, char **arg, - const char *prefix, void *opt); + struct isl_prefixes *prefixes, void *opt); static int parse_child_option(struct isl_arg *decl, char **arg, - const char *prefix, void *opt) + struct isl_prefixes *prefixes, void *opt) { void *child; + int first, parsed; if (decl->offset == (size_t) -1) child = opt; - else { + else child = *(void **)(((char *)opt) + decl->offset); - prefix = decl->long_name; - } - return parse_option(decl->u.child.child->args, arg, prefix, child); + + first = add_prefix(prefixes, decl->long_name); + parsed = parse_option(decl->u.child.child->args, arg, prefixes, child); + drop_prefix(prefixes, first); + + return parsed; } static int parse_option(struct isl_arg *decl, char **arg, - const char *prefix, void *opt) + struct isl_prefixes *prefixes, void *opt) { int i; @@ -1055,32 +1134,38 @@ int parsed = 0; switch (decl[i].type) { case isl_arg_choice: - parsed = parse_choice_option(&decl[i], arg, prefix, opt); + parsed = parse_choice_option(&decl[i], arg, + prefixes, opt); break; case isl_arg_flags: - parsed = parse_flags_option(&decl[i], arg, prefix, opt); + parsed = parse_flags_option(&decl[i], arg, + prefixes, opt); break; case isl_arg_int: - parsed = parse_int_option(&decl[i], arg, prefix, opt); + parsed = parse_int_option(&decl[i], arg, prefixes, opt); break; case isl_arg_long: - parsed = parse_long_option(&decl[i], arg, prefix, opt); + parsed = parse_long_option(&decl[i], arg, + prefixes, opt); break; case isl_arg_ulong: - parsed = parse_ulong_option(&decl[i], arg, prefix, opt); + parsed = parse_ulong_option(&decl[i], arg, + prefixes, opt); break; case isl_arg_bool: - parsed = parse_bool_option(&decl[i], arg, prefix, opt); + parsed = parse_bool_option(&decl[i], arg, + prefixes, opt); break; case isl_arg_str: - parsed = parse_str_option(&decl[i], arg, prefix, opt); + parsed = parse_str_option(&decl[i], arg, prefixes, opt); break; case isl_arg_str_list: - parsed = parse_str_list_option(&decl[i], arg, prefix, + parsed = parse_str_list_option(&decl[i], arg, prefixes, opt); break; case isl_arg_child: - parsed = parse_child_option(&decl[i], arg, prefix, opt); + parsed = parse_child_option(&decl[i], arg, + prefixes, opt); break; case isl_arg_alias: case isl_arg_arg: @@ -1171,6 +1256,7 @@ int skip = 0; int i; int n; + struct isl_prefixes prefixes = { 0 }; n = n_arg(args->args); @@ -1200,7 +1286,8 @@ continue; } check_help(args, argv[1 + skip], argv[0], opt, flags); - parsed = parse_option(args->args, &argv[1 + skip], NULL, opt); + parsed = parse_option(args->args, &argv[1 + skip], + &prefixes, opt); if (parsed) argc = drop_argument(argc, argv, 1 + skip, parsed); else if (ISL_FL_ISSET(flags, ISL_ARG_ALL)) { diff -Nru cloog-0.18.2/isl/isl_ast_build.c cloog-0.18.4/isl/isl_ast_build.c --- cloog-0.18.2/isl/isl_ast_build.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_ast_build.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,15 +1,21 @@ /* - * Copyright 2012 Ecole Normale Superieure + * Copyright 2012-2013 Ecole Normale Superieure + * Copyright 2014 INRIA Rocquencourt * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France + * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, + * B.P. 105 - 78153 Le Chesnay, France */ #include #include +#include #include +#include +#include #include #include @@ -63,10 +69,12 @@ isl_multi_aff_free(build->offsets); build->offsets = isl_multi_aff_zero(isl_space_copy(space)); isl_multi_aff_free(build->values); - build->values = isl_multi_aff_identity(space); + build->values = isl_multi_aff_identity(isl_space_copy(space)); + isl_multi_aff_free(build->internal2input); + build->internal2input = isl_multi_aff_identity(space); if (!build->iterators || !build->domain || !build->generated || - !build->pending || !build->values || + !build->pending || !build->values || !build->internal2input || !build->strides || !build->offsets || !build->options) return isl_ast_build_free(build); @@ -98,7 +106,7 @@ * * The input set is usually a parameter domain, but we currently allow it to * be any kind of set. We set the domain of the returned isl_ast_build - * to "set" and initialize all the other field to default values. + * to "set" and initialize all the other fields to default values. */ __isl_give isl_ast_build *isl_ast_build_from_context(__isl_take isl_set *set) { @@ -143,6 +151,19 @@ return NULL; } +/* Create an isl_ast_build with a universe (parametric) context. + */ +__isl_give isl_ast_build *isl_ast_build_alloc(isl_ctx *ctx) +{ + isl_space *space; + isl_set *context; + + space = isl_space_params_alloc(ctx, 0); + context = isl_set_universe(space); + + return isl_ast_build_from_context(context); +} + __isl_give isl_ast_build *isl_ast_build_copy(__isl_keep isl_ast_build *build) { if (!build) @@ -173,6 +194,7 @@ dup->generated = isl_set_copy(build->generated); dup->pending = isl_set_copy(build->pending); dup->values = isl_multi_aff_copy(build->values); + dup->internal2input = isl_multi_aff_copy(build->internal2input); dup->value = isl_pw_aff_copy(build->value); dup->strides = isl_vec_copy(build->strides); dup->offsets = isl_multi_aff_copy(build->offsets); @@ -185,14 +207,32 @@ dup->before_each_for_user = build->before_each_for_user; dup->after_each_for = build->after_each_for; dup->after_each_for_user = build->after_each_for_user; + dup->before_each_mark = build->before_each_mark; + dup->before_each_mark_user = build->before_each_mark_user; + dup->after_each_mark = build->after_each_mark; + dup->after_each_mark_user = build->after_each_mark_user; dup->create_leaf = build->create_leaf; dup->create_leaf_user = build->create_leaf_user; + dup->node = isl_schedule_node_copy(build->node); + if (build->loop_type) { + int i; + + dup->n = build->n; + dup->loop_type = isl_alloc_array(ctx, + enum isl_ast_loop_type, dup->n); + if (dup->n && !dup->loop_type) + return isl_ast_build_free(dup); + for (i = 0; i < dup->n; ++i) + dup->loop_type[i] = build->loop_type[i]; + } if (!dup->iterators || !dup->domain || !dup->generated || !dup->pending || !dup->values || !dup->strides || !dup->offsets || !dup->options || + (build->internal2input && !dup->internal2input) || (build->executed && !dup->executed) || - (build->value && !dup->value)) + (build->value && !dup->value) || + (build->node && !dup->node)) return isl_ast_build_free(dup); return dup; @@ -220,7 +260,15 @@ isl_space_copy(model)); build->options = isl_union_map_align_params(build->options, isl_space_copy(model)); - isl_space_free(model); + if (build->internal2input) { + build->internal2input = + isl_multi_aff_align_params(build->internal2input, + model); + if (!build->internal2input) + return isl_ast_build_free(build); + } else { + isl_space_free(model); + } if (!build->domain || !build->values || !build->offsets || !build->options) @@ -243,7 +291,8 @@ return isl_ast_build_dup(build); } -void *isl_ast_build_free(__isl_take isl_ast_build *build) +__isl_null isl_ast_build *isl_ast_build_free( + __isl_take isl_ast_build *build) { if (!build) return NULL; @@ -256,12 +305,16 @@ isl_set_free(build->generated); isl_set_free(build->pending); isl_multi_aff_free(build->values); + isl_multi_aff_free(build->internal2input); isl_pw_aff_free(build->value); isl_vec_free(build->strides); isl_multi_aff_free(build->offsets); isl_multi_aff_free(build->schedule_map); isl_union_map_free(build->executed); isl_union_map_free(build->options); + isl_schedule_node_free(build->node); + free(build->loop_type); + isl_set_free(build->isolated); free(build); @@ -379,6 +432,42 @@ return build; } +/* Set the "before_each_mark" callback of "build" to "fn". + */ +__isl_give isl_ast_build *isl_ast_build_set_before_each_mark( + __isl_take isl_ast_build *build, + isl_stat (*fn)(__isl_keep isl_id *mark, __isl_keep isl_ast_build *build, + void *user), void *user) +{ + build = isl_ast_build_cow(build); + + if (!build) + return NULL; + + build->before_each_mark = fn; + build->before_each_mark_user = user; + + return build; +} + +/* Set the "after_each_mark" callback of "build" to "fn". + */ +__isl_give isl_ast_build *isl_ast_build_set_after_each_mark( + __isl_take isl_ast_build *build, + __isl_give isl_ast_node *(*fn)(__isl_take isl_ast_node *node, + __isl_keep isl_ast_build *build, void *user), void *user) +{ + build = isl_ast_build_cow(build); + + if (!build) + return NULL; + + build->after_each_mark = fn; + build->after_each_mark_user = user; + + return build; +} + /* Set the "create_leaf" callback of "build" to "fn". */ __isl_give isl_ast_build *isl_ast_build_set_create_leaf( @@ -419,6 +508,10 @@ build->before_each_for_user = NULL; build->after_each_for = NULL; build->after_each_for_user = NULL; + build->before_each_mark = NULL; + build->before_each_mark_user = NULL; + build->after_each_mark = NULL; + build->after_each_mark_user = NULL; build->create_leaf = NULL; build->create_leaf_user = NULL; @@ -582,6 +675,8 @@ isl_vec_dump(build->strides); fprintf(stderr, "offsets: "); isl_multi_aff_dump(build->offsets); + fprintf(stderr, "internal2input: "); + isl_multi_aff_dump(build->internal2input); } /* Initialize "build" for AST construction in schedule space "space" @@ -616,7 +711,7 @@ * the first (and presumably only) affine expression in the isl_pw_aff * on which this function is used. */ -static int extract_single_piece(__isl_take isl_set *set, +static isl_stat extract_single_piece(__isl_take isl_set *set, __isl_take isl_aff *aff, void *user) { isl_aff **p = user; @@ -624,10 +719,27 @@ *p = aff; isl_set_free(set); - return -1; + return isl_stat_error; +} + +/* Intersect "set" with the stride constraint of "build", if any. + */ +static __isl_give isl_set *intersect_stride_constraint(__isl_take isl_set *set, + __isl_keep isl_ast_build *build) +{ + isl_set *stride; + + if (!build) + return isl_set_free(set); + if (!isl_ast_build_has_stride(build, build->depth)) + return set; + + stride = isl_ast_build_get_stride_constraint(build); + return isl_set_intersect(set, stride); } -/* Check if the given bounds on the current dimension imply that +/* Check if the given bounds on the current dimension (together with + * the stride constraint, if any) imply that * this current dimension attains only a single value (in terms of * parameters and outer dimensions). * If so, we record it in build->value. @@ -654,6 +766,7 @@ set = isl_set_from_basic_set(bounds); set = isl_set_intersect(set, isl_set_copy(build->domain)); + set = intersect_stride_constraint(set, build); it_map = isl_ast_build_map_to_iterator(build, set); sv = isl_map_is_single_valued(it_map); @@ -686,7 +799,7 @@ } /* Update the AST build based on the given loop bounds for - * the current dimension. + * the current dimension and the stride information available in the build. * * We first make sure that the bounds do not refer to any iterators * that have already been eliminated. @@ -699,10 +812,9 @@ * be defined on a subset of the domain. Plugging in the value * would restrict the build domain to this subset, while this * restriction may not be reflected in the generated code. - * build->domain may, however, already refer to the current dimension - * due an earlier call to isl_ast_build_include_stride. If so, we need - * to eliminate the dimension so that we do not introduce it in any other sets. * Finally, we intersect build->domain with the updated bounds. + * We also add the stride constraint unless we have been able + * to find a fixed value expressed as a single affine expression. * * Note that the check for a fixed value in update_values requires * us to intersect the bounds with the current build domain. @@ -733,11 +845,7 @@ set = isl_set_compute_divs(set); build->pending = isl_set_intersect(build->pending, isl_set_copy(set)); - if (isl_ast_build_has_stride(build, build->depth)) { - build->domain = isl_set_eliminate(build->domain, - isl_dim_set, build->depth, 1); - build->domain = isl_set_compute_divs(build->domain); - } + build->domain = isl_set_intersect(build->domain, set); } else { isl_basic_set *generated, *pending; @@ -751,10 +859,13 @@ generated, isl_dim_set, build->depth, 1); build->generated = isl_set_intersect(build->generated, isl_set_from_basic_set(generated)); + build->domain = isl_set_intersect(build->domain, set); + build = isl_ast_build_include_stride(build); + if (!build) + goto error; } isl_basic_set_free(bounds); - build->domain = isl_set_intersect(build->domain, set); if (!build->domain || !build->pending || !build->generated) return isl_ast_build_free(build); @@ -765,38 +876,6 @@ return NULL; } -/* Update build->domain based on the constraints enforced by inner loops. - * - * The constraints in build->pending may end up not getting generated - * if they are implied by "enforced". We therefore reconstruct - * build->domain from build->generated and build->pending, dropping - * those constraint in build->pending that may not get generated. - */ -__isl_give isl_ast_build *isl_ast_build_set_enforced( - __isl_take isl_ast_build *build, __isl_take isl_basic_set *enforced) -{ - isl_set *set; - - build = isl_ast_build_cow(build); - if (!build) - goto error; - - set = isl_set_from_basic_set(enforced); - set = isl_set_gist(isl_set_copy(build->pending), set); - set = isl_set_intersect(isl_set_copy(build->generated), set); - - isl_set_free(build->domain); - build->domain = set; - - if (!build->domain) - return isl_ast_build_free(build); - - return build; -error: - isl_basic_set_free(enforced); - return isl_ast_build_free(build); -} - /* Intersect build->domain with "set", where "set" is specified * in terms of the internal schedule domain. */ @@ -846,6 +925,30 @@ return NULL; } +/* Replace the set of pending constraints by "guard", which is then + * no longer considered as pending. + * That is, add "guard" to the generated constraints and clear all pending + * constraints, making the domain equal to the generated constraints. + */ +__isl_give isl_ast_build *isl_ast_build_replace_pending_by_guard( + __isl_take isl_ast_build *build, __isl_take isl_set *guard) +{ + build = isl_ast_build_restrict_generated(build, guard); + build = isl_ast_build_cow(build); + if (!build) + return NULL; + + isl_set_free(build->domain); + build->domain = isl_set_copy(build->generated); + isl_set_free(build->pending); + build->pending = isl_set_universe(isl_set_get_space(build->domain)); + + if (!build->pending) + return isl_ast_build_free(build); + + return build; +} + /* Intersect build->pending and build->domain with "set", * where "set" is specified in terms of the internal schedule domain. */ @@ -907,6 +1010,95 @@ return NULL; } +/* Does "build" point to a band node? + * That is, are we currently handling a band node inside a schedule tree? + */ +int isl_ast_build_has_schedule_node(__isl_keep isl_ast_build *build) +{ + if (!build) + return -1; + return build->node != NULL; +} + +/* Return a copy of the band node that "build" refers to. + */ +__isl_give isl_schedule_node *isl_ast_build_get_schedule_node( + __isl_keep isl_ast_build *build) +{ + if (!build) + return NULL; + return isl_schedule_node_copy(build->node); +} + +/* Extract the loop AST generation types for the members of build->node + * and store them in build->loop_type. + */ +static __isl_give isl_ast_build *extract_loop_types( + __isl_take isl_ast_build *build) +{ + int i; + isl_ctx *ctx; + isl_schedule_node *node; + + if (!build) + return NULL; + ctx = isl_ast_build_get_ctx(build); + if (!build->node) + isl_die(ctx, isl_error_internal, "missing AST node", + return isl_ast_build_free(build)); + + free(build->loop_type); + build->n = isl_schedule_node_band_n_member(build->node); + build->loop_type = isl_alloc_array(ctx, + enum isl_ast_loop_type, build->n); + if (build->n && !build->loop_type) + return isl_ast_build_free(build); + node = build->node; + for (i = 0; i < build->n; ++i) + build->loop_type[i] = + isl_schedule_node_band_member_get_ast_loop_type(node, i); + + return build; +} + +/* Replace the band node that "build" refers to by "node" and + * extract the corresponding loop AST generation types. + */ +__isl_give isl_ast_build *isl_ast_build_set_schedule_node( + __isl_take isl_ast_build *build, + __isl_take isl_schedule_node *node) +{ + build = isl_ast_build_cow(build); + if (!build || !node) + goto error; + + isl_schedule_node_free(build->node); + build->node = node; + + build = extract_loop_types(build); + + return build; +error: + isl_ast_build_free(build); + isl_schedule_node_free(node); + return NULL; +} + +/* Remove any reference to a band node from "build". + */ +__isl_give isl_ast_build *isl_ast_build_reset_schedule_node( + __isl_take isl_ast_build *build) +{ + build = isl_ast_build_cow(build); + if (!build) + return NULL; + + isl_schedule_node_free(build->node); + build->node = NULL; + + return build; +} + /* Return a copy of the current schedule domain. */ __isl_give isl_set *isl_ast_build_get_domain(__isl_keep isl_ast_build *build) @@ -914,6 +1106,42 @@ return build ? isl_set_copy(build->domain) : NULL; } +/* Return a copy of the set of pending constraints. + */ +__isl_give isl_set *isl_ast_build_get_pending( + __isl_keep isl_ast_build *build) +{ + return build ? isl_set_copy(build->pending) : NULL; +} + +/* Return a copy of the set of generated constraints. + */ +__isl_give isl_set *isl_ast_build_get_generated( + __isl_keep isl_ast_build *build) +{ + return build ? isl_set_copy(build->generated) : NULL; +} + +/* Return a copy of the map from the internal schedule domain + * to the original input schedule domain. + */ +__isl_give isl_multi_aff *isl_ast_build_get_internal2input( + __isl_keep isl_ast_build *build) +{ + return build ? isl_multi_aff_copy(build->internal2input) : NULL; +} + +/* Return the number of variables of the given type + * in the (internal) schedule space. + */ +unsigned isl_ast_build_dim(__isl_keep isl_ast_build *build, + enum isl_dim_type type) +{ + if (!build) + return 0; + return isl_set_dim(build->domain, type); +} + /* Return the (schedule) space of "build". * * If "internal" is set, then this space is the space of the internal @@ -1232,7 +1460,7 @@ * * The expression "-a h(p)/g" can therefore be used as offset. */ -static int detect_stride(__isl_take isl_constraint *c, void *user) +static isl_stat detect_stride(__isl_take isl_constraint *c, void *user) { struct isl_detect_stride_data *data = user; int i, n_div; @@ -1242,7 +1470,7 @@ if (!isl_constraint_is_equality(c) || !isl_constraint_involves_dims(c, isl_dim_set, data->pos, 1)) { isl_constraint_free(c); - return 0; + return isl_stat_ok; } ctx = isl_constraint_get_ctx(c); @@ -1250,7 +1478,7 @@ n_div = isl_constraint_dim(c, isl_dim_div); for (i = 0; i < n_div; ++i) { v = isl_constraint_get_coefficient_val(c, isl_dim_div, i); - v = isl_val_gcd(stride, v); + stride = isl_val_gcd(stride, v); } v = isl_constraint_get_coefficient_val(c, isl_dim_set, data->pos); @@ -1282,7 +1510,7 @@ } isl_constraint_free(c); - return 0; + return isl_stat_ok; } /* Check if the constraints in "set" imply any stride on the current @@ -1327,7 +1555,7 @@ /* Check if "map" involves the input dimension data->depth. */ -static int involves_depth(__isl_take isl_map *map, void *user) +static isl_stat involves_depth(__isl_take isl_map *map, void *user) { struct isl_ast_build_involves_data *data = user; @@ -1335,8 +1563,8 @@ isl_map_free(map); if (data->involves < 0 || data->involves) - return -1; - return 0; + return isl_stat_error; + return isl_stat_ok; } /* Do any options depend on the value of the dimension at the current depth? @@ -1375,7 +1603,7 @@ space = isl_space_set_from_params(space); space = isl_space_add_dims(space, isl_dim_set, 1); space = isl_space_map_from_set(space); - c = isl_equality_alloc(isl_local_space_from_space(space)); + c = isl_constraint_alloc_equality(isl_local_space_from_space(space)); c = isl_constraint_set_coefficient_si(c, isl_dim_in, 0, 1); c = isl_constraint_set_coefficient_si(c, isl_dim_out, 0, -1); bmap1 = isl_basic_map_from_constraint(isl_constraint_copy(c)); @@ -1389,9 +1617,9 @@ } static const char *option_str[] = { - [atomic] = "atomic", - [unroll] = "unroll", - [separate] = "separate" + [isl_ast_loop_atomic] = "atomic", + [isl_ast_loop_unroll] = "unroll", + [isl_ast_loop_separate] = "separate" }; /* Update the "options" to reflect the insertion of a dimension @@ -1420,7 +1648,7 @@ { isl_map *map; isl_union_map *insertion; - enum isl_ast_build_domain_type type; + enum isl_ast_loop_type type; const char *name = "separation_class"; space = isl_space_map_from_set(space); @@ -1436,7 +1664,8 @@ insertion = isl_union_map_empty(isl_union_map_get_space(options)); - for (type = atomic; type <= separate; ++type) { + for (type = isl_ast_loop_atomic; + type <= isl_ast_loop_separate; ++type) { isl_map *map_type = isl_map_copy(map); const char *name = option_str[type]; map_type = isl_map_set_tuple_name(map_type, isl_dim_in, name); @@ -1454,6 +1683,42 @@ return options; } +/* If we are generating an AST from a schedule tree (build->node is set), + * then update the loop AST generation types + * to reflect the insertion of a dimension at (global) position "pos" + * in the schedule domain space. + * We do not need to adjust any isolate option since we would not be inserting + * any dimensions if there were any isolate option. + */ +static __isl_give isl_ast_build *node_insert_dim( + __isl_take isl_ast_build *build, int pos) +{ + int i; + int local_pos; + enum isl_ast_loop_type *loop_type; + isl_ctx *ctx; + + build = isl_ast_build_cow(build); + if (!build) + return NULL; + if (!build->node) + return build; + + ctx = isl_ast_build_get_ctx(build); + local_pos = pos - build->outer_pos; + loop_type = isl_realloc_array(ctx, build->loop_type, + enum isl_ast_loop_type, build->n + 1); + if (!loop_type) + return isl_ast_build_free(build); + build->loop_type = loop_type; + for (i = build->n - 1; i >= local_pos; --i) + loop_type[i + 1] = loop_type[i]; + loop_type[local_pos] = isl_ast_loop_default; + build->n++; + + return build; +} + /* Insert a single dimension in the schedule domain at position "pos". * The new dimension is given an isl_id with the empty string as name. * @@ -1465,6 +1730,12 @@ * However, the original schedule domain space may be named and/or * structured, so we have to take this possibility into account * while performing the transformations. + * + * Since the inserted schedule dimension is used by the caller + * to differentiate between different domain spaces, there is + * no longer a uniform mapping from the internal schedule space + * to the input schedule space. The internal2input mapping is + * therefore removed. */ __isl_give isl_ast_build *isl_ast_build_insert_dim( __isl_take isl_ast_build *build, int pos) @@ -1480,7 +1751,8 @@ ctx = isl_ast_build_get_ctx(build); id = isl_id_alloc(ctx, "", NULL); - space = isl_ast_build_get_space(build, 1); + if (!build->node) + space = isl_ast_build_get_space(build, 1); build->iterators = isl_id_list_insert(build->iterators, pos, id); build->domain = isl_set_insert_dims(build->domain, isl_dim_set, pos, 1); @@ -1498,13 +1770,17 @@ build->offsets = isl_multi_aff_splice(build->offsets, pos, pos, ma); ma = isl_multi_aff_identity(ma_space); build->values = isl_multi_aff_splice(build->values, pos, pos, ma); - build->options = options_insert_dim(build->options, space, pos); + if (!build->node) + build->options = options_insert_dim(build->options, space, pos); + build->internal2input = isl_multi_aff_free(build->internal2input); if (!build->iterators || !build->domain || !build->generated || !build->pending || !build->values || !build->strides || !build->offsets || !build->options) return isl_ast_build_free(build); + build = node_insert_dim(build, pos); + return build; } @@ -1517,7 +1793,11 @@ * This function is called right after the strides have been * detected, but before any constraints on the current dimension * have been included in build->domain. - * We therefore only need to update stride, offset and the options. + * We therefore only need to update stride, offset, the options and + * the mapping from internal schedule space to the original schedule + * space, if we are still keeping track of such a mapping. + * The latter mapping is updated by plugging in + * { [... i ...] -> [... m i ... ] }. */ __isl_give isl_ast_build *isl_ast_build_scale_down( __isl_take isl_ast_build *build, __isl_take isl_val *m, @@ -1533,6 +1813,23 @@ depth = build->depth; + if (build->internal2input) { + isl_space *space; + isl_multi_aff *ma; + isl_aff *aff; + + space = isl_multi_aff_get_space(build->internal2input); + space = isl_space_map_from_set(isl_space_domain(space)); + ma = isl_multi_aff_identity(space); + aff = isl_multi_aff_get_aff(ma, depth); + aff = isl_aff_scale_val(aff, isl_val_copy(m)); + ma = isl_multi_aff_set_aff(ma, depth, aff); + build->internal2input = + isl_multi_aff_pullback_multi_aff(build->internal2input, ma); + if (!build->internal2input) + goto error; + } + v = isl_vec_get_element_val(build->strides, depth); v = isl_val_div(v, isl_val_copy(m)); build->strides = isl_vec_set_element_val(build->strides, depth, v); @@ -1575,7 +1872,7 @@ /* Embed "options" into the given isl_ast_build space. * * This function is called from within a nested call to - * isl_ast_build_ast_from_schedule. + * isl_ast_build_node_from_schedule_map. * "options" refers to the additional schedule, * while space refers to both the space of the outer isl_ast_build and * that of the additional schedule. @@ -1677,7 +1974,18 @@ build->values = isl_multi_aff_align_params(build->values, isl_space_copy(space)); embedding = isl_multi_aff_identity(space); - build->values = isl_multi_aff_product(build->values, embedding); + build->values = isl_multi_aff_product(build->values, + isl_multi_aff_copy(embedding)); + if (build->internal2input) { + build->internal2input = + isl_multi_aff_product(build->internal2input, embedding); + build->internal2input = + isl_multi_aff_flatten_range(build->internal2input); + if (!build->internal2input) + return isl_ast_build_free(build); + } else { + isl_multi_aff_free(embedding); + } space = isl_ast_build_get_space(build, 1); build->options = embed_options(build->options, space); @@ -1768,7 +2076,7 @@ * value that, moreover, can be described by a single affine expression * in terms of the outer dimensions and parameters? * - * If not, then the correponding affine expression in build->values + * If not, then the corresponding affine expression in build->values * is set to be equal to the same input dimension. * Otherwise, it is set to the requested expression in terms of * outer dimensions and parameters. @@ -1855,7 +2163,8 @@ if (!build) goto error; - set = isl_set_preimage_multi_aff(set, + if (!isl_set_is_params(set)) + set = isl_set_preimage_multi_aff(set, isl_multi_aff_copy(build->values)); set = isl_set_gist(set, isl_set_copy(build->domain)); @@ -1865,6 +2174,24 @@ return NULL; } +/* Include information about what we know about the iterators of + * already generated loops to "set". + * + * We currently only plug in the known affine values of outer loop + * iterators. + * In principle we could also introduce equalities or even other + * constraints implied by the intersection of "set" and build->domain. + */ +__isl_give isl_set *isl_ast_build_specialize(__isl_keep isl_ast_build *build, + __isl_take isl_set *set) +{ + if (!build) + return isl_set_free(set); + + return isl_set_preimage_multi_aff(set, + isl_multi_aff_copy(build->values)); +} + /* Simplify the map "map" based on what we know about * the iterators of already generated loops. * @@ -1962,8 +2289,7 @@ * but the position is still that within the current code generation. */ __isl_give isl_set *isl_ast_build_get_option_domain( - __isl_keep isl_ast_build *build, - enum isl_ast_build_domain_type type) + __isl_keep isl_ast_build *build, enum isl_ast_loop_type type) { const char *name; isl_space *space; @@ -1991,6 +2317,145 @@ return domain; } +/* How does the user want the current schedule dimension to be generated? + * These choices have been extracted from the schedule node + * in extract_loop_types and stored in build->loop_type. + * They have been updated to reflect any dimension insertion in + * node_insert_dim. + * Return isl_ast_domain_error on error. + * + * If "isolated" is set, then we get the loop AST generation type + * directly from the band node since node_insert_dim cannot have been + * called on a band with the isolate option. + */ +enum isl_ast_loop_type isl_ast_build_get_loop_type( + __isl_keep isl_ast_build *build, int isolated) +{ + int local_pos; + isl_ctx *ctx; + + if (!build) + return isl_ast_loop_error; + ctx = isl_ast_build_get_ctx(build); + if (!build->node) + isl_die(ctx, isl_error_internal, + "only works for schedule tree based AST generation", + return isl_ast_loop_error); + + local_pos = build->depth - build->outer_pos; + if (!isolated) + return build->loop_type[local_pos]; + return isl_schedule_node_band_member_get_isolate_ast_loop_type( + build->node, local_pos); +} + +/* Extract the isolated set from the isolate option, if any, + * and store in the build. + * If there is no isolate option, then the isolated set is + * set to the empty set. + * + * The isolate option is of the form + * + * isolate[[outer bands] -> current_band] + * + * We flatten this set and then map it back to the internal + * schedule space. + * + * If we have already extracted the isolated set + * or if internal2input is no longer set, then we do not + * need to do anything. In the latter case, we know + * that the current band cannot have any isolate option. + */ +__isl_give isl_ast_build *isl_ast_build_extract_isolated( + __isl_take isl_ast_build *build) +{ + isl_space *space, *space2; + isl_union_set *options; + int n, n2; + isl_set *isolated; + + if (!build) + return NULL; + if (!build->internal2input) + return build; + if (build->isolated) + return build; + + build = isl_ast_build_cow(build); + if (!build) + return NULL; + + options = isl_schedule_node_band_get_ast_build_options(build->node); + + space = isl_multi_aff_get_space(build->internal2input); + space = isl_space_range(space); + space2 = isl_set_get_space(build->domain); + if (isl_space_is_wrapping(space2)) + space2 = isl_space_range(isl_space_unwrap(space2)); + n2 = isl_space_dim(space2, isl_dim_set); + n = isl_space_dim(space, isl_dim_set); + if (n < n2) + isl_die(isl_ast_build_get_ctx(build), isl_error_internal, + "total input space dimension cannot be smaller " + "than dimension of innermost band", + space = isl_space_free(space)); + space = isl_space_drop_dims(space, isl_dim_set, n - n2, n2); + space = isl_space_map_from_domain_and_range(space, space2); + space = isl_space_wrap(space); + space = isl_space_set_tuple_name(space, isl_dim_set, "isolate"); + isolated = isl_union_set_extract_set(options, space); + isl_union_set_free(options); + + isolated = isl_set_flatten(isolated); + isolated = isl_set_preimage_multi_aff(isolated, + isl_multi_aff_copy(build->internal2input)); + + build->isolated = isolated; + if (!build->isolated) + return isl_ast_build_free(build); + + return build; +} + +/* Does "build" have a non-empty isolated set? + * + * The caller is assumed to have called isl_ast_build_extract_isolated first. + */ +int isl_ast_build_has_isolated(__isl_keep isl_ast_build *build) +{ + int empty; + + if (!build) + return -1; + if (!build->internal2input) + return 0; + if (!build->isolated) + isl_die(isl_ast_build_get_ctx(build), isl_error_internal, + "isolated set not extracted yet", return -1); + + empty = isl_set_plain_is_empty(build->isolated); + return empty < 0 ? -1 : !empty; +} + +/* Return a copy of the isolated set of "build". + * + * The caller is assume to have called isl_ast_build_has_isolated first, + * with this function returning true. + * In particular, this function should not be called if we are no + * longer keeping track of internal2input (and there therefore could + * not possibly be any isolated set). + */ +__isl_give isl_set *isl_ast_build_get_isolated(__isl_keep isl_ast_build *build) +{ + if (!build) + return NULL; + if (!build->internal2input) + isl_die(isl_ast_build_get_ctx(build), isl_error_internal, + "build cannot have isolated set", return NULL); + + return isl_set_copy(build->isolated); +} + /* Extract the separation class mapping at the current depth. * * In particular, find and return the subset of build->options that is of diff -Nru cloog-0.18.2/isl/isl_ast_build_expr.c cloog-0.18.4/isl/isl_ast_build_expr.c --- cloog-0.18.2/isl/isl_ast_build_expr.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_ast_build_expr.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,12 +1,16 @@ /* - * Copyright 2012 Ecole Normale Superieure + * Copyright 2012-2014 Ecole Normale Superieure + * Copyright 2014 INRIA Rocquencourt * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France + * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, + * B.P. 105 - 78153 Le Chesnay, France */ +#include #include #include #include @@ -29,11 +33,120 @@ return aff; } +/* Internal data structure used inside isl_ast_expr_add_term. + * The domain of "build" is used to simplify the expressions. + * "build" needs to be set by the caller of isl_ast_expr_add_term. + * "cst" is the constant term of the expression in which the added term + * appears. It may be modified by isl_ast_expr_add_term. + * + * "v" is the coefficient of the term that is being constructed and + * is set internally by isl_ast_expr_add_term. + */ +struct isl_ast_add_term_data { + isl_ast_build *build; + isl_val *cst; + isl_val *v; +}; + +/* Given the numerator "aff" of the argument of an integer division + * with denominator "d", check if it can be made non-negative over + * data->build->domain by stealing part of the constant term of + * the expression in which the integer division appears. + * + * In particular, the outer expression is of the form + * + * v * floor(aff/d) + cst + * + * We already know that "aff" itself may attain negative values. + * Here we check if aff + d*floor(cst/v) is non-negative, such + * that we could rewrite the expression to + * + * v * floor((aff + d*floor(cst/v))/d) + cst - v*floor(cst/v) + * + * Note that aff + d*floor(cst/v) can only possibly be non-negative + * if data->cst and data->v have the same sign. + * Similarly, if floor(cst/v) is zero, then there is no point in + * checking again. + */ +static int is_non_neg_after_stealing(__isl_keep isl_aff *aff, + __isl_keep isl_val *d, struct isl_ast_add_term_data *data) +{ + isl_aff *shifted; + isl_val *shift; + int is_zero; + int non_neg; + + if (isl_val_sgn(data->cst) != isl_val_sgn(data->v)) + return 0; + + shift = isl_val_div(isl_val_copy(data->cst), isl_val_copy(data->v)); + shift = isl_val_floor(shift); + is_zero = isl_val_is_zero(shift); + if (is_zero < 0 || is_zero) { + isl_val_free(shift); + return is_zero < 0 ? -1 : 0; + } + shift = isl_val_mul(shift, isl_val_copy(d)); + shifted = isl_aff_copy(aff); + shifted = isl_aff_add_constant_val(shifted, shift); + non_neg = isl_ast_build_aff_is_nonneg(data->build, shifted); + isl_aff_free(shifted); + + return non_neg; +} + +/* Given the numerator "aff' of the argument of an integer division + * with denominator "d", steal part of the constant term of + * the expression in which the integer division appears to make it + * non-negative over data->build->domain. + * + * In particular, the outer expression is of the form + * + * v * floor(aff/d) + cst + * + * We know that "aff" itself may attain negative values, + * but that aff + d*floor(cst/v) is non-negative. + * Find the minimal positive value that we need to add to "aff" + * to make it positive and adjust data->cst accordingly. + * That is, compute the minimal value "m" of "aff" over + * data->build->domain and take + * + * s = ceil(m/d) + * + * such that + * + * aff + d * s >= 0 + * + * and rewrite the expression to + * + * v * floor((aff + s*d)/d) + (cst - v*s) + */ +static __isl_give isl_aff *steal_from_cst(__isl_take isl_aff *aff, + __isl_keep isl_val *d, struct isl_ast_add_term_data *data) +{ + isl_set *domain; + isl_val *shift, *t; + + domain = isl_ast_build_get_domain(data->build); + shift = isl_set_min_val(domain, aff); + isl_set_free(domain); + + shift = isl_val_neg(shift); + shift = isl_val_div(shift, isl_val_copy(d)); + shift = isl_val_ceil(shift); + + t = isl_val_copy(shift); + t = isl_val_mul(t, isl_val_copy(data->v)); + data->cst = isl_val_sub(data->cst, t); + + shift = isl_val_mul(shift, isl_val_copy(d)); + return isl_aff_add_constant_val(aff, shift); +} + /* Create an isl_ast_expr evaluating the div at position "pos" in "ls". - * The result is simplified in terms of build->domain. + * The result is simplified in terms of data->build->domain. + * This function may change (the sign of) data->v. * - * *change_sign is set by this function if the sign of - * the expression has changed. * "ls" is known to be non-NULL. * * Let the div be of the form floor(e/d). @@ -52,11 +165,20 @@ * * floor(e/d) = -ceil(-e/d) = -floor((-e + d - 1)/d) * - * and still use pdiv_q. + * and still use pdiv_q, while changing the sign of data->v. + * + * Otherwise, we check if + * + * e + d*floor(cst/v) + * + * is non-negative and if so, replace floor(e/d) by + * + * floor((e + s*d)/d) - s + * + * with s the minimal shift that makes the argument non-negative. */ -static __isl_give isl_ast_expr *var_div(int *change_sign, - __isl_keep isl_local_space *ls, - int pos, __isl_keep isl_ast_build *build) +static __isl_give isl_ast_expr *var_div(struct isl_ast_add_term_data *data, + __isl_keep isl_local_space *ls, int pos) { isl_ctx *ctx = isl_local_space_get_ctx(ls); isl_aff *aff; @@ -71,18 +193,23 @@ type = isl_ast_op_fdiv_q; if (isl_options_get_ast_build_prefer_pdiv(ctx)) { - int non_neg = isl_ast_build_aff_is_nonneg(build, aff); + int non_neg = isl_ast_build_aff_is_nonneg(data->build, aff); if (non_neg >= 0 && !non_neg) { isl_aff *opp = oppose_div_arg(isl_aff_copy(aff), isl_val_copy(d)); - non_neg = isl_ast_build_aff_is_nonneg(build, opp); + non_neg = isl_ast_build_aff_is_nonneg(data->build, opp); if (non_neg >= 0 && non_neg) { - *change_sign = 1; + data->v = isl_val_neg(data->v); isl_aff_free(aff); aff = opp; } else isl_aff_free(opp); } + if (non_neg >= 0 && !non_neg) { + non_neg = is_non_neg_after_stealing(aff, d, data); + if (non_neg >= 0 && non_neg) + aff = steal_from_cst(aff, d, data); + } if (non_neg < 0) aff = isl_aff_free(aff); else if (non_neg) @@ -90,33 +217,30 @@ } isl_val_free(d); - num = isl_ast_expr_from_aff(aff, build); + num = isl_ast_expr_from_aff(aff, data->build); return isl_ast_expr_alloc_binary(type, num, den); } /* Create an isl_ast_expr evaluating the specified dimension of "ls". - * The result is simplified in terms of build->domain. - * - * *change_sign is set by this function if the sign of - * the expression has changed. + * The result is simplified in terms of data->build->domain. + * This function may change (the sign of) data->v. * * The isl_ast_expr is constructed based on the type of the dimension. * - divs are constructed by var_div - * - set variables are constructed from the iterator isl_ids in "build" + * - set variables are constructed from the iterator isl_ids in data->build * - parameters are constructed from the isl_ids in "ls" */ -static __isl_give isl_ast_expr *var(int *change_sign, - __isl_keep isl_local_space *ls, - enum isl_dim_type type, int pos, __isl_keep isl_ast_build *build) +static __isl_give isl_ast_expr *var(struct isl_ast_add_term_data *data, + __isl_keep isl_local_space *ls, enum isl_dim_type type, int pos) { isl_ctx *ctx = isl_local_space_get_ctx(ls); isl_id *id; if (type == isl_dim_div) - return var_div(change_sign, ls, pos, build); + return var_div(data, ls, pos); if (type == isl_dim_set) { - id = isl_ast_build_get_iterator_id(build, pos); + id = isl_ast_build_get_iterator_id(data->build, pos); return isl_ast_expr_from_id(id); } @@ -209,14 +333,12 @@ __isl_keep isl_aff *aff, __isl_keep isl_val *d, __isl_keep isl_ast_build *build) { - isl_ctx *ctx; isl_ast_expr *expr; isl_ast_expr *c; if (!aff) return NULL; - ctx = isl_aff_get_ctx(aff); expr = isl_ast_expr_from_aff(isl_aff_copy(aff), build); c = isl_ast_expr_from_val(isl_val_copy(d)); @@ -270,6 +392,9 @@ /* Add an expression for "*v" times the specified dimension of "ls" * to expr. + * If the dimension is an integer division, then this function + * may modify data->cst in order to make the numerator non-negative. + * The result is simplified in terms of data->build->domain. * * Let e be the expression for the specified dimension, * multiplied by the absolute value of "*v". @@ -291,18 +416,16 @@ static __isl_give isl_ast_expr *isl_ast_expr_add_term( __isl_take isl_ast_expr *expr, __isl_keep isl_local_space *ls, enum isl_dim_type type, int pos, - __isl_take isl_val *v, __isl_keep isl_ast_build *build) + __isl_take isl_val *v, struct isl_ast_add_term_data *data) { isl_ast_expr *term; - int change_sign; if (!expr) return NULL; - change_sign = 0; - term = var(&change_sign, ls, type, pos, build); - if (change_sign) - v = isl_val_neg(v); + data->v = v; + term = var(data, ls, type, pos); + v = data->v; if (isl_val_is_neg(v) && !ast_expr_is_zero(expr)) { v = isl_val_neg(v); @@ -319,7 +442,6 @@ static __isl_give isl_ast_expr *isl_ast_expr_add_int( __isl_take isl_ast_expr *expr, __isl_take isl_val *v) { - isl_ctx *ctx; isl_ast_expr *expr_int; if (!expr || !v) @@ -330,7 +452,6 @@ return expr; } - ctx = isl_ast_expr_get_ctx(expr); if (isl_val_is_neg(v) && !ast_expr_is_zero(expr)) { v = isl_val_neg(v); expr_int = isl_ast_expr_from_val(v); @@ -345,19 +466,415 @@ return NULL; } -/* Check if "aff" involves any (implicit) modulo computations based - * on div "j". +/* Internal data structure used inside extract_modulos. + * + * If any modulo expressions are detected in "aff", then the + * expression is removed from "aff" and added to either "pos" or "neg" + * depending on the sign of the coefficient of the modulo expression + * inside "aff". + * + * "add" is an expression that needs to be added to "aff" at the end of + * the computation. It is NULL as long as no modulos have been extracted. + * + * "i" is the position in "aff" of the div under investigation + * "v" is the coefficient in "aff" of the div + * "div" is the argument of the div, with the denominator removed + * "d" is the original denominator of the argument of the div + * + * "nonneg" is an affine expression that is non-negative over "build" + * and that can be used to extract a modulo expression from "div". + * In particular, if "sign" is 1, then the coefficients of "nonneg" + * are equal to those of "div" modulo "d". If "sign" is -1, then + * the coefficients of "nonneg" are opposite to those of "div" modulo "d". + * If "sign" is 0, then no such affine expression has been found (yet). + */ +struct isl_extract_mod_data { + isl_ast_build *build; + isl_aff *aff; + + isl_ast_expr *pos; + isl_ast_expr *neg; + + isl_aff *add; + + int i; + isl_val *v; + isl_val *d; + isl_aff *div; + + isl_aff *nonneg; + int sign; +}; + +/* Given that data->v * div_i in data->aff is equal to + * + * f * (term - (arg mod d)) + * + * with data->d * f = data->v, add + * + * f * term + * + * to data->add and + * + * abs(f) * (arg mod d) + * + * to data->neg or data->pos depending on the sign of -f. + */ +static int extract_term_and_mod(struct isl_extract_mod_data *data, + __isl_take isl_aff *term, __isl_take isl_aff *arg) +{ + isl_ast_expr *expr; + int s; + + data->v = isl_val_div(data->v, isl_val_copy(data->d)); + s = isl_val_sgn(data->v); + data->v = isl_val_abs(data->v); + expr = isl_ast_expr_mod(data->v, arg, data->d, data->build); + isl_aff_free(arg); + if (s > 0) + data->neg = ast_expr_add(data->neg, expr); + else + data->pos = ast_expr_add(data->pos, expr); + data->aff = isl_aff_set_coefficient_si(data->aff, + isl_dim_div, data->i, 0); + if (s < 0) + data->v = isl_val_neg(data->v); + term = isl_aff_scale_val(data->div, isl_val_copy(data->v)); + + if (!data->add) + data->add = term; + else + data->add = isl_aff_add(data->add, term); + if (!data->add) + return -1; + + return 0; +} + +/* Given that data->v * div_i in data->aff is of the form + * + * f * d * floor(div/d) + * + * with div nonnegative on data->build, rewrite it as + * + * f * (div - (div mod d)) = f * div - f * (div mod d) + * + * and add + * + * f * div + * + * to data->add and + * + * abs(f) * (div mod d) + * + * to data->neg or data->pos depending on the sign of -f. + */ +static int extract_mod(struct isl_extract_mod_data *data) +{ + return extract_term_and_mod(data, isl_aff_copy(data->div), + isl_aff_copy(data->div)); +} + +/* Given that data->v * div_i in data->aff is of the form + * + * f * d * floor(div/d) (1) + * + * check if div is non-negative on data->build and, if so, + * extract the corresponding modulo from data->aff. + * If not, then check if + * + * -div + d - 1 + * + * is non-negative on data->build. If so, replace (1) by + * + * -f * d * floor((-div + d - 1)/d) + * + * and extract the corresponding modulo from data->aff. + * + * This function may modify data->div. + */ +static int extract_nonneg_mod(struct isl_extract_mod_data *data) +{ + int mod; + + mod = isl_ast_build_aff_is_nonneg(data->build, data->div); + if (mod < 0) + goto error; + if (mod) + return extract_mod(data); + + data->div = oppose_div_arg(data->div, isl_val_copy(data->d)); + mod = isl_ast_build_aff_is_nonneg(data->build, data->div); + if (mod < 0) + goto error; + if (mod) { + data->v = isl_val_neg(data->v); + return extract_mod(data); + } + + return 0; +error: + data->aff = isl_aff_free(data->aff); + return -1; +} + +/* Is the affine expression of constraint "c" "simpler" than data->nonneg + * for use in extracting a modulo expression? + * + * We currently only consider the constant term of the affine expression. + * In particular, we prefer the affine expression with the smallest constant + * term. + * This means that if there are two constraints, say x >= 0 and -x + 10 >= 0, + * then we would pick x >= 0 + * + * More detailed heuristics could be used if it turns out that there is a need. + */ +static int mod_constraint_is_simpler(struct isl_extract_mod_data *data, + __isl_keep isl_constraint *c) +{ + isl_val *v1, *v2; + int simpler; + + if (!data->nonneg) + return 1; + + v1 = isl_val_abs(isl_constraint_get_constant_val(c)); + v2 = isl_val_abs(isl_aff_get_constant_val(data->nonneg)); + simpler = isl_val_lt(v1, v2); + isl_val_free(v1); + isl_val_free(v2); + + return simpler; +} + +/* Check if the coefficients of "c" are either equal or opposite to those + * of data->div modulo data->d. If so, and if "c" is "simpler" than + * data->nonneg, then replace data->nonneg by the affine expression of "c" + * and set data->sign accordingly. + * + * Both "c" and data->div are assumed not to involve any integer divisions. + * + * Before we start the actual comparison, we first quickly check if + * "c" and data->div have the same non-zero coefficients. + * If not, then we assume that "c" is not of the desired form. + * Note that while the coefficients of data->div can be reasonably expected + * not to involve any coefficients that are multiples of d, "c" may + * very well involve such coefficients. This means that we may actually + * miss some cases. + */ +static isl_stat check_parallel_or_opposite(__isl_take isl_constraint *c, + void *user) +{ + struct isl_extract_mod_data *data = user; + enum isl_dim_type c_type[2] = { isl_dim_param, isl_dim_set }; + enum isl_dim_type a_type[2] = { isl_dim_param, isl_dim_in }; + int i, t; + int n[2]; + int parallel = 1, opposite = 1; + + for (t = 0; t < 2; ++t) { + n[t] = isl_constraint_dim(c, c_type[t]); + for (i = 0; i < n[t]; ++i) { + int a, b; + + a = isl_constraint_involves_dims(c, c_type[t], i, 1); + b = isl_aff_involves_dims(data->div, a_type[t], i, 1); + if (a != b) + parallel = opposite = 0; + } + } + + for (t = 0; t < 2; ++t) { + for (i = 0; i < n[t]; ++i) { + isl_val *v1, *v2; + + if (!parallel && !opposite) + break; + v1 = isl_constraint_get_coefficient_val(c, + c_type[t], i); + v2 = isl_aff_get_coefficient_val(data->div, + a_type[t], i); + if (parallel) { + v1 = isl_val_sub(v1, isl_val_copy(v2)); + parallel = isl_val_is_divisible_by(v1, data->d); + v1 = isl_val_add(v1, isl_val_copy(v2)); + } + if (opposite) { + v1 = isl_val_add(v1, isl_val_copy(v2)); + opposite = isl_val_is_divisible_by(v1, data->d); + } + isl_val_free(v1); + isl_val_free(v2); + } + } + + if ((parallel || opposite) && mod_constraint_is_simpler(data, c)) { + isl_aff_free(data->nonneg); + data->nonneg = isl_constraint_get_aff(c); + data->sign = parallel ? 1 : -1; + } + + isl_constraint_free(c); + + if (data->sign != 0 && data->nonneg == NULL) + return isl_stat_error; + + return isl_stat_ok; +} + +/* Given that data->v * div_i in data->aff is of the form + * + * f * d * floor(div/d) (1) + * + * see if we can find an expression div' that is non-negative over data->build + * and that is related to div through + * + * div' = div + d * e + * + * or + * + * div' = -div + d - 1 + d * e + * + * with e some affine expression. + * If so, we write (1) as + * + * f * div + f * (div' mod d) + * + * or + * + * -f * (-div + d - 1) - f * (div' mod d) + * + * exploiting (in the second case) the fact that + * + * f * d * floor(div/d) = -f * d * floor((-div + d - 1)/d) + * + * + * We first try to find an appropriate expression for div' + * from the constraints of data->build->domain (which is therefore + * guaranteed to be non-negative on data->build), where we remove + * any integer divisions from the constraints and skip this step + * if "div" itself involves any integer divisions. + * If we cannot find an appropriate expression this way, then + * we pass control to extract_nonneg_mod where check + * if div or "-div + d -1" themselves happen to be + * non-negative on data->build. + * + * While looking for an appropriate constraint in data->build->domain, + * we ignore the constant term, so after finding such a constraint, + * we still need to fix up the constant term. + * In particular, if a is the constant term of "div" + * (or d - 1 - the constant term of "div" if data->sign < 0) + * and b is the constant term of the constraint, then we need to find + * a non-negative constant c such that + * + * b + c \equiv a mod d + * + * We therefore take + * + * c = (a - b) mod d + * + * and add it to b to obtain the constant term of div'. + * If this constant term is "too negative", then we add an appropriate + * multiple of d to make it positive. + * + * + * Note that the above is a only a very simple heuristic for finding an + * appropriate expression. We could try a bit harder by also considering + * sums of constraints that involve disjoint sets of variables or + * we could consider arbitrary linear combinations of constraints, + * although that could potentially be much more expensive as it involves + * the solution of an LP problem. + * + * In particular, if v_i is a column vector representing constraint i, + * w represents div and e_i is the i-th unit vector, then we are looking + * for a solution of the constraints + * + * \sum_i lambda_i v_i = w + \sum_i alpha_i d e_i + * + * with \lambda_i >= 0 and alpha_i of unrestricted sign. + * If we are not just interested in a non-negative expression, but + * also in one with a minimal range, then we don't just want + * c = \sum_i lambda_i v_i to be non-negative over the domain, + * but also beta - c = \sum_i mu_i v_i, where beta is a scalar + * that we want to minimize and we now also have to take into account + * the constant terms of the constraints. + * Alternatively, we could first compute the dual of the domain + * and plug in the constraints on the coefficients. + */ +static int try_extract_mod(struct isl_extract_mod_data *data) +{ + isl_basic_set *hull; + isl_val *v1, *v2; + int r, n; + + if (!data->build) + goto error; + + n = isl_aff_dim(data->div, isl_dim_div); + + if (isl_aff_involves_dims(data->div, isl_dim_div, 0, n)) + return extract_nonneg_mod(data); + + hull = isl_set_simple_hull(isl_set_copy(data->build->domain)); + hull = isl_basic_set_remove_divs(hull); + data->sign = 0; + data->nonneg = NULL; + r = isl_basic_set_foreach_constraint(hull, &check_parallel_or_opposite, + data); + isl_basic_set_free(hull); + + if (!data->sign || r < 0) { + isl_aff_free(data->nonneg); + if (r < 0) + goto error; + return extract_nonneg_mod(data); + } + + v1 = isl_aff_get_constant_val(data->div); + v2 = isl_aff_get_constant_val(data->nonneg); + if (data->sign < 0) { + v1 = isl_val_neg(v1); + v1 = isl_val_add(v1, isl_val_copy(data->d)); + v1 = isl_val_sub_ui(v1, 1); + } + v1 = isl_val_sub(v1, isl_val_copy(v2)); + v1 = isl_val_mod(v1, isl_val_copy(data->d)); + v1 = isl_val_add(v1, v2); + v2 = isl_val_div(isl_val_copy(v1), isl_val_copy(data->d)); + v2 = isl_val_ceil(v2); + if (isl_val_is_neg(v2)) { + v2 = isl_val_mul(v2, isl_val_copy(data->d)); + v1 = isl_val_sub(v1, isl_val_copy(v2)); + } + data->nonneg = isl_aff_set_constant_val(data->nonneg, v1); + isl_val_free(v2); + + if (data->sign < 0) { + data->div = oppose_div_arg(data->div, isl_val_copy(data->d)); + data->v = isl_val_neg(data->v); + } + + return extract_term_and_mod(data, + isl_aff_copy(data->div), data->nonneg); +error: + data->aff = isl_aff_free(data->aff); + return -1; +} + +/* Check if "data->aff" involves any (implicit) modulo computations based + * on div "data->i". * If so, remove them from aff and add expressions corresponding - * to those modulo computations to *pos and/or *neg. - * "v" is the coefficient of div "j". + * to those modulo computations to data->pos and/or data->neg. + * + * "aff" is assumed to be an integer affine expression. * - * In particular, check if (v * div_j) / d is of the form + * In particular, check if (v * div_j) is of the form * - * (f * m * floor(a / m)) / d + * f * m * floor(a / m) * * and, if so, rewrite it as * - * (f * (a - (a mod m))) / d = (f * a) / d - (f * (a mod m)) / d + * f * (a - (a mod m)) = f * a - f * (a mod m) * * and extract out -f * (a mod m). * In particular, if f > 0, we add (f * (a mod m)) to *neg. @@ -374,66 +891,19 @@ * floor(a/m) = -ceil(-a/m) = -floor((-a + m - 1)/m) * * and still extract a modulo. - * - * The caller is responsible for dividing *neg and/or *pos by d. */ -static __isl_give isl_aff *extract_modulo(__isl_take isl_aff *aff, - __isl_keep isl_ast_expr **pos, __isl_keep isl_ast_expr **neg, - __isl_keep isl_ast_build *build, int j, __isl_take isl_val *v) +static int extract_modulo(struct isl_extract_mod_data *data) { - isl_ast_expr *expr; - isl_aff *div; - int s; - int mod; - isl_val *d; - - div = isl_aff_get_div(aff, j); - d = isl_aff_get_denominator_val(div); - mod = isl_val_is_divisible_by(v, d); - if (mod) { - div = isl_aff_scale_val(div, isl_val_copy(d)); - mod = isl_ast_build_aff_is_nonneg(build, div); - if (mod >= 0 && !mod) { - isl_aff *opp = oppose_div_arg(isl_aff_copy(div), - isl_val_copy(d)); - mod = isl_ast_build_aff_is_nonneg(build, opp); - if (mod >= 0 && mod) { - isl_aff_free(div); - div = opp; - v = isl_val_neg(v); - } else - isl_aff_free(opp); - } - } - if (mod < 0) { - isl_aff_free(div); - isl_val_free(d); - isl_val_free(v); - return isl_aff_free(aff); - } else if (!mod) { - isl_aff_free(div); - isl_val_free(d); - isl_val_free(v); - return aff; + data->div = isl_aff_get_div(data->aff, data->i); + data->d = isl_aff_get_denominator_val(data->div); + if (isl_val_is_divisible_by(data->v, data->d)) { + data->div = isl_aff_scale_val(data->div, isl_val_copy(data->d)); + if (try_extract_mod(data) < 0) + data->aff = isl_aff_free(data->aff); } - v = isl_val_div(v, isl_val_copy(d)); - s = isl_val_sgn(v); - v = isl_val_abs(v); - expr = isl_ast_expr_mod(v, div, d, build); - isl_val_free(d); - if (s > 0) - *neg = ast_expr_add(*neg, expr); - else - *pos = ast_expr_add(*pos, expr); - aff = isl_aff_set_coefficient_si(aff, isl_dim_div, j, 0); - if (s < 0) - v = isl_val_neg(v); - div = isl_aff_scale_val(div, v); - d = isl_aff_get_denominator_val(aff); - div = isl_aff_scale_down_val(div, d); - aff = isl_aff_add(aff, div); - - return aff; + isl_aff_free(data->div); + isl_val_free(data->d); + return 0; } /* Check if "aff" involves any (implicit) modulo computations. @@ -463,8 +933,9 @@ __isl_keep isl_ast_expr **pos, __isl_keep isl_ast_expr **neg, __isl_keep isl_ast_build *build) { + struct isl_extract_mod_data data = { build, aff, *pos, *neg }; isl_ctx *ctx; - int j, n; + int n; if (!aff) return NULL; @@ -473,94 +944,177 @@ if (!isl_options_get_ast_build_prefer_pdiv(ctx)) return aff; - n = isl_aff_dim(aff, isl_dim_div); - for (j = 0; j < n; ++j) { - isl_val *v; - - v = isl_aff_get_coefficient_val(aff, isl_dim_div, j); - if (!v) + n = isl_aff_dim(data.aff, isl_dim_div); + for (data.i = 0; data.i < n; ++data.i) { + data.v = isl_aff_get_coefficient_val(data.aff, + isl_dim_div, data.i); + if (!data.v) return isl_aff_free(aff); - if (isl_val_is_zero(v) || - isl_val_is_one(v) || isl_val_is_negone(v)) { - isl_val_free(v); + if (isl_val_is_zero(data.v) || + isl_val_is_one(data.v) || isl_val_is_negone(data.v)) { + isl_val_free(data.v); continue; } - aff = extract_modulo(aff, pos, neg, build, j, v); - if (!aff) + if (extract_modulo(&data) < 0) + data.aff = isl_aff_free(data.aff); + isl_val_free(data.v); + if (!data.aff) break; } - return aff; + if (data.add) + data.aff = isl_aff_add(data.aff, data.add); + + *pos = data.pos; + *neg = data.neg; + return data.aff; } -/* Construct an isl_ast_expr that evaluates the affine expression "aff", - * The result is simplified in terms of build->domain. +/* Check if aff involves any non-integer coefficients. + * If so, split aff into * - * We first extract hidden modulo computations from the affine expression - * and then add terms for each variable with a non-zero coefficient. - * Finally, if the affine expression has a non-trivial denominator, - * we divide the resulting isl_ast_expr by this denominator. + * aff = aff1 + (aff2 / d) + * + * with both aff1 and aff2 having only integer coefficients. + * Return aff1 and add (aff2 / d) to *expr. */ -__isl_give isl_ast_expr *isl_ast_expr_from_aff(__isl_take isl_aff *aff, - __isl_keep isl_ast_build *build) +static __isl_give isl_aff *extract_rational(__isl_take isl_aff *aff, + __isl_keep isl_ast_expr **expr, __isl_keep isl_ast_build *build) { - int i, j; - int n; + int i, j, n; + isl_aff *rat = NULL; + isl_local_space *ls = NULL; + isl_ast_expr *rat_expr; isl_val *v, *d; - isl_ctx *ctx = isl_aff_get_ctx(aff); - isl_ast_expr *expr, *expr_neg; enum isl_dim_type t[] = { isl_dim_param, isl_dim_in, isl_dim_div }; enum isl_dim_type l[] = { isl_dim_param, isl_dim_set, isl_dim_div }; - isl_local_space *ls; if (!aff) return NULL; - - expr = isl_ast_expr_alloc_int_si(ctx, 0); - expr_neg = isl_ast_expr_alloc_int_si(ctx, 0); - d = isl_aff_get_denominator_val(aff); - aff = isl_aff_scale_val(aff, isl_val_copy(d)); + if (!d) + goto error; + if (isl_val_is_one(d)) { + isl_val_free(d); + return aff; + } - aff = extract_modulos(aff, &expr, &expr_neg, build); - expr = ast_expr_sub(expr, expr_neg); + aff = isl_aff_scale_val(aff, isl_val_copy(d)); ls = isl_aff_get_domain_local_space(aff); + rat = isl_aff_zero_on_domain(isl_local_space_copy(ls)); for (i = 0; i < 3; ++i) { n = isl_aff_dim(aff, t[i]); for (j = 0; j < n; ++j) { + isl_aff *rat_j; + v = isl_aff_get_coefficient_val(aff, t[i], j); if (!v) - expr = isl_ast_expr_free(expr); - if (isl_val_is_zero(v)) { + goto error; + if (isl_val_is_divisible_by(v, d)) { isl_val_free(v); continue; } - expr = isl_ast_expr_add_term(expr, - ls, l[i], j, v, build); + rat_j = isl_aff_var_on_domain(isl_local_space_copy(ls), + l[i], j); + rat_j = isl_aff_scale_val(rat_j, v); + rat = isl_aff_add(rat, rat_j); } } v = isl_aff_get_constant_val(aff); - expr = isl_ast_expr_add_int(expr, v); + if (isl_val_is_divisible_by(v, d)) { + isl_val_free(v); + } else { + isl_aff *rat_0; - if (!isl_val_is_one(d)) - expr = isl_ast_expr_div(expr, isl_ast_expr_from_val(d)); - else - isl_val_free(d); + rat_0 = isl_aff_val_on_domain(isl_local_space_copy(ls), v); + rat = isl_aff_add(rat, rat_0); + } isl_local_space_free(ls); - isl_aff_free(aff); - return expr; -} -/* Add terms to "expr" for each variable in "aff" with a coefficient - * with sign equal to "sign". + aff = isl_aff_sub(aff, isl_aff_copy(rat)); + aff = isl_aff_scale_down_val(aff, isl_val_copy(d)); + + rat_expr = isl_ast_expr_from_aff(rat, build); + rat_expr = isl_ast_expr_div(rat_expr, isl_ast_expr_from_val(d)); + *expr = ast_expr_add(*expr, rat_expr); + + return aff; +error: + isl_aff_free(rat); + isl_local_space_free(ls); + isl_aff_free(aff); + isl_val_free(d); + return NULL; +} + +/* Construct an isl_ast_expr that evaluates the affine expression "aff", * The result is simplified in terms of build->domain. + * + * We first extract hidden modulo computations from the affine expression + * and then add terms for each variable with a non-zero coefficient. + * Finally, if the affine expression has a non-trivial denominator, + * we divide the resulting isl_ast_expr by this denominator. + */ +__isl_give isl_ast_expr *isl_ast_expr_from_aff(__isl_take isl_aff *aff, + __isl_keep isl_ast_build *build) +{ + int i, j; + int n; + isl_val *v; + isl_ctx *ctx = isl_aff_get_ctx(aff); + isl_ast_expr *expr, *expr_neg; + enum isl_dim_type t[] = { isl_dim_param, isl_dim_in, isl_dim_div }; + enum isl_dim_type l[] = { isl_dim_param, isl_dim_set, isl_dim_div }; + isl_local_space *ls; + struct isl_ast_add_term_data data; + + if (!aff) + return NULL; + + expr = isl_ast_expr_alloc_int_si(ctx, 0); + expr_neg = isl_ast_expr_alloc_int_si(ctx, 0); + + aff = extract_rational(aff, &expr, build); + + aff = extract_modulos(aff, &expr, &expr_neg, build); + expr = ast_expr_sub(expr, expr_neg); + + ls = isl_aff_get_domain_local_space(aff); + + data.build = build; + data.cst = isl_aff_get_constant_val(aff); + for (i = 0; i < 3; ++i) { + n = isl_aff_dim(aff, t[i]); + for (j = 0; j < n; ++j) { + v = isl_aff_get_coefficient_val(aff, t[i], j); + if (!v) + expr = isl_ast_expr_free(expr); + if (isl_val_is_zero(v)) { + isl_val_free(v); + continue; + } + expr = isl_ast_expr_add_term(expr, + ls, l[i], j, v, &data); + } + } + + expr = isl_ast_expr_add_int(expr, data.cst); + + isl_local_space_free(ls); + isl_aff_free(aff); + return expr; +} + +/* Add terms to "expr" for each variable in "aff" with a coefficient + * with sign equal to "sign". + * The result is simplified in terms of data->build->domain. */ static __isl_give isl_ast_expr *add_signed_terms(__isl_take isl_ast_expr *expr, - __isl_keep isl_aff *aff, int sign, __isl_keep isl_ast_build *build) + __isl_keep isl_aff *aff, int sign, struct isl_ast_add_term_data *data) { int i, j; isl_val *v; @@ -580,7 +1134,7 @@ } v = isl_val_abs(v); expr = isl_ast_expr_add_term(expr, - ls, l[i], j, v, build); + ls, l[i], j, v, data); } } @@ -608,10 +1162,143 @@ return isl_val_is_pos(v); } +/* Check if the equality + * + * aff = 0 + * + * represents a stride constraint on the integer division "pos". + * + * In particular, if the integer division "pos" is equal to + * + * floor(e/d) + * + * then check if aff is equal to + * + * e - d floor(e/d) + * + * or its opposite. + * + * If so, the equality is exactly + * + * e mod d = 0 + * + * Note that in principle we could also accept + * + * e - d floor(e'/d) + * + * where e and e' differ by a constant. + */ +static int is_stride_constraint(__isl_keep isl_aff *aff, int pos) +{ + isl_aff *div; + isl_val *c, *d; + int eq; + + div = isl_aff_get_div(aff, pos); + c = isl_aff_get_coefficient_val(aff, isl_dim_div, pos); + d = isl_aff_get_denominator_val(div); + eq = isl_val_abs_eq(c, d); + if (eq >= 0 && eq) { + aff = isl_aff_copy(aff); + aff = isl_aff_set_coefficient_si(aff, isl_dim_div, pos, 0); + div = isl_aff_scale_val(div, d); + if (isl_val_is_pos(c)) + div = isl_aff_neg(div); + eq = isl_aff_plain_is_equal(div, aff); + isl_aff_free(aff); + } else + isl_val_free(d); + isl_val_free(c); + isl_aff_free(div); + + return eq; +} + +/* Are all coefficients of "aff" (zero or) negative? + */ +static int all_negative_coefficients(__isl_keep isl_aff *aff) +{ + int i, n; + + if (!aff) + return 0; + + n = isl_aff_dim(aff, isl_dim_param); + for (i = 0; i < n; ++i) + if (isl_aff_coefficient_sgn(aff, isl_dim_param, i) > 0) + return 0; + + n = isl_aff_dim(aff, isl_dim_in); + for (i = 0; i < n; ++i) + if (isl_aff_coefficient_sgn(aff, isl_dim_in, i) > 0) + return 0; + + return 1; +} + +/* Give an equality of the form + * + * aff = e - d floor(e/d) = 0 + * + * or + * + * aff = -e + d floor(e/d) = 0 + * + * with the integer division "pos" equal to floor(e/d), + * construct the AST expression + * + * (isl_ast_op_eq, (isl_ast_op_zdiv_r, expr(e), expr(d)), expr(0)) + * + * If e only has negative coefficients, then construct + * + * (isl_ast_op_eq, (isl_ast_op_zdiv_r, expr(-e), expr(d)), expr(0)) + * + * instead. + */ +static __isl_give isl_ast_expr *extract_stride_constraint( + __isl_take isl_aff *aff, int pos, __isl_keep isl_ast_build *build) +{ + isl_ctx *ctx; + isl_val *c; + isl_ast_expr *expr, *cst; + + if (!aff) + return NULL; + + ctx = isl_aff_get_ctx(aff); + + c = isl_aff_get_coefficient_val(aff, isl_dim_div, pos); + aff = isl_aff_set_coefficient_si(aff, isl_dim_div, pos, 0); + + if (all_negative_coefficients(aff)) + aff = isl_aff_neg(aff); + + cst = isl_ast_expr_from_val(isl_val_abs(c)); + expr = isl_ast_expr_from_aff(aff, build); + + expr = isl_ast_expr_alloc_binary(isl_ast_op_zdiv_r, expr, cst); + cst = isl_ast_expr_alloc_int_si(ctx, 0); + expr = isl_ast_expr_alloc_binary(isl_ast_op_eq, expr, cst); + + return expr; +} + /* Construct an isl_ast_expr that evaluates the condition "constraint", * The result is simplified in terms of build->domain. * - * Let the constraint by either "a >= 0" or "a == 0". + * We first check if the constraint is an equality of the form + * + * e - d floor(e/d) = 0 + * + * i.e., + * + * e mod d = 0 + * + * If so, we convert it to + * + * (isl_ast_op_eq, (isl_ast_op_zdiv_r, expr(e), expr(d)), expr(0)) + * + * Otherwise, let the constraint by either "a >= 0" or "a == 0". * We first extract hidden modulo computations from "a" * and then collect all the terms with a positive coefficient in cons_pos * and the terms with a negative coefficient in cons_neg. @@ -635,39 +1322,54 @@ static __isl_give isl_ast_expr *isl_ast_expr_from_constraint( __isl_take isl_constraint *constraint, __isl_keep isl_ast_build *build) { + int i, n; isl_ctx *ctx; isl_ast_expr *expr_pos; isl_ast_expr *expr_neg; isl_ast_expr *expr; isl_aff *aff; - isl_val *v; int eq; enum isl_ast_op_type type; + struct isl_ast_add_term_data data; if (!constraint) return NULL; aff = isl_constraint_get_aff(constraint); + eq = isl_constraint_is_equality(constraint); + isl_constraint_free(constraint); + + n = isl_aff_dim(aff, isl_dim_div); + if (eq && n > 0) + for (i = 0; i < n; ++i) { + int is_stride; + is_stride = is_stride_constraint(aff, i); + if (is_stride < 0) + goto error; + if (is_stride) + return extract_stride_constraint(aff, i, build); + } - ctx = isl_constraint_get_ctx(constraint); + ctx = isl_aff_get_ctx(aff); expr_pos = isl_ast_expr_alloc_int_si(ctx, 0); expr_neg = isl_ast_expr_alloc_int_si(ctx, 0); aff = extract_modulos(aff, &expr_pos, &expr_neg, build); - expr_pos = add_signed_terms(expr_pos, aff, 1, build); - expr_neg = add_signed_terms(expr_neg, aff, -1, build); + data.build = build; + data.cst = isl_aff_get_constant_val(aff); + expr_pos = add_signed_terms(expr_pos, aff, 1, &data); + data.cst = isl_val_neg(data.cst); + expr_neg = add_signed_terms(expr_neg, aff, -1, &data); + data.cst = isl_val_neg(data.cst); - v = isl_aff_get_constant_val(aff); - if (constant_is_considered_positive(v, expr_pos, expr_neg)) { - expr_pos = isl_ast_expr_add_int(expr_pos, v); + if (constant_is_considered_positive(data.cst, expr_pos, expr_neg)) { + expr_pos = isl_ast_expr_add_int(expr_pos, data.cst); } else { - v = isl_val_neg(v); - expr_neg = isl_ast_expr_add_int(expr_neg, v); + data.cst = isl_val_neg(data.cst); + expr_neg = isl_ast_expr_add_int(expr_neg, data.cst); } - eq = isl_constraint_is_equality(constraint); - if (isl_ast_expr_get_type(expr_pos) == isl_ast_expr_int && isl_ast_expr_get_type(expr_neg) != isl_ast_expr_int) { type = eq ? isl_ast_op_eq : isl_ast_op_le; @@ -677,68 +1379,92 @@ expr = isl_ast_expr_alloc_binary(type, expr_pos, expr_neg); } - isl_constraint_free(constraint); isl_aff_free(aff); return expr; +error: + isl_aff_free(aff); + return NULL; } -struct isl_expr_from_basic_data { - isl_ast_build *build; - int first; - isl_ast_expr *res; -}; - -/* Construct an isl_ast_expr that evaluates the condition "c", - * except if it is a div constraint, and add it to the data->res. - * The result is simplified in terms of data->build->domain. - */ -static int expr_from_basic_set(__isl_take isl_constraint *c, void *user) -{ - struct isl_expr_from_basic_data *data = user; - isl_ast_expr *expr; - - if (isl_constraint_is_div_constraint(c)) { - isl_constraint_free(c); - return 0; - } - - expr = isl_ast_expr_from_constraint(c, data->build); - if (data->first) - data->res = expr; - else - data->res = isl_ast_expr_and(data->res, expr); - - data->first = 0; - - if (!data->res) - return -1; - return 0; +/* Wrapper around isl_constraint_cmp_last_non_zero for use + * as a callback to isl_constraint_list_sort. + * If isl_constraint_cmp_last_non_zero cannot tell the constraints + * apart, then use isl_constraint_plain_cmp instead. + */ +static int cmp_constraint(__isl_keep isl_constraint *a, + __isl_keep isl_constraint *b, void *user) +{ + int cmp; + + cmp = isl_constraint_cmp_last_non_zero(a, b); + if (cmp != 0) + return cmp; + return isl_constraint_plain_cmp(a, b); } /* Construct an isl_ast_expr that evaluates the conditions defining "bset". * The result is simplified in terms of build->domain. * - * We filter out the div constraints during printing, so we do not know - * in advance how many constraints are going to be printed. - * - * If it turns out that there was no constraint, then we contruct + * If "bset" is not bounded by any constraint, then we contruct * the expression "1", i.e., "true". + * + * Otherwise, we sort the constraints, putting constraints that involve + * integer divisions after those that do not, and construct an "and" + * of the ast expressions of the individual constraints. + * + * Each constraint is added to the generated constraints of the build + * after it has been converted to an AST expression so that it can be used + * to simplify the following constraints. This may change the truth value + * of subsequent constraints that do not satisfy the earlier constraints, + * but this does not affect the outcome of the conjunction as it is + * only true if all the conjuncts are true (no matter in what order + * they are evaluated). In particular, the constraints that do not + * involve integer divisions may serve to simplify some constraints + * that do involve integer divisions. */ __isl_give isl_ast_expr *isl_ast_build_expr_from_basic_set( __isl_keep isl_ast_build *build, __isl_take isl_basic_set *bset) { - struct isl_expr_from_basic_data data = { build, 1, NULL }; + int i, n; + isl_constraint *c; + isl_constraint_list *list; + isl_ast_expr *res; + isl_set *set; - if (isl_basic_set_foreach_constraint(bset, - &expr_from_basic_set, &data) < 0) { - data.res = isl_ast_expr_free(data.res); - } else if (data.res == NULL) { + list = isl_basic_set_get_constraint_list(bset); + isl_basic_set_free(bset); + list = isl_constraint_list_sort(list, &cmp_constraint, NULL); + if (!list) + return NULL; + n = isl_constraint_list_n_constraint(list); + if (n == 0) { isl_ctx *ctx = isl_basic_set_get_ctx(bset); - data.res = isl_ast_expr_alloc_int_si(ctx, 1); + isl_constraint_list_free(list); + return isl_ast_expr_alloc_int_si(ctx, 1); } - isl_basic_set_free(bset); - return data.res; + build = isl_ast_build_copy(build); + + c = isl_constraint_list_get_constraint(list, 0); + bset = isl_basic_set_from_constraint(isl_constraint_copy(c)); + set = isl_set_from_basic_set(bset); + res = isl_ast_expr_from_constraint(c, build); + build = isl_ast_build_restrict_generated(build, set); + + for (i = 1; i < n; ++i) { + isl_ast_expr *expr; + + c = isl_constraint_list_get_constraint(list, i); + bset = isl_basic_set_from_constraint(isl_constraint_copy(c)); + set = isl_set_from_basic_set(bset); + expr = isl_ast_expr_from_constraint(c, build); + build = isl_ast_build_restrict_generated(build, set); + res = isl_ast_expr_and(res, expr); + } + + isl_constraint_list_free(list); + isl_ast_build_free(build); + return res; } struct isl_expr_from_set_data { @@ -751,7 +1477,7 @@ * and add it to data->res. * The result is simplified in terms of data->build->domain. */ -static int expr_from_set(__isl_take isl_basic_set *bset, void *user) +static isl_stat expr_from_set(__isl_take isl_basic_set *bset, void *user) { struct isl_expr_from_set_data *data = user; isl_ast_expr *expr; @@ -765,25 +1491,59 @@ data->first = 0; if (!data->res) - return -1; - return 0; + return isl_stat_error; + return isl_stat_ok; } /* Construct an isl_ast_expr that evaluates the conditions defining "set". * The result is simplified in terms of build->domain. + * + * If "set" is an (obviously) empty set, then return the expression "0". + * + * "set" lives in the internal schedule space. */ -__isl_give isl_ast_expr *isl_ast_build_expr_from_set( +__isl_give isl_ast_expr *isl_ast_build_expr_from_set_internal( __isl_keep isl_ast_build *build, __isl_take isl_set *set) { struct isl_expr_from_set_data data = { build, 1, NULL }; if (isl_set_foreach_basic_set(set, &expr_from_set, &data) < 0) data.res = isl_ast_expr_free(data.res); + else if (data.first) { + isl_ctx *ctx = isl_ast_build_get_ctx(build); + data.res = isl_ast_expr_from_val(isl_val_zero(ctx)); + } isl_set_free(set); return data.res; } +/* Construct an isl_ast_expr that evaluates the conditions defining "set". + * The result is simplified in terms of build->domain. + * + * If "set" is an (obviously) empty set, then return the expression "0". + * + * "set" lives in the external schedule space. + * + * The internal AST expression generation assumes that there are + * no unknown divs, so make sure an explicit representation is available. + * Since the set comes from the outside, it may have constraints that + * are redundant with respect to the build domain. Remove them first. + */ +__isl_give isl_ast_expr *isl_ast_build_expr_from_set( + __isl_keep isl_ast_build *build, __isl_take isl_set *set) +{ + if (isl_ast_build_need_schedule_map(build)) { + isl_multi_aff *ma; + ma = isl_ast_build_get_schedule_map_multi_aff(build); + set = isl_set_preimage_multi_aff(set, ma); + } + + set = isl_set_compute_divs(set); + set = isl_ast_build_compute_gist(build, set); + return isl_ast_build_expr_from_set_internal(build, set); +} + struct isl_from_pw_aff_data { isl_ast_build *build; int n; @@ -801,39 +1561,50 @@ * If this is the last pair, then data->next is set to evaluate aff * and the domain is ignored. * Otherwise, data->next is set to a select operation that selects - * an isl_ast_expr correponding to "aff" on "set" and to an expression + * an isl_ast_expr corresponding to "aff" on "set" and to an expression * that will be filled in by later calls otherwise. + * + * In both cases, the constraints of "set" are added to the generated + * constraints of the build such that they can be exploited to simplify + * the AST expression constructed from "aff". */ -static int ast_expr_from_pw_aff(__isl_take isl_set *set, +static isl_stat ast_expr_from_pw_aff(__isl_take isl_set *set, __isl_take isl_aff *aff, void *user) { struct isl_from_pw_aff_data *data = user; isl_ctx *ctx; + isl_ast_build *build; ctx = isl_set_get_ctx(set); data->n--; if (data->n == 0) { - *data->next = isl_ast_expr_from_aff(aff, data->build); - isl_set_free(set); + build = isl_ast_build_copy(data->build); + build = isl_ast_build_restrict_generated(build, set); + *data->next = isl_ast_expr_from_aff(aff, build); + isl_ast_build_free(build); if (!*data->next) - return -1; + return isl_stat_error; } else { isl_ast_expr *ternary, *arg; + isl_set *gist; ternary = isl_ast_expr_alloc_op(ctx, isl_ast_op_select, 3); - set = isl_set_gist(set, isl_set_copy(data->dom)); - arg = isl_ast_build_expr_from_set(data->build, set); + gist = isl_set_gist(isl_set_copy(set), isl_set_copy(data->dom)); + arg = isl_ast_build_expr_from_set_internal(data->build, gist); ternary = isl_ast_expr_set_op_arg(ternary, 0, arg); - arg = isl_ast_expr_from_aff(aff, data->build); + build = isl_ast_build_copy(data->build); + build = isl_ast_build_restrict_generated(build, set); + arg = isl_ast_expr_from_aff(aff, build); + isl_ast_build_free(build); ternary = isl_ast_expr_set_op_arg(ternary, 1, arg); if (!ternary) - return -1; + return isl_stat_error; *data->next = ternary; data->next = &ternary->u.op.args[2]; } - return 0; + return isl_stat_ok; } /* Construct an isl_ast_expr that evaluates "pa". @@ -847,6 +1618,8 @@ struct isl_from_pw_aff_data data; isl_ast_expr *res = NULL; + pa = isl_ast_build_compute_gist_pw_aff(build, pa); + pa = isl_pw_aff_coalesce(pa); if (!pa) return NULL; @@ -885,102 +1658,258 @@ return expr; } -/* Set the ids of the input dimensions of "pma" to the iterator ids +/* Set the ids of the input dimensions of "mpa" to the iterator ids * of "build". * - * The domain of "pma" is assumed to live in the internal schedule domain. + * The domain of "mpa" is assumed to live in the internal schedule domain. */ -static __isl_give isl_pw_multi_aff *set_iterator_names( - __isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma) +static __isl_give isl_multi_pw_aff *set_iterator_names( + __isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa) { int i, n; - n = isl_pw_multi_aff_dim(pma, isl_dim_in); + n = isl_multi_pw_aff_dim(mpa, isl_dim_in); for (i = 0; i < n; ++i) { isl_id *id; id = isl_ast_build_get_iterator_id(build, i); - pma = isl_pw_multi_aff_set_dim_id(pma, isl_dim_in, i, id); + mpa = isl_multi_pw_aff_set_dim_id(mpa, isl_dim_in, i, id); } - return pma; + return mpa; } -/* Construct an isl_ast_expr that calls the domain element specified by "pma". - * The name of the function is obtained from the output tuple name. - * The arguments are given by the piecewise affine expressions. - * - * The domain of "pma" is assumed to live in the internal schedule domain. +/* Construct an isl_ast_expr of type "type" with as first argument "arg0" and + * the remaining arguments derived from "mpa". + * That is, construct a call or access expression that calls/accesses "arg0" + * with arguments/indices specified by "mpa". */ -static __isl_give isl_ast_expr *isl_ast_build_call_from_pw_multi_aff_internal( - __isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma) +static __isl_give isl_ast_expr *isl_ast_build_with_arguments( + __isl_keep isl_ast_build *build, enum isl_ast_op_type type, + __isl_take isl_ast_expr *arg0, __isl_take isl_multi_pw_aff *mpa) { int i, n; isl_ctx *ctx; - isl_id *id; isl_ast_expr *expr; - pma = set_iterator_names(build, pma); - if (!build || !pma) - return isl_pw_multi_aff_free(pma); - ctx = isl_ast_build_get_ctx(build); - n = isl_pw_multi_aff_dim(pma, isl_dim_out); - expr = isl_ast_expr_alloc_op(ctx, isl_ast_op_call, 1 + n); - if (isl_pw_multi_aff_has_tuple_id(pma, isl_dim_out)) - id = isl_pw_multi_aff_get_tuple_id(pma, isl_dim_out); - else - id = isl_id_alloc(ctx, "", NULL); - - expr = isl_ast_expr_set_op_arg(expr, 0, isl_ast_expr_from_id(id)); + n = isl_multi_pw_aff_dim(mpa, isl_dim_out); + expr = isl_ast_expr_alloc_op(ctx, type, 1 + n); + expr = isl_ast_expr_set_op_arg(expr, 0, arg0); for (i = 0; i < n; ++i) { isl_pw_aff *pa; isl_ast_expr *arg; - pa = isl_pw_multi_aff_get_pw_aff(pma, i); + pa = isl_multi_pw_aff_get_pw_aff(mpa, i); arg = isl_ast_build_expr_from_pw_aff_internal(build, pa); expr = isl_ast_expr_set_op_arg(expr, 1 + i, arg); } - isl_pw_multi_aff_free(pma); + isl_multi_pw_aff_free(mpa); return expr; } -/* Construct an isl_ast_expr that calls the domain element specified by "pma". - * The name of the function is obtained from the output tuple name. - * The arguments are given by the piecewise affine expressions. +static __isl_give isl_ast_expr *isl_ast_build_from_multi_pw_aff_internal( + __isl_keep isl_ast_build *build, enum isl_ast_op_type type, + __isl_take isl_multi_pw_aff *mpa); + +/* Construct an isl_ast_expr that accesses the member specified by "mpa". + * The range of "mpa" is assumed to be wrapped relation. + * The domain of this wrapped relation specifies the structure being + * accessed, while the range of this wrapped relation spacifies the + * member of the structure being accessed. * - * The domain of "pma" is assumed to live in the external schedule domain. + * The domain of "mpa" is assumed to live in the internal schedule domain. */ -__isl_give isl_ast_expr *isl_ast_build_call_from_pw_multi_aff( - __isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma) +static __isl_give isl_ast_expr *isl_ast_build_from_multi_pw_aff_member( + __isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa) +{ + isl_id *id; + isl_multi_pw_aff *domain; + isl_ast_expr *domain_expr, *expr; + enum isl_ast_op_type type = isl_ast_op_access; + + domain = isl_multi_pw_aff_copy(mpa); + domain = isl_multi_pw_aff_range_factor_domain(domain); + domain_expr = isl_ast_build_from_multi_pw_aff_internal(build, + type, domain); + mpa = isl_multi_pw_aff_range_factor_range(mpa); + if (!isl_multi_pw_aff_has_tuple_id(mpa, isl_dim_out)) + isl_die(isl_ast_build_get_ctx(build), isl_error_invalid, + "missing field name", goto error); + id = isl_multi_pw_aff_get_tuple_id(mpa, isl_dim_out); + expr = isl_ast_expr_from_id(id); + expr = isl_ast_expr_alloc_binary(isl_ast_op_member, domain_expr, expr); + return isl_ast_build_with_arguments(build, type, expr, mpa); +error: + isl_multi_pw_aff_free(mpa); + return NULL; +} + +/* Construct an isl_ast_expr of type "type" that calls or accesses + * the element specified by "mpa". + * The first argument is obtained from the output tuple name. + * The remaining arguments are given by the piecewise affine expressions. + * + * If the range of "mpa" is a mapped relation, then we assume it + * represents an access to a member of a structure. + * + * The domain of "mpa" is assumed to live in the internal schedule domain. + */ +static __isl_give isl_ast_expr *isl_ast_build_from_multi_pw_aff_internal( + __isl_keep isl_ast_build *build, enum isl_ast_op_type type, + __isl_take isl_multi_pw_aff *mpa) +{ + isl_ctx *ctx; + isl_id *id; + isl_ast_expr *expr; + + if (!mpa) + goto error; + + if (type == isl_ast_op_access && + isl_multi_pw_aff_range_is_wrapping(mpa)) + return isl_ast_build_from_multi_pw_aff_member(build, mpa); + + mpa = set_iterator_names(build, mpa); + if (!build || !mpa) + goto error; + + ctx = isl_ast_build_get_ctx(build); + + if (isl_multi_pw_aff_has_tuple_id(mpa, isl_dim_out)) + id = isl_multi_pw_aff_get_tuple_id(mpa, isl_dim_out); + else + id = isl_id_alloc(ctx, "", NULL); + + expr = isl_ast_expr_from_id(id); + return isl_ast_build_with_arguments(build, type, expr, mpa); +error: + isl_multi_pw_aff_free(mpa); + return NULL; +} + +/* Construct an isl_ast_expr of type "type" that calls or accesses + * the element specified by "pma". + * The first argument is obtained from the output tuple name. + * The remaining arguments are given by the piecewise affine expressions. + * + * The domain of "pma" is assumed to live in the internal schedule domain. + */ +static __isl_give isl_ast_expr *isl_ast_build_from_pw_multi_aff_internal( + __isl_keep isl_ast_build *build, enum isl_ast_op_type type, + __isl_take isl_pw_multi_aff *pma) +{ + isl_multi_pw_aff *mpa; + + mpa = isl_multi_pw_aff_from_pw_multi_aff(pma); + return isl_ast_build_from_multi_pw_aff_internal(build, type, mpa); +} + +/* Construct an isl_ast_expr of type "type" that calls or accesses + * the element specified by "mpa". + * The first argument is obtained from the output tuple name. + * The remaining arguments are given by the piecewise affine expressions. + * + * The domain of "mpa" is assumed to live in the external schedule domain. + */ +static __isl_give isl_ast_expr *isl_ast_build_from_multi_pw_aff( + __isl_keep isl_ast_build *build, enum isl_ast_op_type type, + __isl_take isl_multi_pw_aff *mpa) { int is_domain; isl_ast_expr *expr; - isl_space *space_build, *space_pma; + isl_space *space_build, *space_mpa; space_build = isl_ast_build_get_space(build, 0); - space_pma = isl_pw_multi_aff_get_space(pma); - is_domain = isl_space_tuple_match(space_build, isl_dim_set, - space_pma, isl_dim_in); + space_mpa = isl_multi_pw_aff_get_space(mpa); + is_domain = isl_space_tuple_is_equal(space_build, isl_dim_set, + space_mpa, isl_dim_in); isl_space_free(space_build); - isl_space_free(space_pma); + isl_space_free(space_mpa); if (is_domain < 0) - return isl_pw_multi_aff_free(pma); + goto error; if (!is_domain) isl_die(isl_ast_build_get_ctx(build), isl_error_invalid, - "spaces don't match", - return isl_pw_multi_aff_free(pma)); + "spaces don't match", goto error); if (isl_ast_build_need_schedule_map(build)) { isl_multi_aff *ma; ma = isl_ast_build_get_schedule_map_multi_aff(build); - pma = isl_pw_multi_aff_pullback_multi_aff(pma, ma); + mpa = isl_multi_pw_aff_pullback_multi_aff(mpa, ma); } - expr = isl_ast_build_call_from_pw_multi_aff_internal(build, pma); + expr = isl_ast_build_from_multi_pw_aff_internal(build, type, mpa); return expr; +error: + isl_multi_pw_aff_free(mpa); + return NULL; +} + +/* Construct an isl_ast_expr that calls the domain element specified by "mpa". + * The name of the function is obtained from the output tuple name. + * The arguments are given by the piecewise affine expressions. + * + * The domain of "mpa" is assumed to live in the external schedule domain. + */ +__isl_give isl_ast_expr *isl_ast_build_call_from_multi_pw_aff( + __isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa) +{ + return isl_ast_build_from_multi_pw_aff(build, isl_ast_op_call, mpa); +} + +/* Construct an isl_ast_expr that accesses the array element specified by "mpa". + * The name of the array is obtained from the output tuple name. + * The index expressions are given by the piecewise affine expressions. + * + * The domain of "mpa" is assumed to live in the external schedule domain. + */ +__isl_give isl_ast_expr *isl_ast_build_access_from_multi_pw_aff( + __isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa) +{ + return isl_ast_build_from_multi_pw_aff(build, isl_ast_op_access, mpa); +} + +/* Construct an isl_ast_expr of type "type" that calls or accesses + * the element specified by "pma". + * The first argument is obtained from the output tuple name. + * The remaining arguments are given by the piecewise affine expressions. + * + * The domain of "pma" is assumed to live in the external schedule domain. + */ +static __isl_give isl_ast_expr *isl_ast_build_from_pw_multi_aff( + __isl_keep isl_ast_build *build, enum isl_ast_op_type type, + __isl_take isl_pw_multi_aff *pma) +{ + isl_multi_pw_aff *mpa; + + mpa = isl_multi_pw_aff_from_pw_multi_aff(pma); + return isl_ast_build_from_multi_pw_aff(build, type, mpa); +} + +/* Construct an isl_ast_expr that calls the domain element specified by "pma". + * The name of the function is obtained from the output tuple name. + * The arguments are given by the piecewise affine expressions. + * + * The domain of "pma" is assumed to live in the external schedule domain. + */ +__isl_give isl_ast_expr *isl_ast_build_call_from_pw_multi_aff( + __isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma) +{ + return isl_ast_build_from_pw_multi_aff(build, isl_ast_op_call, pma); +} + +/* Construct an isl_ast_expr that accesses the array element specified by "pma". + * The name of the array is obtained from the output tuple name. + * The index expressions are given by the piecewise affine expressions. + * + * The domain of "pma" is assumed to live in the external schedule domain. + */ +__isl_give isl_ast_expr *isl_ast_build_access_from_pw_multi_aff( + __isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma) +{ + return isl_ast_build_from_pw_multi_aff(build, isl_ast_op_access, pma); } /* Construct an isl_ast_expr that calls the domain element @@ -999,6 +1928,7 @@ iteration = isl_ast_build_compute_gist_pw_multi_aff(build, iteration); iteration = isl_pw_multi_aff_intersect_domain(iteration, isl_ast_build_get_domain(build)); - expr = isl_ast_build_call_from_pw_multi_aff_internal(build, iteration); + expr = isl_ast_build_from_pw_multi_aff_internal(build, isl_ast_op_call, + iteration); return isl_ast_node_alloc_user(expr); } diff -Nru cloog-0.18.2/isl/isl_ast_build_expr.h cloog-0.18.4/isl/isl_ast_build_expr.h --- cloog-0.18.2/isl/isl_ast_build_expr.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_ast_build_expr.h 2015-07-24 12:23:09.000000000 +0000 @@ -6,7 +6,7 @@ __isl_give isl_ast_expr *isl_ast_build_expr_from_basic_set( __isl_keep isl_ast_build *build, __isl_take isl_basic_set *bset); -__isl_give isl_ast_expr *isl_ast_build_expr_from_set( +__isl_give isl_ast_expr *isl_ast_build_expr_from_set_internal( __isl_keep isl_ast_build *build, __isl_take isl_set *set); __isl_give isl_ast_expr *isl_ast_build_expr_from_pw_aff_internal( diff -Nru cloog-0.18.2/isl/isl_ast_build_private.h cloog-0.18.4/isl/isl_ast_build_private.h --- cloog-0.18.2/isl/isl_ast_build_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_ast_build_private.h 2015-07-24 12:23:09.000000000 +0000 @@ -6,12 +6,7 @@ #include #include #include - -enum isl_ast_build_domain_type { - atomic, - unroll, - separate -}; +#include /* An isl_ast_build represents the context in which AST is being * generated. That is, it (mostly) contains information about outer @@ -89,6 +84,17 @@ * domain. It may be NULL if it hasn't been computed yet. * See isl_ast_build_get_schedule_map_multi_aff. * + * "internal2input" maps the internal schedule domain to the original + * input schedule domain. In case of a schedule tree input, the original + * input schedule domain consist of the flat product of all outer + * band node spaces, including the current band node. + * It may be NULL if there no longer is such a uniform mapping + * (because different iterations have been rescheduled differently). + * + * "options" contains the AST build options in case we are generating + * an AST from a flat schedule map. When creating an AST from a schedule + * tree, this field is ignored. + * * The "create_leaf" callback is called for every leaf in the generated AST. * The callback is responsible for creating the node to be placed at those * leaves. If this callback is not set, then isl will generated user @@ -104,6 +110,12 @@ * The "after_each_for" callback is called on each for node after * its children have been created. * + * The "before_each_mark" callback is called before we handle the subtree + * of an isl_schedule_node_mark node. + * + * The "after_each_mark" callback is called after we have handled the subtree + * of an isl_schedule_node_mark node. + * * "executed" contains the inverse schedule at this point * of the AST generation. * It is currently only used in isl_ast_build_get_schedule, which is @@ -116,6 +128,19 @@ * is extended to a single valued inverse schedule. This is mainly used * to avoid an infinite recursion when we fail to detect later on that * the extended inverse schedule is single valued. + * + * "node" points to the current band node in case we are generating + * an AST from a schedule tree. It may be NULL if we are not generating + * an AST from a schedule tree or if we are not inside a band node. + * + * "loop_type" originally constains loop AST generation types for + * the "n" members of "node" and it is updated (along with "n") when + * a schedule dimension is inserted. + * It is NULL if "node" is NULL. + * + * "isolated" is the piece of the schedule domain isolated by the isolate + * option on the current band. This set may be NULL if we have not checked + * for the isolate option yet. */ struct isl_ast_build { int ref; @@ -136,6 +161,7 @@ isl_multi_aff *offsets; isl_multi_aff *schedule_map; + isl_multi_aff *internal2input; isl_union_map *options; @@ -152,12 +178,25 @@ __isl_keep isl_ast_build *context, void *user); void *after_each_for_user; + isl_stat (*before_each_mark)(__isl_keep isl_id *mark, + __isl_keep isl_ast_build *build, void *user); + void *before_each_mark_user; + __isl_give isl_ast_node *(*after_each_mark)( + __isl_take isl_ast_node *node, + __isl_keep isl_ast_build *context, void *user); + void *after_each_mark_user; + __isl_give isl_ast_node *(*create_leaf)( __isl_take isl_ast_build *build, void *user); void *create_leaf_user; isl_union_map *executed; int single_valued; + + isl_schedule_node *node; + int n; + enum isl_ast_loop_type *loop_type; + isl_set *isolated; }; __isl_give isl_ast_build *isl_ast_build_clear_local_info( @@ -165,6 +204,8 @@ __isl_give isl_ast_build *isl_ast_build_increase_depth( __isl_take isl_ast_build *build); int isl_ast_build_get_depth(__isl_keep isl_ast_build *build); +unsigned isl_ast_build_dim(__isl_keep isl_ast_build *build, + enum isl_dim_type type); __isl_give isl_space *isl_ast_build_get_space( __isl_keep isl_ast_build *build, int internal); __isl_give isl_ast_build *isl_ast_build_align_params( @@ -189,14 +230,20 @@ __isl_take isl_union_map *executed); __isl_give isl_ast_build *isl_ast_build_set_single_valued( __isl_take isl_ast_build *build, int sv); +__isl_give isl_multi_aff *isl_ast_build_get_internal2input( + __isl_keep isl_ast_build *build); __isl_give isl_set *isl_ast_build_get_domain( __isl_keep isl_ast_build *build); +__isl_give isl_set *isl_ast_build_get_pending( + __isl_keep isl_ast_build *build); +__isl_give isl_set *isl_ast_build_get_generated( + __isl_keep isl_ast_build *build); __isl_give isl_ast_build *isl_ast_build_restrict_generated( __isl_take isl_ast_build *build, __isl_take isl_set *set); +__isl_give isl_ast_build *isl_ast_build_replace_pending_by_guard( + __isl_take isl_ast_build *build, __isl_take isl_set *guard); __isl_give isl_ast_build *isl_ast_build_restrict_pending( __isl_take isl_ast_build *build, __isl_take isl_set *set); -__isl_give isl_ast_build *isl_ast_build_set_enforced( - __isl_take isl_ast_build *build, __isl_take isl_basic_set *enforced); __isl_give int isl_ast_build_need_schedule_map( __isl_keep isl_ast_build *build); __isl_give isl_multi_aff *isl_ast_build_get_schedule_map_multi_aff( @@ -208,8 +255,25 @@ __isl_give isl_id *isl_ast_build_get_iterator_id( __isl_keep isl_ast_build *build, int pos); +int isl_ast_build_has_schedule_node(__isl_keep isl_ast_build *build); +__isl_give isl_schedule_node *isl_ast_build_get_schedule_node( + __isl_keep isl_ast_build *build); +__isl_give isl_ast_build *isl_ast_build_set_schedule_node( + __isl_take isl_ast_build *build, + __isl_take isl_schedule_node *node); +__isl_give isl_ast_build *isl_ast_build_reset_schedule_node( + __isl_take isl_ast_build *build); + +__isl_give isl_ast_build *isl_ast_build_extract_isolated( + __isl_take isl_ast_build *build); +int isl_ast_build_has_isolated(__isl_keep isl_ast_build *build); +__isl_give isl_set *isl_ast_build_get_isolated( + __isl_keep isl_ast_build *build); + __isl_give isl_basic_set *isl_ast_build_compute_gist_basic_set( __isl_keep isl_ast_build *build, __isl_take isl_basic_set *bset); +__isl_give isl_set *isl_ast_build_specialize(__isl_keep isl_ast_build *build, + __isl_take isl_set *set); __isl_give isl_set *isl_ast_build_compute_gist( __isl_keep isl_ast_build *build, __isl_take isl_set *set); __isl_give isl_map *isl_ast_build_compute_gist_map_domain( @@ -240,8 +304,7 @@ void isl_ast_build_dump(__isl_keep isl_ast_build *build); __isl_give isl_set *isl_ast_build_get_option_domain( - __isl_keep isl_ast_build *build, - enum isl_ast_build_domain_type type); + __isl_keep isl_ast_build *build, enum isl_ast_loop_type type); __isl_give isl_map *isl_ast_build_get_separation_class( __isl_keep isl_ast_build *build); __isl_give isl_set *isl_ast_build_eliminate( @@ -251,6 +314,9 @@ __isl_give isl_set *isl_ast_build_eliminate_divs( __isl_keep isl_ast_build *build, __isl_take isl_set *set); +enum isl_ast_loop_type isl_ast_build_get_loop_type( + __isl_keep isl_ast_build *build, int isolated); + __isl_give isl_map *isl_ast_build_map_to_iterator( __isl_keep isl_ast_build *build, __isl_take isl_set *set); diff -Nru cloog-0.18.2/isl/isl_ast.c cloog-0.18.4/isl/isl_ast.c --- cloog-0.18.2/isl/isl_ast.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_ast.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,5 +1,13 @@ +/* + * Copyright 2012-2013 Ecole Normale Superieure + * + * Use of this software is governed by the MIT license + * + * Written by Sven Verdoolaege, + * Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France + */ + #include -#include #undef BASE #define BASE ast_expr @@ -76,7 +84,8 @@ return options; } -void *isl_ast_print_options_free(__isl_take isl_ast_print_options *options) +__isl_null isl_ast_print_options *isl_ast_print_options_free( + __isl_take isl_ast_print_options *options) { if (!options) return NULL; @@ -189,7 +198,7 @@ return isl_ast_expr_dup(expr); } -void *isl_ast_expr_free(__isl_take isl_ast_expr *expr) +__isl_null isl_ast_expr *isl_ast_expr_free(__isl_take isl_ast_expr *expr) { int i; @@ -209,8 +218,9 @@ isl_id_free(expr->u.id); break; case isl_ast_expr_op: - for (i = 0; i < expr->u.op.n_arg; ++i) - isl_ast_expr_free(expr->u.op.args[i]); + if (expr->u.op.args) + for (i = 0; i < expr->u.op.n_arg; ++i) + isl_ast_expr_free(expr->u.op.args[i]); free(expr->u.op.args); break; case isl_ast_expr_error: @@ -231,16 +241,6 @@ return expr ? expr->type : isl_ast_expr_error; } -int isl_ast_expr_get_int(__isl_keep isl_ast_expr *expr, isl_int *v) -{ - if (!expr) - return -1; - if (expr->type != isl_ast_expr_int) - isl_die(isl_ast_expr_get_ctx(expr), isl_error_invalid, - "expression not an int", return -1); - return isl_val_get_num_isl_int(expr->u.v, v); -} - /* Return the integer value represented by "expr". */ __isl_give isl_val *isl_ast_expr_get_val(__isl_keep isl_ast_expr *expr) @@ -323,6 +323,46 @@ return isl_ast_expr_free(expr); } +/* Is "expr1" equal to "expr2"? + */ +isl_bool isl_ast_expr_is_equal(__isl_keep isl_ast_expr *expr1, + __isl_keep isl_ast_expr *expr2) +{ + int i; + + if (!expr1 || !expr2) + return isl_bool_error; + + if (expr1 == expr2) + return isl_bool_true; + if (expr1->type != expr2->type) + return isl_bool_false; + switch (expr1->type) { + case isl_ast_expr_int: + return isl_val_eq(expr1->u.v, expr2->u.v); + case isl_ast_expr_id: + return expr1->u.id == expr2->u.id; + case isl_ast_expr_op: + if (expr1->u.op.op != expr2->u.op.op) + return isl_bool_false; + if (expr1->u.op.n_arg != expr2->u.op.n_arg) + return isl_bool_false; + for (i = 0; i < expr1->u.op.n_arg; ++i) { + isl_bool equal; + equal = isl_ast_expr_is_equal(expr1->u.op.args[i], + expr2->u.op.args[i]); + if (equal < 0 || !equal) + return equal; + } + return 1; + case isl_ast_expr_error: + return isl_bool_error; + } + + isl_die(isl_ast_expr_get_ctx(expr1), isl_error_internal, + "unhandled case", return isl_bool_error); +} + /* Create a new operation expression of operation type "op", * with "n_arg" as yet unspecified arguments. */ @@ -362,7 +402,7 @@ ctx = isl_id_get_ctx(id); expr = isl_calloc_type(ctx, isl_ast_expr); if (!expr) - return isl_id_free(id); + goto error; expr->ctx = ctx; isl_ctx_ref(ctx); @@ -371,6 +411,9 @@ expr->u.id = id; return expr; +error: + isl_id_free(id); + return NULL; } /* Create a new integer expression representing "i". @@ -405,12 +448,12 @@ return NULL; if (!isl_val_is_int(v)) isl_die(isl_val_get_ctx(v), isl_error_invalid, - "expecting integer value", return isl_val_free(v)); + "expecting integer value", goto error); ctx = isl_val_get_ctx(v); expr = isl_calloc_type(ctx, isl_ast_expr); if (!expr) - return isl_val_free(v); + goto error; expr->ctx = ctx; isl_ctx_ref(ctx); @@ -419,11 +462,16 @@ expr->u.v = v; return expr; +error: + isl_val_free(v); + return NULL; } -/* Create an expression representing the negation of "arg". +/* Create an expression representing the unary operation "type" applied to + * "arg". */ -__isl_give isl_ast_expr *isl_ast_expr_neg(__isl_take isl_ast_expr *arg) +__isl_give isl_ast_expr *isl_ast_expr_alloc_unary(enum isl_ast_op_type type, + __isl_take isl_ast_expr *arg) { isl_ctx *ctx; isl_ast_expr *expr = NULL; @@ -432,7 +480,7 @@ return NULL; ctx = isl_ast_expr_get_ctx(arg); - expr = isl_ast_expr_alloc_op(ctx, isl_ast_op_minus, 1); + expr = isl_ast_expr_alloc_op(ctx, type, 1); if (!expr) goto error; @@ -444,6 +492,29 @@ return NULL; } +/* Create an expression representing the negation of "arg". + */ +__isl_give isl_ast_expr *isl_ast_expr_neg(__isl_take isl_ast_expr *arg) +{ + return isl_ast_expr_alloc_unary(isl_ast_op_minus, arg); +} + +/* Create an expression representing the address of "expr". + */ +__isl_give isl_ast_expr *isl_ast_expr_address_of(__isl_take isl_ast_expr *expr) +{ + if (!expr) + return NULL; + + if (isl_ast_expr_get_type(expr) != isl_ast_expr_op || + isl_ast_expr_get_op_type(expr) != isl_ast_op_access) + isl_die(isl_ast_expr_get_ctx(expr), isl_error_invalid, + "can only take address of access expressions", + return isl_ast_expr_free(expr)); + + return isl_ast_expr_alloc_unary(isl_ast_op_address_of, expr); +} + /* Create an expression representing the binary operation "type" * applied to "expr1" and "expr2". */ @@ -503,6 +574,26 @@ return isl_ast_expr_alloc_binary(isl_ast_op_div, expr1, expr2); } +/* Create an expression representing the quotient of the integer + * division of "expr1" by "expr2", where "expr1" is known to be + * non-negative. + */ +__isl_give isl_ast_expr *isl_ast_expr_pdiv_q(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2) +{ + return isl_ast_expr_alloc_binary(isl_ast_op_pdiv_q, expr1, expr2); +} + +/* Create an expression representing the remainder of the integer + * division of "expr1" by "expr2", where "expr1" is known to be + * non-negative. + */ +__isl_give isl_ast_expr *isl_ast_expr_pdiv_r(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2) +{ + return isl_ast_expr_alloc_binary(isl_ast_op_pdiv_r, expr1, expr2); +} + /* Create an expression representing the conjunction of "expr1" and "expr2". */ __isl_give isl_ast_expr *isl_ast_expr_and(__isl_take isl_ast_expr *expr1, @@ -511,6 +602,15 @@ return isl_ast_expr_alloc_binary(isl_ast_op_and, expr1, expr2); } +/* Create an expression representing the conjunction of "expr1" and "expr2", + * where "expr2" is evaluated only if "expr1" is evaluated to true. + */ +__isl_give isl_ast_expr *isl_ast_expr_and_then(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2) +{ + return isl_ast_expr_alloc_binary(isl_ast_op_and_then, expr1, expr2); +} + /* Create an expression representing the disjunction of "expr1" and "expr2". */ __isl_give isl_ast_expr *isl_ast_expr_or(__isl_take isl_ast_expr *expr1, @@ -519,6 +619,167 @@ return isl_ast_expr_alloc_binary(isl_ast_op_or, expr1, expr2); } +/* Create an expression representing the disjunction of "expr1" and "expr2", + * where "expr2" is evaluated only if "expr1" is evaluated to false. + */ +__isl_give isl_ast_expr *isl_ast_expr_or_else(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2) +{ + return isl_ast_expr_alloc_binary(isl_ast_op_or_else, expr1, expr2); +} + +/* Create an expression representing "expr1" less than or equal to "expr2". + */ +__isl_give isl_ast_expr *isl_ast_expr_le(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2) +{ + return isl_ast_expr_alloc_binary(isl_ast_op_le, expr1, expr2); +} + +/* Create an expression representing "expr1" less than "expr2". + */ +__isl_give isl_ast_expr *isl_ast_expr_lt(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2) +{ + return isl_ast_expr_alloc_binary(isl_ast_op_lt, expr1, expr2); +} + +/* Create an expression representing "expr1" greater than or equal to "expr2". + */ +__isl_give isl_ast_expr *isl_ast_expr_ge(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2) +{ + return isl_ast_expr_alloc_binary(isl_ast_op_ge, expr1, expr2); +} + +/* Create an expression representing "expr1" greater than "expr2". + */ +__isl_give isl_ast_expr *isl_ast_expr_gt(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2) +{ + return isl_ast_expr_alloc_binary(isl_ast_op_gt, expr1, expr2); +} + +/* Create an expression representing "expr1" equal to "expr2". + */ +__isl_give isl_ast_expr *isl_ast_expr_eq(__isl_take isl_ast_expr *expr1, + __isl_take isl_ast_expr *expr2) +{ + return isl_ast_expr_alloc_binary(isl_ast_op_eq, expr1, expr2); +} + +/* Create an expression of type "type" with as arguments "arg0" followed + * by "arguments". + */ +static __isl_give isl_ast_expr *ast_expr_with_arguments( + enum isl_ast_op_type type, __isl_take isl_ast_expr *arg0, + __isl_take isl_ast_expr_list *arguments) +{ + int i, n; + isl_ctx *ctx; + isl_ast_expr *res = NULL; + + if (!arg0 || !arguments) + goto error; + + ctx = isl_ast_expr_get_ctx(arg0); + n = isl_ast_expr_list_n_ast_expr(arguments); + res = isl_ast_expr_alloc_op(ctx, type, 1 + n); + if (!res) + goto error; + for (i = 0; i < n; ++i) { + isl_ast_expr *arg; + arg = isl_ast_expr_list_get_ast_expr(arguments, i); + res->u.op.args[1 + i] = arg; + if (!arg) + goto error; + } + res->u.op.args[0] = arg0; + + isl_ast_expr_list_free(arguments); + return res; +error: + isl_ast_expr_free(arg0); + isl_ast_expr_list_free(arguments); + isl_ast_expr_free(res); + return NULL; +} + +/* Create an expression representing an access to "array" with index + * expressions "indices". + */ +__isl_give isl_ast_expr *isl_ast_expr_access(__isl_take isl_ast_expr *array, + __isl_take isl_ast_expr_list *indices) +{ + return ast_expr_with_arguments(isl_ast_op_access, array, indices); +} + +/* Create an expression representing a call to "function" with argument + * expressions "arguments". + */ +__isl_give isl_ast_expr *isl_ast_expr_call(__isl_take isl_ast_expr *function, + __isl_take isl_ast_expr_list *arguments) +{ + return ast_expr_with_arguments(isl_ast_op_call, function, arguments); +} + +/* For each subexpression of "expr" of type isl_ast_expr_id, + * if it appears in "id2expr", then replace it by the corresponding + * expression. + */ +__isl_give isl_ast_expr *isl_ast_expr_substitute_ids( + __isl_take isl_ast_expr *expr, __isl_take isl_id_to_ast_expr *id2expr) +{ + int i; + isl_id *id; + + if (!expr || !id2expr) + goto error; + + switch (expr->type) { + case isl_ast_expr_int: + break; + case isl_ast_expr_id: + if (!isl_id_to_ast_expr_has(id2expr, expr->u.id)) + break; + id = isl_id_copy(expr->u.id); + isl_ast_expr_free(expr); + expr = isl_id_to_ast_expr_get(id2expr, id); + break; + case isl_ast_expr_op: + for (i = 0; i < expr->u.op.n_arg; ++i) { + isl_ast_expr *arg; + arg = isl_ast_expr_copy(expr->u.op.args[i]); + arg = isl_ast_expr_substitute_ids(arg, + isl_id_to_ast_expr_copy(id2expr)); + if (arg == expr->u.op.args[i]) { + isl_ast_expr_free(arg); + continue; + } + if (!arg) + expr = isl_ast_expr_free(expr); + expr = isl_ast_expr_cow(expr); + if (!expr) { + isl_ast_expr_free(arg); + break; + } + isl_ast_expr_free(expr->u.op.args[i]); + expr->u.op.args[i] = arg; + } + break; + case isl_ast_expr_error: + expr = isl_ast_expr_free(expr); + break; + } + + isl_id_to_ast_expr_free(id2expr); + return expr; +error: + isl_ast_expr_free(expr); + isl_id_to_ast_expr_free(id2expr); + return NULL; +} + isl_ctx *isl_ast_node_get_ctx(__isl_keep isl_ast_node *node) { return node ? node->ctx : NULL; @@ -583,13 +844,42 @@ ctx = isl_id_get_ctx(id); node = isl_ast_node_alloc(ctx, isl_ast_node_for); if (!node) - return NULL; + goto error; node->u.f.iterator = isl_ast_expr_from_id(id); if (!node->u.f.iterator) return isl_ast_node_free(node); return node; +error: + isl_id_free(id); + return NULL; +} + +/* Create a mark node, marking "node" with "id". + */ +__isl_give isl_ast_node *isl_ast_node_alloc_mark(__isl_take isl_id *id, + __isl_take isl_ast_node *node) +{ + isl_ctx *ctx; + isl_ast_node *mark; + + if (!id || !node) + goto error; + + ctx = isl_id_get_ctx(id); + mark = isl_ast_node_alloc(ctx, isl_ast_node_mark); + if (!mark) + goto error; + + mark->u.m.mark = id; + mark->u.m.node = node; + + return mark; +error: + isl_id_free(id); + isl_ast_node_free(node); + return NULL; } /* Create a user node evaluating "expr". @@ -701,6 +991,12 @@ if (!dup->u.b.children) return isl_ast_node_free(dup); break; + case isl_ast_node_mark: + dup->u.m.mark = isl_id_copy(node->u.m.mark); + dup->u.m.node = isl_ast_node_copy(node->u.m.node); + if (!dup->u.m.mark || !dup->u.m.node) + return isl_ast_node_free(dup); + break; case isl_ast_node_user: dup->u.e.expr = isl_ast_expr_copy(node->u.e.expr); if (!dup->u.e.expr) @@ -724,7 +1020,7 @@ return isl_ast_node_dup(node); } -void *isl_ast_node_free(__isl_take isl_ast_node *node) +__isl_null isl_ast_node *isl_ast_node_free(__isl_take isl_ast_node *node) { if (!node) return NULL; @@ -748,6 +1044,10 @@ case isl_ast_node_block: isl_ast_node_list_free(node->u.b.children); break; + case isl_ast_node_mark: + isl_id_free(node->u.m.mark); + isl_ast_node_free(node->u.m.node); + break; case isl_ast_node_user: isl_ast_expr_free(node->u.e.expr); break; @@ -807,13 +1107,13 @@ return node; } -int isl_ast_node_for_is_degenerate(__isl_keep isl_ast_node *node) +isl_bool isl_ast_node_for_is_degenerate(__isl_keep isl_ast_node *node) { if (!node) - return -1; + return isl_bool_error; if (node->type != isl_ast_node_for) isl_die(isl_ast_node_get_ctx(node), isl_error_invalid, - "not a for node", return -1); + "not a for node", return isl_bool_error); return node->u.f.degenerate; } @@ -913,14 +1213,14 @@ return isl_ast_node_copy(node->u.i.then); } -int isl_ast_node_if_has_else( +isl_bool isl_ast_node_if_has_else( __isl_keep isl_ast_node *node) { if (!node) - return -1; + return isl_bool_error; if (node->type != isl_ast_node_if) isl_die(isl_ast_node_get_ctx(node), isl_error_invalid, - "not an if node", return -1); + "not an if node", return isl_bool_error); return node->u.i.else_node != NULL; } @@ -962,10 +1262,40 @@ { if (!node) return NULL; + if (node->type != isl_ast_node_user) + isl_die(isl_ast_node_get_ctx(node), isl_error_invalid, + "not a user node", return NULL); return isl_ast_expr_copy(node->u.e.expr); } +/* Return the mark identifier of the mark node "node". + */ +__isl_give isl_id *isl_ast_node_mark_get_id(__isl_keep isl_ast_node *node) +{ + if (!node) + return NULL; + if (node->type != isl_ast_node_mark) + isl_die(isl_ast_node_get_ctx(node), isl_error_invalid, + "not a mark node", return NULL); + + return isl_id_copy(node->u.m.mark); +} + +/* Return the node marked by mark node "node". + */ +__isl_give isl_ast_node *isl_ast_node_mark_get_node( + __isl_keep isl_ast_node *node) +{ + if (!node) + return NULL; + if (node->type != isl_ast_node_mark) + isl_die(isl_ast_node_get_ctx(node), isl_error_invalid, + "not a mark node", return NULL); + + return isl_ast_node_copy(node->u.m.node); +} + __isl_give isl_id *isl_ast_node_get_annotation(__isl_keep isl_ast_node *node) { return node ? isl_id_copy(node->annotation) : NULL; @@ -1004,12 +1334,15 @@ [isl_ast_op_mul] = "*", [isl_ast_op_pdiv_q] = "/", [isl_ast_op_pdiv_r] = "%", + [isl_ast_op_zdiv_r] = "%", [isl_ast_op_div] = "/", [isl_ast_op_eq] = "==", [isl_ast_op_le] = "<=", [isl_ast_op_ge] = ">=", [isl_ast_op_lt] = "<", - [isl_ast_op_gt] = ">" + [isl_ast_op_gt] = ">", + [isl_ast_op_member] = ".", + [isl_ast_op_address_of] = "&" }; /* Precedence in C of the various operators. @@ -1031,6 +1364,7 @@ [isl_ast_op_fdiv_q] = 2, [isl_ast_op_pdiv_q] = 5, [isl_ast_op_pdiv_r] = 5, + [isl_ast_op_zdiv_r] = 5, [isl_ast_op_cond] = 15, [isl_ast_op_select] = 15, [isl_ast_op_eq] = 9, @@ -1038,7 +1372,10 @@ [isl_ast_op_ge] = 8, [isl_ast_op_lt] = 8, [isl_ast_op_gt] = 8, - [isl_ast_op_call] = 2 + [isl_ast_op_call] = 2, + [isl_ast_op_access] = 2, + [isl_ast_op_member] = 2, + [isl_ast_op_address_of] = 3 }; /* Is the operator left-to-right associative? @@ -1058,6 +1395,7 @@ [isl_ast_op_fdiv_q] = 1, [isl_ast_op_pdiv_q] = 1, [isl_ast_op_pdiv_r] = 1, + [isl_ast_op_zdiv_r] = 1, [isl_ast_op_cond] = 0, [isl_ast_op_select] = 0, [isl_ast_op_eq] = 1, @@ -1065,7 +1403,10 @@ [isl_ast_op_ge] = 1, [isl_ast_op_lt] = 1, [isl_ast_op_gt] = 1, - [isl_ast_op_call] = 1 + [isl_ast_op_call] = 1, + [isl_ast_op_access] = 1, + [isl_ast_op_member] = 1, + [isl_ast_op_address_of] = 0 }; static int is_and(enum isl_ast_op_type op) @@ -1085,7 +1426,9 @@ static int is_div_mod(enum isl_ast_op_type op) { - return op == isl_ast_op_div || op == isl_ast_op_pdiv_r; + return op == isl_ast_op_div || + op == isl_ast_op_pdiv_r || + op == isl_ast_op_zdiv_r; } /* Do we need/want parentheses around "expr" as a subexpression of @@ -1188,6 +1531,25 @@ return p; } +/* Print an array access "expr". + * + * The first argument represents the array being accessed. + */ +static __isl_give isl_printer *print_access(__isl_take isl_printer *p, + __isl_keep isl_ast_expr *expr) +{ + int i = 0; + + p = isl_printer_print_ast_expr(p, expr->u.op.args[0]); + for (i = 1; i < expr->u.op.n_arg; ++i) { + p = isl_printer_print_str(p, "["); + p = isl_printer_print_ast_expr(p, expr->u.op.args[i]); + p = isl_printer_print_str(p, "]"); + } + + return p; +} + /* Print "expr" to "p". * * If we are printing in isl format, then we also print an indication @@ -1207,6 +1569,10 @@ p = print_call(p, expr); break; } + if (expr->u.op.op == isl_ast_op_access) { + p = print_access(p, expr); + break; + } if (expr->u.op.n_arg == 1) { p = isl_printer_print_str(p, op_str[expr->u.op.op]); p = print_sub_expr(p, expr->u.op.op, @@ -1240,9 +1606,11 @@ "operation should have two arguments", goto error); p = print_sub_expr(p, expr->u.op.op, expr->u.op.args[0], 1); - p = isl_printer_print_str(p, " "); + if (expr->u.op.op != isl_ast_op_member) + p = isl_printer_print_str(p, " "); p = isl_printer_print_str(p, op_str[expr->u.op.op]); - p = isl_printer_print_str(p, " "); + if (expr->u.op.op != isl_ast_op_member) + p = isl_printer_print_str(p, " "); p = print_sub_expr(p, expr->u.op.op, expr->u.op.args[1], 0); break; case isl_ast_expr_id: @@ -1287,6 +1655,11 @@ p = isl_printer_print_ast_node(p, node->u.f.body); } break; + case isl_ast_node_mark: + p = isl_printer_print_str(p, "mark: "); + p = isl_printer_print_id(p, node->u.m.mark); + p = isl_printer_print_str(p, "node: "); + p = isl_printer_print_ast_node(p, node->u.m.node); case isl_ast_node_user: p = isl_printer_print_ast_expr(p, node->u.e.expr); break; @@ -1307,7 +1680,7 @@ case isl_ast_node_block: p = isl_printer_print_ast_node_list(p, node->u.b.children); break; - default: + case isl_ast_node_error: break; } p = isl_printer_print_str(p, ")"); @@ -1320,14 +1693,29 @@ * Also if the node is a degenerate for then we will print it as * an assignment followed by the body of the for loop, so we need a block * as well. + * If the node is an if node with an else, then we print a block + * to avoid spurious dangling else warnings emitted by some compilers. + * If the node is a mark, then in principle, we would have to check + * the child of the mark node. However, even if the child would not + * require us to print a block, for readability it is probably best + * to print a block anyway. + * If the ast_always_print_block option has been set, then we print a block. */ static int need_block(__isl_keep isl_ast_node *node) { + isl_ctx *ctx; + if (node->type == isl_ast_node_block) return 1; if (node->type == isl_ast_node_for && node->u.f.degenerate) return 1; - return 0; + if (node->type == isl_ast_node_if && node->u.i.else_node) + return 1; + if (node->type == isl_ast_node_mark) + return 1; + + ctx = isl_ast_node_get_ctx(node); + return isl_options_get_ast_always_print_block(ctx); } static __isl_give isl_printer *print_ast_node_c(__isl_take isl_printer *p, @@ -1531,6 +1919,13 @@ if (!in_block) p = end_block(p); break; + case isl_ast_node_mark: + p = isl_printer_start_line(p); + p = isl_printer_print_str(p, "// "); + p = isl_printer_print_str(p, isl_id_get_name(node->u.m.mark)); + p = isl_printer_end_line(p); + p = print_ast_node_c(p, node->u.m.node, options, 0, in_list); + break; case isl_ast_node_user: if (options->print_user) return options->print_user(p, @@ -1713,6 +2108,9 @@ macros = ast_node_list_required_macros(node->u.b.children, macros); break; + case isl_ast_node_mark: + macros = ast_node_required_macros(node->u.m.node, macros); + break; case isl_ast_node_user: macros = ast_expr_required_macros(node->u.e.expr, macros); break; @@ -1772,33 +2170,33 @@ /* Call "fn" for each type of operation that appears in "node" * and that requires a macro definition. */ -int isl_ast_node_foreach_ast_op_type(__isl_keep isl_ast_node *node, - int (*fn)(enum isl_ast_op_type type, void *user), void *user) +isl_stat isl_ast_node_foreach_ast_op_type(__isl_keep isl_ast_node *node, + isl_stat (*fn)(enum isl_ast_op_type type, void *user), void *user) { int macros; if (!node) - return -1; + return isl_stat_error; macros = ast_node_required_macros(node, 0); if (macros & ISL_AST_MACRO_MIN && fn(isl_ast_op_min, user) < 0) - return -1; + return isl_stat_error; if (macros & ISL_AST_MACRO_MAX && fn(isl_ast_op_max, user) < 0) - return -1; + return isl_stat_error; if (macros & ISL_AST_MACRO_FLOORD && fn(isl_ast_op_fdiv_q, user) < 0) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } -static int ast_op_type_print_macro(enum isl_ast_op_type type, void *user) +static isl_stat ast_op_type_print_macro(enum isl_ast_op_type type, void *user) { isl_printer **p = user; *p = isl_ast_op_type_print_macro(type, *p); - return 0; + return isl_stat_ok; } /* Print macro definitions for all the macros used in the result diff -Nru cloog-0.18.2/isl/isl_ast_codegen.c cloog-0.18.4/isl/isl_ast_codegen.c --- cloog-0.18.2/isl/isl_ast_codegen.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_ast_codegen.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,17 +1,23 @@ /* - * Copyright 2012 Ecole Normale Superieure + * Copyright 2012-2014 Ecole Normale Superieure + * Copyright 2014 INRIA Rocquencourt * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France + * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, + * B.P. 105 - 78153 Le Chesnay, France */ #include #include +#include #include #include +#include #include +#include #include #include #include @@ -19,47 +25,6 @@ #include #include -/* Add the constraint to the list that "user" points to, if it is not - * a div constraint. - */ -static int collect_constraint(__isl_take isl_constraint *constraint, - void *user) -{ - isl_constraint_list **list = user; - - if (isl_constraint_is_div_constraint(constraint)) - isl_constraint_free(constraint); - else - *list = isl_constraint_list_add(*list, constraint); - - return 0; -} - -/* Extract the constraints of "bset" (except the div constraints) - * and collect them in an isl_constraint_list. - */ -static __isl_give isl_constraint_list *isl_constraint_list_from_basic_set( - __isl_take isl_basic_set *bset) -{ - int n; - isl_ctx *ctx; - isl_constraint_list *list; - - if (!bset) - return NULL; - - ctx = isl_basic_set_get_ctx(bset); - - n = isl_basic_set_n_constraint(bset); - list = isl_constraint_list_alloc(ctx, n); - if (isl_basic_set_foreach_constraint(bset, - &collect_constraint, &list) < 0) - list = isl_constraint_list_free(list); - - isl_basic_set_free(bset); - return list; -} - /* Data used in generate_domain. * * "build" is the input build. @@ -97,7 +62,7 @@ * but will instead create calls to all elements of D that need * to be executed from the current schedule domain. */ -static int generate_non_single_valued(__isl_take isl_map *executed, +static isl_stat generate_non_single_valued(__isl_take isl_map *executed, struct isl_generate_domain_data *data) { isl_map *identity; @@ -114,7 +79,7 @@ data->list = isl_ast_graft_list_concat(data->list, list); - return 0; + return isl_stat_ok; } /* Call the at_each_domain callback, if requested by the user, @@ -145,7 +110,7 @@ } /* Generate an AST for a single domain based on - * the inverse schedule "executed". + * the inverse schedule "executed" and add it to data->list. * * If there is more than one domain element associated to the current * schedule "time", then we need to continue the generation process @@ -153,7 +118,12 @@ * Note that the inverse schedule being single-valued may depend * on constraints that are only available in the original context * domain specified by the user. We therefore first introduce - * the constraints from data->build->domain. + * some of the constraints of data->build->domain. In particular, + * we intersect with a single-disjunct approximation of this set. + * We perform this approximation to avoid further splitting up + * the executed relation, possibly introducing a disjunctive guard + * on the statement. + * * On the other hand, we only perform the test after having taken the gist * of the domain as the resulting map is the one from which the call * expression is constructed. Using this map to construct the call @@ -171,20 +141,38 @@ * domain element and put a guard around it based on the (simplified) * domain of "executed". * + * At this stage, any pending constraints in the build can no longer + * be simplified with respect to any enforced constraints since + * the call node does not have any enforced constraints. + * We therefore turn all pending constraints into guards + * (after simplifying them with respect to the already generated + * constraints) and add them to both the generated constraints + * and the guard of the constructed graft. This guard will ensure + * that the constraints are effectively generated. + * * If the user has set an at_each_domain callback, it is called * on the constructed call expression node. */ -static int generate_domain(__isl_take isl_map *executed, void *user) +static isl_stat generate_domain(__isl_take isl_map *executed, void *user) { struct isl_generate_domain_data *data = user; + isl_ast_build *build; isl_ast_graft *graft; isl_ast_graft_list *list; - isl_set *guard; - isl_map *map; - int sv; - - executed = isl_map_intersect_domain(executed, - isl_set_copy(data->build->domain)); + isl_set *guard, *domain; + isl_map *map = NULL; + int empty, sv; + + domain = isl_ast_build_get_domain(data->build); + domain = isl_set_from_basic_set(isl_set_simple_hull(domain)); + executed = isl_map_intersect_domain(executed, domain); + empty = isl_map_is_empty(executed); + if (empty < 0) + goto error; + if (empty) { + isl_map_free(executed); + return isl_stat_ok; + } executed = isl_map_coalesce(executed); map = isl_map_copy(executed); @@ -200,22 +188,30 @@ return generate_non_single_valued(executed, data); } guard = isl_map_domain(isl_map_copy(map)); + guard = isl_set_compute_divs(guard); + guard = isl_set_intersect(guard, + isl_ast_build_get_pending(data->build)); guard = isl_set_coalesce(guard); - guard = isl_ast_build_compute_gist(data->build, guard); - graft = isl_ast_graft_alloc_domain(map, data->build); - graft = at_each_domain(graft, executed, data->build); + guard = isl_ast_build_specialize(data->build, guard); + guard = isl_set_gist(guard, isl_ast_build_get_generated(data->build)); + build = isl_ast_build_copy(data->build); + build = isl_ast_build_replace_pending_by_guard(build, + isl_set_copy(guard)); + graft = isl_ast_graft_alloc_domain(map, build); + graft = at_each_domain(graft, executed, build); + isl_ast_build_free(build); isl_map_free(executed); graft = isl_ast_graft_add_guard(graft, guard, data->build); list = isl_ast_graft_list_from_ast_graft(graft); data->list = isl_ast_graft_list_concat(data->list, list); - return 0; + return isl_stat_ok; error: isl_map_free(map); isl_map_free(executed); - return -1; + return isl_stat_error; } /* Call build->create_leaf to a create "leaf" node in the AST, @@ -224,6 +220,10 @@ * * Note that the node returned by the user may be an entire tree. * + * Since the node itself cannot enforce any constraints, we turn + * all pending constraints into guards and add them to the resulting + * graft to ensure that they will be generated. + * * Before we pass control to the user, we first clear some information * from the build that is (presumbably) only meaningful * for the current code generation. @@ -233,11 +233,15 @@ static __isl_give isl_ast_graft_list *call_create_leaf( __isl_take isl_union_map *executed, __isl_take isl_ast_build *build) { + isl_set *guard; isl_ast_node *node; isl_ast_graft *graft; isl_ast_build *user_build; + guard = isl_ast_build_get_pending(build); user_build = isl_ast_build_copy(build); + user_build = isl_ast_build_replace_pending_by_guard(user_build, + isl_set_copy(guard)); user_build = isl_ast_build_set_executed(user_build, executed); user_build = isl_ast_build_clear_local_info(user_build); if (!user_build) @@ -245,12 +249,20 @@ else node = build->create_leaf(user_build, build->create_leaf_user); graft = isl_ast_graft_alloc(node, build); + graft = isl_ast_graft_add_guard(graft, guard, build); isl_ast_build_free(build); return isl_ast_graft_list_from_ast_graft(graft); } +static __isl_give isl_ast_graft_list *build_ast_from_child( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed); + /* Generate an AST after having handled the complete schedule - * of this call to the code generator. + * of this call to the code generator or the complete band + * if we are generating an AST from a schedule tree. + * + * If we are inside a band node, then move on to the child of the band. * * If the user has specified a create_leaf callback, control * is passed to the user in call_create_leaf. @@ -267,6 +279,13 @@ if (!build || !executed) goto error; + if (isl_ast_build_has_schedule_node(build)) { + isl_schedule_node *node; + node = isl_ast_build_get_schedule_node(build); + build = isl_ast_build_reset_schedule_node(build); + return build_ast_from_child(build, node, executed); + } + if (build->create_leaf) return call_create_leaf(executed, build); @@ -300,7 +319,7 @@ /* Call the after_each_for callback, if requested by the user. */ -static __isl_give isl_ast_graft *after_each_for(__isl_keep isl_ast_graft *graft, +static __isl_give isl_ast_graft *after_each_for(__isl_take isl_ast_graft *graft, __isl_keep isl_ast_build *build) { if (!graft || !build) @@ -439,10 +458,95 @@ return pa; } +/* Callback for sorting the isl_pw_aff_list passed to reduce_list and + * remove_redundant_lower_bounds. + */ +static int reduce_list_cmp(__isl_keep isl_pw_aff *a, __isl_keep isl_pw_aff *b, + void *user) +{ + return isl_pw_aff_plain_cmp(a, b); +} + +/* Given a list of lower bounds "list", remove those that are redundant + * with respect to the other bounds in "list" and the domain of "build". + * + * We first sort the bounds in the same way as they would be sorted + * by set_for_node_expressions so that we can try and remove the last + * bounds first. + * + * For a lower bound to be effective, there needs to be at least + * one domain element for which it is larger than all other lower bounds. + * For each lower bound we therefore intersect the domain with + * the conditions that it is larger than all other bounds and + * check whether the result is empty. If so, the bound can be removed. + */ +static __isl_give isl_pw_aff_list *remove_redundant_lower_bounds( + __isl_take isl_pw_aff_list *list, __isl_keep isl_ast_build *build) +{ + int i, j, n; + isl_set *domain; + + list = isl_pw_aff_list_sort(list, &reduce_list_cmp, NULL); + if (!list) + return NULL; + + n = isl_pw_aff_list_n_pw_aff(list); + if (n <= 1) + return list; + + domain = isl_ast_build_get_domain(build); + + for (i = n - 1; i >= 0; --i) { + isl_pw_aff *pa_i; + isl_set *domain_i; + int empty; + + domain_i = isl_set_copy(domain); + pa_i = isl_pw_aff_list_get_pw_aff(list, i); + + for (j = 0; j < n; ++j) { + isl_pw_aff *pa_j; + isl_set *better; + + if (j == i) + continue; + + pa_j = isl_pw_aff_list_get_pw_aff(list, j); + better = isl_pw_aff_gt_set(isl_pw_aff_copy(pa_i), pa_j); + domain_i = isl_set_intersect(domain_i, better); + } + + empty = isl_set_is_empty(domain_i); + + isl_set_free(domain_i); + isl_pw_aff_free(pa_i); + + if (empty < 0) + goto error; + if (!empty) + continue; + list = isl_pw_aff_list_drop(list, i, 1); + n--; + } + + isl_set_free(domain); + + return list; +error: + isl_set_free(domain); + return isl_pw_aff_list_free(list); +} + /* Extract a lower bound on dimension "pos" from each constraint * in "constraints" and return the list of lower bounds. * If "constraints" has zero elements, then we extract a lower bound * from "domain" instead. + * + * If the current dimension is strided, then the lower bound + * is adjusted by lower_bound to match the stride information. + * This modification may make one or more lower bounds redundant + * with respect to the other lower bounds. We therefore check + * for this condition and remove the redundant lower bounds. */ static __isl_give isl_pw_aff_list *lower_bounds( __isl_keep isl_constraint_list *constraints, int pos, @@ -475,6 +579,9 @@ list = isl_pw_aff_list_add(list, isl_pw_aff_from_aff(aff)); } + if (isl_ast_build_has_stride(build, pos)) + list = remove_redundant_lower_bounds(list, build); + return list; } @@ -521,6 +628,8 @@ * The list is assumed to contain at least one element. * If the list contains exactly one element, then the returned isl_ast_expr * simply computes that affine expression. + * If the list contains more than one element, then we sort it + * using a fairly abitrary but hopefully reasonably stable order. */ static __isl_give isl_ast_expr *reduce_list(enum isl_ast_op_type type, __isl_keep isl_pw_aff_list *list, __isl_keep isl_ast_build *build) @@ -543,83 +652,89 @@ if (!expr) return NULL; + list = isl_pw_aff_list_copy(list); + list = isl_pw_aff_list_sort(list, &reduce_list_cmp, NULL); + if (!list) + return isl_ast_expr_free(expr); + for (i = 0; i < n; ++i) { isl_ast_expr *expr_i; expr_i = isl_ast_build_expr_from_pw_aff_internal(build, isl_pw_aff_list_get_pw_aff(list, i)); if (!expr_i) - return isl_ast_expr_free(expr); + goto error; expr->u.op.args[i] = expr_i; } + isl_pw_aff_list_free(list); return expr; +error: + isl_pw_aff_list_free(list); + isl_ast_expr_free(expr); + return NULL; } -/* Add a guard to "graft" based on "bound" in the case of a degenerate - * level (including the special case of an eliminated level). - * - * We eliminate the current dimension, simplify the result in the current - * build and add the result as guards to the graft. - * - * Note that we cannot simply drop the constraints on the current dimension - * even in the eliminated case, because the single affine expression may - * not be explicitly available in "bounds". Moreover, the single affine - * expression may only be defined on a subset of the build domain, - * so we do in some cases need to insert a guard even in the eliminated case. +/* Add guards implied by the "generated constraints", + * but not (necessarily) enforced by the generated AST to "guard". + * In particular, if there is any stride constraints, + * then add the guard implied by those constraints. + * If we have generated a degenerate loop, then add the guard + * implied by "bounds" on the outer dimensions, i.e., the guard + * that ensures that the single value actually exists. + * Since there may also be guards implied by a combination + * of these constraints, we first combine them before + * deriving the implied constraints. */ -static __isl_give isl_ast_graft *add_degenerate_guard( - __isl_take isl_ast_graft *graft, __isl_keep isl_basic_set *bounds, +static __isl_give isl_set *add_implied_guards(__isl_take isl_set *guard, + int degenerate, __isl_keep isl_basic_set *bounds, __isl_keep isl_ast_build *build) { - int depth; - isl_set *dom; + int depth, has_stride; + isl_space *space; + isl_set *dom, *set; depth = isl_ast_build_get_depth(build); - - dom = isl_set_from_basic_set(isl_basic_set_copy(bounds)); - if (isl_ast_build_has_stride(build, depth)) { - isl_set *stride; - - stride = isl_ast_build_get_stride_constraint(build); - dom = isl_set_intersect(dom, stride); + has_stride = isl_ast_build_has_stride(build, depth); + if (!has_stride && !degenerate) + return guard; + + space = isl_basic_set_get_space(bounds); + dom = isl_set_universe(space); + + if (degenerate) { + bounds = isl_basic_set_copy(bounds); + bounds = isl_basic_set_drop_constraints_not_involving_dims( + bounds, isl_dim_set, depth, 1); + set = isl_set_from_basic_set(bounds); + dom = isl_set_intersect(dom, set); + } + + if (has_stride) { + set = isl_ast_build_get_stride_constraint(build); + dom = isl_set_intersect(dom, set); } + dom = isl_set_eliminate(dom, isl_dim_set, depth, 1); dom = isl_ast_build_compute_gist(build, dom); + guard = isl_set_intersect(guard, dom); - graft = isl_ast_graft_add_guard(graft, dom, build); - - return graft; -} - -/* Update "graft" based on "bounds" for the eliminated case. - * - * In the eliminated case, no for node is created, so we only need - * to check if "bounds" imply any guards that need to be inserted. - */ -static __isl_give isl_ast_graft *refine_eliminated( - __isl_take isl_ast_graft *graft, __isl_keep isl_basic_set *bounds, - __isl_keep isl_ast_build *build) -{ - return add_degenerate_guard(graft, bounds, build); + return guard; } -/* Update "graft" based on "bounds" and "sub_build" for the degenerate case. +/* Update "graft" based on "sub_build" for the degenerate case. * * "build" is the build in which graft->node was created * "sub_build" contains information about the current level itself, * including the single value attained. * - * We first set the initialization part of the for loop to the single + * We set the initialization part of the for loop to the single * value attained by the current dimension. * The increment and condition are not strictly needed as the are known * to be "1" and "iterator <= value" respectively. - * Then we set the size of the iterator and - * check if "bounds" imply any guards that need to be inserted. */ static __isl_give isl_ast_graft *refine_degenerate( - __isl_take isl_ast_graft *graft, __isl_keep isl_basic_set *bounds, - __isl_keep isl_ast_build *build, + __isl_take isl_ast_graft *graft, __isl_keep isl_ast_build *build, __isl_keep isl_ast_build *sub_build) { isl_pw_aff *value; @@ -634,8 +749,6 @@ if (!graft->node->u.f.init) return isl_ast_graft_free(graft); - graft = add_degenerate_guard(graft, bounds, build); - return graft; } @@ -761,7 +874,7 @@ /* Does "aff" have a negative constant term? */ -static int aff_constant_is_negative(__isl_take isl_set *set, +static isl_stat aff_constant_is_negative(__isl_take isl_set *set, __isl_take isl_aff *aff, void *user) { int *neg = user; @@ -773,20 +886,21 @@ isl_set_free(set); isl_aff_free(aff); - return *neg ? 0 : -1; + return *neg ? isl_stat_ok : isl_stat_error; } /* Does "pa" have a negative constant term over its entire domain? */ -static int pw_aff_constant_is_negative(__isl_take isl_pw_aff *pa, void *user) +static isl_stat pw_aff_constant_is_negative(__isl_take isl_pw_aff *pa, + void *user) { - int r; + isl_stat r; int *neg = user; r = isl_pw_aff_foreach_piece(pa, &aff_constant_is_negative, user); isl_pw_aff_free(pa); - return *neg ? 0 : -1; + return (*neg && r >= 0) ? isl_stat_ok : isl_stat_error; } /* Does each element in "list" have a negative constant term? @@ -890,7 +1004,7 @@ if (!graft) return NULL; - cond = isl_ast_build_expr_from_set(build, isl_set_copy(set)); + cond = isl_ast_build_expr_from_set_internal(build, isl_set_copy(set)); graft->node->u.f.cond = cond; if (!graft->node->u.f.cond) return isl_ast_graft_free(graft); @@ -950,7 +1064,6 @@ * * In particular, * - set the initialization part of the loop to the maximum of the lower bounds - * - set the size of the iterator based on the values attained by the iterator * - extract the increment from the stride of the current dimension * - construct the for condition either based on a list of upper bounds * or on a set of upper bound constraints. @@ -966,8 +1079,6 @@ return NULL; build = isl_ast_build_copy(build); - build = isl_ast_build_set_enforced(build, - isl_ast_graft_get_enforced(graft)); node = graft->node; node->u.f.init = reduce_list(isl_ast_op_max, lower, build); @@ -1091,7 +1202,7 @@ * on whether "c" is independenct of dimensions data->pos, * a lower bound or an upper bound. */ -static int count_constraints(__isl_take isl_constraint *c, void *user) +static isl_stat count_constraints(__isl_take isl_constraint *c, void *user) { struct isl_ast_count_constraints_data *data = user; @@ -1104,14 +1215,16 @@ isl_constraint_free(c); - return 0; + return isl_stat_ok; } /* Update "graft" based on "bounds" and "domain" for the generic, * non-degenerate, case. * * "list" respresent the list of bounds that need to be encoded by - * the for loop (or a guard around the for loop). + * the for loop. Only the constraints that involve the iterator + * are relevant here. The other constraints are taken care of by + * the caller and are included in the generated constraints of "build". * "domain" is the subset of the intersection of the constraints * for which some code is executed. * "build" is the build in which graft->node was created. @@ -1120,17 +1233,11 @@ * are independent of the loop iterator. * * The actual for loop bounds are generated in refine_generic_bounds. - * If there are any constraints that are independent of the loop iterator, - * we need to put a guard around the for loop (which may get hoisted up - * to higher levels) and we call refine_generic_bounds in a build - * where this guard is enforced. */ static __isl_give isl_ast_graft *refine_generic_split( __isl_take isl_ast_graft *graft, __isl_take isl_constraint_list *list, __isl_keep isl_set *domain, __isl_keep isl_ast_build *build) { - isl_ast_build *for_build; - isl_set *guard; struct isl_ast_count_constraints_data data; isl_constraint_list *lower; isl_constraint_list *upper; @@ -1150,54 +1257,12 @@ return isl_ast_graft_free(graft); } - lower = isl_constraint_list_copy(list); - lower = isl_constraint_list_drop(lower, 0, data.n_indep); + lower = isl_constraint_list_drop(list, 0, data.n_indep); upper = isl_constraint_list_copy(lower); lower = isl_constraint_list_drop(lower, data.n_lower, data.n_upper); upper = isl_constraint_list_drop(upper, 0, data.n_lower); - if (data.n_indep == 0) { - isl_constraint_list_free(list); - return refine_generic_bounds(graft, lower, upper, - domain, build); - } - - list = isl_constraint_list_drop(list, data.n_indep, - data.n_lower + data.n_upper); - guard = intersect_constraints(list); - isl_constraint_list_free(list); - - for_build = isl_ast_build_copy(build); - for_build = isl_ast_build_restrict_pending(for_build, - isl_set_copy(guard)); - graft = refine_generic_bounds(graft, lower, upper, domain, for_build); - isl_ast_build_free(for_build); - - graft = isl_ast_graft_add_guard(graft, guard, build); - - return graft; -} - -/* Add the guard implied by the current stride constraint (if any), - * but not (necessarily) enforced by the generated AST to "graft". - */ -static __isl_give isl_ast_graft *add_stride_guard( - __isl_take isl_ast_graft *graft, __isl_keep isl_ast_build *build) -{ - int depth; - isl_set *dom; - - depth = isl_ast_build_get_depth(build); - if (!isl_ast_build_has_stride(build, depth)) - return graft; - - dom = isl_ast_build_get_stride_constraint(build); - dom = isl_set_eliminate(dom, isl_dim_set, depth, 1); - dom = isl_ast_build_compute_gist(build, dom); - - graft = isl_ast_graft_add_guard(graft, dom, build); - - return graft; + return refine_generic_bounds(graft, lower, upper, domain, build); } /* Update "graft" based on "bounds" and "domain" for the generic, @@ -1221,12 +1286,9 @@ if (!build || !graft) return isl_ast_graft_free(graft); - bounds = isl_basic_set_copy(bounds); - bounds = isl_ast_build_compute_gist_basic_set(build, bounds); - list = isl_constraint_list_from_basic_set(bounds); + list = isl_basic_set_get_constraint_list(bounds); graft = refine_generic_split(graft, list, domain, build); - graft = add_stride_guard(graft, build); return graft; } @@ -1254,6 +1316,43 @@ return node; } +/* If the ast_build_exploit_nested_bounds option is set, then return + * the constraints enforced by all elements in "list". + * Otherwise, return the universe. + */ +static __isl_give isl_basic_set *extract_shared_enforced( + __isl_keep isl_ast_graft_list *list, __isl_keep isl_ast_build *build) +{ + isl_ctx *ctx; + isl_space *space; + + if (!list) + return NULL; + + ctx = isl_ast_graft_list_get_ctx(list); + if (isl_options_get_ast_build_exploit_nested_bounds(ctx)) + return isl_ast_graft_list_extract_shared_enforced(list, build); + + space = isl_ast_build_get_space(build, 1); + return isl_basic_set_universe(space); +} + +/* Return the pending constraints of "build" that are not already taken + * care of (by a combination of "enforced" and the generated constraints + * of "build"). + */ +static __isl_give isl_set *extract_pending(__isl_keep isl_ast_build *build, + __isl_keep isl_basic_set *enforced) +{ + isl_set *guard, *context; + + guard = isl_ast_build_get_pending(build); + context = isl_set_from_basic_set(isl_basic_set_copy(enforced)); + context = isl_set_intersect(context, + isl_ast_build_get_generated(build)); + return isl_set_gist(guard, context); +} + /* Create an AST node for the current dimension based on * the schedule domain "bounds" and return the node encapsulated * in an isl_ast_graft. @@ -1283,12 +1382,13 @@ * about the strides at the current level, but this information is not * reflected in the build->domain. * We first add this information and the "bounds" to the sub_build->domain. - * isl_ast_build_set_loop_bounds checks whether the current dimension attains + * isl_ast_build_set_loop_bounds adds the stride information and + * checks whether the current dimension attains * only a single value and whether this single value can be represented using * a single affine expression. * In the first case, the current level is considered "degenerate". * In the second, sub-case, the current level is considered "eliminated". - * Eliminated level don't need to be reflected in the AST since we can + * Eliminated levels don't need to be reflected in the AST since we can * simply plug in the affine expression. For degenerate, but non-eliminated, * levels, we do introduce a for node, but mark is as degenerate so that * it can be printed as an assignment of the single value to the loop @@ -1308,10 +1408,22 @@ * We then generate a sequence of grafts for the next level, * create a surrounding graft for the current level and insert * the for node we created (if the current level is not eliminated). - * - * Finally, we set the bounds of the for loop and insert guards - * (either in the AST or in the graft) in one of - * refine_eliminated, refine_degenerate or refine_generic. + * Before creating a graft for the current level, we first extract + * hoistable constraints from the child guards and combine them + * with the pending constraints in the build. These constraints + * are used to simplify the child guards and then added to the guard + * of the current graft to ensure that they will be generated. + * If the hoisted guard is a disjunction, then we use it directly + * to gist the guards on the children before intersect it with the + * pending constraints. We do so because this disjunction is typically + * identical to the guards on the children such that these guards + * can be effectively removed completely. After the intersection, + * the gist operation would have a harder time figuring this out. + * + * Finally, we set the bounds of the for loop in either + * refine_degenerate or refine_generic. + * We do so in a context where the pending constraints of the build + * have been replaced by the guard of the current graft. */ static __isl_give isl_ast_graft *create_node_scaled( __isl_take isl_union_map *executed, @@ -1321,6 +1433,8 @@ int depth; int degenerate, eliminated; isl_basic_set *hull; + isl_basic_set *enforced; + isl_set *guard, *hoisted; isl_ast_node *node = NULL; isl_ast_graft *graft; isl_ast_graft_list *children; @@ -1335,7 +1449,6 @@ depth = isl_ast_build_get_depth(build); sub_build = isl_ast_build_copy(build); - sub_build = isl_ast_build_include_stride(sub_build); sub_build = isl_ast_build_set_loop_bounds(sub_build, isl_basic_set_copy(bounds)); degenerate = isl_ast_build_has_value(sub_build); @@ -1354,15 +1467,36 @@ children = generate_next_level(executed, isl_ast_build_copy(body_build)); - graft = isl_ast_graft_alloc_level(children, build, sub_build); + enforced = extract_shared_enforced(children, build); + guard = extract_pending(sub_build, enforced); + hoisted = isl_ast_graft_list_extract_hoistable_guard(children, build); + if (isl_set_n_basic_set(hoisted) > 1) + children = isl_ast_graft_list_gist_guards(children, + isl_set_copy(hoisted)); + guard = isl_set_intersect(guard, hoisted); if (!eliminated) + guard = add_implied_guards(guard, degenerate, bounds, build); + + graft = isl_ast_graft_alloc_from_children(children, + isl_set_copy(guard), enforced, build, sub_build); + + if (!degenerate) + bounds = isl_ast_build_compute_gist_basic_set(build, bounds); + if (!eliminated) { + isl_ast_build *for_build; + graft = isl_ast_graft_insert_for(graft, node); - if (eliminated) - graft = refine_eliminated(graft, bounds, build); - else if (degenerate) - graft = refine_degenerate(graft, bounds, build, sub_build); - else - graft = refine_generic(graft, bounds, domain, build); + for_build = isl_ast_build_copy(build); + for_build = isl_ast_build_replace_pending_by_guard(for_build, + isl_set_copy(guard)); + if (degenerate) + graft = refine_degenerate(graft, for_build, sub_build); + else + graft = refine_generic(graft, bounds, + domain, for_build); + isl_ast_build_free(for_build); + } + isl_set_free(guard); if (!eliminated) graft = after_each_for(graft, body_build); @@ -1391,7 +1525,8 @@ * reducing data->m if needed. * Break out of the iteration if data->m has become equal to "1". */ -static int constraint_check_scaled(__isl_take isl_constraint *c, void *user) +static isl_stat constraint_check_scaled(__isl_take isl_constraint *c, + void *user) { struct isl_check_scaled_data *data = user; int i, j, n; @@ -1400,7 +1535,7 @@ if (!isl_constraint_involves_dims(c, isl_dim_in, data->depth, 1)) { isl_constraint_free(c); - return 0; + return isl_stat_ok; } for (i = 0; i < 4; ++i) { @@ -1423,7 +1558,7 @@ isl_constraint_free(c); - return i < 4 ? -1 : 0; + return i < 4 ? isl_stat_error : isl_stat_ok; } /* For each constraint of "bmap" that involves the input dimension data->depth, @@ -1431,9 +1566,10 @@ * reducing data->m if needed. * Break out of the iteration if data->m has become equal to "1". */ -static int basic_map_check_scaled(__isl_take isl_basic_map *bmap, void *user) +static isl_stat basic_map_check_scaled(__isl_take isl_basic_map *bmap, + void *user) { - int r; + isl_stat r; r = isl_basic_map_foreach_constraint(bmap, &constraint_check_scaled, user); @@ -1447,9 +1583,9 @@ * reducing data->m if needed. * Break out of the iteration if data->m has become equal to "1". */ -static int map_check_scaled(__isl_take isl_map *map, void *user) +static isl_stat map_check_scaled(__isl_take isl_map *map, void *user) { - int r; + isl_stat r; r = isl_map_foreach_basic_map(map, &basic_map_check_scaled, user); isl_map_free(map); @@ -1475,7 +1611,7 @@ * * f + s a * - * with a an integer. We check if we can find an integer m that (obviouly) + * with a an integer. We check if we can find an integer m that (obviously) * divides both f and s. * * If so, we check if the current dimension only appears in constraints @@ -1570,13 +1706,13 @@ /* Add the basic set to the list that "user" points to. */ -static int collect_basic_set(__isl_take isl_basic_set *bset, void *user) +static isl_stat collect_basic_set(__isl_take isl_basic_set *bset, void *user) { isl_basic_set_list **list = user; *list = isl_basic_set_list_add(*list, bset); - return 0; + return isl_stat_ok; } /* Extract the basic sets of "set" and collect them in an isl_basic_set_list. @@ -1605,7 +1741,8 @@ /* Generate code for the schedule domain "bounds" * and add the result to "list". * - * We mainly detect strides and additional equalities here + * We mainly detect strides here and check if the bounds do not + * conflict with the current build domain * and then pass over control to create_node. * * "bounds" reflects the bounds on the current dimension and possibly @@ -1622,7 +1759,7 @@ isl_ast_graft *graft; isl_set *domain = NULL; isl_union_set *uset; - int empty; + int empty, disjoint; uset = isl_union_set_from_basic_set(isl_basic_set_copy(bounds)); executed = isl_union_map_intersect_domain(executed, uset); @@ -1634,14 +1771,16 @@ uset = isl_union_map_domain(isl_union_map_copy(executed)); domain = isl_set_from_union_set(uset); - domain = isl_ast_build_compute_gist(build, domain); - empty = isl_set_is_empty(domain); - if (empty < 0) + domain = isl_ast_build_specialize(build, domain); + + domain = isl_set_compute_divs(domain); + domain = isl_ast_build_eliminate_inner(build, domain); + disjoint = isl_set_is_disjoint(domain, build->domain); + if (disjoint < 0) goto error; - if (empty) + if (disjoint) goto done; - domain = isl_ast_build_eliminate_inner(build, domain); build = isl_ast_build_detect_strides(build, isl_set_copy(domain)); graft = create_node(executed, bounds, domain, @@ -1662,12 +1801,12 @@ /* Does any element of i follow or coincide with any element of j * at the current depth for equal values of the outer dimensions? */ -static int domain_follows_at_depth(__isl_keep isl_basic_set *i, +static isl_bool domain_follows_at_depth(__isl_keep isl_basic_set *i, __isl_keep isl_basic_set *j, void *user) { int depth = *(int *) user; isl_basic_map *test; - int empty; + isl_bool empty; int l; test = isl_basic_map_from_domain_and_range(isl_basic_set_copy(i), @@ -1680,7 +1819,7 @@ empty = isl_basic_map_is_empty(test); isl_basic_map_free(test); - return empty < 0 ? -1 : !empty; + return empty < 0 ? isl_bool_error : !empty; } /* Split up each element of "list" into a part that is related to "bset" @@ -1694,6 +1833,9 @@ int i, n; isl_basic_set_list *res; + if (!list) + bset = isl_basic_set_free(bset); + gt = isl_basic_map_copy(gt); gt = isl_basic_map_intersect_domain(gt, isl_basic_set_copy(bset)); n = isl_basic_set_list_n_basic_set(list); @@ -1776,12 +1918,16 @@ * we split off that part of the basic set i that shares the outer dimensions * with j and lies before j in the current dimension. * We collect all the pieces in a new list that replaces "scc". + * + * While the elements in "scc" should be disjoint, we double-check + * this property to avoid running into an infinite recursion in case + * they intersect due to some internal error. */ -static int add_nodes(__isl_take isl_basic_set_list *scc, void *user) +static isl_stat add_nodes(__isl_take isl_basic_set_list *scc, void *user) { struct isl_add_nodes_data *data = user; int i, n, depth; - isl_basic_set *bset; + isl_basic_set *bset, *first; isl_basic_set_list *list; isl_space *space; isl_basic_map *gt; @@ -1793,7 +1939,7 @@ data->list = add_node(data->list, isl_union_map_copy(data->executed), bset, isl_ast_build_copy(data->build)); - return data->list ? 0 : -1; + return data->list ? isl_stat_ok : isl_stat_error; } depth = isl_ast_build_get_depth(data->build); @@ -1804,11 +1950,25 @@ gt = isl_basic_map_equate(gt, isl_dim_in, i, isl_dim_out, i); gt = isl_basic_map_order_gt(gt, isl_dim_in, depth, isl_dim_out, depth); + first = isl_basic_set_copy(bset); list = isl_basic_set_list_from_basic_set(bset); for (i = 1; i < n; ++i) { + int disjoint; + bset = isl_basic_set_list_get_basic_set(scc, i); + + disjoint = isl_basic_set_is_disjoint(bset, first); + if (disjoint < 0) + list = isl_basic_set_list_free(list); + else if (!disjoint) + isl_die(isl_basic_set_list_get_ctx(scc), + isl_error_internal, + "basic sets in scc are assumed to be disjoint", + list = isl_basic_set_list_free(list)); + list = add_split_on(list, bset, gt); } + isl_basic_set_free(first); isl_basic_map_free(gt); isl_basic_set_list_free(scc); scc = list; @@ -1816,7 +1976,7 @@ generate_sorted_domains(scc, data->executed, data->build)); isl_basic_set_list_free(scc); - return data->list ? 0 : -1; + return data->list ? isl_stat_ok : isl_stat_error; } /* Sort the domains in "domain_list" according to the execution order @@ -1867,12 +2027,12 @@ /* Do i and j share any values for the outer dimensions? */ -static int shared_outer(__isl_keep isl_basic_set *i, +static isl_bool shared_outer(__isl_keep isl_basic_set *i, __isl_keep isl_basic_set *j, void *user) { int depth = *(int *) user; isl_basic_map *test; - int empty; + isl_bool empty; int l; test = isl_basic_map_from_domain_and_range(isl_basic_set_copy(i), @@ -1883,7 +2043,7 @@ empty = isl_basic_map_is_empty(test); isl_basic_map_free(test); - return empty < 0 ? -1 : !empty; + return empty < 0 ? isl_bool_error : !empty; } /* Internal data structure for generate_sorted_domains_wrap. @@ -1914,7 +2074,7 @@ * then data->single is set to 1 and the result of generate_sorted_domains * is not fused. */ -static int generate_sorted_domains_wrap(__isl_take isl_basic_set_list *scc, +static isl_stat generate_sorted_domains_wrap(__isl_take isl_basic_set_list *scc, void *user) { struct isl_ast_generate_parallel_domains_data *data = user; @@ -1931,9 +2091,9 @@ isl_basic_set_list_free(scc); if (!data->list) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Look for any (weakly connected) components in the "domain_list" @@ -2045,7 +2205,7 @@ * and then add that part of the range of "map" that does not intersect * with data->domain. */ -static int separate_domain(__isl_take isl_map *map, void *user) +static isl_stat separate_domain(__isl_take isl_map *map, void *user) { struct isl_separate_domain_data *data = user; isl_set *domain; @@ -2064,7 +2224,7 @@ data->domain = isl_set_union(data->domain, d1); data->domain = isl_set_union(data->domain, d2); - return 0; + return isl_stat_ok; } /* Separate the schedule domains of "executed". @@ -2095,22 +2255,143 @@ /* Temporary data used during the search for a lower bound for unrolling. * + * "build" is the build in which the unrolling will be performed * "domain" is the original set for which to find a lower bound * "depth" is the dimension for which to find a lower boudn + * "expansion" is the expansion that needs to be applied to "domain" + * in the unrolling that will be performed * * "lower" is the best lower bound found so far. It is NULL if we have not * found any yet. * "n" is the corresponding size. If lower is NULL, then the value of n * is undefined. + * "n_div" is the maximal number of integer divisions in the first + * unrolled iteration (after expansion). It is set to -1 if it hasn't + * been computed yet. */ struct isl_find_unroll_data { + isl_ast_build *build; isl_set *domain; int depth; + isl_basic_map *expansion; isl_aff *lower; int *n; + int n_div; }; +/* Return the constraint + * + * i_"depth" = aff + offset + */ +static __isl_give isl_constraint *at_offset(int depth, __isl_keep isl_aff *aff, + int offset) +{ + aff = isl_aff_copy(aff); + aff = isl_aff_add_coefficient_si(aff, isl_dim_in, depth, -1); + aff = isl_aff_add_constant_si(aff, offset); + return isl_equality_from_aff(aff); +} + +/* Update *user to the number of integer divsions in the first element + * of "ma", if it is larger than the current value. + */ +static isl_stat update_n_div(__isl_take isl_set *set, + __isl_take isl_multi_aff *ma, void *user) +{ + isl_aff *aff; + int *n = user; + int n_div; + + aff = isl_multi_aff_get_aff(ma, 0); + n_div = isl_aff_dim(aff, isl_dim_div); + isl_aff_free(aff); + isl_multi_aff_free(ma); + isl_set_free(set); + + if (n_div > *n) + *n = n_div; + + return aff ? isl_stat_ok : isl_stat_error; +} + +/* Get the number of integer divisions in the expression for the iterator + * value at the first slice in the unrolling based on lower bound "lower", + * taking into account the expansion that needs to be performed on this slice. + */ +static int get_expanded_n_div(struct isl_find_unroll_data *data, + __isl_keep isl_aff *lower) +{ + isl_constraint *c; + isl_set *set; + isl_map *it_map, *expansion; + isl_pw_multi_aff *pma; + int n; + + c = at_offset(data->depth, lower, 0); + set = isl_set_copy(data->domain); + set = isl_set_add_constraint(set, c); + expansion = isl_map_from_basic_map(isl_basic_map_copy(data->expansion)); + set = isl_set_apply(set, expansion); + it_map = isl_ast_build_map_to_iterator(data->build, set); + pma = isl_pw_multi_aff_from_map(it_map); + n = 0; + if (isl_pw_multi_aff_foreach_piece(pma, &update_n_div, &n) < 0) + n = -1; + isl_pw_multi_aff_free(pma); + + return n; +} + +/* Is the lower bound "lower" with corresponding iteration count "n" + * better than the one stored in "data"? + * If there is no upper bound on the iteration count ("n" is infinity) or + * if the count is too large, then we cannot use this lower bound. + * Otherwise, if there was no previous lower bound or + * if the iteration count of the new lower bound is smaller than + * the iteration count of the previous lower bound, then we consider + * the new lower bound to be better. + * If the iteration count is the same, then compare the number + * of integer divisions that would be needed to express + * the iterator value at the first slice in the unrolling + * according to the lower bound. If we end up computing this + * number, then store the lowest value in data->n_div. + */ +static int is_better_lower_bound(struct isl_find_unroll_data *data, + __isl_keep isl_aff *lower, __isl_keep isl_val *n) +{ + int cmp; + int n_div; + + if (!n) + return -1; + if (isl_val_is_infty(n)) + return 0; + if (isl_val_cmp_si(n, INT_MAX) > 0) + return 0; + if (!data->lower) + return 1; + cmp = isl_val_cmp_si(n, *data->n); + if (cmp < 0) + return 1; + if (cmp > 0) + return 0; + if (data->n_div < 0) + data->n_div = get_expanded_n_div(data, data->lower); + if (data->n_div < 0) + return -1; + if (data->n_div == 0) + return 0; + n_div = get_expanded_n_div(data, lower); + if (n_div < 0) + return -1; + if (n_div >= data->n_div) + return 0; + data->n_div = n_div; + + return 1; +} + /* Check if we can use "c" as a lower bound and if it is better than * any previously found lower bound. * @@ -2134,17 +2415,18 @@ * * meaning that we can use ceil(f(j)/a)) as a lower bound for unrolling. * We just need to check if we have found any lower bound before and - * if the new lower bound is better (smaller n) than the previously found - * lower bounds. + * if the new lower bound is better (smaller n or fewer integer divisions) + * than the previously found lower bounds. */ -static int update_unrolling_lower_bound(struct isl_find_unroll_data *data, +static isl_stat update_unrolling_lower_bound(struct isl_find_unroll_data *data, __isl_keep isl_constraint *c) { isl_aff *aff, *lower; isl_val *max; + int better; if (!isl_constraint_is_lower_bound(c, isl_dim_set, data->depth)) - return 0; + return isl_stat_ok; lower = isl_constraint_get_bound(c, isl_dim_set, data->depth); lower = isl_aff_ceil(lower); @@ -2155,36 +2437,28 @@ max = isl_set_max_val(data->domain, aff); isl_aff_free(aff); - if (!max) - goto error; - if (isl_val_is_infty(max)) { + better = is_better_lower_bound(data, lower, max); + if (better < 0 || !better) { isl_val_free(max); isl_aff_free(lower); - return 0; + return better < 0 ? isl_stat_error : isl_stat_ok; } - if (isl_val_cmp_si(max, INT_MAX) <= 0 && - (!data->lower || isl_val_cmp_si(max, *data->n) < 0)) { - isl_aff_free(data->lower); - data->lower = lower; - *data->n = isl_val_get_num_si(max); - } else - isl_aff_free(lower); + isl_aff_free(data->lower); + data->lower = lower; + *data->n = isl_val_get_num_si(max); isl_val_free(max); - return 1; -error: - isl_aff_free(lower); - return -1; + return isl_stat_ok; } /* Check if we can use "c" as a lower bound and if it is better than * any previously found lower bound. */ -static int constraint_find_unroll(__isl_take isl_constraint *c, void *user) +static isl_stat constraint_find_unroll(__isl_take isl_constraint *c, void *user) { struct isl_find_unroll_data *data; - int r; + isl_stat r; data = (struct isl_find_unroll_data *) user; r = update_unrolling_lower_bound(data, c); @@ -2201,6 +2475,9 @@ * where d is "depth" and l(i) depends only on earlier dimensions. * Furthermore, try and find a lower bound such that n is as small as possible. * In particular, "n" needs to be finite. + * "build" is the build in which the unrolling will be performed. + * "expansion" is the expansion that needs to be applied to "domain" + * in the unrolling that will be performed. * * Inner dimensions have been eliminated from "domain" by the caller. * @@ -2214,10 +2491,12 @@ * If we cannot find a suitable lower bound, then we consider that * to be an error. */ -static __isl_give isl_aff *find_unroll_lower_bound(__isl_keep isl_set *domain, - int depth, int *n) +static __isl_give isl_aff *find_unroll_lower_bound( + __isl_keep isl_ast_build *build, __isl_keep isl_set *domain, + int depth, __isl_keep isl_basic_map *expansion, int *n) { - struct isl_find_unroll_data data = { domain, depth, NULL, n }; + struct isl_find_unroll_data data = + { build, domain, depth, expansion, NULL, n, -1 }; isl_basic_set *hull; hull = isl_set_simple_hull(isl_set_copy(domain)); @@ -2238,23 +2517,10 @@ return isl_aff_free(data.lower); } -/* Return the constraint - * - * i_"depth" = aff + offset - */ -static __isl_give isl_constraint *at_offset(int depth, __isl_keep isl_aff *aff, - int offset) -{ - aff = isl_aff_copy(aff); - aff = isl_aff_add_coefficient_si(aff, isl_dim_in, depth, -1); - aff = isl_aff_add_constant_si(aff, offset); - return isl_equality_from_aff(aff); -} - -/* Return a list of basic sets, one for each value of the current dimension - * in "domain". - * The divs that involve the current dimension have not been projected out - * from this domain. +/* Call "fn" on each iteration of the current dimension of "domain". + * If "init" is not NULL, then it is called with the number of + * iterations before any call to "fn". + * Return -1 on failure. * * Since we are going to be iterating over the individual values, * we first check if there are any strides on the current dimension. @@ -2282,44 +2548,41 @@ * will be taken into account at the next level, as in the case of the * atomic option. * - * Finally, we map i' back to i and add each basic set to the list. + * Finally, we map i' back to i and call "fn". */ -static __isl_give isl_basic_set_list *do_unroll(__isl_take isl_set *domain, - __isl_keep isl_ast_build *build) +static int foreach_iteration(__isl_take isl_set *domain, + __isl_keep isl_ast_build *build, int (*init)(int n, void *user), + int (*fn)(__isl_take isl_basic_set *bset, void *user), void *user) { int i, n; int depth; - isl_ctx *ctx; - isl_aff *lower; - isl_basic_set_list *list; isl_multi_aff *expansion; isl_basic_map *bmap; + isl_aff *lower; + isl_ast_build *stride_build; - if (!domain) - return NULL; - - ctx = isl_set_get_ctx(domain); depth = isl_ast_build_get_depth(build); - build = isl_ast_build_copy(build); + domain = isl_ast_build_eliminate_inner(build, domain); - build = isl_ast_build_detect_strides(build, isl_set_copy(domain)); - expansion = isl_ast_build_get_stride_expansion(build); + domain = isl_set_intersect(domain, isl_ast_build_get_domain(build)); + stride_build = isl_ast_build_copy(build); + stride_build = isl_ast_build_detect_strides(stride_build, + isl_set_copy(domain)); + expansion = isl_ast_build_get_stride_expansion(stride_build); domain = isl_set_preimage_multi_aff(domain, isl_multi_aff_copy(expansion)); - domain = isl_ast_build_eliminate_divs(build, domain); - - isl_ast_build_free(build); - - list = isl_basic_set_list_alloc(ctx, 0); - - lower = find_unroll_lower_bound(domain, depth, &n); - if (!lower) - list = isl_basic_set_list_free(list); + domain = isl_ast_build_eliminate_divs(stride_build, domain); + isl_ast_build_free(stride_build); bmap = isl_basic_map_from_multi_aff(expansion); - for (i = 0; list && i < n; ++i) { + lower = find_unroll_lower_bound(build, domain, depth, bmap, &n); + if (!lower) + n = -1; + else if (init && init(n, user) < 0) + n = -1; + for (i = 0; i < n; ++i) { isl_set *set; isl_basic_set *bset; isl_constraint *slice; @@ -2330,14 +2593,16 @@ bset = isl_set_unshifted_simple_hull(set); bset = isl_basic_set_add_constraint(bset, slice); bset = isl_basic_set_apply(bset, isl_basic_map_copy(bmap)); - list = isl_basic_set_list_add(list, bset); + + if (fn(bset, user) < 0) + break; } isl_aff_free(lower); isl_set_free(domain); isl_basic_map_free(bmap); - return list; + return n < 0 || i < n ? -1 : 0; } /* Data structure for storing the results and the intermediate objects @@ -2358,9 +2623,6 @@ * specialized to the current depth. * "done" contains the union of the separation domains that have already * been handled. - * "atomic" contains the domain that has effectively been made atomic. - * This domain may be larger than the intersection of option[atomic] - * and the schedule domain. */ struct isl_codegen_domains { isl_basic_set_list *list; @@ -2369,21 +2631,88 @@ isl_ast_build *build; isl_set *schedule_domain; - isl_set *option[3]; + isl_set *option[4]; isl_map *sep_class; isl_set *done; - isl_set *atomic; }; -/* Add domains to domains->list for each individual value of the current - * dimension, for that part of the schedule domain that lies in the - * intersection of the option domain and the class domain. +/* Internal data structure for do_unroll. * - * "domain" is the intersection of the class domain and the schedule domain. + * "domains" stores the results of compute_domains. + * "class_domain" is the original class domain passed to do_unroll. + * "unroll_domain" collects the unrolled iterations. + */ +struct isl_ast_unroll_data { + struct isl_codegen_domains *domains; + isl_set *class_domain; + isl_set *unroll_domain; +}; + +/* Given an iteration of an unrolled domain represented by "bset", + * add it to data->domains->list. + * Since we may have dropped some constraints, we intersect with + * the class domain again to ensure that each element in the list + * is disjoint from the other class domains. + */ +static int do_unroll_iteration(__isl_take isl_basic_set *bset, void *user) +{ + struct isl_ast_unroll_data *data = user; + isl_set *set; + isl_basic_set_list *list; + + set = isl_set_from_basic_set(bset); + data->unroll_domain = isl_set_union(data->unroll_domain, + isl_set_copy(set)); + set = isl_set_intersect(set, isl_set_copy(data->class_domain)); + set = isl_set_make_disjoint(set); + list = isl_basic_set_list_from_set(set); + data->domains->list = isl_basic_set_list_concat(data->domains->list, + list); + + return 0; +} + +/* Extend domains->list with a list of basic sets, one for each value + * of the current dimension in "domain" and remove the corresponding + * sets from the class domain. Return the updated class domain. * The divs that involve the current dimension have not been projected out * from this domain. * + * We call foreach_iteration to iterate over the individual values and + * in do_unroll_iteration we collect the individual basic sets in + * domains->list and their union in data->unroll_domain, which is then + * used to update the class domain. + */ +static __isl_give isl_set *do_unroll(struct isl_codegen_domains *domains, + __isl_take isl_set *domain, __isl_take isl_set *class_domain) +{ + struct isl_ast_unroll_data data; + + if (!domain) + return isl_set_free(class_domain); + if (!class_domain) + return isl_set_free(domain); + + data.domains = domains; + data.class_domain = class_domain; + data.unroll_domain = isl_set_empty(isl_set_get_space(domain)); + + if (foreach_iteration(domain, domains->build, NULL, + &do_unroll_iteration, &data) < 0) + data.unroll_domain = isl_set_free(data.unroll_domain); + + class_domain = isl_set_subtract(class_domain, data.unroll_domain); + + return class_domain; +} + +/* Add domains to domains->list for each individual value of the current + * dimension, for that part of the schedule domain that lies in the + * intersection of the option domain and the class domain. + * Remove the corresponding sets from the class domain and + * return the updated class domain. + * * We first break up the unroll option domain into individual pieces * and then handle each of them separately. The unroll option domain * has been made disjoint in compute_domains_init_options, @@ -2394,32 +2723,33 @@ * intersecting with class and schedule domain, hoping that the * unroll option domain specified by the user is relatively simple. */ -static int compute_unroll_domains(struct isl_codegen_domains *domains, - __isl_keep isl_set *domain) +static __isl_give isl_set *compute_unroll_domains( + struct isl_codegen_domains *domains, __isl_take isl_set *class_domain) { isl_set *unroll_domain; isl_basic_set_list *unroll_list; int i, n; int empty; - empty = isl_set_is_empty(domains->option[unroll]); + empty = isl_set_is_empty(domains->option[isl_ast_loop_unroll]); if (empty < 0) - return -1; + return isl_set_free(class_domain); if (empty) - return 0; + return class_domain; - unroll_domain = isl_set_copy(domains->option[unroll]); + unroll_domain = isl_set_copy(domains->option[isl_ast_loop_unroll]); unroll_list = isl_basic_set_list_from_set(unroll_domain); n = isl_basic_set_list_n_basic_set(unroll_list); for (i = 0; i < n; ++i) { isl_basic_set *bset; - isl_basic_set_list *list; bset = isl_basic_set_list_get_basic_set(unroll_list, i); unroll_domain = isl_set_from_basic_set(bset); unroll_domain = isl_set_intersect(unroll_domain, - isl_set_copy(domain)); + isl_set_copy(class_domain)); + unroll_domain = isl_set_intersect(unroll_domain, + isl_set_copy(domains->schedule_domain)); empty = isl_set_is_empty(unroll_domain); if (empty >= 0 && empty) { @@ -2427,19 +2757,18 @@ continue; } - list = do_unroll(unroll_domain, domains->build); - domains->list = isl_basic_set_list_concat(domains->list, list); + class_domain = do_unroll(domains, unroll_domain, class_domain); } isl_basic_set_list_free(unroll_list); - return 0; + return class_domain; } /* Try and construct a single basic set that includes the intersection of * the schedule domain, the atomic option domain and the class domain. - * Add the resulting basic set(s) to domains->list and save a copy - * in domains->atomic for use in compute_partial_domains. + * Add the resulting basic set(s) to domains->list and remove them + * from class_domain. Return the updated class domain. * * We construct a single domain rather than trying to combine * the schedule domains of individual domains because we are working @@ -2453,35 +2782,38 @@ * "domain" is the intersection of the schedule domain and the class domain, * with inner dimensions projected out. */ -static int compute_atomic_domain(struct isl_codegen_domains *domains, - __isl_keep isl_set *class_domain) +static __isl_give isl_set *compute_atomic_domain( + struct isl_codegen_domains *domains, __isl_take isl_set *class_domain) { isl_basic_set *bset; isl_basic_set_list *list; - isl_set *domain; + isl_set *domain, *atomic_domain; int empty; - domain = isl_set_copy(domains->option[atomic]); + domain = isl_set_copy(domains->option[isl_ast_loop_atomic]); domain = isl_set_intersect(domain, isl_set_copy(class_domain)); domain = isl_set_intersect(domain, isl_set_copy(domains->schedule_domain)); empty = isl_set_is_empty(domain); - if (empty < 0 || empty) { - domains->atomic = domain; - return empty < 0 ? -1 : 0; + if (empty < 0) + class_domain = isl_set_free(class_domain); + if (empty) { + isl_set_free(domain); + return class_domain; } domain = isl_ast_build_eliminate(domains->build, domain); domain = isl_set_coalesce(domain); bset = isl_set_unshifted_simple_hull(domain); domain = isl_set_from_basic_set(bset); - domains->atomic = isl_set_copy(domain); + atomic_domain = isl_set_copy(domain); domain = isl_set_intersect(domain, isl_set_copy(class_domain)); + class_domain = isl_set_subtract(class_domain, atomic_domain); domain = isl_set_make_disjoint(domain); list = isl_basic_set_list_from_set(domain); domains->list = isl_basic_set_list_concat(domains->list, list); - return 0; + return class_domain; } /* Split up the schedule domain into uniform basic sets, @@ -2505,7 +2837,7 @@ isl_basic_set_list *list; int empty; - domain = isl_set_copy(domains->option[separate]); + domain = isl_set_copy(domains->option[isl_ast_loop_separate]); domain = isl_set_intersect(domain, isl_set_copy(class_domain)); executed = isl_union_map_copy(domains->executed); executed = isl_union_map_intersect_domain(executed, @@ -2553,14 +2885,16 @@ * * The domain that has been made atomic may be larger than specified * by the user since it needs to be representable as a single basic set. - * This possibly larger domain is stored in domains->atomic by + * This possibly larger domain is removed from class_domain by * compute_atomic_domain. It is computed first so that the extended domain * would not overlap with any domains computed before. + * Similary, the unrolled domains may have some constraints removed and + * may therefore also be larger than specified by the user. * * If anything is left after handling separate, unroll and atomic, * we split it up into basic sets and append the basic sets to domains->list. */ -static int compute_partial_domains(struct isl_codegen_domains *domains, +static isl_stat compute_partial_domains(struct isl_codegen_domains *domains, __isl_take isl_set *class_domain) { isl_basic_set_list *list; @@ -2571,25 +2905,19 @@ domains->done = isl_set_union(domains->done, isl_set_copy(class_domain)); - domain = isl_set_copy(class_domain); + class_domain = compute_atomic_domain(domains, class_domain); + class_domain = compute_unroll_domains(domains, class_domain); - if (compute_atomic_domain(domains, class_domain) < 0) - domain = isl_set_free(domain); - domain = isl_set_subtract(domain, domains->atomic); + domain = isl_set_copy(class_domain); if (compute_separate_domain(domains, domain) < 0) goto error; domain = isl_set_subtract(domain, - isl_set_copy(domains->option[separate])); + isl_set_copy(domains->option[isl_ast_loop_separate])); domain = isl_set_intersect(domain, isl_set_copy(domains->schedule_domain)); - if (compute_unroll_domains(domains, domain) < 0) - goto error; - domain = isl_set_subtract(domain, - isl_set_copy(domains->option[unroll])); - domain = isl_ast_build_eliminate(domains->build, domain); domain = isl_set_intersect(domain, isl_set_copy(class_domain)); @@ -2601,11 +2929,11 @@ isl_set_free(class_domain); - return 0; + return isl_stat_ok; error: isl_set_free(domain); isl_set_free(class_domain); - return -1; + return isl_stat_error; } /* Split up the domain at the current depth into disjoint @@ -2615,7 +2943,7 @@ * We extract the corresponding class domain from domains->sep_class, * eliminate inner dimensions and pass control to compute_partial_domains. */ -static int compute_class_domains(__isl_take isl_point *pnt, void *user) +static isl_stat compute_class_domains(__isl_take isl_point *pnt, void *user) { struct isl_codegen_domains *domains = user; isl_set *class_set; @@ -2630,10 +2958,10 @@ disjoint = isl_set_plain_is_disjoint(domain, domains->schedule_domain); if (disjoint < 0) - return -1; + return isl_stat_error; if (disjoint) { isl_set_free(domain); - return 0; + return isl_stat_ok; } return compute_partial_domains(domains, domain); @@ -2645,20 +2973,24 @@ * The domains specified by the user might overlap, so we make * them disjoint by subtracting earlier domains from later domains. */ -static void compute_domains_init_options(isl_set *option[3], +static void compute_domains_init_options(isl_set *option[4], __isl_keep isl_ast_build *build) { - enum isl_ast_build_domain_type type, type2; + enum isl_ast_loop_type type, type2; + isl_set *unroll; - for (type = atomic; type <= separate; ++type) { + for (type = isl_ast_loop_atomic; + type <= isl_ast_loop_separate; ++type) { option[type] = isl_ast_build_get_option_domain(build, type); - for (type2 = atomic; type2 < type; ++type2) + for (type2 = isl_ast_loop_atomic; type2 < type; ++type2) option[type] = isl_set_subtract(option[type], isl_set_copy(option[type2])); } - option[unroll] = isl_set_coalesce(option[unroll]); - option[unroll] = isl_set_make_disjoint(option[unroll]); + unroll = option[isl_ast_loop_unroll]; + unroll = isl_set_coalesce(unroll); + unroll = isl_set_make_disjoint(unroll); + option[isl_ast_loop_unroll] = unroll; } /* Split up the domain at the current depth into disjoint @@ -2692,7 +3024,7 @@ isl_set *classes; isl_space *space; int n_param; - enum isl_ast_build_domain_type type; + enum isl_ast_loop_type type; int empty; if (!executed) @@ -2737,20 +3069,20 @@ isl_set_free(domains.schedule_domain); isl_set_free(domains.done); isl_map_free(domains.sep_class); - for (type = atomic; type <= separate; ++type) + for (type = isl_ast_loop_atomic; type <= isl_ast_loop_separate; ++type) isl_set_free(domains.option[type]); return domains.list; } /* Generate code for a single component, after shifting (if any) - * has been applied. + * has been applied, in case the schedule was specified as a union map. * * We first split up the domain at the current depth into disjoint * basic sets based on the user-specified options. * Then we generated code for each of them and concatenate the results. */ -static __isl_give isl_ast_graft_list *generate_shifted_component( +static __isl_give isl_ast_graft_list *generate_shifted_component_flat( __isl_take isl_union_map *executed, __isl_take isl_ast_build *build) { isl_basic_set_list *domain_list; @@ -2766,6 +3098,308 @@ return list; } +/* Generate code for a single component, after shifting (if any) + * has been applied, in case the schedule was specified as a schedule tree + * and the separate option was specified. + * + * We perform separation on the domain of "executed" and then generate + * an AST for each of the resulting disjoint basic sets. + */ +static __isl_give isl_ast_graft_list *generate_shifted_component_tree_separate( + __isl_take isl_union_map *executed, __isl_take isl_ast_build *build) +{ + isl_space *space; + isl_set *domain; + isl_basic_set_list *domain_list; + isl_ast_graft_list *list; + + space = isl_ast_build_get_space(build, 1); + domain = separate_schedule_domains(space, + isl_union_map_copy(executed), build); + domain_list = isl_basic_set_list_from_set(domain); + + list = generate_parallel_domains(domain_list, executed, build); + + isl_basic_set_list_free(domain_list); + isl_union_map_free(executed); + isl_ast_build_free(build); + + return list; +} + +/* Internal data structure for generate_shifted_component_tree_unroll. + * + * "executed" and "build" are inputs to generate_shifted_component_tree_unroll. + * "list" collects the constructs grafts. + */ +struct isl_ast_unroll_tree_data { + isl_union_map *executed; + isl_ast_build *build; + isl_ast_graft_list *list; +}; + +/* Initialize data->list to a list of "n" elements. + */ +static int init_unroll_tree(int n, void *user) +{ + struct isl_ast_unroll_tree_data *data = user; + isl_ctx *ctx; + + ctx = isl_ast_build_get_ctx(data->build); + data->list = isl_ast_graft_list_alloc(ctx, n); + + return 0; +} + +/* Given an iteration of an unrolled domain represented by "bset", + * generate the corresponding AST and add the result to data->list. + */ +static int do_unroll_tree_iteration(__isl_take isl_basic_set *bset, void *user) +{ + struct isl_ast_unroll_tree_data *data = user; + + data->list = add_node(data->list, isl_union_map_copy(data->executed), + bset, isl_ast_build_copy(data->build)); + + return 0; +} + +/* Generate code for a single component, after shifting (if any) + * has been applied, in case the schedule was specified as a schedule tree + * and the unroll option was specified. + * + * We call foreach_iteration to iterate over the individual values and + * construct and collect the corresponding grafts in do_unroll_tree_iteration. + */ +static __isl_give isl_ast_graft_list *generate_shifted_component_tree_unroll( + __isl_take isl_union_map *executed, __isl_take isl_set *domain, + __isl_take isl_ast_build *build) +{ + struct isl_ast_unroll_tree_data data = { executed, build, NULL }; + + if (foreach_iteration(domain, build, &init_unroll_tree, + &do_unroll_tree_iteration, &data) < 0) + data.list = isl_ast_graft_list_free(data.list); + + isl_union_map_free(executed); + isl_ast_build_free(build); + + return data.list; +} + +/* Generate code for a single component, after shifting (if any) + * has been applied, in case the schedule was specified as a schedule tree. + * In particular, handle the base case where there is either no isolated + * set or we are within the isolated set (in which case "isolated" is set) + * or the iterations that precede or follow the isolated set. + * + * The schedule domain is broken up or combined into basic sets + * according to the AST generation option specified in the current + * schedule node, which may be either atomic, separate, unroll or + * unspecified. If the option is unspecified, then we currently simply + * split the schedule domain into disjoint basic sets. + * + * In case the separate option is specified, the AST generation is + * handled by generate_shifted_component_tree_separate. + * In the other cases, we need the global schedule domain. + * In the unroll case, the AST generation is then handled by + * generate_shifted_component_tree_unroll which needs the actual + * schedule domain (with divs that may refer to the current dimension) + * so that stride detection can be performed. + * In the atomic or unspecified case, inner dimensions and divs involving + * the current dimensions should be eliminated. + * The result is then either combined into a single basic set or + * split up into disjoint basic sets. + * Finally an AST is generated for each basic set and the results are + * concatenated. + */ +static __isl_give isl_ast_graft_list *generate_shifted_component_tree_base( + __isl_take isl_union_map *executed, __isl_take isl_ast_build *build, + int isolated) +{ + isl_union_set *schedule_domain; + isl_set *domain; + isl_basic_set_list *domain_list; + isl_ast_graft_list *list; + enum isl_ast_loop_type type; + + type = isl_ast_build_get_loop_type(build, isolated); + if (type < 0) + goto error; + + if (type == isl_ast_loop_separate) + return generate_shifted_component_tree_separate(executed, + build); + + schedule_domain = isl_union_map_domain(isl_union_map_copy(executed)); + domain = isl_set_from_union_set(schedule_domain); + + if (type == isl_ast_loop_unroll) + return generate_shifted_component_tree_unroll(executed, domain, + build); + + domain = isl_ast_build_eliminate(build, domain); + domain = isl_set_coalesce(domain); + + if (type == isl_ast_loop_atomic) { + isl_basic_set *hull; + hull = isl_set_unshifted_simple_hull(domain); + domain_list = isl_basic_set_list_from_basic_set(hull); + } else { + domain = isl_set_make_disjoint(domain); + domain_list = isl_basic_set_list_from_set(domain); + } + + list = generate_parallel_domains(domain_list, executed, build); + + isl_basic_set_list_free(domain_list); + isl_union_map_free(executed); + isl_ast_build_free(build); + + return list; +error: + isl_union_map_free(executed); + isl_ast_build_free(build); + return NULL; +} + +/* Generate code for a single component, after shifting (if any) + * has been applied, in case the schedule was specified as a schedule tree. + * In particular, do so for the specified subset of the schedule domain. + */ +static __isl_give isl_ast_graft_list *generate_shifted_component_tree_part( + __isl_keep isl_union_map *executed, __isl_take isl_set *domain, + __isl_keep isl_ast_build *build, int isolated) +{ + isl_union_set *uset; + int empty; + + uset = isl_union_set_from_set(domain); + executed = isl_union_map_copy(executed); + executed = isl_union_map_intersect_domain(executed, uset); + empty = isl_union_map_is_empty(executed); + if (empty < 0) + goto error; + if (empty) { + isl_ctx *ctx; + isl_union_map_free(executed); + ctx = isl_ast_build_get_ctx(build); + return isl_ast_graft_list_alloc(ctx, 0); + } + + build = isl_ast_build_copy(build); + return generate_shifted_component_tree_base(executed, build, isolated); +error: + isl_union_map_free(executed); + return NULL; +} + +/* Generate code for a single component, after shifting (if any) + * has been applied, in case the schedule was specified as a schedule tree. + * + * We first check if the user has specified an isolated schedule domain + * and that we are not already outside of this isolated schedule domain. + * If so, we break up the schedule domain into iterations that + * precede the isolated domain, the isolated domain itself, + * the iterations that follow the isolated domain and + * the remaining iterations (those that are incomparable + * to the isolated domain). + * We generate an AST for each piece and concatenate the results. + * If no isolated set has been specified, then we generate an + * AST for the entire inverse schedule. + */ +static __isl_give isl_ast_graft_list *generate_shifted_component_tree( + __isl_take isl_union_map *executed, __isl_take isl_ast_build *build) +{ + int i, depth; + int empty, has_isolate; + isl_space *space; + isl_union_set *schedule_domain; + isl_set *domain; + isl_basic_set *hull; + isl_set *isolated, *before, *after, *test; + isl_map *gt, *lt; + isl_ast_graft_list *list, *res; + + build = isl_ast_build_extract_isolated(build); + has_isolate = isl_ast_build_has_isolated(build); + if (has_isolate < 0) + executed = isl_union_map_free(executed); + else if (!has_isolate) + return generate_shifted_component_tree_base(executed, build, 0); + + schedule_domain = isl_union_map_domain(isl_union_map_copy(executed)); + domain = isl_set_from_union_set(schedule_domain); + + isolated = isl_ast_build_get_isolated(build); + isolated = isl_set_intersect(isolated, isl_set_copy(domain)); + test = isl_ast_build_specialize(build, isl_set_copy(isolated)); + empty = isl_set_is_empty(test); + isl_set_free(test); + if (empty < 0) + goto error; + if (empty) { + isl_set_free(isolated); + isl_set_free(domain); + return generate_shifted_component_tree_base(executed, build, 0); + } + isolated = isl_ast_build_eliminate(build, isolated); + hull = isl_set_unshifted_simple_hull(isolated); + isolated = isl_set_from_basic_set(hull); + + depth = isl_ast_build_get_depth(build); + space = isl_space_map_from_set(isl_set_get_space(isolated)); + gt = isl_map_universe(space); + for (i = 0; i < depth; ++i) + gt = isl_map_equate(gt, isl_dim_in, i, isl_dim_out, i); + gt = isl_map_order_gt(gt, isl_dim_in, depth, isl_dim_out, depth); + lt = isl_map_reverse(isl_map_copy(gt)); + before = isl_set_apply(isl_set_copy(isolated), gt); + after = isl_set_apply(isl_set_copy(isolated), lt); + + domain = isl_set_subtract(domain, isl_set_copy(isolated)); + domain = isl_set_subtract(domain, isl_set_copy(before)); + domain = isl_set_subtract(domain, isl_set_copy(after)); + after = isl_set_subtract(after, isl_set_copy(isolated)); + after = isl_set_subtract(after, isl_set_copy(before)); + before = isl_set_subtract(before, isl_set_copy(isolated)); + + res = generate_shifted_component_tree_part(executed, before, build, 0); + list = generate_shifted_component_tree_part(executed, isolated, + build, 1); + res = isl_ast_graft_list_concat(res, list); + list = generate_shifted_component_tree_part(executed, after, build, 0); + res = isl_ast_graft_list_concat(res, list); + list = generate_shifted_component_tree_part(executed, domain, build, 0); + res = isl_ast_graft_list_concat(res, list); + + isl_union_map_free(executed); + isl_ast_build_free(build); + + return res; +error: + isl_set_free(domain); + isl_set_free(isolated); + isl_union_map_free(executed); + isl_ast_build_free(build); + return NULL; +} + +/* Generate code for a single component, after shifting (if any) + * has been applied. + * + * Call generate_shifted_component_tree or generate_shifted_component_flat + * depending on whether the schedule was specified as a schedule tree. + */ +static __isl_give isl_ast_graft_list *generate_shifted_component( + __isl_take isl_union_map *executed, __isl_take isl_ast_build *build) +{ + if (isl_ast_build_has_schedule_node(build)) + return generate_shifted_component_tree(executed, build); + else + return generate_shifted_component_flat(executed, build); +} + struct isl_set_map_pair { isl_set *set; isl_map *map; @@ -3040,7 +3674,7 @@ map = isl_map_insert_dims(map, isl_dim_out, depth + 1, 1); space = isl_space_insert_dims(space, isl_dim_out, depth + 1, 1); - c = isl_equality_alloc(isl_local_space_from_space(space)); + c = isl_constraint_alloc_equality(isl_local_space_from_space(space)); c = isl_constraint_set_coefficient_si(c, isl_dim_in, depth, 1); c = isl_constraint_set_coefficient_si(c, isl_dim_out, depth, -1); @@ -3106,19 +3740,17 @@ isl_ast_graft_list *list; int first; int depth; - isl_ctx *ctx; isl_val *val; isl_multi_val *mv; isl_space *space; isl_multi_aff *ma, *zero; isl_union_map *executed; - ctx = isl_ast_build_get_ctx(build); depth = isl_ast_build_get_depth(build); first = first_offset(domain, order, n, build); if (first < 0) - return isl_ast_build_free(build); + goto error; mv = isl_multi_val_copy(offset); val = isl_multi_val_get_val(offset, first); @@ -3143,6 +3775,24 @@ isl_multi_val_free(mv); return list; +error: + isl_ast_build_free(build); + return NULL; +} + +/* Does any node in the schedule tree rooted at the current schedule node + * of "build" depend on outer schedule nodes? + */ +static int has_anchored_subtree(__isl_keep isl_ast_build *build) +{ + isl_schedule_node *node; + int dependent = 0; + + node = isl_ast_build_get_schedule_node(build); + dependent = isl_schedule_node_is_subtree_anchored(node); + isl_schedule_node_free(node); + + return dependent; } /* Generate code for a single component. @@ -3176,11 +3826,15 @@ * a fixed value for almost all domains then there is nothing to be done. * In particular, we need at least two domains where the current schedule * dimension does not have a fixed value. - * Finally, if any of the options refer to the current schedule dimension, + * Finally, in case of a schedule map input, + * if any of the options refer to the current schedule dimension, * then we bail out as well. It would be possible to reformulate the options * in terms of the new schedule domain, but that would introduce constraints * that separate the domains in the options and that is something we would * like to avoid. + * In the case of a schedule tree input, we bail out if any of + * the descendants of the current schedule node refer to outer + * schedule nodes in any way. * * * To see if there is any shifted stride, we look at the differences @@ -3232,17 +3886,21 @@ skip = n == 1; if (skip >= 0 && !skip) skip = at_most_one_non_fixed(domain, order, n, depth); - if (skip >= 0 && !skip) - skip = isl_ast_build_options_involve_depth(build); + if (skip >= 0 && !skip) { + if (isl_ast_build_has_schedule_node(build)) + skip = has_anchored_subtree(build); + else + skip = isl_ast_build_options_involve_depth(build); + } if (skip < 0) - return isl_ast_build_free(build); + goto error; if (skip) return generate_shifted_component_from_list(domain, order, n, build); base = eliminate_non_fixed(domain, order, n, depth, build); if (base < 0) - return isl_ast_build_free(build); + goto error; ctx = isl_ast_build_get_ctx(build); @@ -3306,12 +3964,15 @@ isl_multi_val_free(mv); return list; +error: + isl_ast_build_free(build); + return NULL; } /* Store both "map" itself and its domain in the * structure pointed to by *next and advance to the next array element. */ -static int extract_domain(__isl_take isl_map *map, void *user) +static isl_stat extract_domain(__isl_take isl_map *map, void *user) { struct isl_set_map_pair **next = user; @@ -3319,11 +3980,388 @@ (*next)->set = isl_map_domain(map); (*next)++; + return isl_stat_ok; +} + +static int after_in_tree(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node); + +/* Is any domain element of "umap" scheduled after any of + * the corresponding image elements by the tree rooted at + * the child of "node"? + */ +static int after_in_child(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node) +{ + isl_schedule_node *child; + int after; + + child = isl_schedule_node_get_child(node, 0); + after = after_in_tree(umap, child); + isl_schedule_node_free(child); + + return after; +} + +/* Is any domain element of "umap" scheduled after any of + * the corresponding image elements by the tree rooted at + * the band node "node"? + * + * We first check if any domain element is scheduled after any + * of the corresponding image elements by the band node itself. + * If not, we restrict "map" to those pairs of element that + * are scheduled together by the band node and continue with + * the child of the band node. + * If there are no such pairs then the map passed to after_in_child + * will be empty causing it to return 0. + */ +static int after_in_band(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node) +{ + isl_multi_union_pw_aff *mupa; + isl_union_map *partial, *test, *gt, *universe, *umap1, *umap2; + isl_union_set *domain, *range; + isl_space *space; + int empty; + int after; + + if (isl_schedule_node_band_n_member(node) == 0) + return after_in_child(umap, node); + + mupa = isl_schedule_node_band_get_partial_schedule(node); + space = isl_multi_union_pw_aff_get_space(mupa); + partial = isl_union_map_from_multi_union_pw_aff(mupa); + test = isl_union_map_copy(umap); + test = isl_union_map_apply_domain(test, isl_union_map_copy(partial)); + test = isl_union_map_apply_range(test, isl_union_map_copy(partial)); + gt = isl_union_map_from_map(isl_map_lex_gt(space)); + test = isl_union_map_intersect(test, gt); + empty = isl_union_map_is_empty(test); + isl_union_map_free(test); + + if (empty < 0 || !empty) { + isl_union_map_free(partial); + return empty < 0 ? -1 : 1; + } + + universe = isl_union_map_universe(isl_union_map_copy(umap)); + domain = isl_union_map_domain(isl_union_map_copy(universe)); + range = isl_union_map_range(universe); + umap1 = isl_union_map_copy(partial); + umap1 = isl_union_map_intersect_domain(umap1, domain); + umap2 = isl_union_map_intersect_domain(partial, range); + test = isl_union_map_apply_range(umap1, isl_union_map_reverse(umap2)); + test = isl_union_map_intersect(test, isl_union_map_copy(umap)); + after = after_in_child(test, node); + isl_union_map_free(test); + return after; +} + +/* Is any domain element of "umap" scheduled after any of + * the corresponding image elements by the tree rooted at + * the context node "node"? + * + * The context constraints apply to the schedule domain, + * so we cannot apply them directly to "umap", which contains + * pairs of statement instances. Instead, we add them + * to the range of the prefix schedule for both domain and + * range of "umap". + */ +static int after_in_context(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node) +{ + isl_union_map *prefix, *universe, *umap1, *umap2; + isl_union_set *domain, *range; + isl_set *context; + int after; + + umap = isl_union_map_copy(umap); + context = isl_schedule_node_context_get_context(node); + prefix = isl_schedule_node_get_prefix_schedule_union_map(node); + universe = isl_union_map_universe(isl_union_map_copy(umap)); + domain = isl_union_map_domain(isl_union_map_copy(universe)); + range = isl_union_map_range(universe); + umap1 = isl_union_map_copy(prefix); + umap1 = isl_union_map_intersect_domain(umap1, domain); + umap2 = isl_union_map_intersect_domain(prefix, range); + umap1 = isl_union_map_intersect_range(umap1, + isl_union_set_from_set(context)); + umap1 = isl_union_map_apply_range(umap1, isl_union_map_reverse(umap2)); + umap = isl_union_map_intersect(umap, umap1); + + after = after_in_child(umap, node); + + isl_union_map_free(umap); + + return after; +} + +/* Is any domain element of "umap" scheduled after any of + * the corresponding image elements by the tree rooted at + * the expansion node "node"? + * + * We apply the expansion to domain and range of "umap" and + * continue with its child. + */ +static int after_in_expansion(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node) +{ + isl_union_map *expansion; + int after; + + expansion = isl_schedule_node_expansion_get_expansion(node); + umap = isl_union_map_copy(umap); + umap = isl_union_map_apply_domain(umap, isl_union_map_copy(expansion)); + umap = isl_union_map_apply_range(umap, expansion); + + after = after_in_child(umap, node); + + isl_union_map_free(umap); + + return after; +} + +/* Is any domain element of "umap" scheduled after any of + * the corresponding image elements by the tree rooted at + * the extension node "node"? + * + * Since the extension node may add statement instances before or + * after the pairs of statement instances in "umap", we return 1 + * to ensure that these pairs are not broken up. + */ +static int after_in_extension(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node) +{ + return 1; +} + +/* Is any domain element of "umap" scheduled after any of + * the corresponding image elements by the tree rooted at + * the filter node "node"? + * + * We intersect domain and range of "umap" with the filter and + * continue with its child. + */ +static int after_in_filter(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node) +{ + isl_union_set *filter; + int after; + + umap = isl_union_map_copy(umap); + filter = isl_schedule_node_filter_get_filter(node); + umap = isl_union_map_intersect_domain(umap, isl_union_set_copy(filter)); + umap = isl_union_map_intersect_range(umap, filter); + + after = after_in_child(umap, node); + + isl_union_map_free(umap); + + return after; +} + +/* Is any domain element of "umap" scheduled after any of + * the corresponding image elements by the tree rooted at + * the set node "node"? + * + * This is only the case if this condition holds in any + * of the (filter) children of the set node. + * In particular, if the domain and the range of "umap" + * are contained in different children, then the condition + * does not hold. + */ +static int after_in_set(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node) +{ + int i, n; + + n = isl_schedule_node_n_children(node); + for (i = 0; i < n; ++i) { + isl_schedule_node *child; + int after; + + child = isl_schedule_node_get_child(node, i); + after = after_in_tree(umap, child); + isl_schedule_node_free(child); + + if (after < 0 || after) + return after; + } + return 0; } +/* Return the filter of child "i" of "node". + */ +static __isl_give isl_union_set *child_filter( + __isl_keep isl_schedule_node *node, int i) +{ + isl_schedule_node *child; + isl_union_set *filter; + + child = isl_schedule_node_get_child(node, i); + filter = isl_schedule_node_filter_get_filter(child); + isl_schedule_node_free(child); + + return filter; +} + +/* Is any domain element of "umap" scheduled after any of + * the corresponding image elements by the tree rooted at + * the sequence node "node"? + * + * This happens in particular if any domain element is + * contained in a later child than one containing a range element or + * if the condition holds within a given child in the sequence. + * The later part of the condition is checked by after_in_set. + */ +static int after_in_sequence(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node) +{ + int i, j, n; + isl_union_map *umap_i; + int empty, after = 0; + + n = isl_schedule_node_n_children(node); + for (i = 1; i < n; ++i) { + isl_union_set *filter_i; + + umap_i = isl_union_map_copy(umap); + filter_i = child_filter(node, i); + umap_i = isl_union_map_intersect_domain(umap_i, filter_i); + empty = isl_union_map_is_empty(umap_i); + if (empty < 0) + goto error; + if (empty) { + isl_union_map_free(umap_i); + continue; + } + + for (j = 0; j < i; ++j) { + isl_union_set *filter_j; + isl_union_map *umap_ij; + + umap_ij = isl_union_map_copy(umap_i); + filter_j = child_filter(node, j); + umap_ij = isl_union_map_intersect_range(umap_ij, + filter_j); + empty = isl_union_map_is_empty(umap_ij); + isl_union_map_free(umap_ij); + + if (empty < 0) + goto error; + if (!empty) + after = 1; + if (after) + break; + } + + isl_union_map_free(umap_i); + if (after) + break; + } + + if (after < 0 || after) + return after; + + return after_in_set(umap, node); +error: + isl_union_map_free(umap_i); + return -1; +} + +/* Is any domain element of "umap" scheduled after any of + * the corresponding image elements by the tree rooted at "node"? + * + * If "umap" is empty, then clearly there is no such element. + * Otherwise, consider the different types of nodes separately. + */ +static int after_in_tree(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node) +{ + int empty; + enum isl_schedule_node_type type; + + empty = isl_union_map_is_empty(umap); + if (empty < 0) + return -1; + if (empty) + return 0; + if (!node) + return -1; + + type = isl_schedule_node_get_type(node); + switch (type) { + case isl_schedule_node_error: + return -1; + case isl_schedule_node_leaf: + return 0; + case isl_schedule_node_band: + return after_in_band(umap, node); + case isl_schedule_node_domain: + isl_die(isl_schedule_node_get_ctx(node), isl_error_internal, + "unexpected internal domain node", return -1); + case isl_schedule_node_context: + return after_in_context(umap, node); + case isl_schedule_node_expansion: + return after_in_expansion(umap, node); + case isl_schedule_node_extension: + return after_in_extension(umap, node); + case isl_schedule_node_filter: + return after_in_filter(umap, node); + case isl_schedule_node_guard: + case isl_schedule_node_mark: + return after_in_child(umap, node); + case isl_schedule_node_set: + return after_in_set(umap, node); + case isl_schedule_node_sequence: + return after_in_sequence(umap, node); + } + + return 1; +} + +/* Is any domain element of "map1" scheduled after any domain + * element of "map2" by the subtree underneath the current band node, + * while at the same time being scheduled together by the current + * band node, i.e., by "map1" and "map2? + * + * If the child of the current band node is a leaf, then + * no element can be scheduled after any other element. + * + * Otherwise, we construct a relation between domain elements + * of "map1" and domain elements of "map2" that are scheduled + * together and then check if the subtree underneath the current + * band node determines their relative order. + */ +static int after_in_subtree(__isl_keep isl_ast_build *build, + __isl_keep isl_map *map1, __isl_keep isl_map *map2) +{ + isl_schedule_node *node; + isl_map *map; + isl_union_map *umap; + int after; + + node = isl_ast_build_get_schedule_node(build); + if (!node) + return -1; + node = isl_schedule_node_child(node, 0); + if (isl_schedule_node_get_type(node) == isl_schedule_node_leaf) { + isl_schedule_node_free(node); + return 0; + } + map = isl_map_copy(map2); + map = isl_map_apply_domain(map, isl_map_copy(map1)); + umap = isl_union_map_from_map(map); + after = after_in_tree(umap, node); + isl_union_map_free(umap); + isl_schedule_node_free(node); + return after; +} + /* Internal data for any_scheduled_after. * + * "build" is the build in which the AST is constructed. * "depth" is the number of loops that have already been generated * "group_coscheduled" is a local copy of options->ast_build_group_coscheduled * "domain" is an array of set-map pairs corresponding to the different @@ -3331,6 +4369,7 @@ * of the inverse schedule, while the map is the inverse schedule itself. */ struct isl_any_scheduled_after_data { + isl_ast_build *build; int depth; int group_coscheduled; struct isl_set_map_pair *domain; @@ -3342,10 +4381,15 @@ * data->domain[i].set contains the domain of the inverse schedule * for domain "i", i.e., elements in the schedule domain. * + * If we are inside a band of a schedule tree and there is a pair + * of elements in the two domains that is schedule together by + * the current band, then we check if any element of "i" may be schedule + * after element of "j" by the descendants of the band node. + * * If data->group_coscheduled is set, then we also return 1 if there * is any pair of elements in the two domains that are scheduled together. */ -static int any_scheduled_after(int i, int j, void *user) +static isl_bool any_scheduled_after(int i, int j, void *user) { struct isl_any_scheduled_after_data *data = user; int dim = isl_set_dim(data->domain[i].set, isl_dim_set); @@ -3358,11 +4402,20 @@ data->domain[j].set, pos); if (follows < -1) - return -1; + return isl_bool_error; if (follows > 0) - return 1; + return isl_bool_true; if (follows < 0) - return 0; + return isl_bool_false; + } + + if (isl_ast_build_has_schedule_node(data->build)) { + int after; + + after = after_in_subtree(data->build, data->domain[i].map, + data->domain[j].map); + if (after < 0 || after) + return after; } return data->group_coscheduled; @@ -3411,9 +4464,12 @@ if (!build) goto error; + data.build = build; data.depth = isl_ast_build_get_depth(build); data.group_coscheduled = isl_options_get_ast_build_group_coscheduled(ctx); g = isl_tarjan_graph_init(ctx, n, &any_scheduled_after, &data); + if (!g) + goto error; list = isl_ast_graft_list_alloc(ctx, 0); @@ -3482,7 +4538,7 @@ } depth = isl_ast_build_get_depth(build); - if (depth >= isl_set_dim(build->domain, isl_dim_set)) + if (depth >= isl_ast_build_dim(build, isl_dim_set)) return generate_inner_level(executed, build); if (isl_union_map_n_map(executed) == 1) @@ -3495,7 +4551,7 @@ return NULL; } -/* Internal data structure used by isl_ast_build_ast_from_schedule. +/* Internal data structure used by isl_ast_build_node_from_schedule_map. * internal, executed and build are the inputs to generate_code. * list collects the output. */ @@ -3544,8 +4600,8 @@ } /* Generate an AST that visits the elements in the range of data->executed - * in the relative order specified by the corresponding image element(s) - * for those image elements that belong to "set". + * in the relative order specified by the corresponding domain element(s) + * for those domain elements that belong to "set". * Add the result to data->list. * * The caller ensures that "set" is a universe domain. @@ -3553,11 +4609,19 @@ * It is equal to the space of "set" if build->domain is parametric. * Otherwise, it is equal to the range of the wrapped space of "set". * - * If the build space is not parametric and if isl_ast_build_ast_from_schedule + * If the build space is not parametric and + * if isl_ast_build_node_from_schedule_map * was called from an outside user (data->internal not set), then * the (inverse) schedule refers to the external build domain and needs to * be transformed to refer to the internal build domain. * + * If the build space is parametric, then we add some of the parameter + * constraints to the executed relation. Adding these constraints + * allows for an earlier detection of conflicts in some cases. + * However, we do not want to divide the executed relation into + * more disjuncts than necessary. We therefore approximate + * the constraints on the parameters by a single disjunct set. + * * The build is extended to include the additional part of the schedule. * If the original build space was not parametric, then the options * in data->build refer only to the additional part of the schedule @@ -3572,7 +4636,7 @@ * on the resulting isl_ast_node_list so that it can be used within * the outer AST build. */ -static int generate_code_in_space(struct isl_generate_code_data *data, +static isl_stat generate_code_in_space(struct isl_generate_code_data *data, __isl_take isl_set *set, __isl_take isl_space *space) { isl_union_map *executed; @@ -3587,6 +4651,12 @@ embed = !isl_set_is_params(data->build->domain); if (embed && !data->internal) executed = internal_executed(executed, space, data->build); + if (!embed) { + isl_set *domain; + domain = isl_ast_build_get_domain(data->build); + domain = isl_set_from_basic_set(isl_set_simple_hull(domain)); + executed = isl_union_map_intersect_params(executed, domain); + } build = isl_ast_build_copy(data->build); build = isl_ast_build_product(build, space); @@ -3597,7 +4667,7 @@ data->list = isl_ast_graft_list_concat(data->list, list); - return 0; + return isl_stat_ok; } /* Generate an AST that visits the elements in the range of data->executed @@ -3617,7 +4687,7 @@ * passing along T. * If the build space is not parametric, then T is the space of "set". */ -static int generate_code_set(__isl_take isl_set *set, void *user) +static isl_stat generate_code_set(__isl_take isl_set *set, void *user) { struct isl_generate_code_data *data = user; isl_space *space, *build_space; @@ -3644,7 +4714,7 @@ error: isl_set_free(set); isl_space_free(space); - return -1; + return isl_stat_error; } /* Generate an AST that visits the elements in the range of "executed" @@ -3741,7 +4811,7 @@ * the schedule domain in the domain and the elements to be executed * in the range) called "executed". */ -__isl_give isl_ast_node *isl_ast_build_ast_from_schedule( +__isl_give isl_ast_node *isl_ast_build_node_from_schedule_map( __isl_keep isl_ast_build *build, __isl_take isl_union_map *schedule) { isl_ast_graft_list *list; @@ -3750,6 +4820,8 @@ build = isl_ast_build_copy(build); build = isl_ast_build_set_single_valued(build, 0); + schedule = isl_union_map_coalesce(schedule); + schedule = isl_union_map_remove_redundancies(schedule); executed = isl_union_map_reverse(schedule); list = generate_code(executed, isl_ast_build_copy(build), 0); node = isl_ast_node_from_graft_list(list, build); @@ -3757,3 +4829,688 @@ return node; } + +/* The old name for isl_ast_build_node_from_schedule_map. + * It is being kept for backward compatibility, but + * it will be removed in the future. + */ +__isl_give isl_ast_node *isl_ast_build_ast_from_schedule( + __isl_keep isl_ast_build *build, __isl_take isl_union_map *schedule) +{ + return isl_ast_build_node_from_schedule_map(build, schedule); +} + +/* Generate an AST that visits the elements in the domain of "executed" + * in the relative order specified by the band node "node" and its descendants. + * + * The relation "executed" maps the outer generated loop iterators + * to the domain elements executed by those iterations. + * + * If the band is empty, we continue with its descendants. + * Otherwise, we extend the build and the inverse schedule with + * the additional space/partial schedule and continue generating + * an AST in generate_next_level. + * As soon as we have extended the inverse schedule with the additional + * partial schedule, we look for equalities that may exists between + * the old and the new part. + */ +static __isl_give isl_ast_graft_list *build_ast_from_band( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed) +{ + isl_space *space; + isl_multi_union_pw_aff *extra; + isl_union_map *extra_umap; + isl_ast_graft_list *list; + unsigned n1, n2; + + if (!build || !node || !executed) + goto error; + + if (isl_schedule_node_band_n_member(node) == 0) + return build_ast_from_child(build, node, executed); + + extra = isl_schedule_node_band_get_partial_schedule(node); + extra = isl_multi_union_pw_aff_align_params(extra, + isl_ast_build_get_space(build, 1)); + space = isl_multi_union_pw_aff_get_space(extra); + + extra_umap = isl_union_map_from_multi_union_pw_aff(extra); + extra_umap = isl_union_map_reverse(extra_umap); + + executed = isl_union_map_domain_product(executed, extra_umap); + executed = isl_union_map_detect_equalities(executed); + + n1 = isl_ast_build_dim(build, isl_dim_param); + build = isl_ast_build_product(build, space); + n2 = isl_ast_build_dim(build, isl_dim_param); + if (n2 > n1) + isl_die(isl_ast_build_get_ctx(build), isl_error_invalid, + "band node is not allowed to introduce new parameters", + build = isl_ast_build_free(build)); + build = isl_ast_build_set_schedule_node(build, node); + + list = generate_next_level(executed, build); + + list = isl_ast_graft_list_unembed(list, 1); + + return list; +error: + isl_schedule_node_free(node); + isl_union_map_free(executed); + isl_ast_build_free(build); + return NULL; +} + +/* Hoist a list of grafts (in practice containing a single graft) + * from "sub_build" (which includes extra context information) + * to "build". + * + * In particular, project out all additional parameters introduced + * by the context node from the enforced constraints and the guard + * of the single graft. + */ +static __isl_give isl_ast_graft_list *hoist_out_of_context( + __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build, + __isl_keep isl_ast_build *sub_build) +{ + isl_ast_graft *graft; + isl_basic_set *enforced; + isl_set *guard; + unsigned n_param, extra_param; + + if (!build || !sub_build) + return isl_ast_graft_list_free(list); + + n_param = isl_ast_build_dim(build, isl_dim_param); + extra_param = isl_ast_build_dim(sub_build, isl_dim_param); + + if (extra_param == n_param) + return list; + + extra_param -= n_param; + enforced = isl_ast_graft_list_extract_shared_enforced(list, sub_build); + enforced = isl_basic_set_project_out(enforced, isl_dim_param, + n_param, extra_param); + enforced = isl_basic_set_remove_unknown_divs(enforced); + guard = isl_ast_graft_list_extract_hoistable_guard(list, sub_build); + guard = isl_set_remove_divs_involving_dims(guard, isl_dim_param, + n_param, extra_param); + guard = isl_set_project_out(guard, isl_dim_param, n_param, extra_param); + guard = isl_set_compute_divs(guard); + graft = isl_ast_graft_alloc_from_children(list, guard, enforced, + build, sub_build); + list = isl_ast_graft_list_from_ast_graft(graft); + + return list; +} + +/* Generate an AST that visits the elements in the domain of "executed" + * in the relative order specified by the context node "node" + * and its descendants. + * + * The relation "executed" maps the outer generated loop iterators + * to the domain elements executed by those iterations. + * + * The context node may introduce additional parameters as well as + * constraints on the outer schedule dimenions or original parameters. + * + * We add the extra parameters to a new build and the context + * constraints to both the build and (as a single disjunct) + * to the domain of "executed". Since the context constraints + * are specified in terms of the input schedule, we first need + * to map them to the internal schedule domain. + * + * After constructing the AST from the descendants of "node", + * we combine the list of grafts into a single graft within + * the new build, in order to be able to exploit the additional + * context constraints during this combination. + * + * Additionally, if the current node is the outermost node in + * the schedule tree (apart from the root domain node), we generate + * all pending guards, again to be able to exploit the additional + * context constraints. We currently do not do this for internal + * context nodes since we may still want to hoist conditions + * to outer AST nodes. + * + * If the context node introduced any new parameters, then they + * are removed from the set of enforced constraints and guard + * in hoist_out_of_context. + */ +static __isl_give isl_ast_graft_list *build_ast_from_context( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed) +{ + isl_set *context; + isl_space *space; + isl_multi_aff *internal2input; + isl_ast_build *sub_build; + isl_ast_graft_list *list; + int n, depth; + + depth = isl_schedule_node_get_tree_depth(node); + space = isl_ast_build_get_space(build, 1); + context = isl_schedule_node_context_get_context(node); + context = isl_set_align_params(context, space); + sub_build = isl_ast_build_copy(build); + space = isl_set_get_space(context); + sub_build = isl_ast_build_align_params(sub_build, space); + internal2input = isl_ast_build_get_internal2input(sub_build); + context = isl_set_preimage_multi_aff(context, internal2input); + sub_build = isl_ast_build_restrict_generated(sub_build, + isl_set_copy(context)); + context = isl_set_from_basic_set(isl_set_simple_hull(context)); + executed = isl_union_map_intersect_domain(executed, + isl_union_set_from_set(context)); + + list = build_ast_from_child(isl_ast_build_copy(sub_build), + node, executed); + n = isl_ast_graft_list_n_ast_graft(list); + if (n < 0) + list = isl_ast_graft_list_free(list); + + list = isl_ast_graft_list_fuse(list, sub_build); + if (depth == 1) + list = isl_ast_graft_list_insert_pending_guard_nodes(list, + sub_build); + if (n >= 1) + list = hoist_out_of_context(list, build, sub_build); + + isl_ast_build_free(build); + isl_ast_build_free(sub_build); + + return list; +} + +/* Generate an AST that visits the elements in the domain of "executed" + * in the relative order specified by the expansion node "node" and + * its descendants. + * + * The relation "executed" maps the outer generated loop iterators + * to the domain elements executed by those iterations. + * + * We expand the domain elements by the expansion and + * continue with the descendants of the node. + */ +static __isl_give isl_ast_graft_list *build_ast_from_expansion( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed) +{ + isl_union_map *expansion; + unsigned n1, n2; + + expansion = isl_schedule_node_expansion_get_expansion(node); + expansion = isl_union_map_align_params(expansion, + isl_union_map_get_space(executed)); + + n1 = isl_union_map_dim(executed, isl_dim_param); + executed = isl_union_map_apply_range(executed, expansion); + n2 = isl_union_map_dim(executed, isl_dim_param); + if (n2 > n1) + isl_die(isl_ast_build_get_ctx(build), isl_error_invalid, + "expansion node is not allowed to introduce " + "new parameters", goto error); + + return build_ast_from_child(build, node, executed); +error: + isl_ast_build_free(build); + isl_schedule_node_free(node); + isl_union_map_free(executed); + return NULL; +} + +/* Generate an AST that visits the elements in the domain of "executed" + * in the relative order specified by the extension node "node" and + * its descendants. + * + * The relation "executed" maps the outer generated loop iterators + * to the domain elements executed by those iterations. + * + * Extend the inverse schedule with the extension applied to current + * set of generated constraints. Since the extension if formulated + * in terms of the input schedule, it first needs to be transformed + * to refer to the internal schedule. + */ +static __isl_give isl_ast_graft_list *build_ast_from_extension( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed) +{ + isl_union_set *schedule_domain; + isl_union_map *extension; + isl_set *set; + + set = isl_ast_build_get_generated(build); + schedule_domain = isl_union_set_from_set(set); + + extension = isl_schedule_node_extension_get_extension(node); + + extension = isl_union_map_preimage_domain_multi_aff(extension, + isl_multi_aff_copy(build->internal2input)); + extension = isl_union_map_intersect_domain(extension, schedule_domain); + extension = isl_ast_build_substitute_values_union_map_domain(build, + extension); + executed = isl_union_map_union(executed, extension); + + return build_ast_from_child(build, node, executed); +} + +/* Generate an AST that visits the elements in the domain of "executed" + * in the relative order specified by the filter node "node" and + * its descendants. + * + * The relation "executed" maps the outer generated loop iterators + * to the domain elements executed by those iterations. + * + * We simply intersect the iteration domain (i.e., the range of "executed") + * with the filter and continue with the descendants of the node, + * unless the resulting inverse schedule is empty, in which + * case we return an empty list. + */ +static __isl_give isl_ast_graft_list *build_ast_from_filter( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed) +{ + isl_ctx *ctx; + isl_union_set *filter; + isl_ast_graft_list *list; + int empty; + unsigned n1, n2; + + if (!build || !node || !executed) + goto error; + + filter = isl_schedule_node_filter_get_filter(node); + filter = isl_union_set_align_params(filter, + isl_union_map_get_space(executed)); + n1 = isl_union_map_dim(executed, isl_dim_param); + executed = isl_union_map_intersect_range(executed, filter); + n2 = isl_union_map_dim(executed, isl_dim_param); + if (n2 > n1) + isl_die(isl_ast_build_get_ctx(build), isl_error_invalid, + "filter node is not allowed to introduce " + "new parameters", goto error); + + empty = isl_union_map_is_empty(executed); + if (empty < 0) + goto error; + if (!empty) + return build_ast_from_child(build, node, executed); + + ctx = isl_ast_build_get_ctx(build); + list = isl_ast_graft_list_alloc(ctx, 0); + isl_ast_build_free(build); + isl_schedule_node_free(node); + isl_union_map_free(executed); + return list; +error: + isl_ast_build_free(build); + isl_schedule_node_free(node); + isl_union_map_free(executed); + return NULL; +} + +/* Generate an AST that visits the elements in the domain of "executed" + * in the relative order specified by the guard node "node" and + * its descendants. + * + * The relation "executed" maps the outer generated loop iterators + * to the domain elements executed by those iterations. + * + * Ensure that the associated guard is enforced by the outer AST + * constructs by adding it to the guard of the graft. + * Since we know that we will enforce the guard, we can also include it + * in the generated constraints used to construct an AST for + * the descendant nodes. + */ +static __isl_give isl_ast_graft_list *build_ast_from_guard( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed) +{ + isl_space *space; + isl_set *guard, *hoisted; + isl_basic_set *enforced; + isl_ast_build *sub_build; + isl_ast_graft *graft; + isl_ast_graft_list *list; + unsigned n1, n2; + + space = isl_ast_build_get_space(build, 1); + guard = isl_schedule_node_guard_get_guard(node); + n1 = isl_space_dim(space, isl_dim_param); + guard = isl_set_align_params(guard, space); + n2 = isl_set_dim(guard, isl_dim_param); + if (n2 > n1) + isl_die(isl_ast_build_get_ctx(build), isl_error_invalid, + "guard node is not allowed to introduce " + "new parameters", guard = isl_set_free(guard)); + guard = isl_set_preimage_multi_aff(guard, + isl_multi_aff_copy(build->internal2input)); + guard = isl_ast_build_specialize(build, guard); + guard = isl_set_gist(guard, isl_set_copy(build->generated)); + + sub_build = isl_ast_build_copy(build); + sub_build = isl_ast_build_restrict_generated(sub_build, + isl_set_copy(guard)); + + list = build_ast_from_child(isl_ast_build_copy(sub_build), + node, executed); + + hoisted = isl_ast_graft_list_extract_hoistable_guard(list, sub_build); + if (isl_set_n_basic_set(hoisted) > 1) + list = isl_ast_graft_list_gist_guards(list, + isl_set_copy(hoisted)); + guard = isl_set_intersect(guard, hoisted); + enforced = extract_shared_enforced(list, build); + graft = isl_ast_graft_alloc_from_children(list, guard, enforced, + build, sub_build); + + isl_ast_build_free(sub_build); + isl_ast_build_free(build); + return isl_ast_graft_list_from_ast_graft(graft); +} + +/* Call the before_each_mark callback, if requested by the user. + * + * Return 0 on success and -1 on error. + * + * The caller is responsible for recording the current inverse schedule + * in "build". + */ +static isl_stat before_each_mark(__isl_keep isl_id *mark, + __isl_keep isl_ast_build *build) +{ + if (!build) + return isl_stat_error; + if (!build->before_each_mark) + return isl_stat_ok; + return build->before_each_mark(mark, build, + build->before_each_mark_user); +} + +/* Call the after_each_mark callback, if requested by the user. + * + * The caller is responsible for recording the current inverse schedule + * in "build". + */ +static __isl_give isl_ast_graft *after_each_mark( + __isl_take isl_ast_graft *graft, __isl_keep isl_ast_build *build) +{ + if (!graft || !build) + return isl_ast_graft_free(graft); + if (!build->after_each_mark) + return graft; + graft->node = build->after_each_mark(graft->node, build, + build->after_each_mark_user); + if (!graft->node) + return isl_ast_graft_free(graft); + return graft; +} + + +/* Generate an AST that visits the elements in the domain of "executed" + * in the relative order specified by the mark node "node" and + * its descendants. + * + * The relation "executed" maps the outer generated loop iterators + * to the domain elements executed by those iterations. + + * Since we may be calling before_each_mark and after_each_mark + * callbacks, we record the current inverse schedule in the build. + * + * We generate an AST for the child of the mark node, combine + * the graft list into a single graft and then insert the mark + * in the AST of that single graft. + */ +static __isl_give isl_ast_graft_list *build_ast_from_mark( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed) +{ + isl_id *mark; + isl_ast_graft *graft; + isl_ast_graft_list *list; + int n; + + build = isl_ast_build_set_executed(build, isl_union_map_copy(executed)); + + mark = isl_schedule_node_mark_get_id(node); + if (before_each_mark(mark, build) < 0) + node = isl_schedule_node_free(node); + + list = build_ast_from_child(isl_ast_build_copy(build), node, executed); + list = isl_ast_graft_list_fuse(list, build); + n = isl_ast_graft_list_n_ast_graft(list); + if (n < 0) + list = isl_ast_graft_list_free(list); + if (n == 0) { + isl_id_free(mark); + } else { + graft = isl_ast_graft_list_get_ast_graft(list, 0); + graft = isl_ast_graft_insert_mark(graft, mark); + graft = after_each_mark(graft, build); + list = isl_ast_graft_list_set_ast_graft(list, 0, graft); + } + isl_ast_build_free(build); + + return list; +} + +static __isl_give isl_ast_graft_list *build_ast_from_schedule_node( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed); + +/* Generate an AST that visits the elements in the domain of "executed" + * in the relative order specified by the sequence (or set) node "node" and + * its descendants. + * + * The relation "executed" maps the outer generated loop iterators + * to the domain elements executed by those iterations. + * + * We simply generate an AST for each of the children and concatenate + * the results. + */ +static __isl_give isl_ast_graft_list *build_ast_from_sequence( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed) +{ + int i, n; + isl_ctx *ctx; + isl_ast_graft_list *list; + + ctx = isl_ast_build_get_ctx(build); + list = isl_ast_graft_list_alloc(ctx, 0); + + n = isl_schedule_node_n_children(node); + for (i = 0; i < n; ++i) { + isl_schedule_node *child; + isl_ast_graft_list *list_i; + + child = isl_schedule_node_get_child(node, i); + list_i = build_ast_from_schedule_node(isl_ast_build_copy(build), + child, isl_union_map_copy(executed)); + list = isl_ast_graft_list_concat(list, list_i); + } + isl_ast_build_free(build); + isl_schedule_node_free(node); + isl_union_map_free(executed); + + return list; +} + +/* Generate an AST that visits the elements in the domain of "executed" + * in the relative order specified by the node "node" and its descendants. + * + * The relation "executed" maps the outer generated loop iterators + * to the domain elements executed by those iterations. + * + * If the node is a leaf, then we pass control to generate_inner_level. + * Note that the current build does not refer to any band node, so + * that generate_inner_level will not try to visit the child of + * the leaf node. + * + * The other node types are handled in separate functions. + * Set nodes are currently treated in the same way as sequence nodes. + * The children of a set node may be executed in any order, + * including the order of the children. + */ +static __isl_give isl_ast_graft_list *build_ast_from_schedule_node( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed) +{ + enum isl_schedule_node_type type; + + type = isl_schedule_node_get_type(node); + + switch (type) { + case isl_schedule_node_error: + goto error; + case isl_schedule_node_leaf: + isl_schedule_node_free(node); + return generate_inner_level(executed, build); + case isl_schedule_node_band: + return build_ast_from_band(build, node, executed); + case isl_schedule_node_context: + return build_ast_from_context(build, node, executed); + case isl_schedule_node_domain: + isl_die(isl_schedule_node_get_ctx(node), isl_error_unsupported, + "unexpected internal domain node", goto error); + case isl_schedule_node_expansion: + return build_ast_from_expansion(build, node, executed); + case isl_schedule_node_extension: + return build_ast_from_extension(build, node, executed); + case isl_schedule_node_filter: + return build_ast_from_filter(build, node, executed); + case isl_schedule_node_guard: + return build_ast_from_guard(build, node, executed); + case isl_schedule_node_mark: + return build_ast_from_mark(build, node, executed); + case isl_schedule_node_sequence: + case isl_schedule_node_set: + return build_ast_from_sequence(build, node, executed); + } + + isl_die(isl_ast_build_get_ctx(build), isl_error_internal, + "unhandled type", goto error); +error: + isl_union_map_free(executed); + isl_schedule_node_free(node); + isl_ast_build_free(build); + + return NULL; +} + +/* Generate an AST that visits the elements in the domain of "executed" + * in the relative order specified by the (single) child of "node" and + * its descendants. + * + * The relation "executed" maps the outer generated loop iterators + * to the domain elements executed by those iterations. + * + * This function is never called on a leaf, set or sequence node, + * so the node always has exactly one child. + */ +static __isl_give isl_ast_graft_list *build_ast_from_child( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed) +{ + node = isl_schedule_node_child(node, 0); + return build_ast_from_schedule_node(build, node, executed); +} + +/* Generate an AST that visits the elements in the domain of the domain + * node "node" in the relative order specified by its descendants. + * + * An initial inverse schedule is created that maps a zero-dimensional + * schedule space to the node domain. + * The input "build" is assumed to have a parametric domain and + * is replaced by the same zero-dimensional schedule space. + * + * We also add some of the parameter constraints in the build domain + * to the executed relation. Adding these constraints + * allows for an earlier detection of conflicts in some cases. + * However, we do not want to divide the executed relation into + * more disjuncts than necessary. We therefore approximate + * the constraints on the parameters by a single disjunct set. + */ +static __isl_give isl_ast_node *build_ast_from_domain( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node) +{ + isl_ctx *ctx; + isl_union_set *domain, *schedule_domain; + isl_union_map *executed; + isl_space *space; + isl_set *set; + isl_ast_graft_list *list; + isl_ast_node *ast; + int is_params; + + if (!build) + goto error; + + ctx = isl_ast_build_get_ctx(build); + space = isl_ast_build_get_space(build, 1); + is_params = isl_space_is_params(space); + isl_space_free(space); + if (is_params < 0) + goto error; + if (!is_params) + isl_die(ctx, isl_error_unsupported, + "expecting parametric initial context", goto error); + + domain = isl_schedule_node_domain_get_domain(node); + domain = isl_union_set_coalesce(domain); + + space = isl_union_set_get_space(domain); + space = isl_space_set_from_params(space); + build = isl_ast_build_product(build, space); + + set = isl_ast_build_get_domain(build); + set = isl_set_from_basic_set(isl_set_simple_hull(set)); + schedule_domain = isl_union_set_from_set(set); + + executed = isl_union_map_from_domain_and_range(schedule_domain, domain); + list = build_ast_from_child(isl_ast_build_copy(build), node, executed); + ast = isl_ast_node_from_graft_list(list, build); + isl_ast_build_free(build); + + return ast; +error: + isl_schedule_node_free(node); + isl_ast_build_free(build); + return NULL; +} + +/* Generate an AST that visits the elements in the domain of "schedule" + * in the relative order specified by the schedule tree. + * + * "build" is an isl_ast_build that has been created using + * isl_ast_build_alloc or isl_ast_build_from_context based + * on a parametric set. + * + * The construction starts at the root node of the schedule, + * which is assumed to be a domain node. + */ +__isl_give isl_ast_node *isl_ast_build_node_from_schedule( + __isl_keep isl_ast_build *build, __isl_take isl_schedule *schedule) +{ + isl_ctx *ctx; + isl_schedule_node *node; + + if (!build || !schedule) + goto error; + + ctx = isl_ast_build_get_ctx(build); + + node = isl_schedule_get_root(schedule); + isl_schedule_free(schedule); + + build = isl_ast_build_copy(build); + build = isl_ast_build_set_single_valued(build, 0); + if (isl_schedule_node_get_type(node) != isl_schedule_node_domain) + isl_die(ctx, isl_error_unsupported, + "expecting root domain node", + build = isl_ast_build_free(build)); + return build_ast_from_domain(build, node); +error: + isl_schedule_free(schedule); + return NULL; +} diff -Nru cloog-0.18.2/isl/isl_ast_graft.c cloog-0.18.4/isl/isl_ast_graft.c --- cloog-0.18.2/isl/isl_ast_graft.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_ast_graft.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,10 +1,13 @@ /* * Copyright 2012 Ecole Normale Superieure + * Copyright 2014 INRIA Rocquencourt * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France + * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, + * B.P. 105 - 78153 Le Chesnay, France */ #include @@ -111,7 +114,11 @@ return -1; depth = isl_ast_build_get_depth(build); - skip = isl_set_involves_dims(graft_0->guard, isl_dim_set, depth, 1); + if (isl_set_dim(graft_0->guard, isl_dim_set) <= depth) + skip = 0; + else + skip = isl_set_involves_dims(graft_0->guard, + isl_dim_set, depth, 1); if (skip < 0 || skip) { isl_ast_graft_free(graft_0); return skip < 0 ? -1 : 0; @@ -135,26 +142,61 @@ return equal; } +/* Hoist "guard" out of the current level (given by "build"). + * + * In particular, eliminate the dimension corresponding to the current depth. + */ +static __isl_give isl_set *hoist_guard(__isl_take isl_set *guard, + __isl_keep isl_ast_build *build) +{ + int depth; + + depth = isl_ast_build_get_depth(build); + if (depth < isl_set_dim(guard, isl_dim_set)) { + guard = isl_set_remove_divs_involving_dims(guard, + isl_dim_set, depth, 1); + guard = isl_set_eliminate(guard, isl_dim_set, depth, 1); + guard = isl_set_compute_divs(guard); + } + + return guard; +} + /* Extract a common guard from the grafts in "list" that can be hoisted * out of the current level. If no such guard can be found, then return * a universal set. * * If all the grafts in the list have the same guard and if this guard * is independent of the current level, then it can be hoisted out. + * If there is only one graft in the list and if its guard + * depends on the current level, then we eliminate this level and + * return the result. + * * Otherwise, we return the unshifted simple hull of the guards. + * In order to be able to hoist as many constraints as possible, + * but at the same time avoid hoisting constraints that did not + * appear in the guards in the first place, we intersect the guards + * with all the information that is available (i.e., the domain + * from the build and the enforced constraints of the graft) and + * compute the unshifted hull of the result using only constraints + * from the original guards. + * In particular, intersecting the guards with other known information + * allows us to hoist guards that are only explicit is some of + * the grafts and implicit in the others. * * The special case for equal guards is needed in case those guards * are non-convex. Taking the simple hull would remove information * and would not allow for these guards to be hoisted completely. */ -static __isl_give isl_set *extract_hoistable_guard( +__isl_give isl_set *isl_ast_graft_list_extract_hoistable_guard( __isl_keep isl_ast_graft_list *list, __isl_keep isl_ast_build *build) { int i, n; - int depth; - isl_ast_graft *graft_0; int equal; + isl_ctx *ctx; isl_set *guard; + isl_set_list *set_list; + isl_basic_set *hull; if (!list || !build) return NULL; @@ -167,45 +209,41 @@ if (equal < 0) return NULL; - graft_0 = isl_ast_graft_list_get_ast_graft(list, 0); - if (!graft_0) - return NULL; - guard = isl_set_copy(graft_0->guard); - isl_ast_graft_free(graft_0); - if (equal) - return guard; + if (equal || n == 1) { + isl_ast_graft *graft_0; - depth = isl_ast_build_get_depth(build); - if (depth < isl_set_dim(guard, isl_dim_set)) { - guard = isl_set_remove_divs_involving_dims(guard, - isl_dim_set, depth, 1); - guard = isl_set_eliminate(guard, isl_dim_set, depth, 1); - guard = isl_set_compute_divs(guard); + graft_0 = isl_ast_graft_list_get_ast_graft(list, 0); + if (!graft_0) + return NULL; + guard = isl_set_copy(graft_0->guard); + if (!equal) + guard = hoist_guard(guard, build); + isl_ast_graft_free(graft_0); + return guard; } - for (i = 1; i < n; ++i) { + ctx = isl_ast_build_get_ctx(build); + set_list = isl_set_list_alloc(ctx, n); + guard = isl_set_empty(isl_ast_build_get_space(build, 1)); + for (i = 0; i < n; ++i) { isl_ast_graft *graft; - isl_basic_set *hull; - int is_universe; - - is_universe = isl_set_plain_is_universe(guard); - if (is_universe < 0) - guard = isl_set_free(guard); - if (is_universe) - break; + isl_basic_set *enforced; + isl_set *guard_i; graft = isl_ast_graft_list_get_ast_graft(list, i); - if (!graft) { - guard = isl_set_free(guard); - break; - } - guard = isl_set_union(guard, isl_set_copy(graft->guard)); - hull = isl_set_unshifted_simple_hull(guard); - guard = isl_set_from_basic_set(hull); + enforced = isl_ast_graft_get_enforced(graft); + guard_i = isl_set_copy(graft->guard); isl_ast_graft_free(graft); + set_list = isl_set_list_add(set_list, isl_set_copy(guard_i)); + guard_i = isl_set_intersect(guard_i, + isl_set_from_basic_set(enforced)); + guard_i = isl_set_intersect(guard_i, + isl_ast_build_get_domain(build)); + guard = isl_set_union(guard, guard_i); } - - return guard; + hull = isl_set_unshifted_simple_hull_from_set_list(guard, set_list); + guard = isl_set_from_basic_set(hull); + return hoist_guard(guard, build); } /* Internal data structure used inside insert_if. @@ -220,7 +258,7 @@ isl_ast_build *build; }; -static int insert_if(__isl_take isl_basic_set *bset, void *user); +static isl_stat insert_if(__isl_take isl_basic_set *bset, void *user); /* Insert an if node around "node" testing the condition encoded * in guard "guard". @@ -244,7 +282,7 @@ isl_ast_node *if_node; isl_ast_expr *expr; - expr = isl_ast_build_expr_from_set(build, guard); + expr = isl_ast_build_expr_from_set_internal(build, guard); if_node = isl_ast_node_alloc_if(expr); return isl_ast_node_if_set_then(if_node, node); @@ -266,7 +304,7 @@ /* Insert an if node around a copy of "data->node" testing the condition * encoded in guard "bset" and add the result to data->list. */ -static int insert_if(__isl_take isl_basic_set *bset, void *user) +static isl_stat insert_if(__isl_take isl_basic_set *bset, void *user) { struct isl_insert_if_data *data = user; isl_ast_node *node; @@ -277,7 +315,7 @@ node = ast_node_insert_if(node, set, data->build); data->list = isl_ast_node_list_add(data->list, node); - return 0; + return isl_stat_ok; } /* Insert an if node around graft->node testing the condition encoded @@ -301,8 +339,6 @@ } build = isl_ast_build_copy(build); - build = isl_ast_build_set_enforced(build, - isl_ast_graft_get_enforced(graft)); graft->node = ast_node_insert_if(graft->node, guard, build); isl_ast_build_free(build); @@ -617,6 +653,42 @@ return res; } +/* For each graft in "list", + * insert an if node around graft->node testing the condition encoded + * in graft->guard, assuming graft->guard involves any conditions. + * Subsequently remove the guards from the grafts. + */ +__isl_give isl_ast_graft_list *isl_ast_graft_list_insert_pending_guard_nodes( + __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build) +{ + int i, n; + isl_set *universe; + + list = insert_pending_guard_nodes(list, build); + if (!list) + return NULL; + + universe = isl_set_universe(isl_ast_build_get_space(build, 1)); + n = isl_ast_graft_list_n_ast_graft(list); + for (i = 0; i < n; ++i) { + isl_ast_graft *graft; + + graft = isl_ast_graft_list_get_ast_graft(list, i); + if (!graft) + break; + isl_set_free(graft->guard); + graft->guard = isl_set_copy(universe); + if (!graft->guard) + graft = isl_ast_graft_free(graft); + list = isl_ast_graft_list_set_ast_graft(list, i, graft); + } + isl_set_free(universe); + if (i < n) + return isl_ast_graft_list_free(list); + + return list; +} + /* Collect the nodes contained in the grafts in "list" in a node list. */ static __isl_give isl_ast_node_list *extract_node_list( @@ -649,7 +721,7 @@ * * We assume that the number of children is at least one. */ -static __isl_give isl_basic_set *extract_shared_enforced( +__isl_give isl_basic_set *isl_ast_graft_list_extract_shared_enforced( __isl_keep isl_ast_graft_list *list, __isl_keep isl_ast_build *build) { @@ -685,7 +757,9 @@ /* Record "guard" in "graft" so that it will be enforced somewhere * up the tree. If the graft already has a guard, then it may be partially * redundant in combination with the new guard and in the context - * of build->domain. We therefore (re)compute the gist of the intersection + * the generated constraints of "build". In fact, the new guard + * may in itself have some redundant constraints. + * We therefore (re)compute the gist of the intersection * and coalesce the result. */ static __isl_give isl_ast_graft *store_guard(__isl_take isl_ast_graft *graft, @@ -705,7 +779,8 @@ } graft->guard = isl_set_intersect(graft->guard, guard); - graft->guard = isl_ast_build_compute_gist(build, graft->guard); + graft->guard = isl_set_gist(graft->guard, + isl_ast_build_get_generated(build)); graft->guard = isl_set_coalesce(graft->guard); if (!graft->guard) return isl_ast_graft_free(graft); @@ -746,12 +821,57 @@ return list; } -/* Combine the grafts in the list into a single graft. +/* For each graft in "list", replace its guard with the gist with + * respect to "context". + */ +__isl_give isl_ast_graft_list *isl_ast_graft_list_gist_guards( + __isl_take isl_ast_graft_list *list, __isl_take isl_set *context) +{ + list = gist_guards(list, context); + isl_set_free(context); + + return list; +} + +/* Allocate a graft in "build" based on the list of grafts in "sub_build". + * "guard" and "enforced" are the guard and enforced constraints + * of the allocated graft. The guard is used to simplify the guards + * of the elements in "list". * - * If "up" is set then the resulting graft will be used at an outer level. - * In this case, "build" refers to the outer level, while "sub_build" - * refers to the inner level. If "up" is not set, then the same build - * should be passed to both arguments. + * The node is initialized to either a block containing the nodes of "children" + * or, if there is only a single child, the node of that child. + * If the current level requires a for node, it should be inserted by + * a subsequent call to isl_ast_graft_insert_for. + */ +__isl_give isl_ast_graft *isl_ast_graft_alloc_from_children( + __isl_take isl_ast_graft_list *list, __isl_take isl_set *guard, + __isl_take isl_basic_set *enforced, __isl_keep isl_ast_build *build, + __isl_keep isl_ast_build *sub_build) +{ + isl_ast_build *guard_build; + isl_ast_node *node; + isl_ast_node_list *node_list; + isl_ast_graft *graft; + + guard_build = isl_ast_build_copy(sub_build); + guard_build = isl_ast_build_replace_pending_by_guard(guard_build, + isl_set_copy(guard)); + list = gist_guards(list, guard); + list = insert_pending_guard_nodes(list, guard_build); + isl_ast_build_free(guard_build); + + node_list = extract_node_list(list); + node = isl_ast_node_from_ast_node_list(node_list); + isl_ast_graft_list_free(list); + + graft = isl_ast_graft_alloc(node, build); + graft = store_guard(graft, guard, build); + graft = isl_ast_graft_enforce(graft, enforced); + + return graft; +} + +/* Combine the grafts in the list into a single graft. * * The guard is initialized to the shared guard of the list elements (if any), * provided it does not depend on the current dimension. @@ -767,37 +887,20 @@ * or, if there is only a single element, the node of that element. */ static __isl_give isl_ast_graft *ast_graft_list_fuse( - __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build, - __isl_keep isl_ast_build *sub_build, int up) + __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build) { - isl_ctx *ctx; - isl_ast_node *node; isl_ast_graft *graft; - isl_ast_node_list *node_list; + isl_basic_set *enforced; isl_set *guard; if (!list) return NULL; - ctx = isl_ast_build_get_ctx(build); - guard = extract_hoistable_guard(list, build); - list = gist_guards(list, guard); - list = insert_pending_guard_nodes(list, sub_build); - - node_list = extract_node_list(list); - node = isl_ast_node_from_ast_node_list(node_list); - - graft = isl_ast_graft_alloc(node, build); - - if (!up || isl_options_get_ast_build_exploit_nested_bounds(ctx)) { - isl_basic_set *enforced; - enforced = extract_shared_enforced(list, build); - graft = isl_ast_graft_enforce(graft, enforced); - } + enforced = isl_ast_graft_list_extract_shared_enforced(list, build); + guard = isl_ast_graft_list_extract_hoistable_guard(list, build); + graft = isl_ast_graft_alloc_from_children(list, guard, enforced, + build, build); - graft = store_guard(graft, guard, build); - - isl_ast_graft_list_free(list); return graft; } @@ -815,7 +918,7 @@ return NULL; if (isl_ast_graft_list_n_ast_graft(list) <= 1) return list; - graft = ast_graft_list_fuse(list, build, build, 0); + graft = ast_graft_list_fuse(list, build); return isl_ast_graft_list_from_ast_graft(graft); } @@ -835,24 +938,7 @@ list = isl_ast_graft_list_add(list, graft1); list = isl_ast_graft_list_add(list, graft2); - return ast_graft_list_fuse(list, build, build, 0); -} - -/* Allocate a graft for the current level based on the list of grafts - * of the inner level. - * "build" represents the context of the current level. - * "sub_build" represents the context of the inner level. - * - * The node is initialized to either a block containing the nodes of "children" - * or, if there is only a single child, the node of that child. - * If the current level requires a for node, it should be inserted by - * a subsequent call to isl_ast_graft_insert_for. - */ -__isl_give isl_ast_graft *isl_ast_graft_alloc_level( - __isl_take isl_ast_graft_list *children, - __isl_keep isl_ast_build *build, __isl_keep isl_ast_build *sub_build) -{ - return ast_graft_list_fuse(children, build, sub_build, 1); + return ast_graft_list_fuse(list, build); } /* Insert a for node enclosing the current graft->node. @@ -874,6 +960,25 @@ return NULL; } +/* Insert a mark governing the current graft->node. + */ +__isl_give isl_ast_graft *isl_ast_graft_insert_mark( + __isl_take isl_ast_graft *graft, __isl_take isl_id *mark) +{ + if (!graft) + goto error; + + graft->node = isl_ast_node_alloc_mark(mark, graft->node); + if (!graft->node) + return isl_ast_graft_free(graft); + + return graft; +error: + isl_id_free(mark); + isl_ast_graft_free(graft); + return NULL; +} + /* Represent the graft list as an AST node. * This operation drops the information about guards in the grafts, so * if there are any pending guards, then they are materialized as if nodes. @@ -942,30 +1047,12 @@ } /* Record that "guard" needs to be inserted in "graft". - * - * We first simplify the guard in the context of the enforced set and - * then we store the guard in case we may be able - * to hoist it to higher levels and/or combine it with those of other grafts. */ __isl_give isl_ast_graft *isl_ast_graft_add_guard( __isl_take isl_ast_graft *graft, __isl_take isl_set *guard, __isl_keep isl_ast_build *build) { - isl_basic_set *enforced; - - if (!graft || !build) - goto error; - - enforced = isl_basic_set_copy(graft->enforced); - guard = isl_set_gist(guard, isl_set_from_basic_set(enforced)); - - graft = store_guard(graft, guard, build); - - return graft; -error: - isl_set_free(guard); - isl_ast_graft_free(graft); - return NULL; + return store_guard(graft, guard, build); } /* Reformulate the "graft", which was generated in the context diff -Nru cloog-0.18.2/isl/isl_ast_graft_private.h cloog-0.18.4/isl/isl_ast_graft_private.h --- cloog-0.18.2/isl/isl_ast_graft_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_ast_graft_private.h 2015-07-24 12:23:09.000000000 +0000 @@ -15,7 +15,7 @@ * "guard" contains conditions that should still be enforced by * some ancestor of the current tree. In particular, the already * generated tree assumes that these conditions hold, but may not - * enforced them itself. + * have enforced them itself. * The guard should not contain any unknown divs as it will be used * to generate an if condition. * @@ -44,9 +44,10 @@ __isl_give isl_ast_graft *isl_ast_graft_alloc( __isl_take isl_ast_node *node, __isl_keep isl_ast_build *build); -__isl_give isl_ast_graft *isl_ast_graft_alloc_level( - __isl_take isl_ast_graft_list *children, - __isl_keep isl_ast_build *build, __isl_keep isl_ast_build *sub_build); +__isl_give isl_ast_graft *isl_ast_graft_alloc_from_children( + __isl_take isl_ast_graft_list *list, __isl_take isl_set *guard, + __isl_take isl_basic_set *enforced, __isl_keep isl_ast_build *build, + __isl_keep isl_ast_build *sub_build); __isl_give isl_ast_graft_list *isl_ast_graft_list_fuse( __isl_take isl_ast_graft_list *children, __isl_keep isl_ast_build *build); @@ -75,14 +76,26 @@ __isl_give isl_ast_graft *isl_ast_graft_enforce( __isl_take isl_ast_graft *graft, __isl_take isl_basic_set *enforced); +__isl_give isl_ast_graft *isl_ast_graft_insert_mark( + __isl_take isl_ast_graft *graft, __isl_take isl_id *mark); + __isl_give isl_ast_graft_list *isl_ast_graft_list_unembed( __isl_take isl_ast_graft_list *list, int product); __isl_give isl_ast_graft_list *isl_ast_graft_list_preimage_multi_aff( __isl_take isl_ast_graft_list *list, __isl_take isl_multi_aff *ma); +__isl_give isl_ast_graft_list *isl_ast_graft_list_insert_pending_guard_nodes( + __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build); __isl_give isl_ast_node *isl_ast_node_from_graft_list( __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build); +__isl_give isl_basic_set *isl_ast_graft_list_extract_shared_enforced( + __isl_keep isl_ast_graft_list *list, __isl_keep isl_ast_build *build); +__isl_give isl_set *isl_ast_graft_list_extract_hoistable_guard( + __isl_keep isl_ast_graft_list *list, __isl_keep isl_ast_build *build); +__isl_give isl_ast_graft_list *isl_ast_graft_list_gist_guards( + __isl_take isl_ast_graft_list *list, __isl_take isl_set *context); + __isl_give isl_printer *isl_printer_print_ast_graft(__isl_take isl_printer *p, __isl_keep isl_ast_graft *graft); diff -Nru cloog-0.18.2/isl/isl_ast_int.c cloog-0.18.4/isl/isl_ast_int.c --- cloog-0.18.2/isl/isl_ast_int.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_ast_int.c 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,13 @@ +#include +#include +#include + +int isl_ast_expr_get_int(__isl_keep isl_ast_expr *expr, isl_int *v) +{ + if (!expr) + return -1; + if (expr->type != isl_ast_expr_int) + isl_die(isl_ast_expr_get_ctx(expr), isl_error_invalid, + "expression not an int", return -1); + return isl_val_get_num_isl_int(expr->u.v, v); +} diff -Nru cloog-0.18.2/isl/isl_ast_private.h cloog-0.18.4/isl/isl_ast_private.h --- cloog-0.18.2/isl/isl_ast_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_ast_private.h 2015-07-24 12:23:09.000000000 +0000 @@ -45,9 +45,10 @@ #include -/* A node is either a block, an if, a for or a user node. +/* A node is either a block, an if, a for, a user node or a mark node. * "else_node" is NULL if the if node does not have an else branch. * "cond" and "inc" are NULL for degenerate for nodes. + * In case of a mark node, "mark" is the mark and "node" is the marked node. */ struct isl_ast_node { int ref; @@ -75,6 +76,10 @@ struct { isl_ast_expr *expr; } e; + struct { + isl_id *mark; + isl_ast_node *node; + } m; } u; isl_id *annotation; @@ -86,6 +91,8 @@ __isl_give isl_ast_node *isl_ast_node_alloc_if(__isl_take isl_ast_expr *guard); __isl_give isl_ast_node *isl_ast_node_alloc_block( __isl_take isl_ast_node_list *list); +__isl_give isl_ast_node *isl_ast_node_alloc_mark(__isl_take isl_id *id, + __isl_take isl_ast_node *node); __isl_give isl_ast_node *isl_ast_node_from_ast_node_list( __isl_take isl_ast_node_list *list); __isl_give isl_ast_node *isl_ast_node_for_set_body( diff -Nru cloog-0.18.2/isl/isl_band.c cloog-0.18.4/isl/isl_band.c --- cloog-0.18.2/isl/isl_band.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_band.c 2015-07-24 12:23:09.000000000 +0000 @@ -55,12 +55,12 @@ return NULL; dup->n = band->n; - dup->zero = isl_alloc_array(ctx, int, band->n); - if (band->n && !dup->zero) + dup->coincident = isl_alloc_array(ctx, int, band->n); + if (band->n && !dup->coincident) goto error; for (i = 0; i < band->n; ++i) - dup->zero[i] = band->zero[i]; + dup->coincident[i] = band->coincident[i]; dup->pma = isl_union_pw_multi_aff_copy(band->pma); dup->schedule = band->schedule; @@ -96,17 +96,19 @@ * schedule), then we also need to decrement the reference count of the * containing schedule as it was incremented in isl_band_copy. */ -void *isl_band_free(__isl_take isl_band *band) +__isl_null isl_band *isl_band_free(__isl_take isl_band *band) { if (!band) return NULL; - if (--band->ref > 0) - return isl_schedule_free(band->schedule); + if (--band->ref > 0) { + isl_schedule_free(band->schedule); + return NULL; + } isl_union_pw_multi_aff_free(band->pma); isl_band_list_free(band->children); - free(band->zero); + free(band->coincident); free(band); return NULL; @@ -136,10 +138,10 @@ return band ? band->n : 0; } -/* Is the given scheduling dimension zero distance within the band and - * with respect to the proximity dependences. +/* Is the given scheduling dimension coincident within the band and + * with respect to the coincidence constraints. */ -int isl_band_member_is_zero_distance(__isl_keep isl_band *band, int pos) +int isl_band_member_is_coincident(__isl_keep isl_band *band, int pos) { if (!band) return -1; @@ -148,7 +150,7 @@ isl_die(isl_band_get_ctx(band), isl_error_invalid, "invalid member position", return -1); - return band->zero[pos]; + return band->coincident[pos]; } /* Return the schedule that leads up to this band. @@ -230,7 +232,7 @@ suffix_i = isl_band_get_suffix_schedule_union_pw_multi_aff(el); suffix_i = isl_union_pw_multi_aff_flat_range_product( partial, suffix_i); - suffix = isl_union_pw_multi_aff_add(suffix, suffix_i); + suffix = isl_union_pw_multi_aff_union_add(suffix, suffix_i); isl_band_free(el); } @@ -359,7 +361,7 @@ * floor(s_i(x) / m_i) * */ -static int multi_aff_tile(__isl_take isl_set *set, +static isl_stat multi_aff_tile(__isl_take isl_set *set, __isl_take isl_multi_aff *ma, void *user) { struct isl_band_tile_data *data = user; @@ -387,14 +389,14 @@ pma = isl_pw_multi_aff_alloc(set, ma); data->tiled = isl_pw_multi_aff_union_add(data->tiled, pma); - return 0; + return isl_stat_ok; } /* Given part of the schedule of a band, construct the corresponding * schedule for the tile loops based on the tile sizes in data->sizes * and add the result to data->res. */ -static int pw_multi_aff_tile(__isl_take isl_pw_multi_aff *pma, void *user) +static isl_stat pw_multi_aff_tile(__isl_take isl_pw_multi_aff *pma, void *user) { struct isl_band_tile_data *data = user; @@ -407,11 +409,11 @@ data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, data->tiled); - return 0; + return isl_stat_ok; error: isl_pw_multi_aff_free(pma); isl_pw_multi_aff_free(data->tiled); - return -1; + return isl_stat_error; } /* Given the schedule of a band, construct the corresponding @@ -448,14 +450,15 @@ * All entries are expected to have the same range space, so we can * stop after extracting the range space from the first entry. */ -static int extract_range_space(__isl_take isl_pw_multi_aff *pma, void *user) +static isl_stat extract_range_space(__isl_take isl_pw_multi_aff *pma, + void *user) { isl_space **space = user; *space = isl_space_range(isl_pw_multi_aff_get_space(pma)); isl_pw_multi_aff_free(pma); - return -1; + return isl_stat_error; } /* Extract the range space of "band". All entries in band->pma should @@ -601,7 +604,7 @@ /* Drop the data->n output dimensions starting at data->pos from "pma" * and add the result to data->res. */ -static int pw_multi_aff_drop(__isl_take isl_pw_multi_aff *pma, void *user) +static isl_stat pw_multi_aff_drop(__isl_take isl_pw_multi_aff *pma, void *user) { struct isl_union_pw_multi_aff_drop_data *data = user; @@ -609,9 +612,9 @@ data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, pma); if (!data->res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Drop the "n" output dimensions starting at "pos" from "sched". @@ -654,7 +657,7 @@ band->pma = sched; for (i = pos + n; i < band->n; ++i) - band->zero[i - n] = band->zero[i]; + band->coincident[i - n] = band->coincident[i]; band->n -= n; diff -Nru cloog-0.18.2/isl/isl_band_private.h cloog-0.18.4/isl/isl_band_private.h --- cloog-0.18.2/isl/isl_band_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_band_private.h 2014-10-02 15:33:27.000000000 +0000 @@ -9,8 +9,9 @@ /* Information about a band within a schedule. * * n is the number of scheduling dimensions within the band. - * zero is an array of length n, indicating whether a scheduling dimension - * results in zero dependence distances for the proximity dependences. + * coincident is an array of length n, indicating whether a scheduling dimension + * satisfies the coincidence constraints in the sense that + * the corresponding dependence distances are zero. * pma is the partial schedule corresponding to this band. * schedule is the schedule that contains this band. * parent is the parent of this band (or NULL if the band is a root). @@ -25,7 +26,7 @@ int ref; int n; - int *zero; + int *coincident; isl_union_pw_multi_aff *pma; isl_schedule *schedule; diff -Nru cloog-0.18.2/isl/isl_bernstein.c cloog-0.18.4/isl/isl_bernstein.c --- cloog-0.18.2/isl/isl_bernstein.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_bernstein.c 2014-10-02 15:33:27.000000000 +0000 @@ -16,12 +16,13 @@ #include #include #include -#include +#include #include #include #include #include #include +#include #include struct bernstein_data { diff -Nru cloog-0.18.2/isl/isl_blk.c cloog-0.18.4/isl/isl_blk.c --- cloog-0.18.2/isl/isl_blk.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_blk.c 2014-10-02 15:33:27.000000000 +0000 @@ -7,7 +7,7 @@ * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium */ -#include +#include #include /* The maximal number of cache misses before first element is evicted */ diff -Nru cloog-0.18.2/isl/isl_blk.h cloog-0.18.4/isl/isl_blk.h --- cloog-0.18.2/isl/isl_blk.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_blk.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,40 @@ +/* + * Copyright 2008-2009 Katholieke Universiteit Leuven + * + * Use of this software is governed by the MIT license + * + * Written by Sven Verdoolaege, K.U.Leuven, Departement + * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium + */ + +#ifndef ISL_BLK_H +#define ISL_BLK_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +struct isl_blk { + size_t size; + isl_int *data; +}; + +#define ISL_BLK_CACHE_SIZE 20 + +struct isl_ctx; + +struct isl_blk isl_blk_alloc(struct isl_ctx *ctx, size_t n); +struct isl_blk isl_blk_empty(void); +int isl_blk_is_error(struct isl_blk block); +struct isl_blk isl_blk_extend(struct isl_ctx *ctx, struct isl_blk block, + size_t new_n); +void isl_blk_free(struct isl_ctx *ctx, struct isl_blk block); +void isl_blk_clear_cache(struct isl_ctx *ctx); + +#if defined(__cplusplus) +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/isl_bound.c cloog-0.18.4/isl/isl_bound.c --- cloog-0.18.2/isl/isl_bound.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_bound.c 2015-07-24 12:23:09.000000000 +0000 @@ -153,10 +153,10 @@ return r; } -static int guarded_qp(__isl_take isl_qpolynomial *qp, void *user) +static isl_stat guarded_qp(__isl_take isl_qpolynomial *qp, void *user) { struct isl_bound *bound = (struct isl_bound *)user; - int r; + isl_stat r; r = isl_qpolynomial_as_polynomial_on_domain(qp, bound->bset, &guarded_poly_bound, user); @@ -164,10 +164,10 @@ return r; } -static int basic_guarded_fold(__isl_take isl_basic_set *bset, void *user) +static isl_stat basic_guarded_fold(__isl_take isl_basic_set *bset, void *user) { struct isl_bound *bound = (struct isl_bound *)user; - int r; + isl_stat r; bound->bset = bset; r = isl_qpolynomial_fold_foreach_qpolynomial(bound->fold, @@ -176,7 +176,7 @@ return r; } -static int guarded_fold(__isl_take isl_set *set, +static isl_stat guarded_fold(__isl_take isl_set *set, __isl_take isl_qpolynomial_fold *fold, void *user) { struct isl_bound *bound = (struct isl_bound *)user; @@ -195,11 +195,11 @@ isl_set_free(set); isl_qpolynomial_fold_free(fold); - return 0; + return isl_stat_ok; error: isl_set_free(set); isl_qpolynomial_fold_free(fold); - return -1; + return isl_stat_error; } __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_bound( @@ -287,7 +287,7 @@ isl_union_pw_qpolynomial_fold *res; }; -static int bound_pw(__isl_take isl_pw_qpolynomial *pwqp, void *user) +static isl_stat bound_pw(__isl_take isl_pw_qpolynomial *pwqp, void *user) { struct isl_union_bound_data *data = user; isl_pw_qpolynomial_fold *pwf; @@ -297,7 +297,7 @@ data->res = isl_union_pw_qpolynomial_fold_fold_pw_qpolynomial_fold( data->res, pwf); - return 0; + return isl_stat_ok; } __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_bound( diff -Nru cloog-0.18.2/isl/isl_coalesce.c cloog-0.18.4/isl/isl_coalesce.c --- cloog-0.18.2/isl/isl_coalesce.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_coalesce.c 2015-07-24 12:23:09.000000000 +0000 @@ -2,6 +2,7 @@ * Copyright 2008-2009 Katholieke Universiteit Leuven * Copyright 2010 INRIA Saclay * Copyright 2012-2013 Ecole Normale Superieure + * Copyright 2014 INRIA Rocquencourt * * Use of this software is governed by the MIT license * @@ -10,14 +11,18 @@ * and INRIA Saclay - Ile-de-France, Parc Club Orsay Universite, * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France * and Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France + * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, + * B.P. 105 - 78153 Le Chesnay, France */ #include "isl_map_private.h" -#include +#include #include #include "isl_tab.h" #include #include +#include +#include #define STATUS_ERROR -1 #define STATUS_REDUNDANT 1 @@ -54,6 +59,9 @@ int *eq = isl_calloc_array(bmap_i->ctx, int, 2 * bmap_i->n_eq); unsigned dim; + if (!eq) + return NULL; + dim = isl_basic_map_total_dim(bmap_i); for (k = 0; k < bmap_i->n_eq; ++k) { for (l = 0; l < 2; ++l) { @@ -84,6 +92,9 @@ unsigned n_eq = bmap_i->n_eq; int *ineq = isl_calloc_array(bmap_i->ctx, int, bmap_i->n_ineq); + if (!ineq) + return NULL; + for (k = 0; k < bmap_i->n_ineq; ++k) { if (tab_i && isl_tab_is_redundant(tab_i, n_eq + k)) { ineq[k] = STATUS_REDUNDANT; @@ -136,83 +147,252 @@ return 1; } -static void drop(struct isl_map *map, int i, struct isl_tab **tabs) +/* Internal information associated to a basic map in a map + * that is to be coalesced by isl_map_coalesce. + * + * "bmap" is the basic map itself (or NULL if "removed" is set) + * "tab" is the corresponding tableau (or NULL if "removed" is set) + * "hull_hash" identifies the affine space in which "bmap" lives. + * "removed" is set if this basic map has been removed from the map + * "simplify" is set if this basic map may have some unknown integer + * divisions that were not present in the input basic maps. The basic + * map should then be simplified such that we may be able to find + * a definition among the constraints. + * + * "eq" and "ineq" are only set if we are currently trying to coalesce + * this basic map with another basic map, in which case they represent + * the position of the inequalities of this basic map with respect to + * the other basic map. The number of elements in the "eq" array + * is twice the number of equalities in the "bmap", corresponding + * to the two inequalities that make up each equality. + */ +struct isl_coalesce_info { + isl_basic_map *bmap; + struct isl_tab *tab; + uint32_t hull_hash; + int removed; + int simplify; + int *eq; + int *ineq; +}; + +/* Compute the hash of the (apparent) affine hull of info->bmap (with + * the existentially quantified variables removed) and store it + * in info->hash. + */ +static int coalesce_info_set_hull_hash(struct isl_coalesce_info *info) +{ + isl_basic_map *hull; + unsigned n_div; + + hull = isl_basic_map_copy(info->bmap); + hull = isl_basic_map_plain_affine_hull(hull); + n_div = isl_basic_map_dim(hull, isl_dim_div); + hull = isl_basic_map_drop_constraints_involving_dims(hull, + isl_dim_div, 0, n_div); + info->hull_hash = isl_basic_map_get_hash(hull); + isl_basic_map_free(hull); + + return hull ? 0 : -1; +} + +/* Free all the allocated memory in an array + * of "n" isl_coalesce_info elements. + */ +static void clear_coalesce_info(int n, struct isl_coalesce_info *info) { - isl_basic_map_free(map->p[i]); - isl_tab_free(tabs[i]); + int i; + + if (!info) + return; - if (i != map->n - 1) { - map->p[i] = map->p[map->n - 1]; - tabs[i] = tabs[map->n - 1]; + for (i = 0; i < n; ++i) { + isl_basic_map_free(info[i].bmap); + isl_tab_free(info[i].tab); } - tabs[map->n - 1] = NULL; - map->n--; + + free(info); } -/* Replace the pair of basic maps i and j by the basic map bounded - * by the valid constraints in both basic maps and the constraint - * in extra (if not NULL). +/* Drop the basic map represented by "info". + * That is, clear the memory associated to the entry and + * mark it as having been removed. + */ +static void drop(struct isl_coalesce_info *info) +{ + info->bmap = isl_basic_map_free(info->bmap); + isl_tab_free(info->tab); + info->tab = NULL; + info->removed = 1; +} + +/* Exchange the information in "info1" with that in "info2". */ -static int fuse(struct isl_map *map, int i, int j, - struct isl_tab **tabs, int *eq_i, int *ineq_i, int *eq_j, int *ineq_j, - __isl_keep isl_mat *extra) +static void exchange(struct isl_coalesce_info *info1, + struct isl_coalesce_info *info2) +{ + struct isl_coalesce_info info; + + info = *info1; + *info1 = *info2; + *info2 = info; +} + +/* This type represents the kind of change that has been performed + * while trying to coalesce two basic maps. + * + * isl_change_none: nothing was changed + * isl_change_drop_first: the first basic map was removed + * isl_change_drop_second: the second basic map was removed + * isl_change_fuse: the two basic maps were replaced by a new basic map. + */ +enum isl_change { + isl_change_error = -1, + isl_change_none = 0, + isl_change_drop_first, + isl_change_drop_second, + isl_change_fuse, +}; + +/* Update "change" based on an interchange of the first and the second + * basic map. That is, interchange isl_change_drop_first and + * isl_change_drop_second. + */ +static enum isl_change invert_change(enum isl_change change) +{ + switch (change) { + case isl_change_error: + return isl_change_error; + case isl_change_none: + return isl_change_none; + case isl_change_drop_first: + return isl_change_drop_second; + case isl_change_drop_second: + return isl_change_drop_first; + case isl_change_fuse: + return isl_change_fuse; + } + + return isl_change_error; +} + +/* Add the valid constraints of the basic map represented by "info" + * to "bmap". "len" is the size of the constraints. + * If only one of the pair of inequalities that make up an equality + * is valid, then add that inequality. + */ +static __isl_give isl_basic_map *add_valid_constraints( + __isl_take isl_basic_map *bmap, struct isl_coalesce_info *info, + unsigned len) { int k, l; - struct isl_basic_map *fused = NULL; - struct isl_tab *fused_tab = NULL; - unsigned total = isl_basic_map_total_dim(map->p[i]); - unsigned extra_rows = extra ? extra->n_row : 0; - fused = isl_basic_map_alloc_space(isl_space_copy(map->p[i]->dim), - map->p[i]->n_div, - map->p[i]->n_eq + map->p[j]->n_eq, - map->p[i]->n_ineq + map->p[j]->n_ineq + extra_rows); - if (!fused) - goto error; + if (!bmap) + return NULL; - for (k = 0; k < map->p[i]->n_eq; ++k) { - if (eq_i && (eq_i[2 * k] != STATUS_VALID || - eq_i[2 * k + 1] != STATUS_VALID)) - continue; - l = isl_basic_map_alloc_equality(fused); - if (l < 0) - goto error; - isl_seq_cpy(fused->eq[l], map->p[i]->eq[k], 1 + total); + for (k = 0; k < info->bmap->n_eq; ++k) { + if (info->eq[2 * k] == STATUS_VALID && + info->eq[2 * k + 1] == STATUS_VALID) { + l = isl_basic_map_alloc_equality(bmap); + if (l < 0) + return isl_basic_map_free(bmap); + isl_seq_cpy(bmap->eq[l], info->bmap->eq[k], len); + } else if (info->eq[2 * k] == STATUS_VALID) { + l = isl_basic_map_alloc_inequality(bmap); + if (l < 0) + return isl_basic_map_free(bmap); + isl_seq_neg(bmap->ineq[l], info->bmap->eq[k], len); + } else if (info->eq[2 * k + 1] == STATUS_VALID) { + l = isl_basic_map_alloc_inequality(bmap); + if (l < 0) + return isl_basic_map_free(bmap); + isl_seq_cpy(bmap->ineq[l], info->bmap->eq[k], len); + } } - for (k = 0; k < map->p[j]->n_eq; ++k) { - if (eq_j && (eq_j[2 * k] != STATUS_VALID || - eq_j[2 * k + 1] != STATUS_VALID)) + for (k = 0; k < info->bmap->n_ineq; ++k) { + if (info->ineq[k] != STATUS_VALID) continue; - l = isl_basic_map_alloc_equality(fused); + l = isl_basic_map_alloc_inequality(bmap); if (l < 0) - goto error; - isl_seq_cpy(fused->eq[l], map->p[j]->eq[k], 1 + total); + return isl_basic_map_free(bmap); + isl_seq_cpy(bmap->ineq[l], info->bmap->ineq[k], len); } - for (k = 0; k < map->p[i]->n_ineq; ++k) { - if (ineq_i[k] != STATUS_VALID) - continue; - l = isl_basic_map_alloc_inequality(fused); - if (l < 0) - goto error; - isl_seq_cpy(fused->ineq[l], map->p[i]->ineq[k], 1 + total); - } + return bmap; +} - for (k = 0; k < map->p[j]->n_ineq; ++k) { - if (ineq_j[k] != STATUS_VALID) - continue; - l = isl_basic_map_alloc_inequality(fused); - if (l < 0) - goto error; - isl_seq_cpy(fused->ineq[l], map->p[j]->ineq[k], 1 + total); - } +/* Is "bmap" defined by a number of (non-redundant) constraints that + * is greater than the number of constraints of basic maps i and j combined? + * Equalities are counted as two inequalities. + */ +static int number_of_constraints_increases(int i, int j, + struct isl_coalesce_info *info, + __isl_keep isl_basic_map *bmap, struct isl_tab *tab) +{ + int k, n_old, n_new; + + n_old = 2 * info[i].bmap->n_eq + info[i].bmap->n_ineq; + n_old += 2 * info[j].bmap->n_eq + info[j].bmap->n_ineq; + + n_new = 2 * bmap->n_eq; + for (k = 0; k < bmap->n_ineq; ++k) + if (!isl_tab_is_redundant(tab, bmap->n_eq + k)) + ++n_new; + + return n_new > n_old; +} - for (k = 0; k < map->p[i]->n_div; ++k) { +/* Replace the pair of basic maps i and j by the basic map bounded + * by the valid constraints in both basic maps and the constraints + * in extra (if not NULL). + * Place the fused basic map in the position that is the smallest of i and j. + * + * If "detect_equalities" is set, then look for equalities encoded + * as pairs of inequalities. + * If "check_number" is set, then the original basic maps are only + * replaced if the total number of constraints does not increase. + * While the number of integer divisions in the two basic maps + * is assumed to be the same, the actual definitions may be different. + * We only copy the definition from one of the basic map if it is + * the same as that of the other basic map. Otherwise, we mark + * the integer division as unknown and schedule for the basic map + * to be simplified in an attempt to recover the integer division definition. + */ +static enum isl_change fuse(int i, int j, struct isl_coalesce_info *info, + __isl_keep isl_mat *extra, int detect_equalities, int check_number) +{ + int k, l; + struct isl_basic_map *fused = NULL; + struct isl_tab *fused_tab = NULL; + unsigned total = isl_basic_map_total_dim(info[i].bmap); + unsigned extra_rows = extra ? extra->n_row : 0; + unsigned n_eq, n_ineq; + + if (j < i) + return fuse(j, i, info, extra, detect_equalities, check_number); + + n_eq = info[i].bmap->n_eq + info[j].bmap->n_eq; + n_ineq = info[i].bmap->n_ineq + info[j].bmap->n_ineq; + fused = isl_basic_map_alloc_space(isl_space_copy(info[i].bmap->dim), + info[i].bmap->n_div, n_eq, n_eq + n_ineq + extra_rows); + fused = add_valid_constraints(fused, &info[i], 1 + total); + fused = add_valid_constraints(fused, &info[j], 1 + total); + if (!fused) + goto error; + + for (k = 0; k < info[i].bmap->n_div; ++k) { int l = isl_basic_map_alloc_div(fused); if (l < 0) goto error; - isl_seq_cpy(fused->div[l], map->p[i]->div[k], 1 + 1 + total); + if (isl_seq_eq(info[i].bmap->div[k], info[j].bmap->div[k], + 1 + 1 + total)) { + isl_seq_cpy(fused->div[l], info[i].bmap->div[k], + 1 + 1 + total); + } else { + isl_int_set_si(fused->div[l][0], 0); + info[i].simplify = 1; + } } for (k = 0; k < extra_rows; ++k) { @@ -222,27 +402,37 @@ isl_seq_cpy(fused->ineq[l], extra->row[k], 1 + total); } + if (detect_equalities) + fused = isl_basic_map_detect_inequality_pairs(fused, NULL); fused = isl_basic_map_gauss(fused, NULL); ISL_F_SET(fused, ISL_BASIC_MAP_FINAL); - if (ISL_F_ISSET(map->p[i], ISL_BASIC_MAP_RATIONAL) && - ISL_F_ISSET(map->p[j], ISL_BASIC_MAP_RATIONAL)) + if (ISL_F_ISSET(info[i].bmap, ISL_BASIC_MAP_RATIONAL) && + ISL_F_ISSET(info[j].bmap, ISL_BASIC_MAP_RATIONAL)) ISL_F_SET(fused, ISL_BASIC_MAP_RATIONAL); fused_tab = isl_tab_from_basic_map(fused, 0); if (isl_tab_detect_redundant(fused_tab) < 0) goto error; - isl_basic_map_free(map->p[i]); - map->p[i] = fused; - isl_tab_free(tabs[i]); - tabs[i] = fused_tab; - drop(map, j, tabs); + if (check_number && + number_of_constraints_increases(i, j, info, fused, fused_tab)) { + isl_tab_free(fused_tab); + isl_basic_map_free(fused); + return isl_change_none; + } + + info[i].simplify |= info[j].simplify; + isl_basic_map_free(info[i].bmap); + info[i].bmap = fused; + isl_tab_free(info[i].tab); + info[i].tab = fused_tab; + drop(&info[j]); - return 1; + return isl_change_fuse; error: isl_tab_free(fused_tab); isl_basic_map_free(fused); - return -1; + return isl_change_error; } /* Given a pair of basic maps i and j such that all constraints are either @@ -250,79 +440,107 @@ * constraints of i lie entirely within basic map j. * If so, replace the pair by the basic map consisting of the valid * constraints in both basic maps. + * Checking whether the facet lies entirely within basic map j + * is performed by checking whether the constraints of basic map j + * are valid for the facet. These tests are performed on a rational + * tableau to avoid the theoretical possibility that a constraint + * that was considered to be a cut constraint for the entire basic map i + * happens to be considered to be a valid constraint for the facet, + * even though it cuts off the same rational points. * * To see that we are not introducing any extra points, call the * two basic maps A and B and the resulting map U and let x * be an element of U \setminus ( A \cup B ). - * Then there is a pair of cut constraints c_1 and c_2 in A and B such that x - * violates them. Let X be the intersection of U with the opposites - * of these constraints. Then x \in X. - * The facet corresponding to c_1 contains the corresponding facet of A. - * This facet is entirely contained in B, so c_2 is valid on the facet. - * However, since it is also (part of) a facet of X, -c_2 is also valid - * on the facet. This means c_2 is saturated on the facet, so c_1 and - * c_2 must be opposites of each other, but then x could not violate - * both of them. + * A line connecting x with an element of A \cup B meets a facet F + * of either A or B. Assume it is a facet of B and let c_1 be + * the corresponding facet constraint. We have c_1(x) < 0 and + * so c_1 is a cut constraint. This implies that there is some + * (possibly rational) point x' satisfying the constraints of A + * and the opposite of c_1 as otherwise c_1 would have been marked + * valid for A. The line connecting x and x' meets a facet of A + * in a (possibly rational) point that also violates c_1, but this + * is impossible since all cut constraints of B are valid for all + * cut facets of A. + * In case F is a facet of A rather than B, then we can apply the + * above reasoning to find a facet of B separating x from A \cup B first. */ -static int check_facets(struct isl_map *map, int i, int j, - struct isl_tab **tabs, int *ineq_i, int *ineq_j) +static enum isl_change check_facets(int i, int j, + struct isl_coalesce_info *info) { int k, l; - struct isl_tab_undo *snap; - unsigned n_eq = map->p[i]->n_eq; + struct isl_tab_undo *snap, *snap2; + unsigned n_eq = info[i].bmap->n_eq; - snap = isl_tab_snap(tabs[i]); + snap = isl_tab_snap(info[i].tab); + if (isl_tab_mark_rational(info[i].tab) < 0) + return isl_change_error; + snap2 = isl_tab_snap(info[i].tab); - for (k = 0; k < map->p[i]->n_ineq; ++k) { - if (ineq_i[k] != STATUS_CUT) + for (k = 0; k < info[i].bmap->n_ineq; ++k) { + if (info[i].ineq[k] != STATUS_CUT) continue; - if (isl_tab_select_facet(tabs[i], n_eq + k) < 0) - return -1; - for (l = 0; l < map->p[j]->n_ineq; ++l) { + if (isl_tab_select_facet(info[i].tab, n_eq + k) < 0) + return isl_change_error; + for (l = 0; l < info[j].bmap->n_ineq; ++l) { int stat; - if (ineq_j[l] != STATUS_CUT) + if (info[j].ineq[l] != STATUS_CUT) continue; - stat = status_in(map->p[j]->ineq[l], tabs[i]); + stat = status_in(info[j].bmap->ineq[l], info[i].tab); + if (stat < 0) + return isl_change_error; if (stat != STATUS_VALID) break; } - if (isl_tab_rollback(tabs[i], snap) < 0) - return -1; - if (l < map->p[j]->n_ineq) + if (isl_tab_rollback(info[i].tab, snap2) < 0) + return isl_change_error; + if (l < info[j].bmap->n_ineq) break; } - if (k < map->p[i]->n_ineq) - /* BAD CUT PAIR */ - return 0; - return fuse(map, i, j, tabs, NULL, ineq_i, NULL, ineq_j, NULL); + if (k < info[i].bmap->n_ineq) { + if (isl_tab_rollback(info[i].tab, snap) < 0) + return isl_change_error; + return isl_change_none; + } + return fuse(i, j, info, NULL, 0, 0); } -/* Check if basic map "i" contains the basic map represented +/* Check if info->bmap contains the basic map represented * by the tableau "tab". + * For each equality, we check both the constraint itself + * (as an inequality) and its negation. Make sure the + * equality is returned to its original state before returning. */ -static int contains(struct isl_map *map, int i, int *ineq_i, - struct isl_tab *tab) +static int contains(struct isl_coalesce_info *info, struct isl_tab *tab) { - int k, l; + int k; unsigned dim; + isl_basic_map *bmap = info->bmap; - dim = isl_basic_map_total_dim(map->p[i]); - for (k = 0; k < map->p[i]->n_eq; ++k) { - for (l = 0; l < 2; ++l) { - int stat; - isl_seq_neg(map->p[i]->eq[k], map->p[i]->eq[k], 1+dim); - stat = status_in(map->p[i]->eq[k], tab); - if (stat != STATUS_VALID) - return 0; - } + dim = isl_basic_map_total_dim(bmap); + for (k = 0; k < bmap->n_eq; ++k) { + int stat; + isl_seq_neg(bmap->eq[k], bmap->eq[k], 1 + dim); + stat = status_in(bmap->eq[k], tab); + isl_seq_neg(bmap->eq[k], bmap->eq[k], 1 + dim); + if (stat < 0) + return -1; + if (stat != STATUS_VALID) + return 0; + stat = status_in(bmap->eq[k], tab); + if (stat < 0) + return -1; + if (stat != STATUS_VALID) + return 0; } - for (k = 0; k < map->p[i]->n_ineq; ++k) { + for (k = 0; k < bmap->n_ineq; ++k) { int stat; - if (ineq_i[k] == STATUS_REDUNDANT) + if (info->ineq[k] == STATUS_REDUNDANT) continue; - stat = status_in(map->p[i]->ineq[k], tab); + stat = status_in(bmap->ineq[k], tab); + if (stat < 0) + return -1; if (stat != STATUS_VALID) return 0; } @@ -366,53 +584,57 @@ * | || | | | * |__||_/ |_____/ */ -static int is_adj_ineq_extension(__isl_keep isl_map *map, int i, int j, - struct isl_tab **tabs, int *eq_i, int *ineq_i, int *eq_j, int *ineq_j) +static enum isl_change is_adj_ineq_extension(int i, int j, + struct isl_coalesce_info *info) { int k; struct isl_tab_undo *snap; - unsigned n_eq = map->p[i]->n_eq; - unsigned total = isl_basic_map_total_dim(map->p[i]); + unsigned n_eq = info[i].bmap->n_eq; + unsigned total = isl_basic_map_total_dim(info[i].bmap); int r; + int super; - if (isl_tab_extend_cons(tabs[i], 1 + map->p[j]->n_ineq) < 0) - return -1; + if (isl_tab_extend_cons(info[i].tab, 1 + info[j].bmap->n_ineq) < 0) + return isl_change_error; - for (k = 0; k < map->p[i]->n_ineq; ++k) - if (ineq_i[k] == STATUS_ADJ_INEQ) + for (k = 0; k < info[i].bmap->n_ineq; ++k) + if (info[i].ineq[k] == STATUS_ADJ_INEQ) break; - if (k >= map->p[i]->n_ineq) - isl_die(isl_map_get_ctx(map), isl_error_internal, - "ineq_i should have exactly one STATUS_ADJ_INEQ", - return -1); - - snap = isl_tab_snap(tabs[i]); - - if (isl_tab_unrestrict(tabs[i], n_eq + k) < 0) - return -1; - - isl_seq_neg(map->p[i]->ineq[k], map->p[i]->ineq[k], 1 + total); - isl_int_sub_ui(map->p[i]->ineq[k][0], map->p[i]->ineq[k][0], 1); - r = isl_tab_add_ineq(tabs[i], map->p[i]->ineq[k]); - isl_seq_neg(map->p[i]->ineq[k], map->p[i]->ineq[k], 1 + total); - isl_int_sub_ui(map->p[i]->ineq[k][0], map->p[i]->ineq[k][0], 1); + if (k >= info[i].bmap->n_ineq) + isl_die(isl_basic_map_get_ctx(info[i].bmap), isl_error_internal, + "info[i].ineq should have exactly one STATUS_ADJ_INEQ", + return isl_change_error); + + snap = isl_tab_snap(info[i].tab); + + if (isl_tab_unrestrict(info[i].tab, n_eq + k) < 0) + return isl_change_error; + + isl_seq_neg(info[i].bmap->ineq[k], info[i].bmap->ineq[k], 1 + total); + isl_int_sub_ui(info[i].bmap->ineq[k][0], info[i].bmap->ineq[k][0], 1); + r = isl_tab_add_ineq(info[i].tab, info[i].bmap->ineq[k]); + isl_seq_neg(info[i].bmap->ineq[k], info[i].bmap->ineq[k], 1 + total); + isl_int_sub_ui(info[i].bmap->ineq[k][0], info[i].bmap->ineq[k][0], 1); if (r < 0) - return -1; + return isl_change_error; - for (k = 0; k < map->p[j]->n_ineq; ++k) { - if (ineq_j[k] != STATUS_VALID) + for (k = 0; k < info[j].bmap->n_ineq; ++k) { + if (info[j].ineq[k] != STATUS_VALID) continue; - if (isl_tab_add_ineq(tabs[i], map->p[j]->ineq[k]) < 0) - return -1; + if (isl_tab_add_ineq(info[i].tab, info[j].bmap->ineq[k]) < 0) + return isl_change_error; } - if (contains(map, j, ineq_j, tabs[i])) - return fuse(map, i, j, tabs, eq_i, ineq_i, eq_j, ineq_j, NULL); + super = contains(&info[j], info[i].tab); + if (super < 0) + return isl_change_error; + if (super) + return fuse(i, j, info, NULL, 0, 0); - if (isl_tab_rollback(tabs[i], snap) < 0) - return -1; + if (isl_tab_rollback(info[i].tab, snap) < 0) + return isl_change_error; - return 0; + return isl_change_none; } @@ -447,35 +669,33 @@ * still be able to fuse the two basic maps, but we need to perform * some additional checks in is_adj_ineq_extension. */ -static int check_adj_ineq(struct isl_map *map, int i, int j, - struct isl_tab **tabs, int *eq_i, int *ineq_i, int *eq_j, int *ineq_j) +static enum isl_change check_adj_ineq(int i, int j, + struct isl_coalesce_info *info) { int count_i, count_j; int cut_i, cut_j; - count_i = count(ineq_i, map->p[i]->n_ineq, STATUS_ADJ_INEQ); - count_j = count(ineq_j, map->p[j]->n_ineq, STATUS_ADJ_INEQ); + count_i = count(info[i].ineq, info[i].bmap->n_ineq, STATUS_ADJ_INEQ); + count_j = count(info[j].ineq, info[j].bmap->n_ineq, STATUS_ADJ_INEQ); if (count_i != 1 && count_j != 1) - return 0; + return isl_change_none; - cut_i = any(eq_i, 2 * map->p[i]->n_eq, STATUS_CUT) || - any(ineq_i, map->p[i]->n_ineq, STATUS_CUT); - cut_j = any(eq_j, 2 * map->p[j]->n_eq, STATUS_CUT) || - any(ineq_j, map->p[j]->n_ineq, STATUS_CUT); + cut_i = any(info[i].eq, 2 * info[i].bmap->n_eq, STATUS_CUT) || + any(info[i].ineq, info[i].bmap->n_ineq, STATUS_CUT); + cut_j = any(info[j].eq, 2 * info[j].bmap->n_eq, STATUS_CUT) || + any(info[j].ineq, info[j].bmap->n_ineq, STATUS_CUT); if (!cut_i && !cut_j && count_i == 1 && count_j == 1) - return fuse(map, i, j, tabs, NULL, ineq_i, NULL, ineq_j, NULL); + return fuse(i, j, info, NULL, 0, 0); if (count_i == 1 && !cut_i) - return is_adj_ineq_extension(map, i, j, tabs, - eq_i, ineq_i, eq_j, ineq_j); + return is_adj_ineq_extension(i, j, info); if (count_j == 1 && !cut_j) - return is_adj_ineq_extension(map, j, i, tabs, - eq_j, ineq_j, eq_i, ineq_i); + return is_adj_ineq_extension(j, i, info); - return 0; + return isl_change_none; } /* Basic map "i" has an inequality "k" that is adjacent to some equality @@ -489,6 +709,11 @@ * other basic map is included in the extension, because there * were no "cut" inequalities in "i") and we can replace the * two basic maps by this extension. + * Each integer division that does not have exactly the same + * definition in "i" and "j" is marked unknown and the basic map + * is scheduled to be simplified in an attempt to recover + * the integer division definition. + * Place this extension in the position that is the smallest of i and j. * ____ _____ * / || / | * / || / | @@ -496,38 +721,54 @@ * \ || \ | * \___|| \____| */ -static int is_adj_eq_extension(struct isl_map *map, int i, int j, int k, - struct isl_tab **tabs, int *eq_i, int *ineq_i, int *eq_j, int *ineq_j) +static enum isl_change is_adj_eq_extension(int i, int j, int k, + struct isl_coalesce_info *info) { - int changed = 0; + int change = isl_change_none; int super; struct isl_tab_undo *snap, *snap2; - unsigned n_eq = map->p[i]->n_eq; + unsigned n_eq = info[i].bmap->n_eq; - if (isl_tab_is_equality(tabs[i], n_eq + k)) - return 0; + if (isl_tab_is_equality(info[i].tab, n_eq + k)) + return isl_change_none; - snap = isl_tab_snap(tabs[i]); - tabs[i] = isl_tab_relax(tabs[i], n_eq + k); - snap2 = isl_tab_snap(tabs[i]); - if (isl_tab_select_facet(tabs[i], n_eq + k) < 0) - return -1; - super = contains(map, j, ineq_j, tabs[i]); + snap = isl_tab_snap(info[i].tab); + if (isl_tab_relax(info[i].tab, n_eq + k) < 0) + return isl_change_error; + snap2 = isl_tab_snap(info[i].tab); + if (isl_tab_select_facet(info[i].tab, n_eq + k) < 0) + return isl_change_error; + super = contains(&info[j], info[i].tab); + if (super < 0) + return isl_change_error; if (super) { - if (isl_tab_rollback(tabs[i], snap2) < 0) - return -1; - map->p[i] = isl_basic_map_cow(map->p[i]); - if (!map->p[i]) - return -1; - isl_int_add_ui(map->p[i]->ineq[k][0], map->p[i]->ineq[k][0], 1); - ISL_F_SET(map->p[i], ISL_BASIC_MAP_FINAL); - drop(map, j, tabs); - changed = 1; + int l; + unsigned total; + + if (isl_tab_rollback(info[i].tab, snap2) < 0) + return isl_change_error; + info[i].bmap = isl_basic_map_cow(info[i].bmap); + if (!info[i].bmap) + return isl_change_error; + total = isl_basic_map_total_dim(info[i].bmap); + for (l = 0; l < info[i].bmap->n_div; ++l) + if (!isl_seq_eq(info[i].bmap->div[l], + info[j].bmap->div[l], 1 + 1 + total)) { + isl_int_set_si(info[i].bmap->div[l][0], 0); + info[i].simplify = 1; + } + isl_int_add_ui(info[i].bmap->ineq[k][0], + info[i].bmap->ineq[k][0], 1); + ISL_F_SET(info[i].bmap, ISL_BASIC_MAP_FINAL); + drop(&info[j]); + if (j < i) + exchange(&info[i], &info[j]); + change = isl_change_fuse; } else - if (isl_tab_rollback(tabs[i], snap) < 0) - return -1; + if (isl_tab_rollback(info[i].tab, snap) < 0) + return isl_change_error; - return changed; + return change; } /* Data structure that keeps track of the wrapping constraints @@ -544,31 +785,32 @@ }; /* Update wraps->max to be greater than or equal to the coefficients - * in the equalities and inequalities of bmap that can be removed if we end up - * applying wrapping. + * in the equalities and inequalities of info->bmap that can be removed + * if we end up applying wrapping. */ static void wraps_update_max(struct isl_wraps *wraps, - __isl_keep isl_basic_map *bmap, int *eq, int *ineq) + struct isl_coalesce_info *info) { int k; isl_int max_k; - unsigned total = isl_basic_map_total_dim(bmap); + unsigned total = isl_basic_map_total_dim(info->bmap); isl_int_init(max_k); - for (k = 0; k < bmap->n_eq; ++k) { - if (eq[2 * k] == STATUS_VALID && - eq[2 * k + 1] == STATUS_VALID) + for (k = 0; k < info->bmap->n_eq; ++k) { + if (info->eq[2 * k] == STATUS_VALID && + info->eq[2 * k + 1] == STATUS_VALID) continue; - isl_seq_abs_max(bmap->eq[k] + 1, total, &max_k); + isl_seq_abs_max(info->bmap->eq[k] + 1, total, &max_k); if (isl_int_abs_gt(max_k, wraps->max)) isl_int_set(wraps->max, max_k); } - for (k = 0; k < bmap->n_ineq; ++k) { - if (ineq[k] == STATUS_VALID || ineq[k] == STATUS_REDUNDANT) + for (k = 0; k < info->bmap->n_ineq; ++k) { + if (info->ineq[k] == STATUS_VALID || + info->ineq[k] == STATUS_REDUNDANT) continue; - isl_seq_abs_max(bmap->ineq[k] + 1, total, &max_k); + isl_seq_abs_max(info->bmap->ineq[k] + 1, total, &max_k); if (isl_int_abs_gt(max_k, wraps->max)) isl_int_set(wraps->max, max_k); } @@ -583,8 +825,7 @@ * applying wrapping. */ static void wraps_init(struct isl_wraps *wraps, __isl_take isl_mat *mat, - __isl_keep isl_map *map, int i, int j, - int *eq_i, int *ineq_i, int *eq_j, int *ineq_j) + struct isl_coalesce_info *info, int i, int j) { isl_ctx *ctx; @@ -598,8 +839,8 @@ return; isl_int_init(wraps->max); isl_int_set_si(wraps->max, 0); - wraps_update_max(wraps, map->p[i], eq_i, ineq_i); - wraps_update_max(wraps, map->p[j], eq_j, ineq_j); + wraps_update_max(wraps, &info[i]); + wraps_update_max(wraps, &info[j]); } /* Free the contents of the isl_wraps data structure. @@ -630,9 +871,40 @@ return 1; } -/* For each non-redundant constraint in "bmap" (as determined by "tab"), +/* Wrap "ineq" (or its opposite if "negate" is set) around "bound" + * to include "set" and add the result in position "w" of "wraps". + * "len" is the total number of coefficients in "bound" and "ineq". + * Return 1 on success, 0 on failure and -1 on error. + * Wrapping can fail if the result of wrapping is equal to "bound" + * or if we want to bound the sizes of the coefficients and + * the wrapped constraint does not satisfy this bound. + */ +static int add_wrap(struct isl_wraps *wraps, int w, isl_int *bound, + isl_int *ineq, unsigned len, __isl_keep isl_set *set, int negate) +{ + isl_seq_cpy(wraps->mat->row[w], bound, len); + if (negate) { + isl_seq_neg(wraps->mat->row[w + 1], ineq, len); + ineq = wraps->mat->row[w + 1]; + } + if (!isl_set_wrap_facet(set, wraps->mat->row[w], ineq)) + return -1; + if (isl_seq_eq(wraps->mat->row[w], bound, len)) + return 0; + if (!allow_wrap(wraps, w)) + return 0; + return 1; +} + +/* For each constraint in info->bmap that is not redundant (as determined + * by info->tab) and that is not a valid constraint for the other basic map, * wrap the constraint around "bound" such that it includes the whole * set "set" and append the resulting constraint to "wraps". + * Note that the constraints that are valid for the other basic map + * will be added to the combined basic map by default, so there is + * no need to wrap them. + * The caller wrap_in_facets even relies on this function not wrapping + * any constraints that are already valid. * "wraps" is assumed to have been pre-allocated to the appropriate size. * wraps->n_row is the number of actual wrapped constraints that have * been added. @@ -644,57 +916,52 @@ * constraints and a newly added wrapping constraint does not * satisfy the bound, then wraps->n_row is also reset to zero. */ -static int add_wraps(struct isl_wraps *wraps, __isl_keep isl_basic_map *bmap, - struct isl_tab *tab, isl_int *bound, __isl_keep isl_set *set) +static int add_wraps(struct isl_wraps *wraps, struct isl_coalesce_info *info, + isl_int *bound, __isl_keep isl_set *set) { - int l; + int l, m; int w; - unsigned total = isl_basic_map_total_dim(bmap); + int added; + isl_basic_map *bmap = info->bmap; + unsigned len = 1 + isl_basic_map_total_dim(bmap); w = wraps->mat->n_row; for (l = 0; l < bmap->n_ineq; ++l) { - if (isl_seq_is_neg(bound, bmap->ineq[l], 1 + total)) + if (info->ineq[l] == STATUS_VALID || + info->ineq[l] == STATUS_REDUNDANT) continue; - if (isl_seq_eq(bound, bmap->ineq[l], 1 + total)) + if (isl_seq_is_neg(bound, bmap->ineq[l], len)) continue; - if (isl_tab_is_redundant(tab, bmap->n_eq + l)) + if (isl_seq_eq(bound, bmap->ineq[l], len)) + continue; + if (isl_tab_is_redundant(info->tab, bmap->n_eq + l)) continue; - isl_seq_cpy(wraps->mat->row[w], bound, 1 + total); - if (!isl_set_wrap_facet(set, wraps->mat->row[w], bmap->ineq[l])) + added = add_wrap(wraps, w, bound, bmap->ineq[l], len, set, 0); + if (added < 0) return -1; - if (isl_seq_eq(wraps->mat->row[w], bound, 1 + total)) - goto unbounded; - if (!allow_wrap(wraps, w)) + if (!added) goto unbounded; ++w; } for (l = 0; l < bmap->n_eq; ++l) { - if (isl_seq_is_neg(bound, bmap->eq[l], 1 + total)) + if (isl_seq_is_neg(bound, bmap->eq[l], len)) continue; - if (isl_seq_eq(bound, bmap->eq[l], 1 + total)) + if (isl_seq_eq(bound, bmap->eq[l], len)) continue; - isl_seq_cpy(wraps->mat->row[w], bound, 1 + total); - isl_seq_neg(wraps->mat->row[w + 1], bmap->eq[l], 1 + total); - if (!isl_set_wrap_facet(set, wraps->mat->row[w], - wraps->mat->row[w + 1])) - return -1; - if (isl_seq_eq(wraps->mat->row[w], bound, 1 + total)) - goto unbounded; - if (!allow_wrap(wraps, w)) - goto unbounded; - ++w; - - isl_seq_cpy(wraps->mat->row[w], bound, 1 + total); - if (!isl_set_wrap_facet(set, wraps->mat->row[w], bmap->eq[l])) - return -1; - if (isl_seq_eq(wraps->mat->row[w], bound, 1 + total)) - goto unbounded; - if (!allow_wrap(wraps, w)) - goto unbounded; - ++w; + for (m = 0; m < 2; ++m) { + if (info->eq[2 * l + m] == STATUS_VALID) + continue; + added = add_wrap(wraps, w, bound, bmap->eq[l], len, + set, !m); + if (added < 0) + return -1; + if (!added) + goto unbounded; + ++w; + } } wraps->mat->n_row = w; @@ -727,7 +994,7 @@ return 0; } -/* Return a set that corresponds to the non-redudant constraints +/* Return a set that corresponds to the non-redundant constraints * (as recorded in tab) of bmap. * * It's important to remove the redundant constraints as some @@ -738,34 +1005,73 @@ * and should therefore continue to be ignored ever after. * Otherwise, the relaxation might be thwarted by some of * these constraints. + * + * Update the underlying set to ensure that the dimension doesn't change. + * Otherwise the integer divisions could get dropped if the tab + * turns out to be empty. */ static __isl_give isl_set *set_from_updated_bmap(__isl_keep isl_basic_map *bmap, struct isl_tab *tab) { + isl_basic_set *bset; + bmap = isl_basic_map_copy(bmap); - bmap = isl_basic_map_cow(bmap); - bmap = isl_basic_map_update_from_tab(bmap, tab); - return isl_set_from_basic_set(isl_basic_map_underlying_set(bmap)); + bset = isl_basic_map_underlying_set(bmap); + bset = isl_basic_set_cow(bset); + bset = isl_basic_set_update_from_tab(bset, tab); + return isl_set_from_basic_set(bset); +} + +/* Wrap the constraints of info->bmap that bound the facet defined + * by inequality "k" around (the opposite of) this inequality to + * include "set". "bound" may be used to store the negated inequality. + * Since the wrapped constraints are not guaranteed to contain the whole + * of info->bmap, we check them in check_wraps. + * If any of the wrapped constraints turn out to be invalid, then + * check_wraps will reset wrap->n_row to zero. + */ +static int add_wraps_around_facet(struct isl_wraps *wraps, + struct isl_coalesce_info *info, int k, isl_int *bound, + __isl_keep isl_set *set) +{ + struct isl_tab_undo *snap; + int n; + unsigned total = isl_basic_map_total_dim(info->bmap); + + snap = isl_tab_snap(info->tab); + + if (isl_tab_select_facet(info->tab, info->bmap->n_eq + k) < 0) + return -1; + if (isl_tab_detect_redundant(info->tab) < 0) + return -1; + + isl_seq_neg(bound, info->bmap->ineq[k], 1 + total); + + n = wraps->mat->n_row; + if (add_wraps(wraps, info, bound, set) < 0) + return -1; + + if (isl_tab_rollback(info->tab, snap) < 0) + return -1; + if (check_wraps(wraps->mat, n, info->tab) < 0) + return -1; + + return 0; } -/* Given a basic set i with a constraint k that is adjacent to either the - * whole of basic set j or a facet of basic set j, check if we can wrap - * both the facet corresponding to k and the facet of j (or the whole of j) - * around their ridges to include the other set. +/* Given a basic set i with a constraint k that is adjacent to + * basic set j, check if we can wrap + * both the facet corresponding to k (if "wrap_facet" is set) and basic map j + * (always) around their ridges to include the other set. * If so, replace the pair of basic sets by their union. * - * All constraints of i (except k) are assumed to be valid for j. - * - * However, the constraints of j may not be valid for i and so - * we have to check that the wrapping constraints for j are valid for i. - * - * In the case where j has a facet adjacent to i, tab[j] is assumed - * to have been restricted to this facet, so that the non-redundant - * constraints in tab[j] are the ridges of the facet. - * Note that for the purpose of wrapping, it does not matter whether - * we wrap the ridges of i around the whole of j or just around - * the facet since all the other constraints are assumed to be valid for j. - * In practice, we wrap to include the whole of j. + * All constraints of i (except k) are assumed to be valid or + * cut constraints for j. + * Wrapping the cut constraints to include basic map j may result + * in constraints that are no longer valid of basic map i + * we have to check that the resulting wrapping constraints are valid for i. + * If "wrap_facet" is not set, then all constraints of i (except k) + * are assumed to be valid for j. * ____ _____ * / | / \ * / || / | @@ -774,61 +1080,49 @@ * \___|| \____| * */ -static int can_wrap_in_facet(struct isl_map *map, int i, int j, int k, - struct isl_tab **tabs, int *eq_i, int *ineq_i, int *eq_j, int *ineq_j) +static enum isl_change can_wrap_in_facet(int i, int j, int k, + struct isl_coalesce_info *info, int wrap_facet) { - int changed = 0; + enum isl_change change = isl_change_none; struct isl_wraps wraps; + isl_ctx *ctx; isl_mat *mat; struct isl_set *set_i = NULL; struct isl_set *set_j = NULL; struct isl_vec *bound = NULL; - unsigned total = isl_basic_map_total_dim(map->p[i]); - struct isl_tab_undo *snap; - int n; + unsigned total = isl_basic_map_total_dim(info[i].bmap); - set_i = set_from_updated_bmap(map->p[i], tabs[i]); - set_j = set_from_updated_bmap(map->p[j], tabs[j]); - mat = isl_mat_alloc(map->ctx, 2 * (map->p[i]->n_eq + map->p[j]->n_eq) + - map->p[i]->n_ineq + map->p[j]->n_ineq, - 1 + total); - wraps_init(&wraps, mat, map, i, j, eq_i, ineq_i, eq_j, ineq_j); - bound = isl_vec_alloc(map->ctx, 1 + total); + set_i = set_from_updated_bmap(info[i].bmap, info[i].tab); + set_j = set_from_updated_bmap(info[j].bmap, info[j].tab); + ctx = isl_basic_map_get_ctx(info[i].bmap); + mat = isl_mat_alloc(ctx, 2 * (info[i].bmap->n_eq + info[j].bmap->n_eq) + + info[i].bmap->n_ineq + info[j].bmap->n_ineq, + 1 + total); + wraps_init(&wraps, mat, info, i, j); + bound = isl_vec_alloc(ctx, 1 + total); if (!set_i || !set_j || !wraps.mat || !bound) goto error; - isl_seq_cpy(bound->el, map->p[i]->ineq[k], 1 + total); + isl_seq_cpy(bound->el, info[i].bmap->ineq[k], 1 + total); isl_int_add_ui(bound->el[0], bound->el[0], 1); isl_seq_cpy(wraps.mat->row[0], bound->el, 1 + total); wraps.mat->n_row = 1; - if (add_wraps(&wraps, map->p[j], tabs[j], bound->el, set_i) < 0) + if (add_wraps(&wraps, &info[j], bound->el, set_i) < 0) goto error; if (!wraps.mat->n_row) goto unbounded; - snap = isl_tab_snap(tabs[i]); - - if (isl_tab_select_facet(tabs[i], map->p[i]->n_eq + k) < 0) - goto error; - if (isl_tab_detect_redundant(tabs[i]) < 0) - goto error; - - isl_seq_neg(bound->el, map->p[i]->ineq[k], 1 + total); - - n = wraps.mat->n_row; - if (add_wraps(&wraps, map->p[i], tabs[i], bound->el, set_j) < 0) - goto error; - - if (isl_tab_rollback(tabs[i], snap) < 0) - goto error; - if (check_wraps(wraps.mat, n, tabs[i]) < 0) - goto error; - if (!wraps.mat->n_row) - goto unbounded; + if (wrap_facet) { + if (add_wraps_around_facet(&wraps, &info[i], k, + bound->el, set_j) < 0) + goto error; + if (!wraps.mat->n_row) + goto unbounded; + } - changed = fuse(map, i, j, tabs, eq_i, ineq_i, eq_j, ineq_j, wraps.mat); + change = fuse(i, j, info, wraps.mat, 0, 0); unbounded: wraps_free(&wraps); @@ -838,38 +1132,13 @@ isl_vec_free(bound); - return changed; + return change; error: wraps_free(&wraps); isl_vec_free(bound); isl_set_free(set_i); isl_set_free(set_j); - return -1; -} - -/* Set the is_redundant property of the "n" constraints in "cuts", - * except "k" to "v". - * This is a fairly tricky operation as it bypasses isl_tab.c. - * The reason we want to temporarily mark some constraints redundant - * is that we want to ignore them in add_wraps. - * - * Initially all cut constraints are non-redundant, but the - * selection of a facet right before the call to this function - * may have made some of them redundant. - * Likewise, the same constraints are marked non-redundant - * in the second call to this function, before they are officially - * made non-redundant again in the subsequent rollback. - */ -static void set_is_redundant(struct isl_tab *tab, unsigned n_eq, - int *cuts, int n, int k, int v) -{ - int l; - - for (l = 0; l < n; ++l) { - if (l == k) - continue; - tab->con[n_eq + cuts[l]].is_redundant = v; - } + return isl_change_error; } /* Given a pair of basic maps i and j such that j sticks out @@ -878,91 +1147,75 @@ * basic maps by a single basic map. * The other constraints of i are assumed to be valid for j. * - * The facets of i corresponding to the cut constraints are - * wrapped around their ridges, except those ridges determined - * by any of the other cut constraints. - * The intersections of cut constraints need to be ignored - * as the result of wrapping one cut constraint around another - * would result in a constraint cutting the union. - * In each case, the facets are wrapped to include the union - * of the two basic maps. - * - * The pieces of j that lie at an offset of exactly one from - * one of the cut constraints of i are wrapped around their edges. - * Here, there is no need to ignore intersections because we - * are wrapping around the union of the two basic maps. + * For each cut constraint t(x) >= 0 of i, we add the relaxed version + * t(x) + 1 >= 0, along with wrapping constraints for all constraints + * of basic map j that bound the part of basic map j that sticks out + * of the cut constraint. + * In particular, we first intersect basic map j with t(x) + 1 = 0. + * If the result is empty, then t(x) >= 0 was actually a valid constraint + * (with respect to the integer points), so we add t(x) >= 0 instead. + * Otherwise, we wrap the constraints of basic map j that are not + * redundant in this intersection and that are not already valid + * for basic map i over basic map i. + * Note that it is sufficient to wrap the constraints to include + * basic map i, because we will only wrap the constraints that do + * not include basic map i already. The wrapped constraint will + * therefore be more relaxed compared to the original constraint. + * Since the original constraint is valid for basic map j, so is + * the wrapped constraint. * * If any wrapping fails, i.e., if we cannot wrap to touch * the union, then we give up. * Otherwise, the pair of basic maps is replaced by their union. */ -static int wrap_in_facets(struct isl_map *map, int i, int j, - int *cuts, int n, struct isl_tab **tabs, - int *eq_i, int *ineq_i, int *eq_j, int *ineq_j) +static enum isl_change wrap_in_facets(int i, int j, int *cuts, int n, + struct isl_coalesce_info *info) { - int changed = 0; + enum isl_change change = isl_change_none; struct isl_wraps wraps; + isl_ctx *ctx; isl_mat *mat; - isl_set *set = NULL; - isl_vec *bound = NULL; - unsigned total = isl_basic_map_total_dim(map->p[i]); + isl_set *set_i = NULL; + unsigned total = isl_basic_map_total_dim(info[i].bmap); int max_wrap; - int k; - struct isl_tab_undo *snap_i, *snap_j; + int k, w; + struct isl_tab_undo *snap; - if (isl_tab_extend_cons(tabs[j], 1) < 0) + if (isl_tab_extend_cons(info[j].tab, 1) < 0) goto error; - max_wrap = 2 * (map->p[i]->n_eq + map->p[j]->n_eq) + - map->p[i]->n_ineq + map->p[j]->n_ineq; + max_wrap = 1 + 2 * info[j].bmap->n_eq + info[j].bmap->n_ineq; max_wrap *= n; - set = isl_set_union(set_from_updated_bmap(map->p[i], tabs[i]), - set_from_updated_bmap(map->p[j], tabs[j])); - mat = isl_mat_alloc(map->ctx, max_wrap, 1 + total); - wraps_init(&wraps, mat, map, i, j, eq_i, ineq_i, eq_j, ineq_j); - bound = isl_vec_alloc(map->ctx, 1 + total); - if (!set || !wraps.mat || !bound) + set_i = set_from_updated_bmap(info[i].bmap, info[i].tab); + ctx = isl_basic_map_get_ctx(info[i].bmap); + mat = isl_mat_alloc(ctx, max_wrap, 1 + total); + wraps_init(&wraps, mat, info, i, j); + if (!set_i || !wraps.mat) goto error; - snap_i = isl_tab_snap(tabs[i]); - snap_j = isl_tab_snap(tabs[j]); + snap = isl_tab_snap(info[j].tab); wraps.mat->n_row = 0; for (k = 0; k < n; ++k) { - if (isl_tab_select_facet(tabs[i], map->p[i]->n_eq + cuts[k]) < 0) - goto error; - if (isl_tab_detect_redundant(tabs[i]) < 0) - goto error; - set_is_redundant(tabs[i], map->p[i]->n_eq, cuts, n, k, 1); - - isl_seq_neg(bound->el, map->p[i]->ineq[cuts[k]], 1 + total); - if (!tabs[i]->empty && - add_wraps(&wraps, map->p[i], tabs[i], bound->el, set) < 0) - goto error; - - set_is_redundant(tabs[i], map->p[i]->n_eq, cuts, n, k, 0); - if (isl_tab_rollback(tabs[i], snap_i) < 0) - goto error; - - if (tabs[i]->empty) - break; - if (!wraps.mat->n_row) - break; - - isl_seq_cpy(bound->el, map->p[i]->ineq[cuts[k]], 1 + total); - isl_int_add_ui(bound->el[0], bound->el[0], 1); - if (isl_tab_add_eq(tabs[j], bound->el) < 0) + w = wraps.mat->n_row++; + isl_seq_cpy(wraps.mat->row[w], + info[i].bmap->ineq[cuts[k]], 1 + total); + isl_int_add_ui(wraps.mat->row[w][0], wraps.mat->row[w][0], 1); + if (isl_tab_add_eq(info[j].tab, wraps.mat->row[w]) < 0) goto error; - if (isl_tab_detect_redundant(tabs[j]) < 0) + if (isl_tab_detect_redundant(info[j].tab) < 0) goto error; - if (!tabs[j]->empty && - add_wraps(&wraps, map->p[j], tabs[j], bound->el, set) < 0) + if (info[j].tab->empty) + isl_int_sub_ui(wraps.mat->row[w][0], + wraps.mat->row[w][0], 1); + else if (add_wraps(&wraps, &info[j], + wraps.mat->row[w], set_i) < 0) goto error; - if (isl_tab_rollback(tabs[j], snap_j) < 0) + if (isl_tab_rollback(info[j].tab, snap) < 0) goto error; if (!wraps.mat->n_row) @@ -970,19 +1223,16 @@ } if (k == n) - changed = fuse(map, i, j, tabs, - eq_i, ineq_i, eq_j, ineq_j, wraps.mat); + change = fuse(i, j, info, wraps.mat, 0, 1); - isl_vec_free(bound); wraps_free(&wraps); - isl_set_free(set); + isl_set_free(set_i); - return changed; + return change; error: - isl_vec_free(bound); wraps_free(&wraps); - isl_set_free(set); - return -1; + isl_set_free(set_i); + return isl_change_error; } /* Given two basic sets i and j such that i has no cut equalities, @@ -1044,35 +1294,39 @@ * | * \______________________________________________________________________ */ -static int can_wrap_in_set(struct isl_map *map, int i, int j, - struct isl_tab **tabs, int *eq_i, int *ineq_i, int *eq_j, int *ineq_j) +static enum isl_change can_wrap_in_set(int i, int j, + struct isl_coalesce_info *info) { - int changed = 0; + enum isl_change change = isl_change_none; int k, m; int n; int *cuts = NULL; + isl_ctx *ctx; - if (ISL_F_ISSET(map->p[i], ISL_BASIC_MAP_RATIONAL) || - ISL_F_ISSET(map->p[j], ISL_BASIC_MAP_RATIONAL)) - return 0; + if (ISL_F_ISSET(info[i].bmap, ISL_BASIC_MAP_RATIONAL) || + ISL_F_ISSET(info[j].bmap, ISL_BASIC_MAP_RATIONAL)) + return isl_change_none; - n = count(ineq_i, map->p[i]->n_ineq, STATUS_CUT); + n = count(info[i].ineq, info[i].bmap->n_ineq, STATUS_CUT); if (n == 0) - return 0; + return isl_change_none; - cuts = isl_alloc_array(map->ctx, int, n); + ctx = isl_basic_map_get_ctx(info[i].bmap); + cuts = isl_alloc_array(ctx, int, n); if (!cuts) - return -1; + return isl_change_error; for (k = 0, m = 0; m < n; ++k) { enum isl_ineq_type type; - if (ineq_i[k] != STATUS_CUT) + if (info[i].ineq[k] != STATUS_CUT) continue; - isl_int_add_ui(map->p[i]->ineq[k][0], map->p[i]->ineq[k][0], 1); - type = isl_tab_ineq_type(tabs[j], map->p[i]->ineq[k]); - isl_int_sub_ui(map->p[i]->ineq[k][0], map->p[i]->ineq[k][0], 1); + isl_int_add_ui(info[i].bmap->ineq[k][0], + info[i].bmap->ineq[k][0], 1); + type = isl_tab_ineq_type(info[j].tab, info[i].bmap->ineq[k]); + isl_int_sub_ui(info[i].bmap->ineq[k][0], + info[i].bmap->ineq[k][0], 1); if (type == isl_ineq_error) goto error; if (type != isl_ineq_redundant) @@ -1082,36 +1336,32 @@ } if (m == n) - changed = wrap_in_facets(map, i, j, cuts, n, tabs, - eq_i, ineq_i, eq_j, ineq_j); + change = wrap_in_facets(i, j, cuts, n, info); free(cuts); - return changed; + return change; error: free(cuts); - return -1; + return isl_change_error; } -/* Check if either i or j has a single cut constraint that can +/* Check if either i or j has only cut inequalities that can * be used to wrap in (a facet of) the other basic set. * if so, replace the pair by their union. */ -static int check_wrap(struct isl_map *map, int i, int j, - struct isl_tab **tabs, int *eq_i, int *ineq_i, int *eq_j, int *ineq_j) +static enum isl_change check_wrap(int i, int j, struct isl_coalesce_info *info) { - int changed = 0; + enum isl_change change = isl_change_none; - if (!any(eq_i, 2 * map->p[i]->n_eq, STATUS_CUT)) - changed = can_wrap_in_set(map, i, j, tabs, - eq_i, ineq_i, eq_j, ineq_j); - if (changed) - return changed; - - if (!any(eq_j, 2 * map->p[j]->n_eq, STATUS_CUT)) - changed = can_wrap_in_set(map, j, i, tabs, - eq_j, ineq_j, eq_i, ineq_i); - return changed; + if (!any(info[i].eq, 2 * info[i].bmap->n_eq, STATUS_CUT)) + change = can_wrap_in_set(i, j, info); + if (change != isl_change_none) + return change; + + if (!any(info[j].eq, 2 * info[j].bmap->n_eq, STATUS_CUT)) + change = can_wrap_in_set(j, i, info); + return change; } /* At least one of the basic maps has an equality that is adjacent @@ -1122,52 +1372,49 @@ * map that has the equality "j". * If "i" has any "cut" (in)equality, then relaxing the inequality * by one would not result in a basic map that contains the other + * basic map. However, it may still be possible to wrap in the other * basic map. */ -static int check_adj_eq(struct isl_map *map, int i, int j, - struct isl_tab **tabs, int *eq_i, int *ineq_i, int *eq_j, int *ineq_j) +static enum isl_change check_adj_eq(int i, int j, + struct isl_coalesce_info *info) { - int changed = 0; + enum isl_change change = isl_change_none; int k; + int any_cut; - if (any(eq_i, 2 * map->p[i]->n_eq, STATUS_ADJ_INEQ) && - any(eq_j, 2 * map->p[j]->n_eq, STATUS_ADJ_INEQ)) + if (any(info[i].eq, 2 * info[i].bmap->n_eq, STATUS_ADJ_INEQ) && + any(info[j].eq, 2 * info[j].bmap->n_eq, STATUS_ADJ_INEQ)) /* ADJ EQ TOO MANY */ - return 0; + return isl_change_none; - if (any(eq_i, 2 * map->p[i]->n_eq, STATUS_ADJ_INEQ)) - return check_adj_eq(map, j, i, tabs, - eq_j, ineq_j, eq_i, ineq_i); + if (any(info[i].eq, 2 * info[i].bmap->n_eq, STATUS_ADJ_INEQ)) + return check_adj_eq(j, i, info); /* j has an equality adjacent to an inequality in i */ - if (any(eq_i, 2 * map->p[i]->n_eq, STATUS_CUT)) - return 0; - if (any(ineq_i, map->p[i]->n_ineq, STATUS_CUT)) - /* ADJ EQ CUT */ - return 0; - if (count(ineq_i, map->p[i]->n_ineq, STATUS_ADJ_EQ) != 1 || - any(ineq_j, map->p[j]->n_ineq, STATUS_ADJ_EQ) || - any(ineq_i, map->p[i]->n_ineq, STATUS_ADJ_INEQ) || - any(ineq_j, map->p[j]->n_ineq, STATUS_ADJ_INEQ)) + if (any(info[i].eq, 2 * info[i].bmap->n_eq, STATUS_CUT)) + return isl_change_none; + any_cut = any(info[i].ineq, info[i].bmap->n_ineq, STATUS_CUT); + if (count(info[i].ineq, info[i].bmap->n_ineq, STATUS_ADJ_EQ) != 1 || + any(info[j].ineq, info[j].bmap->n_ineq, STATUS_ADJ_EQ) || + any(info[i].ineq, info[i].bmap->n_ineq, STATUS_ADJ_INEQ) || + any(info[j].ineq, info[j].bmap->n_ineq, STATUS_ADJ_INEQ)) /* ADJ EQ TOO MANY */ - return 0; + return isl_change_none; - for (k = 0; k < map->p[i]->n_ineq; ++k) - if (ineq_i[k] == STATUS_ADJ_EQ) + for (k = 0; k < info[i].bmap->n_ineq; ++k) + if (info[i].ineq[k] == STATUS_ADJ_EQ) break; - changed = is_adj_eq_extension(map, i, j, k, tabs, - eq_i, ineq_i, eq_j, ineq_j); - if (changed) - return changed; - - if (count(eq_j, 2 * map->p[j]->n_eq, STATUS_ADJ_INEQ) != 1) - return 0; + if (!any_cut) { + change = is_adj_eq_extension(i, j, k, info); + if (change != isl_change_none) + return change; + } - changed = can_wrap_in_facet(map, i, j, k, tabs, eq_i, ineq_i, eq_j, ineq_j); + change = can_wrap_in_facet(i, j, k, info, any_cut); - return changed; + return change; } /* The two basic maps lie on adjacent hyperplanes. In particular, @@ -1182,60 +1429,54 @@ * \\ => \\ * \ \| * - * We only allow one equality of "i" to be adjacent to an equality of "j" - * to avoid coalescing - * - * [m, n] -> { [x, y] -> [x, 1 + y] : x >= 1 and y >= 1 and - * x <= 10 and y <= 10; - * [x, y] -> [1 + x, y] : x >= 1 and x <= 20 and - * y >= 5 and y <= 15 } - * - * to - * - * [m, n] -> { [x, y] -> [x2, y2] : x >= 1 and 10y2 <= 20 - x + 10y and - * 4y2 >= 5 + 3y and 5y2 <= 15 + 4y and - * y2 <= 1 + x + y - x2 and y2 >= y and - * y2 >= 1 + x + y - x2 } + * If there is more than one equality of "i" adjacent to an equality of "j", + * then the result will satisfy one or more equalities that are a linear + * combination of these equalities. These will be encoded as pairs + * of inequalities in the wrapping constraints and need to be made + * explicit. */ -static int check_eq_adj_eq(struct isl_map *map, int i, int j, - struct isl_tab **tabs, int *eq_i, int *ineq_i, int *eq_j, int *ineq_j) +static enum isl_change check_eq_adj_eq(int i, int j, + struct isl_coalesce_info *info) { int k; - int changed = 0; + enum isl_change change = isl_change_none; + int detect_equalities = 0; struct isl_wraps wraps; + isl_ctx *ctx; isl_mat *mat; struct isl_set *set_i = NULL; struct isl_set *set_j = NULL; struct isl_vec *bound = NULL; - unsigned total = isl_basic_map_total_dim(map->p[i]); + unsigned total = isl_basic_map_total_dim(info[i].bmap); - if (count(eq_i, 2 * map->p[i]->n_eq, STATUS_ADJ_EQ) != 1) - return 0; + if (count(info[i].eq, 2 * info[i].bmap->n_eq, STATUS_ADJ_EQ) != 1) + detect_equalities = 1; - for (k = 0; k < 2 * map->p[i]->n_eq ; ++k) - if (eq_i[k] == STATUS_ADJ_EQ) + for (k = 0; k < 2 * info[i].bmap->n_eq ; ++k) + if (info[i].eq[k] == STATUS_ADJ_EQ) break; - set_i = set_from_updated_bmap(map->p[i], tabs[i]); - set_j = set_from_updated_bmap(map->p[j], tabs[j]); - mat = isl_mat_alloc(map->ctx, 2 * (map->p[i]->n_eq + map->p[j]->n_eq) + - map->p[i]->n_ineq + map->p[j]->n_ineq, - 1 + total); - wraps_init(&wraps, mat, map, i, j, eq_i, ineq_i, eq_j, ineq_j); - bound = isl_vec_alloc(map->ctx, 1 + total); + set_i = set_from_updated_bmap(info[i].bmap, info[i].tab); + set_j = set_from_updated_bmap(info[j].bmap, info[j].tab); + ctx = isl_basic_map_get_ctx(info[i].bmap); + mat = isl_mat_alloc(ctx, 2 * (info[i].bmap->n_eq + info[j].bmap->n_eq) + + info[i].bmap->n_ineq + info[j].bmap->n_ineq, + 1 + total); + wraps_init(&wraps, mat, info, i, j); + bound = isl_vec_alloc(ctx, 1 + total); if (!set_i || !set_j || !wraps.mat || !bound) goto error; if (k % 2 == 0) - isl_seq_neg(bound->el, map->p[i]->eq[k / 2], 1 + total); + isl_seq_neg(bound->el, info[i].bmap->eq[k / 2], 1 + total); else - isl_seq_cpy(bound->el, map->p[i]->eq[k / 2], 1 + total); + isl_seq_cpy(bound->el, info[i].bmap->eq[k / 2], 1 + total); isl_int_add_ui(bound->el[0], bound->el[0], 1); isl_seq_cpy(wraps.mat->row[0], bound->el, 1 + total); wraps.mat->n_row = 1; - if (add_wraps(&wraps, map->p[j], tabs[j], bound->el, set_i) < 0) + if (add_wraps(&wraps, &info[j], bound->el, set_i) < 0) goto error; if (!wraps.mat->n_row) goto unbounded; @@ -1246,15 +1487,15 @@ isl_seq_cpy(wraps.mat->row[wraps.mat->n_row], bound->el, 1 + total); wraps.mat->n_row++; - if (add_wraps(&wraps, map->p[i], tabs[i], bound->el, set_j) < 0) + if (add_wraps(&wraps, &info[i], bound->el, set_j) < 0) goto error; if (!wraps.mat->n_row) goto unbounded; - changed = fuse(map, i, j, tabs, eq_i, ineq_i, eq_j, ineq_j, wraps.mat); + change = fuse(i, j, info, wraps.mat, detect_equalities, 0); if (0) { -error: changed = -1; +error: change = isl_change_error; } unbounded: @@ -1263,13 +1504,14 @@ isl_set_free(set_j); isl_vec_free(bound); - return changed; + return change; } /* Check if the union of the given pair of basic maps * can be represented by a single basic map. - * If so, replace the pair by the single basic map and return 1. - * Otherwise, return 0; + * If so, replace the pair by the single basic map and return + * isl_change_drop_first, isl_change_drop_second or isl_change_fuse. + * Otherwise, return isl_change_none. * The two basic maps are assumed to live in the same local space. * * We first check the effect of each constraint of one basic map @@ -1348,94 +1590,184 @@ * corresponding to the basic maps. When the basic maps are dropped * or combined, the tableaus are modified accordingly. */ -static int coalesce_local_pair(__isl_keep isl_map *map, int i, int j, - struct isl_tab **tabs) +static enum isl_change coalesce_local_pair(int i, int j, + struct isl_coalesce_info *info) { - int changed = 0; - int *eq_i = NULL; - int *eq_j = NULL; - int *ineq_i = NULL; - int *ineq_j = NULL; + enum isl_change change = isl_change_none; + + info[i].eq = info[i].ineq = NULL; + info[j].eq = info[j].ineq = NULL; - eq_i = eq_status_in(map->p[i], tabs[j]); - if (map->p[i]->n_eq && !eq_i) + info[i].eq = eq_status_in(info[i].bmap, info[j].tab); + if (info[i].bmap->n_eq && !info[i].eq) goto error; - if (any(eq_i, 2 * map->p[i]->n_eq, STATUS_ERROR)) + if (any(info[i].eq, 2 * info[i].bmap->n_eq, STATUS_ERROR)) goto error; - if (any(eq_i, 2 * map->p[i]->n_eq, STATUS_SEPARATE)) + if (any(info[i].eq, 2 * info[i].bmap->n_eq, STATUS_SEPARATE)) goto done; - eq_j = eq_status_in(map->p[j], tabs[i]); - if (map->p[j]->n_eq && !eq_j) + info[j].eq = eq_status_in(info[j].bmap, info[i].tab); + if (info[j].bmap->n_eq && !info[j].eq) goto error; - if (any(eq_j, 2 * map->p[j]->n_eq, STATUS_ERROR)) + if (any(info[j].eq, 2 * info[j].bmap->n_eq, STATUS_ERROR)) goto error; - if (any(eq_j, 2 * map->p[j]->n_eq, STATUS_SEPARATE)) + if (any(info[j].eq, 2 * info[j].bmap->n_eq, STATUS_SEPARATE)) goto done; - ineq_i = ineq_status_in(map->p[i], tabs[i], tabs[j]); - if (map->p[i]->n_ineq && !ineq_i) + info[i].ineq = ineq_status_in(info[i].bmap, info[i].tab, info[j].tab); + if (info[i].bmap->n_ineq && !info[i].ineq) goto error; - if (any(ineq_i, map->p[i]->n_ineq, STATUS_ERROR)) + if (any(info[i].ineq, info[i].bmap->n_ineq, STATUS_ERROR)) goto error; - if (any(ineq_i, map->p[i]->n_ineq, STATUS_SEPARATE)) + if (any(info[i].ineq, info[i].bmap->n_ineq, STATUS_SEPARATE)) goto done; - ineq_j = ineq_status_in(map->p[j], tabs[j], tabs[i]); - if (map->p[j]->n_ineq && !ineq_j) + info[j].ineq = ineq_status_in(info[j].bmap, info[j].tab, info[i].tab); + if (info[j].bmap->n_ineq && !info[j].ineq) goto error; - if (any(ineq_j, map->p[j]->n_ineq, STATUS_ERROR)) + if (any(info[j].ineq, info[j].bmap->n_ineq, STATUS_ERROR)) goto error; - if (any(ineq_j, map->p[j]->n_ineq, STATUS_SEPARATE)) + if (any(info[j].ineq, info[j].bmap->n_ineq, STATUS_SEPARATE)) goto done; - if (all(eq_i, 2 * map->p[i]->n_eq, STATUS_VALID) && - all(ineq_i, map->p[i]->n_ineq, STATUS_VALID)) { - drop(map, j, tabs); - changed = 1; - } else if (all(eq_j, 2 * map->p[j]->n_eq, STATUS_VALID) && - all(ineq_j, map->p[j]->n_ineq, STATUS_VALID)) { - drop(map, i, tabs); - changed = 1; - } else if (any(eq_i, 2 * map->p[i]->n_eq, STATUS_ADJ_EQ)) { - changed = check_eq_adj_eq(map, i, j, tabs, - eq_i, ineq_i, eq_j, ineq_j); - } else if (any(eq_j, 2 * map->p[j]->n_eq, STATUS_ADJ_EQ)) { - changed = check_eq_adj_eq(map, j, i, tabs, - eq_j, ineq_j, eq_i, ineq_i); - } else if (any(eq_i, 2 * map->p[i]->n_eq, STATUS_ADJ_INEQ) || - any(eq_j, 2 * map->p[j]->n_eq, STATUS_ADJ_INEQ)) { - changed = check_adj_eq(map, i, j, tabs, - eq_i, ineq_i, eq_j, ineq_j); - } else if (any(ineq_i, map->p[i]->n_ineq, STATUS_ADJ_EQ) || - any(ineq_j, map->p[j]->n_ineq, STATUS_ADJ_EQ)) { + if (all(info[i].eq, 2 * info[i].bmap->n_eq, STATUS_VALID) && + all(info[i].ineq, info[i].bmap->n_ineq, STATUS_VALID)) { + drop(&info[j]); + change = isl_change_drop_second; + } else if (all(info[j].eq, 2 * info[j].bmap->n_eq, STATUS_VALID) && + all(info[j].ineq, info[j].bmap->n_ineq, STATUS_VALID)) { + drop(&info[i]); + change = isl_change_drop_first; + } else if (any(info[i].eq, 2 * info[i].bmap->n_eq, STATUS_ADJ_EQ)) { + change = check_eq_adj_eq(i, j, info); + } else if (any(info[j].eq, 2 * info[j].bmap->n_eq, STATUS_ADJ_EQ)) { + change = check_eq_adj_eq(j, i, info); + } else if (any(info[i].eq, 2 * info[i].bmap->n_eq, STATUS_ADJ_INEQ) || + any(info[j].eq, 2 * info[j].bmap->n_eq, STATUS_ADJ_INEQ)) { + change = check_adj_eq(i, j, info); + } else if (any(info[i].ineq, info[i].bmap->n_ineq, STATUS_ADJ_EQ) || + any(info[j].ineq, info[j].bmap->n_ineq, STATUS_ADJ_EQ)) { /* Can't happen */ /* BAD ADJ INEQ */ - } else if (any(ineq_i, map->p[i]->n_ineq, STATUS_ADJ_INEQ) || - any(ineq_j, map->p[j]->n_ineq, STATUS_ADJ_INEQ)) { - changed = check_adj_ineq(map, i, j, tabs, - eq_i, ineq_i, eq_j, ineq_j); + } else if (any(info[i].ineq, info[i].bmap->n_ineq, STATUS_ADJ_INEQ) || + any(info[j].ineq, info[j].bmap->n_ineq, STATUS_ADJ_INEQ)) { + change = check_adj_ineq(i, j, info); } else { - if (!any(eq_i, 2 * map->p[i]->n_eq, STATUS_CUT) && - !any(eq_j, 2 * map->p[j]->n_eq, STATUS_CUT)) - changed = check_facets(map, i, j, tabs, ineq_i, ineq_j); - if (!changed) - changed = check_wrap(map, i, j, tabs, - eq_i, ineq_i, eq_j, ineq_j); + if (!any(info[i].eq, 2 * info[i].bmap->n_eq, STATUS_CUT) && + !any(info[j].eq, 2 * info[j].bmap->n_eq, STATUS_CUT)) + change = check_facets(i, j, info); + if (change == isl_change_none) + change = check_wrap(i, j, info); } done: - free(eq_i); - free(eq_j); - free(ineq_i); - free(ineq_j); - return changed; + free(info[i].eq); + free(info[j].eq); + free(info[i].ineq); + free(info[j].ineq); + return change; error: - free(eq_i); - free(eq_j); - free(ineq_i); - free(ineq_j); - return -1; + free(info[i].eq); + free(info[j].eq); + free(info[i].ineq); + free(info[j].ineq); + return isl_change_error; +} + +/* Shift the integer division at position "div" of the basic map + * represented by "info" by "shift". + * + * That is, if the integer division has the form + * + * floor(f(x)/d) + * + * then replace it by + * + * floor((f(x) + shift * d)/d) - shift + */ +static int shift_div(struct isl_coalesce_info *info, int div, isl_int shift) +{ + unsigned total; + + info->bmap = isl_basic_map_shift_div(info->bmap, div, shift); + if (!info->bmap) + return -1; + + total = isl_basic_map_dim(info->bmap, isl_dim_all); + total -= isl_basic_map_dim(info->bmap, isl_dim_div); + if (isl_tab_shift_var(info->tab, total + div, shift) < 0) + return -1; + + return 0; +} + +/* Check if some of the divs in the basic map represented by "info1" + * are shifts of the corresponding divs in the basic map represented + * by "info2". If so, align them with those of "info2". + * Only do this if "info1" and "info2" have the same number + * of integer divisions. + * + * An integer division is considered to be a shift of another integer + * division if one is equal to the other plus a constant. + * + * In particular, for each pair of integer divisions, if both are known, + * have identical coefficients (apart from the constant term) and + * if the difference between the constant terms (taking into account + * the denominator) is an integer, then move the difference outside. + * That is, if one integer division is of the form + * + * floor((f(x) + c_1)/d) + * + * while the other is of the form + * + * floor((f(x) + c_2)/d) + * + * and n = (c_2 - c_1)/d is an integer, then replace the first + * integer division by + * + * floor((f(x) + c_1 + n * d)/d) - n = floor((f(x) + c_2)/d) - n + */ +static int harmonize_divs(struct isl_coalesce_info *info1, + struct isl_coalesce_info *info2) +{ + int i; + int total; + + if (!info1->bmap || !info2->bmap) + return -1; + + if (info1->bmap->n_div != info2->bmap->n_div) + return 0; + if (info1->bmap->n_div == 0) + return 0; + + total = isl_basic_map_total_dim(info1->bmap); + for (i = 0; i < info1->bmap->n_div; ++i) { + isl_int d; + int r = 0; + + if (isl_int_is_zero(info1->bmap->div[i][0]) || + isl_int_is_zero(info2->bmap->div[i][0])) + continue; + if (isl_int_ne(info1->bmap->div[i][0], info2->bmap->div[i][0])) + continue; + if (isl_int_eq(info1->bmap->div[i][1], info2->bmap->div[i][1])) + continue; + if (!isl_seq_eq(info1->bmap->div[i] + 2, + info2->bmap->div[i] + 2, total)) + continue; + isl_int_init(d); + isl_int_sub(d, info2->bmap->div[i][1], info1->bmap->div[i][1]); + if (isl_int_is_divisible_by(d, info1->bmap->div[i][0])) { + isl_int_divexact(d, d, info1->bmap->div[i][0]); + r = shift_div(info1, i, d); + } + isl_int_clear(d); + if (r < 0) + return -1; + } + + return 0; } /* Do the two basic maps live in the same local space, i.e., @@ -1473,29 +1805,26 @@ return 1; } -/* Given two basic maps "i" and "j", where the divs of "i" form a subset - * of those of "j", check if basic map "j" is a subset of basic map "i" - * and, if so, drop basic map "j". - * - * We first expand the divs of basic map "i" to match those of basic map "j", - * using the divs and expansion computed by the caller. - * Then we check if all constraints of the expanded "i" are valid for "j". +/* Does "bmap" contain the basic map represented by the tableau "tab" + * after expanding the divs of "bmap" to match those of "tab"? + * The expansion is performed using the divs "div" and expansion "exp" + * computed by the caller. + * Then we check if all constraints of the expanded "bmap" are valid for "tab". */ -static int coalesce_subset(__isl_keep isl_map *map, int i, int j, - struct isl_tab **tabs, __isl_keep isl_mat *div, int *exp) +static int contains_with_expanded_divs(__isl_keep isl_basic_map *bmap, + struct isl_tab *tab, __isl_keep isl_mat *div, int *exp) { - isl_basic_map *bmap; - int changed = 0; + int superset = 0; int *eq_i = NULL; int *ineq_i = NULL; - bmap = isl_basic_map_copy(map->p[i]); + bmap = isl_basic_map_copy(bmap); bmap = isl_basic_set_expand_divs(bmap, isl_mat_copy(div), exp); if (!bmap) goto error; - eq_i = eq_status_in(bmap, tabs[j]); + eq_i = eq_status_in(bmap, tab); if (bmap->n_eq && !eq_i) goto error; if (any(eq_i, 2 * bmap->n_eq, STATUS_ERROR)) @@ -1503,7 +1832,7 @@ if (any(eq_i, 2 * bmap->n_eq, STATUS_SEPARATE)) goto done; - ineq_i = ineq_status_in(bmap, NULL, tabs[j]); + ineq_i = ineq_status_in(bmap, NULL, tab); if (bmap->n_ineq && !ineq_i) goto error; if (any(ineq_i, bmap->n_ineq, STATUS_ERROR)) @@ -1511,17 +1840,15 @@ if (any(ineq_i, bmap->n_ineq, STATUS_SEPARATE)) goto done; - if (all(eq_i, 2 * map->p[i]->n_eq, STATUS_VALID) && - all(ineq_i, map->p[i]->n_ineq, STATUS_VALID)) { - drop(map, j, tabs); - changed = 1; - } + if (all(eq_i, 2 * bmap->n_eq, STATUS_VALID) && + all(ineq_i, bmap->n_ineq, STATUS_VALID)) + superset = 1; done: isl_basic_map_free(bmap); free(eq_i); free(ineq_i); - return 0; + return superset; error: isl_basic_map_free(bmap); free(eq_i); @@ -1529,20 +1856,17 @@ return -1; } -/* Check if the basic map "j" is a subset of basic map "i", - * assuming that "i" has fewer divs that "j". - * If not, then we change the order. - * - * If the two basic maps have the same number of divs, then - * they must necessarily be different. Otherwise, we would have - * called coalesce_local_pair. We therefore don't try anything - * in this case. - * - * We first check if the divs of "i" are all known and form a subset - * of those of "j". If so, we pass control over to coalesce_subset. +/* Does "bmap_i" contain the basic map represented by "info_j" + * after aligning the divs of "bmap_i" to those of "info_j". + * Note that this can only succeed if the number of divs of "bmap_i" + * is smaller than (or equal to) the number of divs of "info_j". + * + * We first check if the divs of "bmap_i" are all known and form a subset + * of those of "bmap_j". If so, we pass control over to + * contains_with_expanded_divs. */ -static int check_coalesce_subset(__isl_keep isl_map *map, int i, int j, - struct isl_tab **tabs) +static int contains_after_aligning_divs(__isl_keep isl_basic_map *bmap_i, + struct isl_coalesce_info *info_j) { int known; isl_mat *div_i, *div_j, *div; @@ -1551,19 +1875,14 @@ isl_ctx *ctx; int subset; - if (map->p[i]->n_div == map->p[j]->n_div) - return 0; - if (map->p[j]->n_div < map->p[i]->n_div) - return check_coalesce_subset(map, j, i, tabs); - - known = isl_basic_map_divs_known(map->p[i]); + known = isl_basic_map_divs_known(bmap_i); if (known < 0 || !known) return known; - ctx = isl_map_get_ctx(map); + ctx = isl_basic_map_get_ctx(bmap_i); - div_i = isl_basic_map_get_divs(map->p[i]); - div_j = isl_basic_map_get_divs(map->p[j]); + div_i = isl_basic_map_get_divs(bmap_i); + div_j = isl_basic_map_get_divs(info_j->bmap); if (!div_i || !div_j) goto error; @@ -1578,7 +1897,8 @@ goto error; if (div->n_row == div_j->n_row) - subset = coalesce_subset(map, i, j, tabs, div, exp1); + subset = contains_with_expanded_divs(bmap_i, + info_j->tab, div, exp1); else subset = 0; @@ -1599,53 +1919,683 @@ return -1; } +/* Check if the basic map "j" is a subset of basic map "i", + * if "i" has fewer divs that "j". + * If so, remove basic map "j". + * + * If the two basic maps have the same number of divs, then + * they must necessarily be different. Otherwise, we would have + * called coalesce_local_pair. We therefore don't try anything + * in this case. + */ +static int coalesced_subset(int i, int j, struct isl_coalesce_info *info) +{ + int superset; + + if (info[i].bmap->n_div >= info[j].bmap->n_div) + return 0; + + superset = contains_after_aligning_divs(info[i].bmap, &info[j]); + if (superset < 0) + return -1; + if (superset) + drop(&info[j]); + + return superset; +} + +/* Check if basic map "j" is a subset of basic map "i" after + * exploiting the extra equalities of "j" to simplify the divs of "i". + * If so, remove basic map "j". + * + * If "j" does not have any equalities or if they are the same + * as those of "i", then we cannot exploit them to simplify the divs. + * Similarly, if there are no divs in "i", then they cannot be simplified. + * If, on the other hand, the affine hulls of "i" and "j" do not intersect, + * then "j" cannot be a subset of "i". + * + * Otherwise, we intersect "i" with the affine hull of "j" and then + * check if "j" is a subset of the result after aligning the divs. + * If so, then "j" is definitely a subset of "i" and can be removed. + * Note that if after intersection with the affine hull of "j". + * "i" still has more divs than "j", then there is no way we can + * align the divs of "i" to those of "j". + */ +static int coalesced_subset_with_equalities(int i, int j, + struct isl_coalesce_info *info) +{ + isl_basic_map *hull_i, *hull_j, *bmap_i; + int equal, empty, subset; + + if (info[j].bmap->n_eq == 0) + return 0; + if (info[i].bmap->n_div == 0) + return 0; + + hull_i = isl_basic_map_copy(info[i].bmap); + hull_i = isl_basic_map_plain_affine_hull(hull_i); + hull_j = isl_basic_map_copy(info[j].bmap); + hull_j = isl_basic_map_plain_affine_hull(hull_j); + + hull_j = isl_basic_map_intersect(hull_j, isl_basic_map_copy(hull_i)); + equal = isl_basic_map_plain_is_equal(hull_i, hull_j); + empty = isl_basic_map_plain_is_empty(hull_j); + isl_basic_map_free(hull_i); + + if (equal < 0 || equal || empty < 0 || empty) { + isl_basic_map_free(hull_j); + return equal < 0 || empty < 0 ? -1 : 0; + } + + bmap_i = isl_basic_map_copy(info[i].bmap); + bmap_i = isl_basic_map_intersect(bmap_i, hull_j); + if (!bmap_i) + return -1; + + if (bmap_i->n_div > info[j].bmap->n_div) { + isl_basic_map_free(bmap_i); + return 0; + } + + subset = contains_after_aligning_divs(bmap_i, &info[j]); + + isl_basic_map_free(bmap_i); + + if (subset < 0) + return -1; + if (subset) + drop(&info[j]); + + return subset; +} + +/* Check if one of the basic maps is a subset of the other and, if so, + * drop the subset. + * Note that we only perform any test if the number of divs is different + * in the two basic maps. In case the number of divs is the same, + * we have already established that the divs are different + * in the two basic maps. + * In particular, if the number of divs of basic map i is smaller than + * the number of divs of basic map j, then we check if j is a subset of i + * and vice versa. + */ +static enum isl_change check_coalesce_subset(int i, int j, + struct isl_coalesce_info *info) +{ + int changed; + + changed = coalesced_subset(i, j, info); + if (changed < 0 || changed) + return changed < 0 ? isl_change_error : isl_change_drop_second; + + changed = coalesced_subset(j, i, info); + if (changed < 0 || changed) + return changed < 0 ? isl_change_error : isl_change_drop_first; + + changed = coalesced_subset_with_equalities(i, j, info); + if (changed < 0 || changed) + return changed < 0 ? isl_change_error : isl_change_drop_second; + + changed = coalesced_subset_with_equalities(j, i, info); + if (changed < 0 || changed) + return changed < 0 ? isl_change_error : isl_change_drop_first; + + return isl_change_none; +} + +/* Does "bmap" involve any divs that themselves refer to divs? + */ +static int has_nested_div(__isl_keep isl_basic_map *bmap) +{ + int i; + unsigned total; + unsigned n_div; + + total = isl_basic_map_dim(bmap, isl_dim_all); + n_div = isl_basic_map_dim(bmap, isl_dim_div); + total -= n_div; + + for (i = 0; i < n_div; ++i) + if (isl_seq_first_non_zero(bmap->div[i] + 2 + total, + n_div) != -1) + return 1; + + return 0; +} + +/* Return a list of affine expressions, one for each integer division + * in "bmap_i". For each integer division that also appears in "bmap_j", + * the affine expression is set to NaN. The number of NaNs in the list + * is equal to the number of integer divisions in "bmap_j". + * For the other integer divisions of "bmap_i", the corresponding + * element in the list is a purely affine expression equal to the integer + * division in "hull". + * If no such list can be constructed, then the number of elements + * in the returned list is smaller than the number of integer divisions + * in "bmap_i". + */ +static __isl_give isl_aff_list *set_up_substitutions( + __isl_keep isl_basic_map *bmap_i, __isl_keep isl_basic_map *bmap_j, + __isl_take isl_basic_map *hull) +{ + unsigned n_div_i, n_div_j, total; + isl_ctx *ctx; + isl_local_space *ls; + isl_basic_set *wrap_hull; + isl_aff *aff_nan; + isl_aff_list *list; + int i, j; + + if (!hull) + return NULL; + + ctx = isl_basic_map_get_ctx(hull); + + n_div_i = isl_basic_map_dim(bmap_i, isl_dim_div); + n_div_j = isl_basic_map_dim(bmap_j, isl_dim_div); + total = isl_basic_map_total_dim(bmap_i) - n_div_i; + + ls = isl_basic_map_get_local_space(bmap_i); + ls = isl_local_space_wrap(ls); + wrap_hull = isl_basic_map_wrap(hull); + + aff_nan = isl_aff_nan_on_domain(isl_local_space_copy(ls)); + list = isl_aff_list_alloc(ctx, n_div_i); + + j = 0; + for (i = 0; i < n_div_i; ++i) { + isl_aff *aff; + + if (j < n_div_j && + isl_seq_eq(bmap_i->div[i], bmap_j->div[j], 2 + total)) { + ++j; + list = isl_aff_list_add(list, isl_aff_copy(aff_nan)); + continue; + } + if (n_div_i - i <= n_div_j - j) + break; + + aff = isl_local_space_get_div(ls, i); + aff = isl_aff_substitute_equalities(aff, + isl_basic_set_copy(wrap_hull)); + aff = isl_aff_floor(aff); + if (!aff) + goto error; + if (isl_aff_dim(aff, isl_dim_div) != 0) { + isl_aff_free(aff); + break; + } + + list = isl_aff_list_add(list, aff); + } + + isl_aff_free(aff_nan); + isl_local_space_free(ls); + isl_basic_set_free(wrap_hull); + + return list; +error: + isl_aff_free(aff_nan); + isl_local_space_free(ls); + isl_basic_set_free(wrap_hull); + isl_aff_list_free(list); + return NULL; +} + +/* Add variables to "tab" corresponding to the elements in "list" + * that are not set to NaN. + * "dim" is the offset in the variables of "tab" where we should + * start considering the elements in "list". + * When this function returns, the total number of variables in "tab" + * is equal to "dim" plus the number of elements in "list". + */ +static int add_sub_vars(struct isl_tab *tab, __isl_keep isl_aff_list *list, + int dim) +{ + int i, n; + + n = isl_aff_list_n_aff(list); + for (i = 0; i < n; ++i) { + int is_nan; + isl_aff *aff; + + aff = isl_aff_list_get_aff(list, i); + is_nan = isl_aff_is_nan(aff); + isl_aff_free(aff); + if (is_nan < 0) + return -1; + + if (!is_nan && isl_tab_insert_var(tab, dim + i) < 0) + return -1; + } + + return 0; +} + +/* For each element in "list" that is not set to NaN, fix the corresponding + * variable in "tab" to the purely affine expression defined by the element. + * "dim" is the offset in the variables of "tab" where we should + * start considering the elements in "list". + */ +static int add_sub_equalities(struct isl_tab *tab, + __isl_keep isl_aff_list *list, int dim) +{ + int i, n; + isl_ctx *ctx; + isl_vec *sub; + isl_aff *aff; + + n = isl_aff_list_n_aff(list); + + ctx = isl_tab_get_ctx(tab); + sub = isl_vec_alloc(ctx, 1 + dim + n); + if (!sub) + return -1; + isl_seq_clr(sub->el + 1 + dim, n); + + for (i = 0; i < n; ++i) { + aff = isl_aff_list_get_aff(list, i); + if (!aff) + goto error; + if (isl_aff_is_nan(aff)) { + isl_aff_free(aff); + continue; + } + isl_seq_cpy(sub->el, aff->v->el + 1, 1 + dim); + isl_int_neg(sub->el[1 + dim + i], aff->v->el[0]); + if (isl_tab_add_eq(tab, sub->el) < 0) + goto error; + isl_int_set_si(sub->el[1 + dim + i], 0); + isl_aff_free(aff); + } + + isl_vec_free(sub); + return 0; +error: + isl_aff_free(aff); + isl_vec_free(sub); + return -1; +} + +/* Add variables to info->tab corresponding to the elements in "list" + * that are not set to NaN. The value of the added variable + * is fixed to the purely affine expression defined by the element. + * "dim" is the offset in the variables of info->tab where we should + * start considering the elements in "list". + * When this function returns, the total number of variables in info->tab + * is equal to "dim" plus the number of elements in "list". + * Additionally, add the div constraints that have been added info->bmap + * after the tableau was constructed to info->tab. These constraints + * start at position "n_ineq" in info->bmap. + * The constraints need to be added to the tableau before + * the equalities assigning the purely affine expression + * because the position needs to match that in info->bmap. + * They are frozen because the corresponding added equality is a consequence + * of the two div constraints and the other equalities, meaning that + * the div constraints would otherwise get marked as redundant, + * while they are only redundant with respect to the extra equalities + * added to the tableau, which do not appear explicitly in the basic map. + */ +static int add_subs(struct isl_coalesce_info *info, + __isl_keep isl_aff_list *list, int dim, int n_ineq) +{ + int i, extra_var, extra_con; + int n; + unsigned n_eq = info->bmap->n_eq; + + if (!list) + return -1; + + n = isl_aff_list_n_aff(list); + extra_var = n - (info->tab->n_var - dim); + extra_con = info->bmap->n_ineq - n_ineq; + + if (isl_tab_extend_vars(info->tab, extra_var) < 0) + return -1; + if (isl_tab_extend_cons(info->tab, extra_con + 2 * extra_var) < 0) + return -1; + if (add_sub_vars(info->tab, list, dim) < 0) + return -1; + + for (i = n_ineq; i < info->bmap->n_ineq; ++i) { + if (isl_tab_add_ineq(info->tab, info->bmap->ineq[i]) < 0) + return -1; + if (isl_tab_freeze_constraint(info->tab, n_eq + i) < 0) + return -1; + } + + return add_sub_equalities(info->tab, list, dim); +} + +/* Coalesce basic map "j" into basic map "i" after adding the extra integer + * divisions in "i" but not in "j" to basic map "j", with values + * specified by "list". The total number of elements in "list" + * is equal to the number of integer divisions in "i", while the number + * of NaN elements in the list is equal to the number of integer divisions + * in "j". + * Adding extra integer divisions to "j" through isl_basic_map_align_divs + * also adds the corresponding div constraints. These need to be added + * to the corresponding tableau as well in add_subs to maintain consistency. + * + * If no coalescing can be performed, then we need to revert basic map "j" + * to its original state. We do the same if basic map "i" gets dropped + * during the coalescing, even though this should not happen in practice + * since we have already checked for "j" being a subset of "i" + * before we reach this stage. + */ +static enum isl_change coalesce_with_subs(int i, int j, + struct isl_coalesce_info *info, __isl_keep isl_aff_list *list) +{ + isl_basic_map *bmap_j; + struct isl_tab_undo *snap; + unsigned dim; + enum isl_change change; + int n_ineq; + + bmap_j = isl_basic_map_copy(info[j].bmap); + n_ineq = info[j].bmap->n_ineq; + info[j].bmap = isl_basic_map_align_divs(info[j].bmap, info[i].bmap); + if (!info[j].bmap) + goto error; + + snap = isl_tab_snap(info[j].tab); + + dim = isl_basic_map_dim(bmap_j, isl_dim_all); + dim -= isl_basic_map_dim(bmap_j, isl_dim_div); + if (add_subs(&info[j], list, dim, n_ineq) < 0) + goto error; + + change = coalesce_local_pair(i, j, info); + if (change != isl_change_none && change != isl_change_drop_first) { + isl_basic_map_free(bmap_j); + } else { + isl_basic_map_free(info[j].bmap); + info[j].bmap = bmap_j; + + if (isl_tab_rollback(info[j].tab, snap) < 0) + return isl_change_error; + } + + return change; +error: + isl_basic_map_free(bmap_j); + return isl_change_error; +} + +/* Check if we can coalesce basic map "j" into basic map "i" after copying + * those extra integer divisions in "i" that can be simplified away + * using the extra equalities in "j". + * All divs are assumed to be known and not contain any nested divs. + * + * We first check if there are any extra equalities in "j" that we + * can exploit. Then we check if every integer division in "i" + * either already appears in "j" or can be simplified using the + * extra equalities to a purely affine expression. + * If these tests succeed, then we try to coalesce the two basic maps + * by introducing extra dimensions in "j" corresponding to + * the extra integer divsisions "i" fixed to the corresponding + * purely affine expression. + */ +static enum isl_change check_coalesce_into_eq(int i, int j, + struct isl_coalesce_info *info) +{ + unsigned n_div_i, n_div_j; + isl_basic_map *hull_i, *hull_j; + int equal, empty; + isl_aff_list *list; + enum isl_change change; + + n_div_i = isl_basic_map_dim(info[i].bmap, isl_dim_div); + n_div_j = isl_basic_map_dim(info[j].bmap, isl_dim_div); + if (n_div_i <= n_div_j) + return isl_change_none; + if (info[j].bmap->n_eq == 0) + return isl_change_none; + + hull_i = isl_basic_map_copy(info[i].bmap); + hull_i = isl_basic_map_plain_affine_hull(hull_i); + hull_j = isl_basic_map_copy(info[j].bmap); + hull_j = isl_basic_map_plain_affine_hull(hull_j); + + hull_j = isl_basic_map_intersect(hull_j, isl_basic_map_copy(hull_i)); + equal = isl_basic_map_plain_is_equal(hull_i, hull_j); + empty = isl_basic_map_plain_is_empty(hull_j); + isl_basic_map_free(hull_i); + + if (equal < 0 || empty < 0) + goto error; + if (equal || empty) { + isl_basic_map_free(hull_j); + return isl_change_none; + } + + list = set_up_substitutions(info[i].bmap, info[j].bmap, hull_j); + if (!list) + return isl_change_error; + if (isl_aff_list_n_aff(list) < n_div_i) + change = isl_change_none; + else + change = coalesce_with_subs(i, j, info, list); + + isl_aff_list_free(list); + + return change; +error: + isl_basic_map_free(hull_j); + return isl_change_error; +} + +/* Check if we can coalesce basic maps "i" and "j" after copying + * those extra integer divisions in one of the basic maps that can + * be simplified away using the extra equalities in the other basic map. + * We require all divs to be known in both basic maps. + * Furthermore, to simplify the comparison of div expressions, + * we do not allow any nested integer divisions. + */ +static enum isl_change check_coalesce_eq(int i, int j, + struct isl_coalesce_info *info) +{ + int known, nested; + enum isl_change change; + + known = isl_basic_map_divs_known(info[i].bmap); + if (known < 0 || !known) + return known < 0 ? isl_change_error : isl_change_none; + known = isl_basic_map_divs_known(info[j].bmap); + if (known < 0 || !known) + return known < 0 ? isl_change_error : isl_change_none; + nested = has_nested_div(info[i].bmap); + if (nested < 0 || nested) + return nested < 0 ? isl_change_error : isl_change_none; + nested = has_nested_div(info[j].bmap); + if (nested < 0 || nested) + return nested < 0 ? isl_change_error : isl_change_none; + + change = check_coalesce_into_eq(i, j, info); + if (change != isl_change_none) + return change; + change = check_coalesce_into_eq(j, i, info); + if (change != isl_change_none) + return invert_change(change); + + return isl_change_none; +} + /* Check if the union of the given pair of basic maps * can be represented by a single basic map. - * If so, replace the pair by the single basic map and return 1. - * Otherwise, return 0; - * - * We first check if the two basic maps live in the same local space. - * If so, we do the complete check. Otherwise, we check if one is - * an obvious subset of the other. + * If so, replace the pair by the single basic map and return + * isl_change_drop_first, isl_change_drop_second or isl_change_fuse. + * Otherwise, return isl_change_none. + * + * We first check if the two basic maps live in the same local space, + * after aligning the divs that differ by only an integer constant. + * If so, we do the complete check. Otherwise, we check if they have + * the same number of integer divisions and can be coalesced, if one is + * an obvious subset of the other or if the extra integer divisions + * of one basic map can be simplified away using the extra equalities + * of the other basic map. */ -static int coalesce_pair(__isl_keep isl_map *map, int i, int j, - struct isl_tab **tabs) +static enum isl_change coalesce_pair(int i, int j, + struct isl_coalesce_info *info) { int same; + enum isl_change change; - same = same_divs(map->p[i], map->p[j]); + if (harmonize_divs(&info[i], &info[j]) < 0) + return isl_change_error; + same = same_divs(info[i].bmap, info[j].bmap); if (same < 0) - return -1; + return isl_change_error; if (same) - return coalesce_local_pair(map, i, j, tabs); + return coalesce_local_pair(i, j, info); + + if (info[i].bmap->n_div == info[j].bmap->n_div) { + change = coalesce_local_pair(i, j, info); + if (change != isl_change_none) + return change; + } + + change = check_coalesce_subset(i, j, info); + if (change != isl_change_none) + return change; - return check_coalesce_subset(map, i, j, tabs); + return check_coalesce_eq(i, j, info); +} + +/* Return the maximum of "a" and "b". + */ +static inline int max(int a, int b) +{ + return a > b ? a : b; } -static struct isl_map *coalesce(struct isl_map *map, struct isl_tab **tabs) +/* Pairwise coalesce the basic maps in the range [start1, end1[ of "info" + * with those in the range [start2, end2[, skipping basic maps + * that have been removed (either before or within this function). + * + * For each basic map i in the first range, we check if it can be coalesced + * with respect to any previously considered basic map j in the second range. + * If i gets dropped (because it was a subset of some j), then + * we can move on to the next basic map. + * If j gets dropped, we need to continue checking against the other + * previously considered basic maps. + * If the two basic maps got fused, then we recheck the fused basic map + * against the previously considered basic maps, starting at i + 1 + * (even if start2 is greater than i + 1). + */ +static int coalesce_range(isl_ctx *ctx, struct isl_coalesce_info *info, + int start1, int end1, int start2, int end2) { int i, j; - for (i = map->n - 2; i >= 0; --i) -restart: - for (j = i + 1; j < map->n; ++j) { - int changed; - changed = coalesce_pair(map, i, j, tabs); - if (changed < 0) - goto error; - if (changed) - goto restart; + for (i = end1 - 1; i >= start1; --i) { + if (info[i].removed) + continue; + for (j = max(i + 1, start2); j < end2; ++j) { + enum isl_change changed; + + if (info[j].removed) + continue; + if (info[i].removed) + isl_die(ctx, isl_error_internal, + "basic map unexpectedly removed", + return -1); + changed = coalesce_pair(i, j, info); + switch (changed) { + case isl_change_error: + return -1; + case isl_change_none: + case isl_change_drop_second: + continue; + case isl_change_drop_first: + j = end2; + break; + case isl_change_fuse: + j = i; + break; + } + } + } + + return 0; +} + +/* Pairwise coalesce the basic maps described by the "n" elements of "info". + * + * We consider groups of basic maps that live in the same apparent + * affine hull and we first coalesce within such a group before we + * coalesce the elements in the group with elements of previously + * considered groups. If a fuse happens during the second phase, + * then we also reconsider the elements within the group. + */ +static int coalesce(isl_ctx *ctx, int n, struct isl_coalesce_info *info) +{ + int start, end; + + for (end = n; end > 0; end = start) { + start = end - 1; + while (start >= 1 && + info[start - 1].hull_hash == info[start].hull_hash) + start--; + if (coalesce_range(ctx, info, start, end, start, end) < 0) + return -1; + if (coalesce_range(ctx, info, start, end, end, n) < 0) + return -1; + } + + return 0; +} + +/* Update the basic maps in "map" based on the information in "info". + * In particular, remove the basic maps that have been marked removed and + * update the others based on the information in the corresponding tableau. + * Since we detected implicit equalities without calling + * isl_basic_map_gauss, we need to do it now. + * Also call isl_basic_map_simplify if we may have lost the definition + * of one or more integer divisions. + */ +static __isl_give isl_map *update_basic_maps(__isl_take isl_map *map, + int n, struct isl_coalesce_info *info) +{ + int i; + + if (!map) + return NULL; + + for (i = n - 1; i >= 0; --i) { + if (info[i].removed) { + isl_basic_map_free(map->p[i]); + if (i != map->n - 1) + map->p[i] = map->p[map->n - 1]; + map->n--; + continue; } + + info[i].bmap = isl_basic_map_update_from_tab(info[i].bmap, + info[i].tab); + info[i].bmap = isl_basic_map_gauss(info[i].bmap, NULL); + if (info[i].simplify) + info[i].bmap = isl_basic_map_simplify(info[i].bmap); + info[i].bmap = isl_basic_map_finalize(info[i].bmap); + if (!info[i].bmap) + return isl_map_free(map); + ISL_F_SET(info[i].bmap, ISL_BASIC_MAP_NO_IMPLICIT); + ISL_F_SET(info[i].bmap, ISL_BASIC_MAP_NO_REDUNDANT); + isl_basic_map_free(map->p[i]); + map->p[i] = info[i].bmap; + info[i].bmap = NULL; + } + return map; -error: - isl_map_free(map); - return NULL; } /* For each pair of basic maps in the map, check if the union of the two * can be represented by a single basic map. * If so, replace the pair by the single basic map and start over. * + * We factor out any (hidden) common factor from the constraint + * coefficients to improve the detection of adjacent constraints. + * * Since we are constructing the tableaus of the basic maps anyway, * we exploit them to detect implicit equalities and redundant constraints. * This also helps the coalescing as it can ignore the redundant constraints. @@ -1653,14 +2603,17 @@ * in the basic maps. We don't call isl_basic_map_gauss, though, * as that may affect the number of constraints. * This means that we have to call isl_basic_map_gauss at the end - * of the computation to ensure that the basic maps are not left - * in an unexpected state. + * of the computation (in update_basic_maps) to ensure that + * the basic maps are not left in an unexpected state. + * For each basic map, we also compute the hash of the apparent affine hull + * for use in coalesce. */ struct isl_map *isl_map_coalesce(struct isl_map *map) { int i; unsigned n; - struct isl_tab **tabs = NULL; + isl_ctx *ctx; + struct isl_coalesce_info *info = NULL; map = isl_map_remove_empty_parts(map); if (!map) @@ -1669,58 +2622,54 @@ if (map->n <= 1) return map; + ctx = isl_map_get_ctx(map); map = isl_map_sort_divs(map); map = isl_map_cow(map); - tabs = isl_calloc_array(map->ctx, struct isl_tab *, map->n); - if (!tabs) - goto error; + if (!map) + return NULL; n = map->n; + + info = isl_calloc_array(map->ctx, struct isl_coalesce_info, n); + if (!info) + goto error; + for (i = 0; i < map->n; ++i) { - tabs[i] = isl_tab_from_basic_map(map->p[i], 0); - if (!tabs[i]) + map->p[i] = isl_basic_map_reduce_coefficients(map->p[i]); + if (!map->p[i]) goto error; - if (!ISL_F_ISSET(map->p[i], ISL_BASIC_MAP_NO_IMPLICIT)) - if (isl_tab_detect_implicit_equalities(tabs[i]) < 0) + info[i].bmap = isl_basic_map_copy(map->p[i]); + info[i].tab = isl_tab_from_basic_map(info[i].bmap, 0); + if (!info[i].tab) + goto error; + if (!ISL_F_ISSET(info[i].bmap, ISL_BASIC_MAP_NO_IMPLICIT)) + if (isl_tab_detect_implicit_equalities(info[i].tab) < 0) goto error; - map->p[i] = isl_tab_make_equalities_explicit(tabs[i], - map->p[i]); - if (!map->p[i]) + info[i].bmap = isl_tab_make_equalities_explicit(info[i].tab, + info[i].bmap); + if (!info[i].bmap) goto error; - if (!ISL_F_ISSET(map->p[i], ISL_BASIC_MAP_NO_REDUNDANT)) - if (isl_tab_detect_redundant(tabs[i]) < 0) + if (!ISL_F_ISSET(info[i].bmap, ISL_BASIC_MAP_NO_REDUNDANT)) + if (isl_tab_detect_redundant(info[i].tab) < 0) goto error; + if (coalesce_info_set_hull_hash(&info[i]) < 0) + goto error; } for (i = map->n - 1; i >= 0; --i) - if (tabs[i]->empty) - drop(map, i, tabs); - - map = coalesce(map, tabs); + if (info[i].tab->empty) + drop(&info[i]); - if (map) - for (i = 0; i < map->n; ++i) { - map->p[i] = isl_basic_map_update_from_tab(map->p[i], - tabs[i]); - map->p[i] = isl_basic_map_gauss(map->p[i], NULL); - map->p[i] = isl_basic_map_finalize(map->p[i]); - if (!map->p[i]) - goto error; - ISL_F_SET(map->p[i], ISL_BASIC_MAP_NO_IMPLICIT); - ISL_F_SET(map->p[i], ISL_BASIC_MAP_NO_REDUNDANT); - } + if (coalesce(ctx, n, info) < 0) + goto error; - for (i = 0; i < n; ++i) - isl_tab_free(tabs[i]); + map = update_basic_maps(map, n, info); - free(tabs); + clear_coalesce_info(n, info); return map; error: - if (tabs) - for (i = 0; i < n; ++i) - isl_tab_free(tabs[i]); - free(tabs); + clear_coalesce_info(n, info); isl_map_free(map); return NULL; } diff -Nru cloog-0.18.2/isl/isl_config.h.in cloog-0.18.4/isl/isl_config.h.in --- cloog-0.18.2/isl/isl_config.h.in 2013-12-18 12:36:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_config.h.in 2015-07-24 12:29:48.000000000 +0000 @@ -9,9 +9,18 @@ /* Define if CompilerInstance::createDiagnostics takes argc and argv */ #undef CREATEDIAGNOSTICS_TAKES_ARG +/* Define if CompilerInstance::createPreprocessor takes TranslationUnitKind */ +#undef CREATEPREPROCESSOR_TAKES_TUKIND + /* Define if TargetInfo::CreateTargetInfo takes pointer */ #undef CREATETARGETINFO_TAKES_POINTER +/* Define if TargetInfo::CreateTargetInfo takes shared_ptr */ +#undef CREATETARGETINFO_TAKES_SHARED_PTR + +/* Define if Driver constructor takes default image name */ +#undef DRIVER_CTOR_TAKES_DEFAULTIMAGENAME + /* Define to Diagnostic for older versions of clang */ #undef DiagnosticsEngine @@ -19,8 +28,8 @@ */ #undef GCC_WARN_UNUSED_RESULT -/* result of mpz_gcdext needs to be normalized */ -#undef GMP_NORMALIZE_GCDEXT +/* Define if llvm/ADT/OwningPtr.h exists */ +#undef HAVE_ADT_OWNINGPTR_H /* Define if clang/Basic/DiagnosticOptions.h exists */ #undef HAVE_BASIC_DIAGNOSTICOPTIONS_H @@ -28,10 +37,17 @@ /* Define if Driver constructor takes CXXIsProduction argument */ #undef HAVE_CXXISPRODUCTION +/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */ +#undef HAVE_DECL_FFS + /* Define to 1 if you have the declaration of `mp_get_memory_functions', and to 0 if you don't. */ #undef HAVE_DECL_MP_GET_MEMORY_FUNCTIONS +/* Define to 1 if you have the declaration of `__builtin_ffs', and to 0 if you + don't. */ +#undef HAVE_DECL___BUILTIN_FFS + /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H @@ -47,6 +63,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H +/* Define if SourceManager has a setMainFileID method */ +#undef HAVE_SETMAINFILEID + /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H @@ -77,10 +96,8 @@ /* Return type of HandleTopLevelDeclReturn */ #undef HandleTopLevelDeclReturn -/* piplib is available */ -#undef ISL_PIPLIB - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ #undef LT_OBJDIR /* Name of package */ @@ -125,13 +142,28 @@ /* Define if Driver::BuildCompilation takes ArrayRef */ #undef USE_ARRAYREF +/* use gmp to implement isl_int */ +#undef USE_GMP_FOR_MP + +/* use imath to implement isl_int */ +#undef USE_IMATH_FOR_MP + /* Version number of package */ #undef VERSION +/* Define to getParamType for newer versions of clang */ +#undef getArgType + /* Define to getHostTriple for older versions of clang */ #undef getDefaultTargetTriple /* Define to getInstantiationLineNumber for older versions of clang */ #undef getExpansionLineNumber +/* Define to getNumParams for newer versions of clang */ +#undef getNumArgs + +/* Define to getResultType for older versions of clang */ +#undef getReturnType + #include diff -Nru cloog-0.18.2/isl/isl_config_post.h cloog-0.18.4/isl/isl_config_post.h --- cloog-0.18.2/isl/isl_config_post.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_config_post.h 2014-10-02 15:48:18.000000000 +0000 @@ -1,3 +1,13 @@ #ifndef HAVE___ATTRIBUTE__ #define __attribute__(x) #endif + +#if (HAVE_DECL_FFS==0) && (HAVE_DECL___BUILTIN_FFS==1) +#define ffs __builtin_ffs +#endif + +#ifdef GCC_WARN_UNUSED_RESULT +#define WARN_UNUSED GCC_WARN_UNUSED_RESULT +#else +#define WARN_UNUSED +#endif diff -Nru cloog-0.18.2/isl/isl_constraint.c cloog-0.18.4/isl/isl_constraint.c --- cloog-0.18.2/isl/isl_constraint.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_constraint.c 2015-07-24 12:23:09.000000000 +0000 @@ -13,10 +13,12 @@ #include #include #include -#include +#include #include #include #include +#include +#include #undef BASE #define BASE constraint @@ -133,12 +135,14 @@ return isl_basic_map_constraint((struct isl_basic_map *)bset, line); } -__isl_give isl_constraint *isl_equality_alloc(__isl_take isl_local_space *ls) +__isl_give isl_constraint *isl_constraint_alloc_equality( + __isl_take isl_local_space *ls) { return isl_constraint_alloc(1, ls); } -__isl_give isl_constraint *isl_inequality_alloc(__isl_take isl_local_space *ls) +__isl_give isl_constraint *isl_constraint_alloc_inequality( + __isl_take isl_local_space *ls) { return isl_constraint_alloc(0, ls); } @@ -172,7 +176,7 @@ return constraint; } -void *isl_constraint_free(struct isl_constraint *c) +__isl_null isl_constraint *isl_constraint_free(__isl_take isl_constraint *c) { if (!c) return NULL; @@ -187,57 +191,122 @@ return NULL; } +/* Return the number of constraints in "bmap", i.e., the + * number of times isl_basic_map_foreach_constraint will + * call the callback. + */ +int isl_basic_map_n_constraint(__isl_keep isl_basic_map *bmap) +{ + if (!bmap) + return -1; + + return bmap->n_eq + bmap->n_ineq; +} + /* Return the number of constraints in "bset", i.e., the * number of times isl_basic_set_foreach_constraint will * call the callback. */ int isl_basic_set_n_constraint(__isl_keep isl_basic_set *bset) { - if (!bset) - return -1; - - return bset->n_eq + bset->n_ineq; + return isl_basic_map_n_constraint(bset); } -int isl_basic_map_foreach_constraint(__isl_keep isl_basic_map *bmap, - int (*fn)(__isl_take isl_constraint *c, void *user), void *user) +isl_stat isl_basic_map_foreach_constraint(__isl_keep isl_basic_map *bmap, + isl_stat (*fn)(__isl_take isl_constraint *c, void *user), void *user) { int i; struct isl_constraint *c; if (!bmap) - return -1; + return isl_stat_error; isl_assert(bmap->ctx, ISL_F_ISSET(bmap, ISL_BASIC_MAP_FINAL), - return -1); + return isl_stat_error); for (i = 0; i < bmap->n_eq; ++i) { c = isl_basic_map_constraint(isl_basic_map_copy(bmap), &bmap->eq[i]); if (!c) - return -1; + return isl_stat_error; if (fn(c, user) < 0) - return -1; + return isl_stat_error; } for (i = 0; i < bmap->n_ineq; ++i) { c = isl_basic_map_constraint(isl_basic_map_copy(bmap), &bmap->ineq[i]); if (!c) - return -1; + return isl_stat_error; if (fn(c, user) < 0) - return -1; + return isl_stat_error; } - return 0; + return isl_stat_ok; } -int isl_basic_set_foreach_constraint(__isl_keep isl_basic_set *bset, - int (*fn)(__isl_take isl_constraint *c, void *user), void *user) +isl_stat isl_basic_set_foreach_constraint(__isl_keep isl_basic_set *bset, + isl_stat (*fn)(__isl_take isl_constraint *c, void *user), void *user) { return isl_basic_map_foreach_constraint((isl_basic_map *)bset, fn, user); } +/* Add the constraint to the list that "user" points to, if it is not + * a div constraint. + */ +static isl_stat collect_constraint(__isl_take isl_constraint *constraint, + void *user) +{ + isl_constraint_list **list = user; + + if (isl_constraint_is_div_constraint(constraint)) + isl_constraint_free(constraint); + else + *list = isl_constraint_list_add(*list, constraint); + + return isl_stat_ok; +} + +/* Return a list of constraints that, when combined, are equivalent + * to "bmap". The input is required to have only known divs. + * + * There is no need to include the div constraints as they are + * implied by the div expressions. + */ +__isl_give isl_constraint_list *isl_basic_map_get_constraint_list( + __isl_keep isl_basic_map *bmap) +{ + int n; + int known; + isl_ctx *ctx; + isl_constraint_list *list; + + known = isl_basic_map_divs_known(bmap); + if (known < 0) + return NULL; + ctx = isl_basic_map_get_ctx(bmap); + if (!known) + isl_die(ctx, isl_error_invalid, + "input involves unknown divs", return NULL); + + n = isl_basic_map_n_constraint(bmap); + list = isl_constraint_list_alloc(ctx, n); + if (isl_basic_map_foreach_constraint(bmap, + &collect_constraint, &list) < 0) + list = isl_constraint_list_free(list); + + return list; +} + +/* Return a list of constraints that, when combined, are equivalent + * to "bset". The input is required to have only known divs. + */ +__isl_give isl_constraint_list *isl_basic_set_get_constraint_list( + __isl_keep isl_basic_set *bset) +{ + return isl_basic_map_get_constraint_list(bset); +} + int isl_constraint_is_equal(struct isl_constraint *constraint1, struct isl_constraint *constraint2) { @@ -323,23 +392,23 @@ return n(constraint, type); } -int isl_constraint_involves_dims(__isl_keep isl_constraint *constraint, +isl_bool isl_constraint_involves_dims(__isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned first, unsigned n) { int i; isl_ctx *ctx; int *active = NULL; - int involves = 0; + isl_bool involves = isl_bool_false; if (!constraint) - return -1; + return isl_bool_error; if (n == 0) - return 0; + return isl_bool_false; ctx = isl_constraint_get_ctx(constraint); if (first + n > isl_constraint_dim(constraint, type)) isl_die(ctx, isl_error_invalid, - "range out of bounds", return -1); + "range out of bounds", return isl_bool_error); active = isl_local_space_get_active(constraint->ls, constraint->v->el + 1); @@ -349,7 +418,7 @@ first += isl_local_space_offset(constraint->ls, type) - 1; for (i = 0; i < n; ++i) if (active[first + i]) { - involves = 1; + involves = isl_bool_true; break; } @@ -358,21 +427,21 @@ return involves; error: free(active); - return -1; + return isl_bool_error; } /* Does the given constraint represent a lower bound on the given * dimension? */ -int isl_constraint_is_lower_bound(__isl_keep isl_constraint *constraint, +isl_bool isl_constraint_is_lower_bound(__isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned pos) { if (!constraint) - return -1; + return isl_bool_error; if (pos >= isl_local_space_dim(constraint->ls, type)) isl_die(isl_constraint_get_ctx(constraint), isl_error_invalid, - "position out of bounds", return -1); + "position out of bounds", return isl_bool_error); pos += isl_local_space_offset(constraint->ls, type); return isl_int_is_pos(constraint->v->el[pos]); @@ -381,15 +450,15 @@ /* Does the given constraint represent an upper bound on the given * dimension? */ -int isl_constraint_is_upper_bound(__isl_keep isl_constraint *constraint, +isl_bool isl_constraint_is_upper_bound(__isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned pos) { if (!constraint) - return -1; + return isl_bool_error; if (pos >= isl_local_space_dim(constraint->ls, type)) isl_die(isl_constraint_get_ctx(constraint), isl_error_invalid, - "position out of bounds", return -1); + "position out of bounds", return isl_bool_error); pos += isl_local_space_offset(constraint->ls, type); return isl_int_is_neg(constraint->v->el[pos]); @@ -548,7 +617,7 @@ */ __isl_give isl_constraint *isl_constraint_set_coefficient_val( __isl_take isl_constraint *constraint, - enum isl_dim_type type, int pos, isl_val *v) + enum isl_dim_type type, int pos, __isl_take isl_val *v) { constraint = isl_constraint_cow(constraint); if (!constraint || !v) @@ -602,11 +671,9 @@ * In particular, this means that the local spaces of "bset" and * "constraint" need to be the same. * - * Since the given constraint may actually be a pointer into the bset, - * we have to be careful not to reorder the constraints as the user - * may be holding on to other constraints from the same bset. - * This should be cleaned up when the internal representation of - * isl_constraint is changed to use isl_aff. + * We manually set ISL_BASIC_SET_FINAL instead of calling + * isl_basic_set_finalize because this function is called by CLooG, + * which does not expect any variables to disappear. */ __isl_give isl_basic_set *isl_basic_set_drop_constraint( __isl_take isl_basic_set *bset, __isl_take isl_constraint *constraint) @@ -617,6 +684,7 @@ unsigned total; isl_local_space *ls1; int equal; + int equality; if (!bset || !constraint) goto error; @@ -631,7 +699,12 @@ return bset; } - if (isl_constraint_is_equality(constraint)) { + bset = isl_basic_set_cow(bset); + if (!bset) + goto error; + + equality = isl_constraint_is_equality(constraint); + if (equality) { n = bset->n_eq; row = bset->eq; } else { @@ -640,11 +713,18 @@ } total = isl_constraint_dim(constraint, isl_dim_all); - for (i = 0; i < n; ++i) - if (isl_seq_eq(row[i], constraint->v->el, 1 + total)) - isl_seq_clr(row[i], 1 + total); + for (i = 0; i < n; ++i) { + if (!isl_seq_eq(row[i], constraint->v->el, 1 + total)) + continue; + if (equality && isl_basic_set_drop_equality(bset, i) < 0) + goto error; + if (!equality && isl_basic_set_drop_inequality(bset, i) < 0) + goto error; + break; + } isl_constraint_free(constraint); + ISL_F_SET(bset, ISL_BASIC_SET_FINAL); return bset; error: isl_constraint_free(constraint); @@ -672,10 +752,10 @@ return constraint; } -int isl_constraint_is_equality(struct isl_constraint *constraint) +isl_bool isl_constraint_is_equality(struct isl_constraint *constraint) { if (!constraint) - return -1; + return isl_bool_error; return constraint->eq; } @@ -750,11 +830,18 @@ if (isl_constraint_dim(constraint, isl_dim_in) != 0) isl_die(isl_constraint_get_ctx(constraint), isl_error_invalid, - "not a set constraint", - return isl_constraint_free(constraint)); + "not a set constraint", goto error); return (isl_basic_set *)isl_basic_map_from_constraint(constraint); +error: + isl_constraint_free(constraint); + return NULL; } +/* Is the variable of "type" at position "pos" of "bmap" defined + * in terms of earlier dimensions through an equality? + * + * If so, and if c is not NULL, then return a copy of this equality in *c. + */ int isl_basic_map_has_defining_equality( __isl_keep isl_basic_map *bmap, enum isl_dim_type type, int pos, __isl_give isl_constraint **c) @@ -768,17 +855,24 @@ offset = basic_map_offset(bmap, type); total = isl_basic_map_total_dim(bmap); isl_assert(bmap->ctx, pos < isl_basic_map_dim(bmap, type), return -1); - for (i = 0; i < bmap->n_eq; ++i) - if (!isl_int_is_zero(bmap->eq[i][offset + pos]) && + for (i = 0; i < bmap->n_eq; ++i) { + if (isl_int_is_zero(bmap->eq[i][offset + pos]) || isl_seq_first_non_zero(bmap->eq[i]+offset+pos+1, - 1+total-offset-pos-1) == -1) { + 1+total-offset-pos-1) != -1) + continue; + if (c) *c = isl_basic_map_constraint(isl_basic_map_copy(bmap), &bmap->eq[i]); - return 1; - } + return 1; + } return 0; } +/* Is the variable of "type" at position "pos" of "bset" defined + * in terms of earlier dimensions through an equality? + * + * If so, and if c is not NULL, then return a copy of this equality in *c. + */ int isl_basic_set_has_defining_equality( __isl_keep isl_basic_set *bset, enum isl_dim_type type, int pos, __isl_give isl_constraint **c) @@ -945,10 +1039,10 @@ return context; } -static int foreach_upper_bound(__isl_keep isl_basic_set *bset, +static isl_stat foreach_upper_bound(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned abs_pos, __isl_take isl_basic_set *context, int n_upper, - int (*fn)(__isl_take isl_constraint *lower, + isl_stat (*fn)(__isl_take isl_constraint *lower, __isl_take isl_constraint *upper, __isl_take isl_basic_set *bset, void *user), void *user) { @@ -977,20 +1071,20 @@ isl_basic_set_free(context); if (i < bset->n_ineq) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; error: isl_constraint_free(upper); isl_basic_set_free(context_i); isl_basic_set_free(context); - return -1; + return isl_stat_error; } -static int foreach_lower_bound(__isl_keep isl_basic_set *bset, +static isl_stat foreach_lower_bound(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned abs_pos, __isl_take isl_basic_set *context, int n_lower, - int (*fn)(__isl_take isl_constraint *lower, + isl_stat (*fn)(__isl_take isl_constraint *lower, __isl_take isl_constraint *upper, __isl_take isl_basic_set *bset, void *user), void *user) { @@ -1019,20 +1113,20 @@ isl_basic_set_free(context); if (i < bset->n_ineq) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; error: isl_constraint_free(lower); isl_basic_set_free(context_i); isl_basic_set_free(context); - return -1; + return isl_stat_error; } -static int foreach_bound_pair(__isl_keep isl_basic_set *bset, +static isl_stat foreach_bound_pair(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned abs_pos, __isl_take isl_basic_set *context, int n_lower, int n_upper, - int (*fn)(__isl_take isl_constraint *lower, + isl_stat (*fn)(__isl_take isl_constraint *lower, __isl_take isl_constraint *upper, __isl_take isl_basic_set *bset, void *user), void *user) { @@ -1087,16 +1181,16 @@ isl_basic_set_free(context); if (i < bset->n_ineq) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; error: isl_constraint_free(lower); isl_constraint_free(upper); isl_basic_set_free(context_i); isl_basic_set_free(context_j); isl_basic_set_free(context); - return -1; + return isl_stat_error; } /* For each pair of lower and upper bounds on the variable "pos" @@ -1115,9 +1209,9 @@ * If not, we count the number of lower and upper bounds and * act accordingly. */ -int isl_basic_set_foreach_bound_pair(__isl_keep isl_basic_set *bset, +isl_stat isl_basic_set_foreach_bound_pair(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned pos, - int (*fn)(__isl_take isl_constraint *lower, + isl_stat (*fn)(__isl_take isl_constraint *lower, __isl_take isl_constraint *upper, __isl_take isl_basic_set *bset, void *user), void *user) { @@ -1129,10 +1223,11 @@ int n_lower, n_upper; if (!bset) - return -1; - isl_assert(bset->ctx, pos < isl_basic_set_dim(bset, type), return -1); + return isl_stat_error; + isl_assert(bset->ctx, pos < isl_basic_set_dim(bset, type), + return isl_stat_error); isl_assert(bset->ctx, type == isl_dim_param || type == isl_dim_set, - return -1); + return isl_stat_error); abs_pos = pos; if (type == isl_dim_set) @@ -1286,3 +1381,71 @@ { return isl_constraint_alloc_aff(0, aff); } + +/* Compare two isl_constraints. + * + * Return -1 if "c1" is "smaller" than "c2", 1 if "c1" is "greater" + * than "c2" and 0 if they are equal. + * + * The order is fairly arbitrary. We do consider constraints that only involve + * earlier dimensions as "smaller". + */ +int isl_constraint_plain_cmp(__isl_keep isl_constraint *c1, + __isl_keep isl_constraint *c2) +{ + int cmp; + int last1, last2; + + if (c1 == c2) + return 0; + if (!c1) + return -1; + if (!c2) + return 1; + cmp = isl_local_space_cmp(c1->ls, c2->ls); + if (cmp != 0) + return cmp; + + last1 = isl_seq_last_non_zero(c1->v->el + 1, c1->v->size - 1); + last2 = isl_seq_last_non_zero(c2->v->el + 1, c1->v->size - 1); + if (last1 != last2) + return last1 - last2; + + return isl_seq_cmp(c1->v->el, c2->v->el, c1->v->size); +} + +/* Compare two constraints based on their final (non-zero) coefficients. + * In particular, the constraint that involves later variables or + * that has a larger coefficient for a shared latest variable + * is considered "greater" than the other constraint. + * + * Return -1 if "c1" is "smaller" than "c2", 1 if "c1" is "greater" + * than "c2" and 0 if they are equal. + * + * If the constraints live in different local spaces, then we cannot + * really compare the constraints so we compare the local spaces instead. + */ +int isl_constraint_cmp_last_non_zero(__isl_keep isl_constraint *c1, + __isl_keep isl_constraint *c2) +{ + int cmp; + int last1, last2; + + if (c1 == c2) + return 0; + if (!c1) + return -1; + if (!c2) + return 1; + cmp = isl_local_space_cmp(c1->ls, c2->ls); + if (cmp != 0) + return cmp; + + last1 = isl_seq_last_non_zero(c1->v->el + 1, c1->v->size - 1); + last2 = isl_seq_last_non_zero(c2->v->el + 1, c1->v->size - 1); + if (last1 != last2) + return last1 - last2; + if (last1 == -1) + return 0; + return isl_int_abs_cmp(c1->v->el[1 + last1], c2->v->el[1 + last2]); +} diff -Nru cloog-0.18.2/isl/isl_constraint_private.h cloog-0.18.4/isl/isl_constraint_private.h --- cloog-0.18.2/isl/isl_constraint_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_constraint_private.h 2014-10-02 15:33:27.000000000 +0000 @@ -21,4 +21,12 @@ struct isl_constraint *isl_basic_set_constraint(struct isl_basic_set *bset, isl_int **line); +void isl_constraint_get_coefficient(__isl_keep isl_constraint *constraint, + enum isl_dim_type type, int pos, isl_int *v); +__isl_give isl_constraint *isl_constraint_set_constant( + __isl_take isl_constraint *constraint, isl_int v); +__isl_give isl_constraint *isl_constraint_set_coefficient( + __isl_take isl_constraint *constraint, + enum isl_dim_type type, int pos, isl_int v); + #endif diff -Nru cloog-0.18.2/isl/isl_convex_hull.c cloog-0.18.4/isl/isl_convex_hull.c --- cloog-0.18.2/isl/isl_convex_hull.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_convex_hull.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,22 +1,27 @@ /* * Copyright 2008-2009 Katholieke Universiteit Leuven + * Copyright 2014 INRIA Rocquencourt * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, K.U.Leuven, Departement * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium + * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, + * B.P. 105 - 78153 Le Chesnay, France */ #include #include -#include +#include #include #include +#include #include -#include +#include #include #include "isl_equalities.h" #include "isl_tab.h" +#include static struct isl_basic_set *uset_convex_hull_wrap_bounded(struct isl_set *set); @@ -590,8 +595,9 @@ set = isl_set_preimage(set, U); facet = uset_convex_hull_wrap_bounded(set); facet = isl_basic_set_preimage(facet, Q); - if (facet) - isl_assert(ctx, facet->n_eq == 0, goto error); + if (facet && facet->n_eq != 0) + isl_die(ctx, isl_error_internal, "unexpected equality", + return isl_basic_set_free(facet)); return facet; error: isl_basic_set_free(facet); @@ -1309,12 +1315,12 @@ if (!bset1 || !bset2) goto error; - ctx = bset1->ctx; + ctx = isl_basic_set_get_ctx(bset1); dir = valid_direction(isl_basic_set_copy(bset1), isl_basic_set_copy(bset2)); if (!dir) goto error; - T = isl_mat_alloc(bset1->ctx, dir->size, dir->size); + T = isl_mat_alloc(ctx, dir->size, dir->size); if (!T) goto error; isl_seq_cpy(T->row[0], dir->block.data, dir->size); @@ -1380,7 +1386,7 @@ goto error; if (bounded1 && bounded2) - uset_convex_hull_wrap(isl_basic_set_union(bset1, bset2)); + return uset_convex_hull_wrap(isl_basic_set_union(bset1, bset2)); if (bounded1 || bounded2) return convex_hull_pair_pointed(bset1, bset2); @@ -1908,6 +1914,18 @@ return NULL; } +/* Return an empty basic map living in the same space as "map". + */ +static __isl_give isl_basic_map *replace_map_by_empty_basic_map( + __isl_take isl_map *map) +{ + isl_space *space; + + space = isl_map_get_space(map); + isl_map_free(map); + return isl_basic_map_empty(space); +} + /* Compute the convex hull of a map. * * The implementation was inspired by "Extended Convex Hull" by Fukuda et al., @@ -1920,22 +1938,15 @@ struct isl_basic_set *affine_hull = NULL; struct isl_basic_map *convex_hull = NULL; struct isl_set *set = NULL; - struct isl_ctx *ctx; - - if (!map) - goto error; - - ctx = map->ctx; - if (map->n == 0) { - convex_hull = isl_basic_map_empty_like_map(map); - isl_map_free(map); - return convex_hull; - } map = isl_map_detect_equalities(map); map = isl_map_align_divs(map); if (!map) goto error; + + if (map->n == 0) + return replace_map_by_empty_basic_map(map); + model = isl_basic_map_copy(map->p[0]); set = isl_map_underlying_set(map); if (!set) @@ -2190,9 +2201,9 @@ return hull; k = isl_basic_set_alloc_inequality(hull); - isl_seq_cpy(hull->ineq[k], ineq, 1 + v.len); if (k < 0) goto error; + isl_seq_cpy(hull->ineq[k], ineq, 1 + v.len); for (j = 0; j < i; ++j) { int bound; @@ -2328,11 +2339,8 @@ if (!map) return NULL; - if (map->n == 0) { - hull = isl_basic_map_empty_like_map(map); - isl_map_free(map); - return hull; - } + if (map->n == 0) + return replace_map_by_empty_basic_map(map); if (map->n == 1) { hull = isl_basic_map_copy(map->p[0]); isl_map_free(map); @@ -2358,6 +2366,8 @@ ISL_F_SET(hull, ISL_BASIC_MAP_NO_IMPLICIT); ISL_F_SET(hull, ISL_BASIC_MAP_ALL_EQUALITIES); + hull = isl_basic_map_finalize(hull); + return hull; } @@ -2390,6 +2400,370 @@ return isl_map_unshifted_simple_hull(set); } +/* Check if "ineq" is a bound on "set" and, if so, add it to "hull". + * + * For each basic set in "set", we first check if the basic set + * contains a translate of "ineq". If this translate is more relaxed, + * then we assume that "ineq" is not a bound on this basic set. + * Otherwise, we know that it is a bound. + * If the basic set does not contain a translate of "ineq", then + * we call is_bound to perform the test. + */ +static __isl_give isl_basic_set *add_bound_from_constraint( + __isl_take isl_basic_set *hull, struct sh_data *data, + __isl_keep isl_set *set, isl_int *ineq) +{ + int i, k; + isl_ctx *ctx; + uint32_t c_hash; + struct ineq_cmp_data v; + + if (!hull || !set) + return isl_basic_set_free(hull); + + v.len = isl_basic_set_total_dim(hull); + v.p = ineq; + c_hash = isl_seq_get_hash(ineq + 1, v.len); + + ctx = isl_basic_set_get_ctx(hull); + for (i = 0; i < set->n; ++i) { + int bound; + struct isl_hash_table_entry *entry; + + entry = isl_hash_table_find(ctx, data->p[i].table, + c_hash, &has_ineq, &v, 0); + if (entry) { + isl_int *ineq_i = entry->data; + int neg, more_relaxed; + + neg = isl_seq_is_neg(ineq_i + 1, ineq + 1, v.len); + if (neg) + isl_int_neg(ineq_i[0], ineq_i[0]); + more_relaxed = isl_int_gt(ineq_i[0], ineq[0]); + if (neg) + isl_int_neg(ineq_i[0], ineq_i[0]); + if (more_relaxed) + break; + else + continue; + } + bound = is_bound(data, set, i, ineq, 0); + if (bound < 0) + return isl_basic_set_free(hull); + if (!bound) + break; + } + if (i < set->n) + return hull; + + k = isl_basic_set_alloc_inequality(hull); + if (k < 0) + return isl_basic_set_free(hull); + isl_seq_cpy(hull->ineq[k], ineq, 1 + v.len); + + return hull; +} + +/* Compute a superset of the convex hull of "set" that is described + * by only some of the "n_ineq" constraints in the list "ineq", where "set" + * has no parameters or integer divisions. + * + * The inequalities in "ineq" are assumed to have been sorted such + * that constraints with the same linear part appear together and + * that among constraints with the same linear part, those with + * smaller constant term appear first. + * + * We reuse the same data structure that is used by uset_simple_hull, + * but we do not need the hull table since we will not consider the + * same constraint more than once. We therefore allocate it with zero size. + * + * We run through the constraints and try to add them one by one, + * skipping identical constraints. If we have added a constraint and + * the next constraint is a more relaxed translate, then we skip this + * next constraint as well. + */ +static __isl_give isl_basic_set *uset_unshifted_simple_hull_from_constraints( + __isl_take isl_set *set, int n_ineq, isl_int **ineq) +{ + int i; + int last_added = 0; + struct sh_data *data = NULL; + isl_basic_set *hull = NULL; + unsigned dim; + + hull = isl_basic_set_alloc_space(isl_set_get_space(set), 0, 0, n_ineq); + if (!hull) + goto error; + + data = sh_data_alloc(set, 0); + if (!data) + goto error; + + dim = isl_set_dim(set, isl_dim_set); + for (i = 0; i < n_ineq; ++i) { + int hull_n_ineq = hull->n_ineq; + int parallel; + + parallel = i > 0 && isl_seq_eq(ineq[i - 1] + 1, ineq[i] + 1, + dim); + if (parallel && + (last_added || isl_int_eq(ineq[i - 1][0], ineq[i][0]))) + continue; + hull = add_bound_from_constraint(hull, data, set, ineq[i]); + if (!hull) + goto error; + last_added = hull->n_ineq > hull_n_ineq; + } + + sh_data_free(data); + isl_set_free(set); + return hull; +error: + sh_data_free(data); + isl_set_free(set); + isl_basic_set_free(hull); + return NULL; +} + +/* Collect pointers to all the inequalities in the elements of "list" + * in "ineq". For equalities, store both a pointer to the equality and + * a pointer to its opposite, which is first copied to "mat". + * "ineq" and "mat" are assumed to have been preallocated to the right size + * (the number of inequalities + 2 times the number of equalites and + * the number of equalities, respectively). + */ +static __isl_give isl_mat *collect_inequalities(__isl_take isl_mat *mat, + __isl_keep isl_basic_set_list *list, isl_int **ineq) +{ + int i, j, n, n_eq, n_ineq; + + if (!mat) + return NULL; + + n_eq = 0; + n_ineq = 0; + n = isl_basic_set_list_n_basic_set(list); + for (i = 0; i < n; ++i) { + isl_basic_set *bset; + bset = isl_basic_set_list_get_basic_set(list, i); + if (!bset) + return isl_mat_free(mat); + for (j = 0; j < bset->n_eq; ++j) { + ineq[n_ineq++] = mat->row[n_eq]; + ineq[n_ineq++] = bset->eq[j]; + isl_seq_neg(mat->row[n_eq++], bset->eq[j], mat->n_col); + } + for (j = 0; j < bset->n_ineq; ++j) + ineq[n_ineq++] = bset->ineq[j]; + isl_basic_set_free(bset); + } + + return mat; +} + +/* Comparison routine for use as an isl_sort callback. + * + * Constraints with the same linear part are sorted together and + * among constraints with the same linear part, those with smaller + * constant term are sorted first. + */ +static int cmp_ineq(const void *a, const void *b, void *arg) +{ + unsigned dim = *(unsigned *) arg; + isl_int * const *ineq1 = a; + isl_int * const *ineq2 = b; + int cmp; + + cmp = isl_seq_cmp((*ineq1) + 1, (*ineq2) + 1, dim); + if (cmp != 0) + return cmp; + return isl_int_cmp((*ineq1)[0], (*ineq2)[0]); +} + +/* Compute a superset of the convex hull of "set" that is described + * by only constraints in the elements of "list", where "set" has + * no parameters or integer divisions. + * + * We collect all the constraints in those elements and then + * sort the constraints such that constraints with the same linear part + * are sorted together and that those with smaller constant term are + * sorted first. + */ +static __isl_give isl_basic_set *uset_unshifted_simple_hull_from_basic_set_list( + __isl_take isl_set *set, __isl_take isl_basic_set_list *list) +{ + int i, n, n_eq, n_ineq; + unsigned dim; + isl_ctx *ctx; + isl_mat *mat = NULL; + isl_int **ineq = NULL; + isl_basic_set *hull; + + if (!set) + goto error; + ctx = isl_set_get_ctx(set); + + n_eq = 0; + n_ineq = 0; + n = isl_basic_set_list_n_basic_set(list); + for (i = 0; i < n; ++i) { + isl_basic_set *bset; + bset = isl_basic_set_list_get_basic_set(list, i); + if (!bset) + goto error; + n_eq += bset->n_eq; + n_ineq += 2 * bset->n_eq + bset->n_ineq; + isl_basic_set_free(bset); + } + + ineq = isl_alloc_array(ctx, isl_int *, n_ineq); + if (n_ineq > 0 && !ineq) + goto error; + + dim = isl_set_dim(set, isl_dim_set); + mat = isl_mat_alloc(ctx, n_eq, 1 + dim); + mat = collect_inequalities(mat, list, ineq); + if (!mat) + goto error; + + if (isl_sort(ineq, n_ineq, sizeof(ineq[0]), &cmp_ineq, &dim) < 0) + goto error; + + hull = uset_unshifted_simple_hull_from_constraints(set, n_ineq, ineq); + + isl_mat_free(mat); + free(ineq); + isl_basic_set_list_free(list); + return hull; +error: + isl_mat_free(mat); + free(ineq); + isl_set_free(set); + isl_basic_set_list_free(list); + return NULL; +} + +/* Compute a superset of the convex hull of "map" that is described + * by only constraints in the elements of "list". + * + * If the list is empty, then we can only describe the universe set. + * If the input map is empty, then all constraints are valid, so + * we return the intersection of the elements in "list". + * + * Otherwise, we align all divs and temporarily treat them + * as regular variables, computing the unshifted simple hull in + * uset_unshifted_simple_hull_from_basic_set_list. + */ +static __isl_give isl_basic_map *map_unshifted_simple_hull_from_basic_map_list( + __isl_take isl_map *map, __isl_take isl_basic_map_list *list) +{ + isl_basic_map *model; + isl_basic_map *hull; + isl_set *set; + isl_basic_set_list *bset_list; + + if (!map || !list) + goto error; + + if (isl_basic_map_list_n_basic_map(list) == 0) { + isl_space *space; + + space = isl_map_get_space(map); + isl_map_free(map); + isl_basic_map_list_free(list); + return isl_basic_map_universe(space); + } + if (isl_map_plain_is_empty(map)) { + isl_map_free(map); + return isl_basic_map_list_intersect(list); + } + + map = isl_map_align_divs_to_basic_map_list(map, list); + if (!map) + goto error; + list = isl_basic_map_list_align_divs_to_basic_map(list, map->p[0]); + + model = isl_basic_map_list_get_basic_map(list, 0); + + set = isl_map_underlying_set(map); + bset_list = isl_basic_map_list_underlying_set(list); + + hull = uset_unshifted_simple_hull_from_basic_set_list(set, bset_list); + hull = isl_basic_map_overlying_set(hull, model); + + return hull; +error: + isl_map_free(map); + isl_basic_map_list_free(list); + return NULL; +} + +/* Return a sequence of the basic maps that make up the maps in "list". + */ +static __isl_give isl_basic_set_list *collect_basic_maps( + __isl_take isl_map_list *list) +{ + int i, n; + isl_ctx *ctx; + isl_basic_map_list *bmap_list; + + if (!list) + return NULL; + n = isl_map_list_n_map(list); + ctx = isl_map_list_get_ctx(list); + bmap_list = isl_basic_map_list_alloc(ctx, 0); + + for (i = 0; i < n; ++i) { + isl_map *map; + isl_basic_map_list *list_i; + + map = isl_map_list_get_map(list, i); + map = isl_map_compute_divs(map); + list_i = isl_map_get_basic_map_list(map); + isl_map_free(map); + bmap_list = isl_basic_map_list_concat(bmap_list, list_i); + } + + isl_map_list_free(list); + return bmap_list; +} + +/* Compute a superset of the convex hull of "map" that is described + * by only constraints in the elements of "list". + * + * If "map" is the universe, then the convex hull (and therefore + * any superset of the convexhull) is the universe as well. + * + * Otherwise, we collect all the basic maps in the map list and + * continue with map_unshifted_simple_hull_from_basic_map_list. + */ +__isl_give isl_basic_map *isl_map_unshifted_simple_hull_from_map_list( + __isl_take isl_map *map, __isl_take isl_map_list *list) +{ + isl_basic_map_list *bmap_list; + int is_universe; + + is_universe = isl_map_plain_is_universe(map); + if (is_universe < 0) + map = isl_map_free(map); + if (is_universe < 0 || is_universe) { + isl_map_list_free(list); + return isl_map_unshifted_simple_hull(map); + } + + bmap_list = collect_basic_maps(list); + return map_unshifted_simple_hull_from_basic_map_list(map, bmap_list); +} + +/* Compute a superset of the convex hull of "set" that is described + * by only constraints in the elements of "list". + */ +__isl_give isl_basic_set *isl_set_unshifted_simple_hull_from_set_list( + __isl_take isl_set *set, __isl_take isl_set_list *list) +{ + return isl_map_unshifted_simple_hull_from_map_list(set, list); +} + /* Given a set "set", return parametric bounds on the dimension "dim". */ static struct isl_basic_set *set_bounds(struct isl_set *set, int dim) diff -Nru cloog-0.18.2/isl/isl_ctx.c cloog-0.18.4/isl/isl_ctx.c --- cloog-0.18.2/isl/isl_ctx.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_ctx.c 2014-10-02 15:48:18.000000000 +0000 @@ -14,6 +14,69 @@ #define __isl_calloc(type,size) ((type *)calloc(1, size)) #define __isl_calloc_type(type) __isl_calloc(type,sizeof(type)) +/* Check that the result of an allocation ("p") is not NULL and + * complain if it is. + * The only exception is when allocation size ("size") is equal to zero. + */ +static void *check_non_null(isl_ctx *ctx, void *p, size_t size) +{ + if (p || size == 0) + return p; + isl_die(ctx, isl_error_alloc, "allocation failure", return NULL); +} + +/* Prepare for performing the next "operation" in the context. + * Return 0 if we are allowed to perform this operation and + * return -1 if we should abort the computation. + * + * In particular, we should stop if the user has explicitly aborted + * the computation or if the maximal number of operations has been exceeded. + */ +int isl_ctx_next_operation(isl_ctx *ctx) +{ + if (!ctx) + return -1; + if (ctx->abort) { + isl_ctx_set_error(ctx, isl_error_abort); + return -1; + } + if (ctx->max_operations && ctx->operations >= ctx->max_operations) + isl_die(ctx, isl_error_quota, + "maximal number of operations exceeded", return -1); + ctx->operations++; + return 0; +} + +/* Call malloc and complain if it fails. + * If ctx is NULL, then return NULL. + */ +void *isl_malloc_or_die(isl_ctx *ctx, size_t size) +{ + if (isl_ctx_next_operation(ctx) < 0) + return NULL; + return ctx ? check_non_null(ctx, malloc(size), size) : NULL; +} + +/* Call calloc and complain if it fails. + * If ctx is NULL, then return NULL. + */ +void *isl_calloc_or_die(isl_ctx *ctx, size_t nmemb, size_t size) +{ + if (isl_ctx_next_operation(ctx) < 0) + return NULL; + return ctx ? check_non_null(ctx, calloc(nmemb, size), nmemb) : NULL; +} + +/* Call realloc and complain if it fails. + * If ctx is NULL, then return NULL. + */ +void *isl_realloc_or_die(isl_ctx *ctx, void *ptr, size_t size) +{ + if (isl_ctx_next_operation(ctx) < 0) + return NULL; + return ctx ? check_non_null(ctx, realloc(ptr, size), size) : NULL; +} + void isl_handle_error(isl_ctx *ctx, enum isl_error error, const char *msg, const char *file, int line) { @@ -45,11 +108,19 @@ return opt; for (i = 0; args->args[i].type != isl_arg_end; ++i) { - if (args->args[i].type != isl_arg_child) + struct isl_arg *arg = &args->args[i]; + void *child; + + if (arg->type != isl_arg_child) continue; - options = find_nested_options(args->args[i].u.child.child, - *(void **)(((char *)opt) + args->args[i].offset), - wanted); + + if (arg->offset == (size_t) -1) + child = opt; + else + child = *(void **)(((char *)opt) + arg->offset); + + options = find_nested_options(arg->u.child.child, + child, wanted); if (options) return options; } @@ -125,6 +196,9 @@ ctx->error = isl_error_none; + ctx->operations = 0; + isl_ctx_set_max_operations(ctx, ctx->opt->max_operations); + return ctx; error: isl_args_free(args, user_opt); @@ -154,6 +228,13 @@ ctx->ref--; } +/* Print statistics on usage. + */ +static void print_stats(isl_ctx *ctx) +{ + fprintf(stderr, "operations: %lu\n", ctx->operations); +} + void isl_ctx_free(struct isl_ctx *ctx) { if (!ctx) @@ -163,6 +244,9 @@ "isl_ctx freed, but some objects still reference it", return); + if (ctx->opt->print_stats) + print_stats(ctx); + isl_hash_table_clear(&ctx->id_table); isl_blk_clear_cache(ctx); isl_int_clear(ctx->zero); @@ -223,3 +307,28 @@ return -1; return isl_args_parse(ctx->user_args, argc, argv, ctx->user_opt, flags); } + +/* Set the maximal number of iterations of "ctx" to "max_operations". + */ +void isl_ctx_set_max_operations(isl_ctx *ctx, unsigned long max_operations) +{ + if (!ctx) + return; + ctx->max_operations = max_operations; +} + +/* Return the maximal number of iterations of "ctx". + */ +unsigned long isl_ctx_get_max_operations(isl_ctx *ctx) +{ + return ctx ? ctx->max_operations : 0; +} + +/* Reset the number of operations performed by "ctx". + */ +void isl_ctx_reset_operations(isl_ctx *ctx) +{ + if (!ctx) + return; + ctx->operations = 0; +} diff -Nru cloog-0.18.2/isl/isl_ctx_private.h cloog-0.18.4/isl/isl_ctx_private.h --- cloog-0.18.2/isl/isl_ctx_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_ctx_private.h 2014-10-02 15:48:18.000000000 +0000 @@ -1,4 +1,5 @@ #include +#include struct isl_ctx { int ref; @@ -25,4 +26,9 @@ enum isl_error error; int abort; + + unsigned long operations; + unsigned long max_operations; }; + +int isl_ctx_next_operation(isl_ctx *ctx); diff -Nru cloog-0.18.2/isl/isl_deprecated.c cloog-0.18.4/isl/isl_deprecated.c --- cloog-0.18.2/isl/isl_deprecated.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_deprecated.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,3 +1,4 @@ +#include #include /* This function was never documented and has been replaced by @@ -8,3 +9,17 @@ { return isl_basic_set_add_dims(bset, type, n); } + +/* This function was replaced by isl_constraint_alloc_equality. + */ +__isl_give isl_constraint *isl_equality_alloc(__isl_take isl_local_space *ls) +{ + return isl_constraint_alloc_equality(ls); +} + +/* This function was replaced by isl_constraint_alloc_inequality. + */ +__isl_give isl_constraint *isl_inequality_alloc(__isl_take isl_local_space *ls) +{ + return isl_constraint_alloc_inequality(ls); +} diff -Nru cloog-0.18.2/isl/isl_dim.c cloog-0.18.4/isl/isl_dim.c --- cloog-0.18.2/isl/isl_dim.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_dim.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,258 +0,0 @@ -#include -#include -#include -#include -#include - -isl_ctx *isl_dim_get_ctx(__isl_keep isl_space *dim) -{ - return isl_space_get_ctx(dim); -} - -__isl_give isl_space *isl_dim_alloc(isl_ctx *ctx, - unsigned nparam, unsigned n_in, unsigned n_out) -{ - return isl_space_alloc(ctx, nparam, n_in, n_out); -} -__isl_give isl_space *isl_dim_set_alloc(isl_ctx *ctx, - unsigned nparam, unsigned dim) -{ - return isl_space_set_alloc(ctx, nparam, dim); -} -__isl_give isl_space *isl_dim_copy(__isl_keep isl_space *dim) -{ - return isl_space_copy(dim); -} -void isl_dim_free(__isl_take isl_space *dim) -{ - isl_space_free(dim); -} - -unsigned isl_dim_size(__isl_keep isl_space *dim, enum isl_dim_type type) -{ - return isl_space_dim(dim, type); -} - -__isl_give isl_space *isl_dim_set_dim_id(__isl_take isl_space *dim, - enum isl_dim_type type, unsigned pos, __isl_take isl_id *id) -{ - return isl_space_set_dim_id(dim, type, pos, id); -} -int isl_dim_has_dim_id(__isl_keep isl_space *dim, - enum isl_dim_type type, unsigned pos) -{ - return isl_space_has_dim_id(dim, type, pos); -} -__isl_give isl_id *isl_dim_get_dim_id(__isl_keep isl_space *dim, - enum isl_dim_type type, unsigned pos) -{ - return isl_space_get_dim_id(dim, type, pos); -} - -int isl_dim_find_dim_by_id(__isl_keep isl_space *dim, - enum isl_dim_type type, __isl_keep isl_id *id) -{ - return isl_space_find_dim_by_id(dim, type, id); -} - -__isl_give isl_space *isl_dim_set_tuple_id(__isl_take isl_space *dim, - enum isl_dim_type type, __isl_take isl_id *id) -{ - return isl_space_set_tuple_id(dim, type, id); -} -__isl_give isl_space *isl_dim_reset_tuple_id(__isl_take isl_space *dim, - enum isl_dim_type type) -{ - return isl_space_reset_tuple_id(dim, type); -} -int isl_dim_has_tuple_id(__isl_keep isl_space *dim, enum isl_dim_type type) -{ - return isl_space_has_tuple_id(dim, type); -} -__isl_give isl_id *isl_dim_get_tuple_id(__isl_keep isl_space *dim, - enum isl_dim_type type) -{ - return isl_space_get_tuple_id(dim, type); -} - -__isl_give isl_space *isl_dim_set_name(__isl_take isl_space *dim, - enum isl_dim_type type, unsigned pos, __isl_keep const char *name) -{ - return isl_space_set_dim_name(dim, type, pos, name); -} -__isl_keep const char *isl_dim_get_name(__isl_keep isl_space *dim, - enum isl_dim_type type, unsigned pos) -{ - return isl_space_get_dim_name(dim, type, pos); -} - -__isl_give isl_space *isl_dim_set_tuple_name(__isl_take isl_space *dim, - enum isl_dim_type type, const char *s) -{ - return isl_space_set_tuple_name(dim, type, s); -} -const char *isl_dim_get_tuple_name(__isl_keep isl_space *dim, - enum isl_dim_type type) -{ - return isl_space_get_tuple_name(dim, type); -} - -int isl_dim_is_wrapping(__isl_keep isl_space *dim) -{ - return isl_space_is_wrapping(dim); -} -__isl_give isl_space *isl_dim_wrap(__isl_take isl_space *dim) -{ - return isl_space_wrap(dim); -} -__isl_give isl_space *isl_dim_unwrap(__isl_take isl_space *dim) -{ - return isl_space_unwrap(dim); -} - -__isl_give isl_space *isl_dim_domain(__isl_take isl_space *dim) -{ - return isl_space_domain(dim); -} -__isl_give isl_space *isl_dim_from_domain(__isl_take isl_space *dim) -{ - return isl_space_from_domain(dim); -} -__isl_give isl_space *isl_dim_range(__isl_take isl_space *dim) -{ - return isl_space_range(dim); -} -__isl_give isl_space *isl_dim_from_range(__isl_take isl_space *dim) -{ - return isl_space_from_range(dim); -} -__isl_give isl_space *isl_dim_reverse(__isl_take isl_space *dim) -{ - return isl_space_reverse(dim); -} -__isl_give isl_space *isl_dim_join(__isl_take isl_space *left, - __isl_take isl_space *right) -{ - return isl_space_join(left, right); -} -__isl_give isl_space *isl_dim_align_params(__isl_take isl_space *dim1, - __isl_take isl_space *dim2) -{ - return isl_space_align_params(dim1, dim2); -} -__isl_give isl_space *isl_dim_insert(__isl_take isl_space *dim, - enum isl_dim_type type, unsigned pos, unsigned n) -{ - return isl_space_insert_dims(dim, type, pos, n); -} -__isl_give isl_space *isl_dim_add(__isl_take isl_space *dim, - enum isl_dim_type type, unsigned n) -{ - return isl_space_add_dims(dim, type, n); -} -__isl_give isl_space *isl_dim_drop(__isl_take isl_space *dim, - enum isl_dim_type type, unsigned first, unsigned n) -{ - return isl_space_drop_dims(dim, type, first, n); -} -__isl_give isl_space *isl_dim_move(__isl_take isl_space *dim, - enum isl_dim_type dst_type, unsigned dst_pos, - enum isl_dim_type src_type, unsigned src_pos, unsigned n) -{ - return isl_space_move_dims(dim, dst_type, dst_pos, src_type, src_pos, n); -} -__isl_give isl_space *isl_dim_map_from_set(__isl_take isl_space *dim) -{ - return isl_space_map_from_set(dim); -} -__isl_give isl_space *isl_dim_zip(__isl_take isl_space *dim) -{ - return isl_space_zip(dim); -} - -__isl_give isl_local_space *isl_local_space_from_dim( - __isl_take isl_space *dim) -{ - return isl_local_space_from_space(dim); -} -__isl_give isl_space *isl_local_space_get_dim( - __isl_keep isl_local_space *ls) -{ - return isl_local_space_get_space(ls); -} - -__isl_give isl_space *isl_aff_get_dim(__isl_keep isl_aff *aff) -{ - return isl_aff_get_space(aff); -} -__isl_give isl_space *isl_pw_aff_get_dim(__isl_keep isl_pw_aff *pwaff) -{ - return isl_pw_aff_get_space(pwaff); -} - -__isl_give isl_space *isl_constraint_get_dim( - __isl_keep isl_constraint *constraint) -{ - return isl_constraint_get_space(constraint); -} - -__isl_give isl_space *isl_basic_map_get_dim(__isl_keep isl_basic_map *bmap) -{ - return isl_basic_map_get_space(bmap); -} -__isl_give isl_space *isl_map_get_dim(__isl_keep isl_map *map) -{ - return isl_map_get_space(map); -} -__isl_give isl_space *isl_union_map_get_dim(__isl_keep isl_union_map *umap) -{ - return isl_union_map_get_space(umap); -} - -__isl_give isl_space *isl_basic_set_get_dim(__isl_keep isl_basic_set *bset) -{ - return isl_basic_set_get_space(bset); -} -__isl_give isl_space *isl_set_get_dim(__isl_keep isl_set *set) -{ - return isl_set_get_space(set); -} -__isl_give isl_space *isl_union_set_get_dim(__isl_keep isl_union_set *uset) -{ - return isl_union_set_get_space(uset); -} - -__isl_give isl_space *isl_point_get_dim(__isl_keep isl_point *pnt) -{ - return isl_point_get_space(pnt); -} - -__isl_give isl_space *isl_qpolynomial_get_dim(__isl_keep isl_qpolynomial *qp) -{ - return isl_qpolynomial_get_space(qp); -} -__isl_give isl_space *isl_pw_qpolynomial_get_dim( - __isl_keep isl_pw_qpolynomial *pwqp) -{ - return isl_pw_qpolynomial_get_space(pwqp); -} -__isl_give isl_space *isl_qpolynomial_fold_get_dim( - __isl_keep isl_qpolynomial_fold *fold) -{ - return isl_qpolynomial_fold_get_space(fold); -} -__isl_give isl_space *isl_pw_qpolynomial_fold_get_dim( - __isl_keep isl_pw_qpolynomial_fold *pwf) -{ - return isl_pw_qpolynomial_fold_get_space(pwf); -} -__isl_give isl_space *isl_union_pw_qpolynomial_get_dim( - __isl_keep isl_union_pw_qpolynomial *upwqp) -{ - return isl_union_pw_qpolynomial_get_space(upwqp); -} -__isl_give isl_space *isl_union_pw_qpolynomial_fold_get_dim( - __isl_keep isl_union_pw_qpolynomial_fold *upwf) -{ - return isl_union_pw_qpolynomial_fold_get_space(upwf); -} diff -Nru cloog-0.18.2/isl/isl_equalities.c cloog-0.18.4/isl/isl_equalities.c --- cloog-0.18.2/isl/isl_equalities.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_equalities.c 2015-07-24 12:23:09.000000000 +0000 @@ -11,7 +11,8 @@ */ #include -#include +#include +#include #include "isl_map_private.h" #include "isl_equalities.h" #include @@ -637,10 +638,10 @@ return 0; } - ctx = bset->ctx; + ctx = isl_basic_set_get_ctx(bset); total = isl_basic_set_total_dim(bset); nparam = isl_basic_set_n_param(bset); - H = isl_mat_sub_alloc6(bset->ctx, bset->eq, 0, bset->n_eq, 1, total); + H = isl_mat_sub_alloc6(ctx, bset->eq, 0, bset->n_eq, 1, total); H = isl_mat_left_hermite(H, 0, &U, NULL); if (!H) return -1; @@ -656,11 +657,11 @@ return 0; } - C = isl_mat_alloc(bset->ctx, 1+bset->n_eq, 1); + C = isl_mat_alloc(ctx, 1 + bset->n_eq, 1); if (!C) goto error; isl_int_set_si(C->row[0][0], 1); - isl_mat_sub_neg(C->ctx, C->row+1, bset->eq, bset->n_eq, 0, 0, 1); + isl_mat_sub_neg(ctx, C->row + 1, bset->eq, bset->n_eq, 0, 0, 1); H1 = isl_mat_sub_alloc(H, 0, H->n_row, 0, H->n_row); H1 = isl_mat_lin_to_aff(H1); C = isl_mat_inverse_product(H1, C); @@ -670,7 +671,7 @@ isl_mat_free(U); C = isl_mat_product(U1, C); if (!C) - goto error; + return -1; if (!isl_int_is_divisible_by(C->row[1][0], C->row[0][0])) { bset = isl_basic_set_copy(bset); bset = isl_basic_set_set_to_empty(bset); @@ -757,13 +758,13 @@ * If i_dim does not belong to such a residue class, then *modulo * is set to 1 and *residue is set to 0. */ -int isl_set_dim_residue_class_val(__isl_keep isl_set *set, +isl_stat isl_set_dim_residue_class_val(__isl_keep isl_set *set, int pos, __isl_give isl_val **modulo, __isl_give isl_val **residue) { *modulo = NULL; *residue = NULL; if (!set) - return -1; + return isl_stat_error; *modulo = isl_val_alloc(isl_set_get_ctx(set)); *residue = isl_val_alloc(isl_set_get_ctx(set)); if (!*modulo || !*residue) @@ -773,9 +774,9 @@ goto error; isl_int_set_si((*modulo)->d, 1); isl_int_set_si((*residue)->d, 1); - return 0; + return isl_stat_ok; error: isl_val_free(*modulo); isl_val_free(*residue); - return -1; + return isl_stat_error; } diff -Nru cloog-0.18.2/isl/isl_farkas.c cloog-0.18.4/isl/isl_farkas.c --- cloog-0.18.2/isl/isl_farkas.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_farkas.c 2014-10-02 15:48:18.000000000 +0000 @@ -11,7 +11,7 @@ #include #include #include -#include +#include /* * Let C be a cone and define @@ -40,16 +40,16 @@ * constraints on P. * This is essentially Farkas' lemma. * - * Let A' = [b A], then, since + * Since * [ 1 0 ] * [ w y ] = [t_0 t] [ b A ] * * we have * - * C' = { w, y | exists t_0, t >= 0 : y = t A' and w = t_0 + t b } + * C' = { w, y | exists t_0, t >= 0 : y = t A and w = t_0 + t b } * or * - * C' = { w, y | exists t >= 0 : y = t A' and w - t b >= 0 } + * C' = { w, y | exists t >= 0 : y = t A and w - t b >= 0 } * * In practice, we introduce an extra variable (w), shifting all * other variables to the right, and an extra inequality @@ -194,23 +194,45 @@ return dim; } +/* Return the rational universe basic set in the given space. + */ +static __isl_give isl_basic_set *rational_universe(__isl_take isl_space *space) +{ + isl_basic_set *bset; + + bset = isl_basic_set_universe(space); + bset = isl_basic_set_set_rational(bset); + + return bset; +} + /* Compute the dual of "bset" by applying Farkas' lemma. * As explained above, we add an extra dimension to represent * the coefficient of the constant term when going from solutions * to coefficients (shift == 1) and we drop the extra dimension when going * in the opposite direction (shift == -1). "dim" is the space in which * the dual should be created. + * + * If "bset" is (obviously) empty, then the way this emptiness + * is represented by the constraints does not allow for the application + * of the standard farkas algorithm. We therefore handle this case + * specifically and return the universe basic set. */ -static __isl_give isl_basic_set *farkas(__isl_take isl_space *dim, +static __isl_give isl_basic_set *farkas(__isl_take isl_space *space, __isl_take isl_basic_set *bset, int shift) { int i, j, k; isl_basic_set *dual = NULL; unsigned total; + if (isl_basic_set_plain_is_empty(bset)) { + isl_basic_set_free(bset); + return rational_universe(space); + } + total = isl_basic_set_total_dim(bset); - dual = isl_basic_set_alloc_space(dim, bset->n_eq + bset->n_ineq, + dual = isl_basic_set_alloc_space(space, bset->n_eq + bset->n_ineq, total, bset->n_ineq + (shift > 0)); dual = isl_basic_set_set_rational(dual); @@ -330,12 +352,10 @@ if (!set) return NULL; if (set->n == 0) { - isl_space *dim = isl_set_get_space(set); - dim = isl_space_coefficients(dim); - coeff = isl_basic_set_universe(dim); - coeff = isl_basic_set_set_rational(coeff); + isl_space *space = isl_set_get_space(set); + space = isl_space_coefficients(space); isl_set_free(set); - return coeff; + return rational_universe(space); } coeff = isl_basic_set_coefficients(isl_basic_set_copy(set->p[0])); @@ -363,12 +383,10 @@ if (!set) return NULL; if (set->n == 0) { - isl_space *dim = isl_set_get_space(set); - dim = isl_space_solutions(dim); - sol = isl_basic_set_universe(dim); - sol = isl_basic_set_set_rational(sol); + isl_space *space = isl_set_get_space(set); + space = isl_space_solutions(space); isl_set_free(set); - return sol; + return rational_universe(space); } sol = isl_basic_set_solutions(isl_basic_set_copy(set->p[0])); diff -Nru cloog-0.18.2/isl/isl_flow.c cloog-0.18.4/isl/isl_flow.c --- cloog-0.18.2/isl/isl_flow.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_flow.c 2015-07-24 12:23:09.000000000 +0000 @@ -3,6 +3,7 @@ * Copyright 2008-2009 Katholieke Universiteit Leuven * Copyright 2010 INRIA Saclay * Copyright 2012 Universiteit Leiden + * Copyright 2014 Ecole Normale Superieure * * Use of this software is governed by the MIT license * @@ -12,11 +13,15 @@ * B-3001 Leuven, Belgium * and INRIA Saclay - Ile-de-France, Parc Club Orsay Universite, * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France + * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France */ #include #include +#include +#include #include +#include #include enum isl_restriction_type { @@ -127,7 +132,8 @@ return NULL; } -void *isl_restriction_free(__isl_take isl_restriction *restr) +__isl_null isl_restriction *isl_restriction_free( + __isl_take isl_restriction *restr) { if (!restr) return NULL; @@ -227,7 +233,8 @@ /* Free the given isl_access_info structure. */ -void *isl_access_info_free(__isl_take isl_access_info *acc) +__isl_null isl_access_info *isl_access_info_free( + __isl_take isl_access_info *acc) { int i; @@ -429,24 +436,25 @@ * while the third argument correspond to the final argument of * the isl_flow_foreach call. */ -int isl_flow_foreach(__isl_keep isl_flow *deps, - int (*fn)(__isl_take isl_map *dep, int must, void *dep_user, void *user), +isl_stat isl_flow_foreach(__isl_keep isl_flow *deps, + isl_stat (*fn)(__isl_take isl_map *dep, int must, void *dep_user, + void *user), void *user) { int i; if (!deps) - return -1; + return isl_stat_error; for (i = 0; i < deps->n_source; ++i) { if (isl_map_plain_is_empty(deps->dep[i].map)) continue; if (fn(isl_map_copy(deps->dep[i].map), deps->dep[i].must, deps->dep[i].data, user) < 0) - return -1; + return isl_stat_error; } - return 0; + return isl_stat_ok; } /* Return a copy of the subset of the sink for which no source could be found. @@ -736,7 +744,7 @@ * after_level. */ static __isl_give isl_map *all_later_sources(__isl_keep isl_access_info *acc, - __isl_keep isl_map *old_map, + __isl_take isl_map *old_map, int j, int before_level, int k, int after_level) { isl_space *dim; @@ -928,7 +936,7 @@ depth = 2 * isl_map_dim(acc->sink.map, isl_dim_in) + 1; mustdo = isl_map_domain(isl_map_copy(acc->sink.map)); - maydo = isl_set_empty_like(mustdo); + maydo = isl_set_empty(isl_set_get_space(mustdo)); if (!mustdo || !maydo) goto error; if (isl_set_plain_is_empty(mustdo)) @@ -941,7 +949,9 @@ for (level = depth; level >= 1; --level) { for (j = acc->n_must-1; j >=0; --j) { - must_rel[j] = isl_map_empty_like(res->dep[j].map); + isl_space *space; + space = isl_map_get_space(res->dep[2 * j].map); + must_rel[j] = isl_map_empty(space); may_rel[j] = isl_map_copy(must_rel[j]); } @@ -1165,13 +1175,470 @@ return NULL; } -struct isl_compute_flow_data { +/* This structure represents the input for a dependence analysis computation. + * + * "sink" represents the sink accesses. + * "must_source" represents the definite source accesses. + * "may_source" represents the possible source accesses. + * + * "schedule" or "schedule_map" represents the execution order. + * Exactly one of these fields should be NULL. The other field + * determines the execution order. + * + * The domains of these four maps refer to the same iteration spaces(s). + * The ranges of the first three maps also refer to the same data space(s). + * + * After a call to isl_union_access_info_introduce_schedule, + * the "schedule_map" field no longer contains useful information. + */ +struct isl_union_access_info { + isl_union_map *sink; isl_union_map *must_source; isl_union_map *may_source; + + isl_schedule *schedule; + isl_union_map *schedule_map; +}; + +/* Free "access" and return NULL. + */ +__isl_null isl_union_access_info *isl_union_access_info_free( + __isl_take isl_union_access_info *access) +{ + if (!access) + return NULL; + + isl_union_map_free(access->sink); + isl_union_map_free(access->must_source); + isl_union_map_free(access->may_source); + isl_schedule_free(access->schedule); + isl_union_map_free(access->schedule_map); + free(access); + + return NULL; +} + +/* Return the isl_ctx to which "access" belongs. + */ +isl_ctx *isl_union_access_info_get_ctx(__isl_keep isl_union_access_info *access) +{ + return access ? isl_union_map_get_ctx(access->sink) : NULL; +} + +/* Create a new isl_union_access_info with the given sink accesses and + * and no source accesses or schedule information. + * + * By default, we use the schedule field of the isl_union_access_info, + * but this may be overridden by a call + * to isl_union_access_info_set_schedule_map. + */ +__isl_give isl_union_access_info *isl_union_access_info_from_sink( + __isl_take isl_union_map *sink) +{ + isl_ctx *ctx; + isl_space *space; + isl_union_map *empty; + isl_union_access_info *access; + + if (!sink) + return NULL; + ctx = isl_union_map_get_ctx(sink); + access = isl_alloc_type(ctx, isl_union_access_info); + if (!access) + goto error; + + space = isl_union_map_get_space(sink); + empty = isl_union_map_empty(isl_space_copy(space)); + access->sink = sink; + access->must_source = isl_union_map_copy(empty); + access->may_source = empty; + access->schedule = isl_schedule_empty(space); + access->schedule_map = NULL; + + if (!access->sink || !access->must_source || + !access->may_source || !access->schedule) + return isl_union_access_info_free(access); + + return access; +error: + isl_union_map_free(sink); + return NULL; +} + +/* Replace the definite source accesses of "access" by "must_source". + */ +__isl_give isl_union_access_info *isl_union_access_info_set_must_source( + __isl_take isl_union_access_info *access, + __isl_take isl_union_map *must_source) +{ + if (!access || !must_source) + goto error; + + isl_union_map_free(access->must_source); + access->must_source = must_source; + + return access; +error: + isl_union_access_info_free(access); + isl_union_map_free(must_source); + return NULL; +} + +/* Replace the possible source accesses of "access" by "may_source". + */ +__isl_give isl_union_access_info *isl_union_access_info_set_may_source( + __isl_take isl_union_access_info *access, + __isl_take isl_union_map *may_source) +{ + if (!access || !may_source) + goto error; + + isl_union_map_free(access->may_source); + access->may_source = may_source; + + return access; +error: + isl_union_access_info_free(access); + isl_union_map_free(may_source); + return NULL; +} + +/* Replace the schedule of "access" by "schedule". + * Also free the schedule_map in case it was set last. + */ +__isl_give isl_union_access_info *isl_union_access_info_set_schedule( + __isl_take isl_union_access_info *access, + __isl_take isl_schedule *schedule) +{ + if (!access || !schedule) + goto error; + + access->schedule_map = isl_union_map_free(access->schedule_map); + isl_schedule_free(access->schedule); + access->schedule = schedule; + + return access; +error: + isl_union_access_info_free(access); + isl_schedule_free(schedule); + return NULL; +} + +/* Replace the schedule map of "access" by "schedule_map". + * Also free the schedule in case it was set last. + */ +__isl_give isl_union_access_info *isl_union_access_info_set_schedule_map( + __isl_take isl_union_access_info *access, + __isl_take isl_union_map *schedule_map) +{ + if (!access || !schedule_map) + goto error; + + isl_union_map_free(access->schedule_map); + access->schedule = isl_schedule_free(access->schedule); + access->schedule_map = schedule_map; + + return access; +error: + isl_union_access_info_free(access); + isl_union_map_free(schedule_map); + return NULL; +} + +__isl_give isl_union_access_info *isl_union_access_info_copy( + __isl_keep isl_union_access_info *access) +{ + isl_union_access_info *copy; + + if (!access) + return NULL; + copy = isl_union_access_info_from_sink( + isl_union_map_copy(access->sink)); + copy = isl_union_access_info_set_must_source(copy, + isl_union_map_copy(access->must_source)); + copy = isl_union_access_info_set_may_source(copy, + isl_union_map_copy(access->may_source)); + if (access->schedule) + copy = isl_union_access_info_set_schedule(copy, + isl_schedule_copy(access->schedule)); + else + copy = isl_union_access_info_set_schedule_map(copy, + isl_union_map_copy(access->schedule_map)); + + return copy; +} + +/* Update the fields of "access" such that they all have the same parameters, + * keeping in mind that the schedule_map field may be NULL and ignoring + * the schedule field. + */ +static __isl_give isl_union_access_info *isl_union_access_info_align_params( + __isl_take isl_union_access_info *access) +{ + isl_space *space; + + if (!access) + return NULL; + + space = isl_union_map_get_space(access->sink); + space = isl_space_align_params(space, + isl_union_map_get_space(access->must_source)); + space = isl_space_align_params(space, + isl_union_map_get_space(access->may_source)); + if (access->schedule_map) + space = isl_space_align_params(space, + isl_union_map_get_space(access->schedule_map)); + access->sink = isl_union_map_align_params(access->sink, + isl_space_copy(space)); + access->must_source = isl_union_map_align_params(access->must_source, + isl_space_copy(space)); + access->may_source = isl_union_map_align_params(access->may_source, + isl_space_copy(space)); + if (!access->schedule_map) { + isl_space_free(space); + } else { + access->schedule_map = + isl_union_map_align_params(access->schedule_map, space); + if (!access->schedule_map) + return isl_union_access_info_free(access); + } + + if (!access->sink || !access->must_source || !access->may_source) + return isl_union_access_info_free(access); + + return access; +} + +/* Prepend the schedule dimensions to the iteration domains. + * + * That is, if the schedule is of the form + * + * D -> S + * + * while the access relations are of the form + * + * D -> A + * + * then the updated access relations are of the form + * + * [S -> D] -> A + * + * The schedule map is also replaced by the map + * + * [S -> D] -> D + * + * that is used during the internal computation. + * Neither the original schedule map nor this updated schedule map + * are used after the call to this function. + */ +static __isl_give isl_union_access_info * +isl_union_access_info_introduce_schedule( + __isl_take isl_union_access_info *access) +{ + isl_union_map *sm; + + if (!access) + return NULL; + + sm = isl_union_map_reverse(access->schedule_map); + sm = isl_union_map_range_map(sm); + access->sink = isl_union_map_apply_range(isl_union_map_copy(sm), + access->sink); + access->may_source = isl_union_map_apply_range(isl_union_map_copy(sm), + access->may_source); + access->must_source = isl_union_map_apply_range(isl_union_map_copy(sm), + access->must_source); + access->schedule_map = sm; + + if (!access->sink || !access->must_source || + !access->may_source || !access->schedule_map) + return isl_union_access_info_free(access); + + return access; +} + +/* This structure epresents the result of a dependence analysis computation. + * + * "must_dep" represents the definite dependences. + * "may_dep" represents the non-definite dependences. + * "must_no_source" represents the subset of the sink accesses for which + * definitely no source was found. + * "may_no_source" represents the subset of the sink accesses for which + * possibly, but not definitely, no source was found. + */ +struct isl_union_flow { isl_union_map *must_dep; isl_union_map *may_dep; isl_union_map *must_no_source; isl_union_map *may_no_source; +}; + +/* Return the isl_ctx to which "flow" belongs. + */ +isl_ctx *isl_union_flow_get_ctx(__isl_keep isl_union_flow *flow) +{ + return flow ? isl_union_map_get_ctx(flow->must_dep) : NULL; +} + +/* Free "flow" and return NULL. + */ +__isl_null isl_union_flow *isl_union_flow_free(__isl_take isl_union_flow *flow) +{ + if (!flow) + return NULL; + isl_union_map_free(flow->must_dep); + isl_union_map_free(flow->may_dep); + isl_union_map_free(flow->must_no_source); + isl_union_map_free(flow->may_no_source); + free(flow); + return NULL; +} + +void isl_union_flow_dump(__isl_keep isl_union_flow *flow) +{ + if (!flow) + return; + + fprintf(stderr, "must dependences: "); + isl_union_map_dump(flow->must_dep); + fprintf(stderr, "may dependences: "); + isl_union_map_dump(flow->may_dep); + fprintf(stderr, "must no source: "); + isl_union_map_dump(flow->must_no_source); + fprintf(stderr, "may no source: "); + isl_union_map_dump(flow->may_no_source); +} + +/* Return the definite dependences in "flow". + */ +__isl_give isl_union_map *isl_union_flow_get_must_dependence( + __isl_keep isl_union_flow *flow) +{ + if (!flow) + return NULL; + return isl_union_map_copy(flow->must_dep); +} + +/* Return the possible dependences in "flow", including the definite + * dependences. + */ +__isl_give isl_union_map *isl_union_flow_get_may_dependence( + __isl_keep isl_union_flow *flow) +{ + if (!flow) + return NULL; + return isl_union_map_union(isl_union_map_copy(flow->must_dep), + isl_union_map_copy(flow->may_dep)); +} + +/* Return the non-definite dependences in "flow". + */ +static __isl_give isl_union_map *isl_union_flow_get_non_must_dependence( + __isl_keep isl_union_flow *flow) +{ + if (!flow) + return NULL; + return isl_union_map_copy(flow->may_dep); +} + +/* Return the subset of the sink accesses for which definitely + * no source was found. + */ +__isl_give isl_union_map *isl_union_flow_get_must_no_source( + __isl_keep isl_union_flow *flow) +{ + if (!flow) + return NULL; + return isl_union_map_copy(flow->must_no_source); +} + +/* Return the subset of the sink accesses for which possibly + * no source was found, including those for which definitely + * no source was found. + */ +__isl_give isl_union_map *isl_union_flow_get_may_no_source( + __isl_keep isl_union_flow *flow) +{ + if (!flow) + return NULL; + return isl_union_map_union(isl_union_map_copy(flow->must_no_source), + isl_union_map_copy(flow->may_no_source)); +} + +/* Return the subset of the sink accesses for which possibly, but not + * definitely, no source was found. + */ +static __isl_give isl_union_map *isl_union_flow_get_non_must_no_source( + __isl_keep isl_union_flow *flow) +{ + if (!flow) + return NULL; + return isl_union_map_copy(flow->may_no_source); +} + +/* Create a new isl_union_flow object, initialized with empty + * dependence relations and sink subsets. + */ +static __isl_give isl_union_flow *isl_union_flow_alloc( + __isl_take isl_space *space) +{ + isl_ctx *ctx; + isl_union_map *empty; + isl_union_flow *flow; + + if (!space) + return NULL; + ctx = isl_space_get_ctx(space); + flow = isl_alloc_type(ctx, isl_union_flow); + if (!flow) + goto error; + + empty = isl_union_map_empty(space); + flow->must_dep = isl_union_map_copy(empty); + flow->may_dep = isl_union_map_copy(empty); + flow->must_no_source = isl_union_map_copy(empty); + flow->may_no_source = empty; + + if (!flow->must_dep || !flow->may_dep || + !flow->must_no_source || !flow->may_no_source) + return isl_union_flow_free(flow); + + return flow; +error: + isl_space_free(space); + return NULL; +} + +/* Drop the schedule dimensions from the iteration domains in "flow". + * In particular, the schedule dimensions have been prepended + * to the iteration domains prior to the dependence analysis by + * replacing the iteration domain D, by the wrapped map [S -> D]. + * Replace these wrapped maps by the original D. + */ +static __isl_give isl_union_flow *isl_union_flow_drop_schedule( + __isl_take isl_union_flow *flow) +{ + if (!flow) + return NULL; + + flow->must_dep = isl_union_map_factor_range(flow->must_dep); + flow->may_dep = isl_union_map_factor_range(flow->may_dep); + flow->must_no_source = + isl_union_map_domain_factor_range(flow->must_no_source); + flow->may_no_source = + isl_union_map_domain_factor_range(flow->may_no_source); + + if (!flow->must_dep || !flow->may_dep || + !flow->must_no_source || !flow->may_no_source) + return isl_union_flow_free(flow); + + return flow; +} + +struct isl_compute_flow_data { + isl_union_map *must_source; + isl_union_map *may_source; + isl_union_flow *flow; int count; int must; @@ -1181,7 +1648,7 @@ isl_access_info *accesses; }; -static int count_matching_array(__isl_take isl_map *map, void *user) +static isl_stat count_matching_array(__isl_take isl_map *map, void *user) { int eq; isl_space *dim; @@ -1197,14 +1664,14 @@ isl_map_free(map); if (eq < 0) - return -1; + return isl_stat_error; if (eq) data->count++; - return 0; + return isl_stat_ok; } -static int collect_matching_array(__isl_take isl_map *map, void *user) +static isl_stat collect_matching_array(__isl_take isl_map *map, void *user) { int eq; isl_space *dim; @@ -1223,7 +1690,7 @@ goto error; if (!eq) { isl_map_free(map); - return 0; + return isl_stat_ok; } info = sched_info_alloc(map); @@ -1234,10 +1701,10 @@ data->count++; - return 0; + return isl_stat_ok; error: isl_map_free(map); - return -1; + return isl_stat_error; } /* Determine the shared nesting level and the "textual order" of @@ -1289,14 +1756,16 @@ * the same array and perform dataflow analysis on them using * isl_access_info_compute_flow. */ -static int compute_flow(__isl_take isl_map *map, void *user) +static isl_stat compute_flow(__isl_take isl_map *map, void *user) { int i; isl_ctx *ctx; struct isl_compute_flow_data *data; isl_flow *flow; + isl_union_flow *df; data = (struct isl_compute_flow_data *)user; + df = data->flow; ctx = isl_map_get_ctx(map); @@ -1338,18 +1807,18 @@ if (!flow) goto error; - data->must_no_source = isl_union_map_union(data->must_no_source, + df->must_no_source = isl_union_map_union(df->must_no_source, isl_union_map_from_map(isl_flow_get_no_source(flow, 1))); - data->may_no_source = isl_union_map_union(data->may_no_source, + df->may_no_source = isl_union_map_union(df->may_no_source, isl_union_map_from_map(isl_flow_get_no_source(flow, 0))); for (i = 0; i < flow->n_source; ++i) { isl_union_map *dep; dep = isl_union_map_from_map(isl_map_copy(flow->dep[i].map)); if (flow->dep[i].must) - data->must_dep = isl_union_map_union(data->must_dep, dep); + df->must_dep = isl_union_map_union(df->must_dep, dep); else - data->may_dep = isl_union_map_union(data->may_dep, dep); + df->may_dep = isl_union_map_union(df->may_dep, dep); } isl_flow_free(flow); @@ -1363,7 +1832,7 @@ isl_space_free(data->dim); isl_map_free(map); - return 0; + return isl_stat_ok; error: isl_access_info_free(data->accesses); sched_info_free(data->sink_info); @@ -1375,7 +1844,527 @@ isl_space_free(data->dim); isl_map_free(map); - return -1; + return isl_stat_error; +} + +/* Remove the must accesses from the may accesses. + * + * A must access always trumps a may access, so there is no need + * for a must access to also be considered as a may access. Doing so + * would only cost extra computations only to find out that + * the duplicated may access does not make any difference. + */ +static __isl_give isl_union_access_info *isl_union_access_info_normalize( + __isl_take isl_union_access_info *access) +{ + if (!access) + return NULL; + access->may_source = isl_union_map_subtract(access->may_source, + isl_union_map_copy(access->must_source)); + if (!access->may_source) + return isl_union_access_info_free(access); + + return access; +} + +/* Given a description of the "sink" accesses, the "source" accesses and + * a schedule, compute for each instance of a sink access + * and for each element accessed by that instance, + * the possible or definite source accesses that last accessed the + * element accessed by the sink access before this sink access + * in the sense that there is no intermediate definite source access. + * + * The must_no_source and may_no_source elements of the result + * are subsets of access->sink. The elements must_dep and may_dep + * map domain elements of access->{may,must)_source to + * domain elements of access->sink. + * + * This function is used when only the schedule map representation + * is available. + * + * We first prepend the schedule dimensions to the domain + * of the accesses so that we can easily compare their relative order. + * Then we consider each sink access individually in compute_flow. + */ +static __isl_give isl_union_flow *compute_flow_union_map( + __isl_take isl_union_access_info *access) +{ + struct isl_compute_flow_data data; + + access = isl_union_access_info_align_params(access); + access = isl_union_access_info_introduce_schedule(access); + if (!access) + return NULL; + + data.must_source = access->must_source; + data.may_source = access->may_source; + + data.flow = isl_union_flow_alloc(isl_union_map_get_space(access->sink)); + + if (isl_union_map_foreach_map(access->sink, &compute_flow, &data) < 0) + goto error; + + data.flow = isl_union_flow_drop_schedule(data.flow); + + isl_union_access_info_free(access); + return data.flow; +error: + isl_union_access_info_free(access); + isl_union_flow_free(data.flow); + return NULL; +} + +/* A schedule access relation. + * + * The access relation "access" is of the form [S -> D] -> A, + * where S corresponds to the prefix schedule at "node". + * "must" is only relevant for source accesses and indicates + * whether the access is a must source or a may source. + */ +struct isl_scheduled_access { + isl_map *access; + int must; + isl_schedule_node *node; +}; + +/* Data structure for keeping track of individual scheduled sink and source + * accesses when computing dependence analysis based on a schedule tree. + * + * "n_sink" is the number of used entries in "sink" + * "n_source" is the number of used entries in "source" + * + * "set_sink", "must" and "node" are only used inside collect_sink_source, + * to keep track of the current node and + * of what extract_sink_source needs to do. + */ +struct isl_compute_flow_schedule_data { + isl_union_access_info *access; + + int n_sink; + int n_source; + + struct isl_scheduled_access *sink; + struct isl_scheduled_access *source; + + int set_sink; + int must; + isl_schedule_node *node; +}; + +/* Align the parameters of all sinks with all sources. + * + * If there are no sinks or no sources, then no alignment is needed. + */ +static void isl_compute_flow_schedule_data_align_params( + struct isl_compute_flow_schedule_data *data) +{ + int i; + isl_space *space; + + if (data->n_sink == 0 || data->n_source == 0) + return; + + space = isl_map_get_space(data->sink[0].access); + + for (i = 1; i < data->n_sink; ++i) + space = isl_space_align_params(space, + isl_map_get_space(data->sink[i].access)); + for (i = 0; i < data->n_source; ++i) + space = isl_space_align_params(space, + isl_map_get_space(data->source[i].access)); + + for (i = 0; i < data->n_sink; ++i) + data->sink[i].access = + isl_map_align_params(data->sink[i].access, + isl_space_copy(space)); + for (i = 0; i < data->n_source; ++i) + data->source[i].access = + isl_map_align_params(data->source[i].access, + isl_space_copy(space)); + + isl_space_free(space); +} + +/* Free all the memory referenced from "data". + * Do not free "data" itself as it may be allocated on the stack. + */ +static void isl_compute_flow_schedule_data_clear( + struct isl_compute_flow_schedule_data *data) +{ + int i; + + if (!data->sink) + return; + + for (i = 0; i < data->n_sink; ++i) { + isl_map_free(data->sink[i].access); + isl_schedule_node_free(data->sink[i].node); + } + + for (i = 0; i < data->n_source; ++i) { + isl_map_free(data->source[i].access); + isl_schedule_node_free(data->source[i].node); + } + + free(data->sink); +} + +/* isl_schedule_foreach_schedule_node_top_down callback for counting + * (an upper bound on) the number of sinks and sources. + * + * Sinks and sources are only extracted at leaves of the tree, + * so we skip the node if it is not a leaf. + * Otherwise we increment data->n_sink and data->n_source with + * the number of spaces in the sink and source access domains + * that reach this node. + */ +static isl_bool count_sink_source(__isl_keep isl_schedule_node *node, + void *user) +{ + struct isl_compute_flow_schedule_data *data = user; + isl_union_set *domain; + isl_union_map *umap; + isl_bool r = isl_bool_false; + + if (isl_schedule_node_get_type(node) != isl_schedule_node_leaf) + return isl_bool_true; + + domain = isl_schedule_node_get_universe_domain(node); + + umap = isl_union_map_copy(data->access->sink); + umap = isl_union_map_intersect_domain(umap, isl_union_set_copy(domain)); + data->n_sink += isl_union_map_n_map(umap); + isl_union_map_free(umap); + if (!umap) + r = isl_bool_error; + + umap = isl_union_map_copy(data->access->must_source); + umap = isl_union_map_intersect_domain(umap, isl_union_set_copy(domain)); + data->n_source += isl_union_map_n_map(umap); + isl_union_map_free(umap); + if (!umap) + r = isl_bool_error; + + umap = isl_union_map_copy(data->access->may_source); + umap = isl_union_map_intersect_domain(umap, isl_union_set_copy(domain)); + data->n_source += isl_union_map_n_map(umap); + isl_union_map_free(umap); + if (!umap) + r = isl_bool_error; + + isl_union_set_free(domain); + + return r; +} + +/* Add a single scheduled sink or source (depending on data->set_sink) + * with scheduled access relation "map", must property data->must and + * schedule node data->node to the list of sinks or sources. + */ +static isl_stat extract_sink_source(__isl_take isl_map *map, void *user) +{ + struct isl_compute_flow_schedule_data *data = user; + struct isl_scheduled_access *access; + + if (data->set_sink) + access = data->sink + data->n_sink++; + else + access = data->source + data->n_source++; + + access->access = map; + access->must = data->must; + access->node = isl_schedule_node_copy(data->node); + + return isl_stat_ok; +} + +/* isl_schedule_foreach_schedule_node_top_down callback for collecting + * individual scheduled source and sink accesses. + * + * We only collect accesses at the leaves of the schedule tree. + * We prepend the schedule dimensions at the leaf to the iteration + * domains of the source and sink accesses and then extract + * the individual accesses (per space). + * + * In particular, if the prefix schedule at the node is of the form + * + * D -> S + * + * while the access relations are of the form + * + * D -> A + * + * then the updated access relations are of the form + * + * [S -> D] -> A + * + * Note that S consists of a single space such that introducing S + * in the access relations does not increase the number of spaces. + */ +static isl_bool collect_sink_source(__isl_keep isl_schedule_node *node, + void *user) +{ + struct isl_compute_flow_schedule_data *data = user; + isl_union_map *prefix; + isl_union_map *umap; + isl_bool r = isl_bool_false; + + if (isl_schedule_node_get_type(node) != isl_schedule_node_leaf) + return isl_bool_true; + + data->node = node; + + prefix = isl_schedule_node_get_prefix_schedule_union_map(node); + prefix = isl_union_map_reverse(prefix); + prefix = isl_union_map_range_map(prefix); + + data->set_sink = 1; + umap = isl_union_map_copy(data->access->sink); + umap = isl_union_map_apply_range(isl_union_map_copy(prefix), umap); + if (isl_union_map_foreach_map(umap, &extract_sink_source, data) < 0) + r = isl_bool_error; + isl_union_map_free(umap); + + data->set_sink = 0; + data->must = 1; + umap = isl_union_map_copy(data->access->must_source); + umap = isl_union_map_apply_range(isl_union_map_copy(prefix), umap); + if (isl_union_map_foreach_map(umap, &extract_sink_source, data) < 0) + r = isl_bool_error; + isl_union_map_free(umap); + + data->set_sink = 0; + data->must = 0; + umap = isl_union_map_copy(data->access->may_source); + umap = isl_union_map_apply_range(isl_union_map_copy(prefix), umap); + if (isl_union_map_foreach_map(umap, &extract_sink_source, data) < 0) + r = isl_bool_error; + isl_union_map_free(umap); + + isl_union_map_free(prefix); + + return r; +} + +/* isl_access_info_compute_flow callback for determining whether + * the shared nesting level and the ordering within that level + * for two scheduled accesses for use in compute_single_flow. + * + * The tokens passed to this function refer to the leaves + * in the schedule tree where the accesses take place. + * + * If n is the shared number of loops, then we need to return + * "2 * n + 1" if "first" precedes "second" inside the innermost + * shared loop and "2 * n" otherwise. + * + * The innermost shared ancestor may be the leaves themselves + * if the accesses take place in the same leaf. Otherwise, + * it is either a set node or a sequence node. Only in the case + * of a sequence node do we consider one access to precede the other. + */ +static int before_node(void *first, void *second) +{ + isl_schedule_node *node1 = first; + isl_schedule_node *node2 = second; + isl_schedule_node *shared; + int depth; + int before = 0; + + shared = isl_schedule_node_get_shared_ancestor(node1, node2); + if (!shared) + return -1; + + depth = isl_schedule_node_get_schedule_depth(shared); + if (isl_schedule_node_get_type(shared) == isl_schedule_node_sequence) { + int pos1, pos2; + + pos1 = isl_schedule_node_get_ancestor_child_position(node1, + shared); + pos2 = isl_schedule_node_get_ancestor_child_position(node2, + shared); + before = pos1 < pos2; + } + + isl_schedule_node_free(shared); + + return 2 * depth + before; +} + +/* Add the scheduled sources from "data" that access + * the same data space as "sink" to "access". + */ +static __isl_give isl_access_info *add_matching_sources( + __isl_take isl_access_info *access, struct isl_scheduled_access *sink, + struct isl_compute_flow_schedule_data *data) +{ + int i; + isl_space *space; + + space = isl_space_range(isl_map_get_space(sink->access)); + for (i = 0; i < data->n_source; ++i) { + struct isl_scheduled_access *source; + isl_space *source_space; + int eq; + + source = &data->source[i]; + source_space = isl_map_get_space(source->access); + source_space = isl_space_range(source_space); + eq = isl_space_is_equal(space, source_space); + isl_space_free(source_space); + + if (!eq) + continue; + if (eq < 0) + goto error; + + access = isl_access_info_add_source(access, + isl_map_copy(source->access), source->must, source->node); + } + + isl_space_free(space); + return access; +error: + isl_space_free(space); + isl_access_info_free(access); + return NULL; +} + +/* Given a scheduled sink access relation "sink", compute the corresponding + * dependences on the sources in "data" and add the computed dependences + * to "uf". + */ +static __isl_give isl_union_flow *compute_single_flow( + __isl_take isl_union_flow *uf, struct isl_scheduled_access *sink, + struct isl_compute_flow_schedule_data *data) +{ + int i; + isl_access_info *access; + isl_flow *flow; + isl_map *map; + + if (!uf) + return NULL; + + access = isl_access_info_alloc(isl_map_copy(sink->access), sink->node, + &before_node, data->n_source); + access = add_matching_sources(access, sink, data); + + flow = isl_access_info_compute_flow(access); + if (!flow) + return isl_union_flow_free(uf); + + map = isl_map_domain_factor_range(isl_flow_get_no_source(flow, 1)); + uf->must_no_source = isl_union_map_union(uf->must_no_source, + isl_union_map_from_map(map)); + map = isl_map_domain_factor_range(isl_flow_get_no_source(flow, 0)); + uf->may_no_source = isl_union_map_union(uf->may_no_source, + isl_union_map_from_map(map)); + + for (i = 0; i < flow->n_source; ++i) { + isl_union_map *dep; + + map = isl_map_factor_range(isl_map_copy(flow->dep[i].map)); + dep = isl_union_map_from_map(map); + if (flow->dep[i].must) + uf->must_dep = isl_union_map_union(uf->must_dep, dep); + else + uf->may_dep = isl_union_map_union(uf->may_dep, dep); + } + + isl_flow_free(flow); + + return uf; +} + +/* Given a description of the "sink" accesses, the "source" accesses and + * a schedule, compute for each instance of a sink access + * and for each element accessed by that instance, + * the possible or definite source accesses that last accessed the + * element accessed by the sink access before this sink access + * in the sense that there is no intermediate definite source access. + * + * The must_no_source and may_no_source elements of the result + * are subsets of access->sink. The elements must_dep and may_dep + * map domain elements of access->{may,must)_source to + * domain elements of access->sink. + * + * This function is used when a schedule tree representation + * is available. + * + * We extract the individual scheduled source and sink access relations and + * then compute dependences for each scheduled sink individually. + */ +static __isl_give isl_union_flow *compute_flow_schedule( + __isl_take isl_union_access_info *access) +{ + struct isl_compute_flow_schedule_data data = { access }; + int i, n; + isl_ctx *ctx; + isl_union_flow *flow; + + ctx = isl_union_access_info_get_ctx(access); + + data.n_sink = 0; + data.n_source = 0; + if (isl_schedule_foreach_schedule_node_top_down(access->schedule, + &count_sink_source, &data) < 0) + goto error; + + n = data.n_sink + data.n_source; + data.sink = isl_calloc_array(ctx, struct isl_scheduled_access, n); + if (n && !data.sink) + goto error; + data.source = data.sink + data.n_sink; + + data.n_sink = 0; + data.n_source = 0; + if (isl_schedule_foreach_schedule_node_top_down(access->schedule, + &collect_sink_source, &data) < 0) + goto error; + + flow = isl_union_flow_alloc(isl_union_map_get_space(access->sink)); + + isl_compute_flow_schedule_data_align_params(&data); + + for (i = 0; i < data.n_sink; ++i) + flow = compute_single_flow(flow, &data.sink[i], &data); + + isl_compute_flow_schedule_data_clear(&data); + + isl_union_access_info_free(access); + return flow; +error: + isl_union_access_info_free(access); + isl_compute_flow_schedule_data_clear(&data); + return NULL; +} + +/* Given a description of the "sink" accesses, the "source" accesses and + * a schedule, compute for each instance of a sink access + * and for each element accessed by that instance, + * the possible or definite source accesses that last accessed the + * element accessed by the sink access before this sink access + * in the sense that there is no intermediate definite source access. + * + * The must_no_source and may_no_source elements of the result + * are subsets of access->sink. The elements must_dep and may_dep + * map domain elements of access->{may,must)_source to + * domain elements of access->sink. + * + * We check whether the schedule is available as a schedule tree + * or a schedule map and call the correpsonding function to perform + * the analysis. + */ +__isl_give isl_union_flow *isl_union_access_info_compute_flow( + __isl_take isl_union_access_info *access) +{ + access = isl_union_access_info_normalize(access); + if (!access) + return NULL; + if (access->schedule) + return compute_flow_schedule(access); + else + return compute_flow_union_map(access); } /* Given a collection of "sink" and "source" accesses, @@ -1390,9 +2379,9 @@ * corresponding to those iterations that access an element * not previously accessed. * - * We first prepend the schedule dimensions to the domain - * of the accesses so that we can easily compare their relative order. - * Then we consider each sink access individually in compute_flow. + * We collect the inputs in an isl_union_access_info object, + * call isl_union_access_info_compute_flow and extract + * the outputs from the result. */ int isl_union_map_compute_flow(__isl_take isl_union_map *sink, __isl_take isl_union_map *must_source, @@ -1402,93 +2391,40 @@ __isl_give isl_union_map **must_no_source, __isl_give isl_union_map **may_no_source) { - isl_space *dim; - isl_union_map *range_map = NULL; - struct isl_compute_flow_data data; - - sink = isl_union_map_align_params(sink, - isl_union_map_get_space(must_source)); - sink = isl_union_map_align_params(sink, - isl_union_map_get_space(may_source)); - sink = isl_union_map_align_params(sink, - isl_union_map_get_space(schedule)); - dim = isl_union_map_get_space(sink); - must_source = isl_union_map_align_params(must_source, isl_space_copy(dim)); - may_source = isl_union_map_align_params(may_source, isl_space_copy(dim)); - schedule = isl_union_map_align_params(schedule, isl_space_copy(dim)); - - schedule = isl_union_map_reverse(schedule); - range_map = isl_union_map_range_map(schedule); - schedule = isl_union_map_reverse(isl_union_map_copy(range_map)); - sink = isl_union_map_apply_domain(sink, isl_union_map_copy(schedule)); - must_source = isl_union_map_apply_domain(must_source, - isl_union_map_copy(schedule)); - may_source = isl_union_map_apply_domain(may_source, schedule); - - data.must_source = must_source; - data.may_source = may_source; - data.must_dep = must_dep ? - isl_union_map_empty(isl_space_copy(dim)) : NULL; - data.may_dep = may_dep ? isl_union_map_empty(isl_space_copy(dim)) : NULL; - data.must_no_source = must_no_source ? - isl_union_map_empty(isl_space_copy(dim)) : NULL; - data.may_no_source = may_no_source ? - isl_union_map_empty(isl_space_copy(dim)) : NULL; - - isl_space_free(dim); + isl_union_access_info *access; + isl_union_flow *flow; - if (isl_union_map_foreach_map(sink, &compute_flow, &data) < 0) - goto error; + access = isl_union_access_info_from_sink(sink); + access = isl_union_access_info_set_must_source(access, must_source); + access = isl_union_access_info_set_may_source(access, may_source); + access = isl_union_access_info_set_schedule_map(access, schedule); + flow = isl_union_access_info_compute_flow(access); - isl_union_map_free(sink); - isl_union_map_free(must_source); - isl_union_map_free(may_source); + if (must_dep) + *must_dep = isl_union_flow_get_must_dependence(flow); + if (may_dep) + *may_dep = isl_union_flow_get_non_must_dependence(flow); + if (must_no_source) + *must_no_source = isl_union_flow_get_must_no_source(flow); + if (may_no_source) + *may_no_source = isl_union_flow_get_non_must_no_source(flow); - if (must_dep) { - data.must_dep = isl_union_map_apply_domain(data.must_dep, - isl_union_map_copy(range_map)); - data.must_dep = isl_union_map_apply_range(data.must_dep, - isl_union_map_copy(range_map)); - *must_dep = data.must_dep; - } - if (may_dep) { - data.may_dep = isl_union_map_apply_domain(data.may_dep, - isl_union_map_copy(range_map)); - data.may_dep = isl_union_map_apply_range(data.may_dep, - isl_union_map_copy(range_map)); - *may_dep = data.may_dep; - } - if (must_no_source) { - data.must_no_source = isl_union_map_apply_domain( - data.must_no_source, isl_union_map_copy(range_map)); - *must_no_source = data.must_no_source; - } - if (may_no_source) { - data.may_no_source = isl_union_map_apply_domain( - data.may_no_source, isl_union_map_copy(range_map)); - *may_no_source = data.may_no_source; - } + isl_union_flow_free(flow); - isl_union_map_free(range_map); + if ((must_dep && !*must_dep) || (may_dep && !*may_dep) || + (must_no_source && !*must_no_source) || + (may_no_source && !*may_no_source)) + goto error; return 0; error: - isl_union_map_free(range_map); - isl_union_map_free(sink); - isl_union_map_free(must_source); - isl_union_map_free(may_source); - isl_union_map_free(data.must_dep); - isl_union_map_free(data.may_dep); - isl_union_map_free(data.must_no_source); - isl_union_map_free(data.may_no_source); - if (must_dep) - *must_dep = NULL; + *must_dep = isl_union_map_free(*must_dep); if (may_dep) - *may_dep = NULL; + *may_dep = isl_union_map_free(*may_dep); if (must_no_source) - *must_no_source = NULL; + *must_no_source = isl_union_map_free(*must_no_source); if (may_no_source) - *may_no_source = NULL; + *may_no_source = isl_union_map_free(*may_no_source); return -1; } diff -Nru cloog-0.18.2/isl/isl_fold.c cloog-0.18.4/isl/isl_fold.c --- cloog-0.18.2/isl/isl_fold.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_fold.c 2015-07-24 12:23:09.000000000 +0000 @@ -14,11 +14,13 @@ #include #include #include -#include -#include +#include +#include #include #include +#include #include +#include enum isl_fold isl_fold_type_negate(enum isl_fold type) { @@ -232,10 +234,23 @@ return NULL; } +/* Determine the sign of the constant quasipolynomial "qp". + * + * Return + * -1 if qp <= 0 + * 1 if qp >= 0 + * 0 if unknown + * + * For qp == 0, we can return either -1 or 1. In practice, we return 1. + * For qp == NaN, the sign is undefined, so we return 0. + */ static int isl_qpolynomial_cst_sign(__isl_keep isl_qpolynomial *qp) { struct isl_upoly_cst *cst; + if (isl_qpolynomial_is_nan(qp)) + return 0; + cst = isl_upoly_as_cst(qp->upoly); if (!cst) return 0; @@ -391,6 +406,14 @@ return sgn; } +/* Combine "fold1" and "fold2" into a single reduction, eliminating + * those elements of one reduction that are already covered by the other + * reduction on "set". + * + * If "fold1" or "fold2" is an empty reduction, then return + * the other reduction. + * If "fold1" or "fold2" is a NaN, then return this NaN. + */ __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_fold_on_domain( __isl_keep isl_set *set, __isl_take isl_qpolynomial_fold *fold1, @@ -410,12 +433,14 @@ better = fold1->type == isl_fold_max ? -1 : 1; - if (isl_qpolynomial_fold_is_empty(fold1)) { + if (isl_qpolynomial_fold_is_empty(fold1) || + isl_qpolynomial_fold_is_nan(fold2)) { isl_qpolynomial_fold_free(fold1); return fold2; } - if (isl_qpolynomial_fold_is_empty(fold2)) { + if (isl_qpolynomial_fold_is_empty(fold2) || + isl_qpolynomial_fold_is_nan(fold1)) { isl_qpolynomial_fold_free(fold2); return fold1; } @@ -436,7 +461,13 @@ for (i = 0; i < fold2->n; ++i) { for (j = n1 - 1; j >= 0; --j) { isl_qpolynomial *d; - int sgn; + int sgn, equal; + equal = isl_qpolynomial_plain_is_equal(res->qp[j], + fold2->qp[i]); + if (equal < 0) + goto error; + if (equal) + break; d = isl_qpolynomial_sub( isl_qpolynomial_copy(res->qp[j]), isl_qpolynomial_copy(fold2->qp[i])); @@ -639,6 +670,7 @@ #define DEFAULT_IS_ZERO 1 #define NO_NEG +#define NO_SUB #define NO_PULLBACK #include @@ -649,7 +681,6 @@ #define PART isl_pw_qpolynomial_fold #undef PARTS #define PARTS pw_qpolynomial_fold -#define ALIGN_DOMAIN #define NO_SUB @@ -754,6 +785,17 @@ return fold->n == 0; } +/* Does "fold" represent max(NaN) or min(NaN)? + */ +isl_bool isl_qpolynomial_fold_is_nan(__isl_keep isl_qpolynomial_fold *fold) +{ + if (!fold) + return isl_bool_error; + if (fold->n != 1) + return isl_bool_false; + return isl_qpolynomial_is_nan(fold->qp[0]); +} + __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_fold( __isl_take isl_qpolynomial_fold *fold1, __isl_take isl_qpolynomial_fold *fold2) @@ -893,12 +935,14 @@ if (!part || !u) goto error; - isl_assert(u->dim->ctx, isl_space_match(part->dim, isl_dim_param, u->dim, - isl_dim_param), goto error); + isl_assert(u->space->ctx, + isl_space_match(part->dim, isl_dim_param, u->space, isl_dim_param), + goto error); hash = isl_space_get_hash(part->dim); - entry = isl_hash_table_find(u->dim->ctx, &u->table, hash, - &has_dim, part->dim, 1); + entry = isl_hash_table_find(u->space->ctx, &u->table, hash, + &isl_union_pw_qpolynomial_fold_has_same_domain_space, + part->dim, 1); if (!entry) goto error; @@ -919,14 +963,14 @@ return NULL; } -static int fold_part(__isl_take isl_pw_qpolynomial_fold *part, void *user) +static isl_stat fold_part(__isl_take isl_pw_qpolynomial_fold *part, void *user) { isl_union_pw_qpolynomial_fold **u; u = (isl_union_pw_qpolynomial_fold **)user; *u = isl_union_pw_qpolynomial_fold_fold_pw_qpolynomial_fold(*u, part); - return 0; + return isl_stat_ok; } __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_fold( @@ -1002,39 +1046,41 @@ return 1; } -__isl_give isl_qpolynomial *isl_qpolynomial_fold_eval( +__isl_give isl_val *isl_qpolynomial_fold_eval( __isl_take isl_qpolynomial_fold *fold, __isl_take isl_point *pnt) { - isl_qpolynomial *qp; + isl_ctx *ctx; + isl_val *v; if (!fold || !pnt) goto error; + ctx = isl_point_get_ctx(pnt); isl_assert(pnt->dim->ctx, isl_space_is_equal(pnt->dim, fold->dim), goto error); isl_assert(pnt->dim->ctx, fold->type == isl_fold_max || fold->type == isl_fold_min, goto error); if (fold->n == 0) - qp = isl_qpolynomial_zero_on_domain(isl_space_copy(fold->dim)); + v = isl_val_zero(ctx); else { int i; - qp = isl_qpolynomial_eval(isl_qpolynomial_copy(fold->qp[0]), + v = isl_qpolynomial_eval(isl_qpolynomial_copy(fold->qp[0]), isl_point_copy(pnt)); for (i = 1; i < fold->n; ++i) { - isl_qpolynomial *qp_i; - qp_i = isl_qpolynomial_eval( + isl_val *v_i; + v_i = isl_qpolynomial_eval( isl_qpolynomial_copy(fold->qp[i]), isl_point_copy(pnt)); if (fold->type == isl_fold_max) - qp = isl_qpolynomial_max_cst(qp, qp_i); + v = isl_val_max(v, v_i); else - qp = isl_qpolynomial_min_cst(qp, qp_i); + v = isl_val_min(v, v_i); } } isl_qpolynomial_fold_free(fold); isl_point_free(pnt); - return qp; + return v; error: isl_qpolynomial_fold_free(fold); isl_point_free(pnt); @@ -1052,33 +1098,33 @@ return n; } -__isl_give isl_qpolynomial *isl_qpolynomial_fold_opt_on_domain( +__isl_give isl_val *isl_qpolynomial_fold_opt_on_domain( __isl_take isl_qpolynomial_fold *fold, __isl_take isl_set *set, int max) { int i; - isl_qpolynomial *opt; + isl_val *opt; if (!set || !fold) goto error; if (fold->n == 0) { - isl_space *dim = isl_space_copy(fold->dim); + opt = isl_val_zero(isl_set_get_ctx(set)); isl_set_free(set); isl_qpolynomial_fold_free(fold); - return isl_qpolynomial_zero_on_domain(dim); + return opt; } opt = isl_qpolynomial_opt_on_domain(isl_qpolynomial_copy(fold->qp[0]), isl_set_copy(set), max); for (i = 1; i < fold->n; ++i) { - isl_qpolynomial *opt_i; + isl_val *opt_i; opt_i = isl_qpolynomial_opt_on_domain( isl_qpolynomial_copy(fold->qp[i]), isl_set_copy(set), max); if (max) - opt = isl_qpolynomial_max_cst(opt, opt_i); + opt = isl_val_max(opt, opt_i); else - opt = isl_qpolynomial_min_cst(opt, opt_i); + opt = isl_val_min(opt, opt_i); } isl_set_free(set); @@ -1270,20 +1316,20 @@ return NULL; } -int isl_qpolynomial_fold_foreach_qpolynomial( +isl_stat isl_qpolynomial_fold_foreach_qpolynomial( __isl_keep isl_qpolynomial_fold *fold, - int (*fn)(__isl_take isl_qpolynomial *qp, void *user), void *user) + isl_stat (*fn)(__isl_take isl_qpolynomial *qp, void *user), void *user) { int i; if (!fold) - return -1; + return isl_stat_error; for (i = 0; i < fold->n; ++i) if (fn(isl_qpolynomial_copy(fold->qp[i]), user) < 0) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_move_dims( @@ -1348,7 +1394,7 @@ return NULL; } -static int add_pwqp(__isl_take isl_pw_qpolynomial *pwqp, void *user) +static isl_stat add_pwqp(__isl_take isl_pw_qpolynomial *pwqp, void *user) { isl_ctx *ctx; isl_pw_qpolynomial_fold *pwf; @@ -1360,8 +1406,9 @@ ctx = pwqp->dim->ctx; hash = isl_space_get_hash(pwqp->dim); - entry = isl_hash_table_find(ctx, &(*upwf)->table, - hash, &has_dim, pwqp->dim, 1); + entry = isl_hash_table_find(ctx, &(*upwf)->table, hash, + &isl_union_pw_qpolynomial_fold_has_same_domain_space, + pwqp->dim, 1); if (!entry) goto error; @@ -1371,17 +1418,17 @@ else { entry->data = isl_pw_qpolynomial_fold_add(entry->data, pwf); if (!entry->data) - return -1; + return isl_stat_error; if (isl_pw_qpolynomial_fold_is_zero(entry->data)) { isl_pw_qpolynomial_fold_free(entry->data); isl_hash_table_remove(ctx, &(*upwf)->table, entry); } } - return 0; + return isl_stat_ok; error: isl_pw_qpolynomial_free(pwqp); - return -1; + return isl_stat_error; } __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_add_union_pw_qpolynomial( @@ -1416,7 +1463,7 @@ m = isl_space_match(dim1, isl_dim_param, dim2, isl_dim_param); if (m < 0 || !m) return m; - return isl_space_tuple_match(dim1, isl_dim_out, dim2, isl_dim_in); + return isl_space_tuple_is_equal(dim1, isl_dim_out, dim2, isl_dim_in); } /* Compute the intersection of the range of the map and the domain @@ -1483,8 +1530,8 @@ int tight; }; -static int pw_qpolynomial_fold_apply(__isl_take isl_pw_qpolynomial_fold *pwf, - void *user) +static isl_stat pw_qpolynomial_fold_apply( + __isl_take isl_pw_qpolynomial_fold *pwf, void *user) { isl_space *map_dim; isl_space *pwf_dim; @@ -1505,13 +1552,13 @@ } else isl_pw_qpolynomial_fold_free(pwf); - return 0; + return isl_stat_ok; } -static int map_apply(__isl_take isl_map *map, void *user) +static isl_stat map_apply(__isl_take isl_map *map, void *user) { struct isl_apply_fold_data *data = user; - int r; + isl_stat r; data->map = map; r = isl_union_pw_qpolynomial_fold_foreach_pw_qpolynomial_fold( @@ -1676,5 +1723,31 @@ error: isl_val_free(v); isl_qpolynomial_fold_free(fold); + return NULL; +} + +/* Divide "fold" by "v". + */ +__isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_scale_down_val( + __isl_take isl_qpolynomial_fold *fold, __isl_take isl_val *v) +{ + if (!fold || !v) + goto error; + + if (isl_val_is_one(v)) { + isl_val_free(v); + return fold; + } + if (!isl_val_is_rat(v)) + isl_die(isl_qpolynomial_fold_get_ctx(fold), isl_error_invalid, + "expecting rational factor", goto error); + if (isl_val_is_zero(v)) + isl_die(isl_val_get_ctx(v), isl_error_invalid, + "cannot scale down by zero", goto error); + + return isl_qpolynomial_fold_scale_val(fold, isl_val_inv(v)); +error: + isl_val_free(v); + isl_qpolynomial_fold_free(fold); return NULL; } diff -Nru cloog-0.18.2/isl/isl_gmp.c cloog-0.18.4/isl/isl_gmp.c --- cloog-0.18.2/isl/isl_gmp.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_gmp.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,4 +1,3 @@ -#include /* * Copyright 2008-2009 Katholieke Universiteit Leuven * @@ -23,36 +22,3 @@ isl_hash_byte(hash, *data); return hash; } - -/* This function tries to produce outputs that do not depend on - * the version of GMP that is being used. - * - * In particular, when computing the extended gcd of -1 and 9, - * some versions will produce - * - * 1 = -1 * -1 + 0 * 9 - * - * while other versions will produce - * - * 1 = 8 * -1 + 1 * 9 - * - * If configure detects that we are in the former case, then - * mpz_gcdext will be called directly. Otherwise, this function - * is called and then we try to mimic the behavior of the other versions. - */ -void isl_gmp_gcdext(mpz_t G, mpz_t S, mpz_t T, mpz_t A, mpz_t B) -{ - if (mpz_divisible_p(B, A)) { - mpz_set_si(S, mpz_sgn(A)); - mpz_set_si(T, 0); - mpz_abs(G, A); - return; - } - if (mpz_divisible_p(A, B)) { - mpz_set_si(S, 0); - mpz_set_si(T, mpz_sgn(B)); - mpz_abs(G, B); - return; - } - mpz_gcdext(G, S, T, A, B); -} diff -Nru cloog-0.18.2/isl/isl_hash.c cloog-0.18.4/isl/isl_hash.c --- cloog-0.18.2/isl/isl_hash.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_hash.c 2015-07-24 12:23:09.000000000 +0000 @@ -11,6 +11,7 @@ #include #include #include +#include "isl_config.h" uint32_t isl_hash_string(uint32_t hash, const char *s) { @@ -61,8 +62,21 @@ return 0; } -static int grow_table(struct isl_ctx *ctx, struct isl_hash_table *table, - int (*eq)(const void *entry, const void *val)) +/* Dummy comparison function that always returns false. + */ +static int no(const void *entry, const void *val) +{ + return 0; +} + +/* Extend "table" to twice its size. + * Return 0 on success and -1 on error. + * + * We reuse isl_hash_table_find to create entries in the extended table. + * Since all entries in the original table are assumed to be different, + * there is no need to compare them against each other. + */ +static int grow_table(struct isl_ctx *ctx, struct isl_hash_table *table) { int n; size_t old_size, size; @@ -90,7 +104,7 @@ continue; entry = isl_hash_table_find(ctx, table, entries[h].hash, - eq, entries[h].data, 1); + &no, NULL, 1); if (!entry) { table->bits--; free(table->entries); @@ -155,7 +169,7 @@ return NULL; if (4 * table->n >= 3 * size) { - if (grow_table(ctx, table, eq) < 0) + if (grow_table(ctx, table) < 0) return NULL; return isl_hash_table_find(ctx, table, key_hash, eq, val, 1); } @@ -166,20 +180,22 @@ return &table->entries[h]; } -int isl_hash_table_foreach(struct isl_ctx *ctx, - struct isl_hash_table *table, - int (*fn)(void **entry, void *user), void *user) +isl_stat isl_hash_table_foreach(isl_ctx *ctx, struct isl_hash_table *table, + isl_stat (*fn)(void **entry, void *user), void *user) { size_t size; uint32_t h; + if (!table->entries) + return isl_stat_error; + size = 1 << table->bits; for (h = 0; h < size; ++ h) if (table->entries[h].data && fn(&table->entries[h].data, user) < 0) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } void isl_hash_table_remove(struct isl_ctx *ctx, diff -Nru cloog-0.18.2/isl/isl_hide_deprecated.h cloog-0.18.4/isl/isl_hide_deprecated.h --- cloog-0.18.2/isl/isl_hide_deprecated.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_hide_deprecated.h 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,52 @@ +#define isl_aff_get_constant isl_gmp_aff_get_constant +#define isl_aff_get_coefficient isl_gmp_aff_get_coefficient +#define isl_aff_get_denominator isl_gmp_aff_get_denominator +#define isl_aff_set_constant isl_gmp_aff_set_constant +#define isl_aff_set_coefficient isl_gmp_aff_set_coefficient +#define isl_aff_set_denominator isl_gmp_aff_set_denominator +#define isl_aff_add_constant isl_gmp_aff_add_constant +#define isl_aff_add_constant_num isl_gmp_aff_add_constant_num +#define isl_aff_add_coefficient isl_gmp_aff_add_coefficient +#define isl_aff_mod isl_gmp_aff_mod +#define isl_aff_scale isl_gmp_aff_scale +#define isl_aff_scale_down isl_gmp_aff_scale_down +#define isl_pw_aff_mod isl_gmp_pw_aff_mod +#define isl_pw_aff_scale isl_gmp_pw_aff_scale +#define isl_pw_aff_scale_down isl_gmp_pw_aff_scale_down +#define isl_multi_aff_scale isl_gmp_multi_aff_scale +#define isl_ast_expr_get_int isl_gmp_ast_expr_get_int +#define isl_constraint_get_constant isl_gmp_constraint_get_constant +#define isl_constraint_get_coefficient isl_gmp_constraint_get_coefficient +#define isl_constraint_set_constant isl_gmp_constraint_set_constant +#define isl_constraint_set_coefficient isl_gmp_constraint_set_coefficient +#define isl_basic_set_max isl_gmp_basic_set_max +#define isl_set_min isl_gmp_set_min +#define isl_set_max isl_gmp_set_max +#define isl_gmp_hash isl_gmp_gmp_hash +#define isl_basic_map_plain_is_fixed isl_gmp_basic_map_plain_is_fixed +#define isl_map_fix isl_gmp_map_fix +#define isl_map_plain_is_fixed isl_gmp_map_plain_is_fixed +#define isl_map_fixed_power isl_gmp_map_fixed_power +#define isl_mat_get_element isl_gmp_mat_get_element +#define isl_mat_set_element isl_gmp_mat_set_element +#define isl_point_get_coordinate isl_gmp_point_get_coordinate +#define isl_point_set_coordinate isl_gmp_point_set_coordinate +#define isl_qpolynomial_rat_cst_on_domain isl_gmp_qpolynomial_rat_cst_on_domain +#define isl_qpolynomial_is_cst isl_gmp_qpolynomial_is_cst +#define isl_qpolynomial_scale isl_gmp_qpolynomial_scale +#define isl_term_get_num isl_gmp_term_get_num +#define isl_term_get_den isl_gmp_term_get_den +#define isl_qpolynomial_fold_scale isl_gmp_qpolynomial_fold_scale +#define isl_pw_qpolynomial_fold_fix_dim isl_gmp_pw_qpolynomial_fold_fix_dim +#define isl_basic_set_fix isl_gmp_basic_set_fix +#define isl_set_lower_bound isl_gmp_set_lower_bound +#define isl_set_upper_bound isl_gmp_set_upper_bound +#define isl_set_fix isl_gmp_set_fix +#define isl_set_plain_is_fixed isl_gmp_set_plain_is_fixed +#define isl_union_map_fixed_power isl_gmp_union_map_fixed_power +#define isl_val_int_from_isl_int isl_gmp_val_int_from_isl_int +#define isl_val_get_num_isl_int isl_gmp_val_get_num_isl_int +#define isl_vec_get_element isl_gmp_vec_get_element +#define isl_vec_set_element isl_gmp_vec_set_element +#define isl_vec_set isl_gmp_vec_set +#define isl_vec_fdiv_r isl_gmp_vec_fdiv_r diff -Nru cloog-0.18.2/isl/isl_hmap_map_basic_set.c cloog-0.18.4/isl/isl_hmap_map_basic_set.c --- cloog-0.18.2/isl/isl_hmap_map_basic_set.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_hmap_map_basic_set.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ -#include - -struct isl_map_basic_set_pair { - isl_map *key; - isl_basic_set *val; -}; - -__isl_give isl_hmap_map_basic_set *isl_hmap_map_basic_set_alloc(isl_ctx *ctx, - int min_size) -{ - return (isl_hmap_map_basic_set *) isl_hash_table_alloc(ctx, min_size); -} - -static int free_pair(void **entry, void *user) -{ - struct isl_map_basic_set_pair *pair = *entry; - isl_map_free(pair->key); - isl_basic_set_free(pair->val); - free(pair); - *entry = NULL; - return 0; -} - -void isl_hmap_map_basic_set_free(isl_ctx *ctx, - __isl_take isl_hmap_map_basic_set *hmap) -{ - if (!hmap) - return; - isl_hash_table_foreach(ctx, &hmap->table, &free_pair, NULL); - isl_hash_table_free(ctx, &hmap->table); -} - -static int has_key(const void *entry, const void *key) -{ - const struct isl_map_basic_set_pair *pair = entry; - isl_map *map = (isl_map *)key; - - return isl_map_plain_is_equal(pair->key, map); -} - -int isl_hmap_map_basic_set_has(isl_ctx *ctx, - __isl_keep isl_hmap_map_basic_set *hmap, __isl_keep isl_map *key) -{ - uint32_t hash; - - hash = isl_map_get_hash(key); - return !!isl_hash_table_find(ctx, &hmap->table, hash, &has_key, key, 0); -} - -__isl_give isl_basic_set *isl_hmap_map_basic_set_get(isl_ctx *ctx, - __isl_keep isl_hmap_map_basic_set *hmap, __isl_take isl_map *key) -{ - struct isl_hash_table_entry *entry; - struct isl_map_basic_set_pair *pair; - uint32_t hash; - - hash = isl_map_get_hash(key); - entry = isl_hash_table_find(ctx, &hmap->table, hash, &has_key, key, 0); - isl_map_free(key); - - if (!entry) - return NULL; - - pair = entry->data; - - return isl_basic_set_copy(pair->val); -} - -int isl_hmap_map_basic_set_set(isl_ctx *ctx, - __isl_keep isl_hmap_map_basic_set *hmap, __isl_take isl_map *key, - __isl_take isl_basic_set *val) -{ - struct isl_hash_table_entry *entry; - struct isl_map_basic_set_pair *pair; - uint32_t hash; - - hash = isl_map_get_hash(key); - entry = isl_hash_table_find(ctx, &hmap->table, hash, &has_key, key, 1); - - if (!entry) - goto error; - - if (entry->data) { - pair = entry->data; - isl_basic_set_free(pair->val); - pair->val = val; - isl_map_free(key); - return 0; - } - - pair = isl_alloc_type(ctx, struct isl_map_basic_set_pair); - if (!pair) - goto error; - - entry->data = pair; - pair->key = key; - pair->val = val; - return 0; -error: - isl_map_free(key); - isl_basic_set_free(val); - return -1; -} diff -Nru cloog-0.18.2/isl/isl_hmap_map_basic_set.h cloog-0.18.4/isl/isl_hmap_map_basic_set.h --- cloog-0.18.2/isl/isl_hmap_map_basic_set.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_hmap_map_basic_set.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -#ifndef ISL_HMAP_MAP_BASIC_SET_H -#define ISL_HMAP_MAP_BASIC_SET_H - -#include -#include -#include - -struct isl_hmap_map_basic_set { - struct isl_hash_table table; -}; -typedef struct isl_hmap_map_basic_set isl_hmap_map_basic_set; - -__isl_give isl_hmap_map_basic_set *isl_hmap_map_basic_set_alloc( isl_ctx *ctx, - int min_size); -void isl_hmap_map_basic_set_free(isl_ctx *ctx, - __isl_take isl_hmap_map_basic_set *hmap); - -int isl_hmap_map_basic_set_has(isl_ctx *ctx, - __isl_keep isl_hmap_map_basic_set *hmap, __isl_keep isl_map *key); -__isl_give isl_basic_set *isl_hmap_map_basic_set_get(isl_ctx *ctx, - __isl_keep isl_hmap_map_basic_set *hmap, __isl_take isl_map *key); -int isl_hmap_map_basic_set_set(isl_ctx *ctx, - __isl_keep isl_hmap_map_basic_set *hmap, __isl_take isl_map *key, - __isl_take isl_basic_set *val); - -#endif diff -Nru cloog-0.18.2/isl/isl_hmap_templ.c cloog-0.18.4/isl/isl_hmap_templ.c --- cloog-0.18.2/isl/isl_hmap_templ.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_hmap_templ.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,389 @@ +/* + * Copyright 2011 INRIA Saclay + * Copyright 2013 Ecole Normale Superieure + * + * Use of this software is governed by the MIT license + * + * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, + * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, + * 91893 Orsay, France + * and Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France + */ + +#include +#include + +#define xCAT(A,B) A ## B +#define CAT(A,B) xCAT(A,B) +#define KEY CAT(isl_,KEY_BASE) +#define VAL CAT(isl_,VAL_BASE) +#define xFN(TYPE,NAME) TYPE ## _ ## NAME +#define FN(TYPE,NAME) xFN(TYPE,NAME) +#define xHMAP(KEY,VAL_BASE) KEY ## _to_ ## VAL_BASE +#define yHMAP(KEY,VAL_BASE) xHMAP(KEY,VAL_BASE) +#define HMAP yHMAP(KEY,VAL_BASE) +#define HMAP_BASE yHMAP(KEY_BASE,VAL_BASE) +#define xS(TYPE1,TYPE2,NAME) struct isl_ ## TYPE1 ## _ ## TYPE2 ## _ ## NAME +#define yS(TYPE1,TYPE2,NAME) xS(TYPE1,TYPE2,NAME) +#define S(NAME) yS(KEY_BASE,VAL_BASE,NAME) + +struct HMAP { + int ref; + isl_ctx *ctx; + struct isl_hash_table table; +}; + +S(pair) { + KEY *key; + VAL *val; +}; + +__isl_give HMAP *FN(HMAP,alloc)(isl_ctx *ctx, int min_size) +{ + HMAP *hmap; + + hmap = isl_calloc_type(ctx, HMAP); + if (!hmap) + return NULL; + + hmap->ctx = ctx; + isl_ctx_ref(ctx); + hmap->ref = 1; + + if (isl_hash_table_init(ctx, &hmap->table, min_size) < 0) + return FN(HMAP,free)(hmap); + + return hmap; +} + +static isl_stat free_pair(void **entry, void *user) +{ + S(pair) *pair = *entry; + FN(KEY,free)(pair->key); + FN(VAL,free)(pair->val); + free(pair); + *entry = NULL; + return isl_stat_ok; +} + +__isl_null HMAP *FN(HMAP,free)(__isl_take HMAP *hmap) +{ + if (!hmap) + return NULL; + if (--hmap->ref > 0) + return NULL; + isl_hash_table_foreach(hmap->ctx, &hmap->table, &free_pair, NULL); + isl_hash_table_clear(&hmap->table); + isl_ctx_deref(hmap->ctx); + free(hmap); + return NULL; +} + +isl_ctx *FN(HMAP,get_ctx)(__isl_keep HMAP *hmap) +{ + return hmap ? hmap->ctx : NULL; +} + +/* Add a mapping from "key" to "val" to the associative array + * pointed to by user. + */ +static isl_stat add_key_val(__isl_take KEY *key, __isl_take VAL *val, + void *user) +{ + HMAP **hmap = (HMAP **) user; + + *hmap = FN(HMAP,set)(*hmap, key, val); + + if (!*hmap) + return isl_stat_error; + + return isl_stat_ok; +} + +__isl_give HMAP *FN(HMAP,dup)(__isl_keep HMAP *hmap) +{ + HMAP *dup; + + if (!hmap) + return NULL; + + dup = FN(HMAP,alloc)(hmap->ctx, hmap->table.n); + if (FN(HMAP,foreach)(hmap, &add_key_val, &dup) < 0) + return FN(HMAP,free)(dup); + + return dup; +} + +__isl_give HMAP *FN(HMAP,cow)(__isl_take HMAP *hmap) +{ + if (!hmap) + return NULL; + + if (hmap->ref == 1) + return hmap; + hmap->ref--; + return FN(HMAP,dup)(hmap); +} + +__isl_give HMAP *FN(HMAP,copy)(__isl_keep HMAP *hmap) +{ + if (!hmap) + return NULL; + + hmap->ref++; + return hmap; +} + +static int has_key(const void *entry, const void *c_key) +{ + const S(pair) *pair = entry; + KEY *key = (KEY *) c_key; + + return KEY_EQUAL(pair->key, key); +} + +isl_bool FN(HMAP,has)(__isl_keep HMAP *hmap, __isl_keep KEY *key) +{ + uint32_t hash; + + if (!hmap) + return isl_bool_error; + + hash = FN(KEY,get_hash)(key); + return !!isl_hash_table_find(hmap->ctx, &hmap->table, hash, + &has_key, key, 0); +} + +__isl_give VAL *FN(HMAP,get)(__isl_keep HMAP *hmap, __isl_take KEY *key) +{ + struct isl_hash_table_entry *entry; + S(pair) *pair; + uint32_t hash; + + if (!hmap || !key) + goto error; + + hash = FN(KEY,get_hash)(key); + entry = isl_hash_table_find(hmap->ctx, &hmap->table, hash, + &has_key, key, 0); + FN(KEY,free)(key); + + if (!entry) + return NULL; + + pair = entry->data; + + return FN(VAL,copy)(pair->val); +error: + FN(KEY,free)(key); + return NULL; +} + +/* Remove the mapping between "key" and its associated value (if any) + * from "hmap". + * + * If "key" is not mapped to anything, then we leave "hmap" untouched" + */ +__isl_give HMAP *FN(HMAP,drop)(__isl_take HMAP *hmap, __isl_take KEY *key) +{ + struct isl_hash_table_entry *entry; + S(pair) *pair; + uint32_t hash; + + if (!hmap || !key) + goto error; + + hash = FN(KEY,get_hash)(key); + entry = isl_hash_table_find(hmap->ctx, &hmap->table, hash, + &has_key, key, 0); + if (!entry) { + FN(KEY,free)(key); + return hmap; + } + + hmap = FN(HMAP,cow)(hmap); + if (!hmap) + goto error; + entry = isl_hash_table_find(hmap->ctx, &hmap->table, hash, + &has_key, key, 0); + FN(KEY,free)(key); + + if (!entry) + isl_die(hmap->ctx, isl_error_internal, + "missing entry" , goto error); + + pair = entry->data; + isl_hash_table_remove(hmap->ctx, &hmap->table, entry); + FN(KEY,free)(pair->key); + FN(VAL,free)(pair->val); + free(pair); + + return hmap; +error: + FN(KEY,free)(key); + FN(HMAP,free)(hmap); + return NULL; +} + +/* Add a mapping from "key" to "val" to "hmap". + * If "key" was already mapped to something else, then that mapping + * is replaced. + * If key happened to be mapped to "val" already, then we leave + * "hmap" untouched. + */ +__isl_give HMAP *FN(HMAP,set)(__isl_take HMAP *hmap, + __isl_take KEY *key, __isl_take VAL *val) +{ + struct isl_hash_table_entry *entry; + S(pair) *pair; + uint32_t hash; + + if (!hmap || !key || !val) + goto error; + + hash = FN(KEY,get_hash)(key); + entry = isl_hash_table_find(hmap->ctx, &hmap->table, hash, + &has_key, key, 0); + if (entry) { + int equal; + pair = entry->data; + equal = VAL_EQUAL(pair->val, val); + if (equal < 0) + goto error; + if (equal) { + FN(KEY,free)(key); + FN(VAL,free)(val); + return hmap; + } + } + + hmap = FN(HMAP,cow)(hmap); + if (!hmap) + goto error; + + entry = isl_hash_table_find(hmap->ctx, &hmap->table, hash, + &has_key, key, 1); + + if (!entry) + goto error; + + if (entry->data) { + pair = entry->data; + FN(VAL,free)(pair->val); + pair->val = val; + FN(KEY,free)(key); + return hmap; + } + + pair = isl_alloc_type(hmap->ctx, S(pair)); + if (!pair) + goto error; + + entry->data = pair; + pair->key = key; + pair->val = val; + return hmap; +error: + FN(KEY,free)(key); + FN(VAL,free)(val); + return FN(HMAP,free)(hmap); +} + +/* Internal data structure for isl_map_to_basic_set_foreach. + * + * fn is the function that should be called on each entry. + * user is the user-specified final argument to fn. + */ +S(foreach_data) { + isl_stat (*fn)(__isl_take KEY *key, __isl_take VAL *val, void *user); + void *user; +}; + +/* Call data->fn on a copy of the key and value in *entry. + */ +static isl_stat call_on_copy(void **entry, void *user) +{ + S(pair) *pair = *entry; + S(foreach_data) *data = (S(foreach_data) *) user; + + return data->fn(FN(KEY,copy)(pair->key), FN(VAL,copy)(pair->val), + data->user); +} + +/* Call "fn" on each pair of key and value in "hmap". + */ +isl_stat FN(HMAP,foreach)(__isl_keep HMAP *hmap, + isl_stat (*fn)(__isl_take KEY *key, __isl_take VAL *val, void *user), + void *user) +{ + S(foreach_data) data = { fn, user }; + + if (!hmap) + return isl_stat_error; + + return isl_hash_table_foreach(hmap->ctx, &hmap->table, + &call_on_copy, &data); +} + +/* Internal data structure for print_pair. + * + * p is the printer on which the associative array is being printed. + * first is set if the current key-value pair is the first to be printed. + */ +S(print_data) { + isl_printer *p; + int first; +}; + +/* Print the given key-value pair to data->p. + */ +static isl_stat print_pair(__isl_take KEY *key, __isl_take VAL *val, void *user) +{ + S(print_data) *data = user; + + if (!data->first) + data->p = isl_printer_print_str(data->p, ", "); + data->p = FN(isl_printer_print,KEY_BASE)(data->p, key); + data->p = isl_printer_print_str(data->p, ": "); + data->p = FN(isl_printer_print,VAL_BASE)(data->p, val); + data->first = 0; + + FN(KEY,free)(key); + FN(VAL,free)(val); + return isl_stat_ok; +} + +/* Print the associative array to "p". + */ +__isl_give isl_printer *FN(isl_printer_print,HMAP_BASE)( + __isl_take isl_printer *p, __isl_keep HMAP *hmap) +{ + S(print_data) data; + + if (!p || !hmap) + return isl_printer_free(p); + + p = isl_printer_print_str(p, "{"); + data.p = p; + data.first = 1; + if (FN(HMAP,foreach)(hmap, &print_pair, &data) < 0) + data.p = isl_printer_free(data.p); + p = data.p; + p = isl_printer_print_str(p, "}"); + + return p; +} + +void FN(HMAP,dump)(__isl_keep HMAP *hmap) +{ + isl_printer *printer; + + if (!hmap) + return; + + printer = isl_printer_to_file(FN(HMAP,get_ctx)(hmap), stderr); + printer = FN(isl_printer_print,HMAP_BASE)(printer, hmap); + printer = isl_printer_end_line(printer); + + isl_printer_free(printer); +} diff -Nru cloog-0.18.2/isl/isl_id.c cloog-0.18.4/isl/isl_id.c --- cloog-0.18.2/isl/isl_id.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_id.c 2015-07-24 12:23:09.000000000 +0000 @@ -71,6 +71,11 @@ return NULL; } +uint32_t isl_id_get_hash(__isl_keep isl_id *id) +{ + return id ? id->hash : 0; +} + struct isl_name_and_user { const char *name; void *user; @@ -83,8 +88,10 @@ if (id->user != nu->user) return 0; - if (!id->name && !nu->name) + if (id->name == nu->name) return 1; + if (!id->name || !nu->name) + return 0; return !strcmp(id->name, nu->name); } @@ -95,6 +102,9 @@ uint32_t id_hash; struct isl_name_and_user nu = { name, user }; + if (!ctx) + return NULL; + id_hash = isl_hash_init(); if (name) id_hash = isl_hash_string(id_hash, name); @@ -127,6 +137,33 @@ return id; } +/* Compare two isl_ids. + * + * The order is fairly arbitrary. We do keep the comparison of + * the user pointers as a last resort since these pointer values + * may not be stable across different systems or even different runs. + */ +int isl_id_cmp(__isl_keep isl_id *id1, __isl_keep isl_id *id2) +{ + if (id1 == id2) + return 0; + if (!id1) + return -1; + if (!id2) + return 1; + if (!id1->name != !id2->name) + return !id1->name - !id2->name; + if (id1->name) { + int cmp = strcmp(id1->name, id2->name); + if (cmp != 0) + return cmp; + } + if (id1->user < id2->user) + return -1; + else + return 1; +} + static int isl_id_eq(const void *entry, const void *name) { return entry == name; @@ -156,7 +193,7 @@ /* If the id has a negative refcount, then it is a static isl_id * and should not be freed. */ -void *isl_id_free(__isl_take isl_id *id) +__isl_null isl_id *isl_id_free(__isl_take isl_id *id) { struct isl_hash_table_entry *entry; diff -Nru cloog-0.18.2/isl/isl_id_private.h cloog-0.18.4/isl/isl_id_private.h --- cloog-0.18.2/isl/isl_id_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_id_private.h 2014-10-02 15:33:27.000000000 +0000 @@ -34,6 +34,7 @@ #include uint32_t isl_hash_id(uint32_t hash, __isl_keep isl_id *id); +int isl_id_cmp(__isl_keep isl_id *id1, __isl_keep isl_id *id2); extern isl_id isl_id_none; diff -Nru cloog-0.18.2/isl/isl_id_to_ast_expr.c cloog-0.18.4/isl/isl_id_to_ast_expr.c --- cloog-0.18.2/isl/isl_id_to_ast_expr.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_id_to_ast_expr.c 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,11 @@ +#include +#include + +#define isl_id_is_equal(id1,id2) id1 == id2 + +#define KEY_BASE id +#define KEY_EQUAL isl_id_is_equal +#define VAL_BASE ast_expr +#define VAL_EQUAL isl_ast_expr_is_equal + +#include diff -Nru cloog-0.18.2/isl/isl_id_to_pw_aff.c cloog-0.18.4/isl/isl_id_to_pw_aff.c --- cloog-0.18.2/isl/isl_id_to_pw_aff.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_id_to_pw_aff.c 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,11 @@ +#include +#include + +#define isl_id_is_equal(id1,id2) id1 == id2 + +#define KEY_BASE id +#define KEY_EQUAL isl_id_is_equal +#define VAL_BASE pw_aff +#define VAL_EQUAL isl_pw_aff_plain_is_equal + +#include diff -Nru cloog-0.18.2/isl/isl_ilp.c cloog-0.18.4/isl/isl_ilp.c --- cloog-0.18.2/isl/isl_ilp.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_ilp.c 2015-07-24 12:23:09.000000000 +0000 @@ -11,12 +11,16 @@ #include #include #include "isl_sample.h" -#include +#include #include "isl_equalities.h" #include #include #include #include +#include +#include +#include +#include /* Given a basic set "bset", construct a basic set U such that for * each element x in U, the whole unit box positioned at x is inside @@ -37,9 +41,9 @@ goto error; if (bset->n_eq != 0) { - unit_box = isl_basic_set_empty_like(bset); + isl_space *space = isl_basic_set_get_space(bset); isl_basic_set_free(bset); - return unit_box; + return isl_basic_set_empty(space); } total = isl_basic_set_total_dim(bset); @@ -464,7 +468,7 @@ } if (res == isl_lp_ok) empty = 0; - if (isl_int_gt(opt_i, *opt)) + if (max ? isl_int_gt(opt_i, *opt) : isl_int_lt(opt_i, *opt)) isl_int_set(*opt, opt_i); } isl_int_clear(opt_i); diff -Nru cloog-0.18.2/isl/isl_ilp_private.h cloog-0.18.4/isl/isl_ilp_private.h --- cloog-0.18.2/isl/isl_ilp_private.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_ilp_private.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,11 @@ +#ifndef ISL_ILP_PRIVATE_H +#define ISL_ILP_PRIVATE_H + +#include +#include +#include + +enum isl_lp_result isl_basic_set_solve_ilp(__isl_keep isl_basic_set *bset, + int max, isl_int *f, isl_int *opt, __isl_give isl_vec **sol_p); + +#endif diff -Nru cloog-0.18.2/isl/isl_imath.c cloog-0.18.4/isl/isl_imath.c --- cloog-0.18.2/isl/isl_imath.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_imath.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,53 @@ +#include + +uint32_t isl_imath_hash(mp_int v, uint32_t hash) +{ + unsigned const char *data = (unsigned char *)v->digits; + unsigned const char *end = data + v->used * sizeof(v->digits[0]); + + if (v->sign == 1) + isl_hash_byte(hash, 0xFF); + for (; data < end; ++data) + isl_hash_byte(hash, *data); + return hash; +} + +/* Try a standard conversion that fits into a long. + */ +int isl_imath_fits_slong_p(mp_int op) +{ + long out; + mp_result res = mp_int_to_int(op, &out); + return res == MP_OK; +} + +/* Try a standard conversion that fits into an unsigned long. + */ +int isl_imath_fits_ulong_p(mp_int op) +{ + unsigned long out; + mp_result res = mp_int_to_uint(op, &out); + return res == MP_OK; +} + +void isl_imath_addmul_ui(mp_int rop, mp_int op1, unsigned long op2) +{ + isl_int temp; + isl_int_init(temp); + + isl_int_set_ui(temp, op2); + isl_int_addmul(rop, op1, temp); + + isl_int_clear(temp); +} + +void isl_imath_submul_ui(mp_int rop, mp_int op1, unsigned long op2) +{ + isl_int temp; + isl_int_init(temp); + + isl_int_set_ui(temp, op2); + isl_int_submul(rop, op1, temp); + + isl_int_clear(temp); +} diff -Nru cloog-0.18.2/isl/isl_imath.h cloog-0.18.4/isl/isl_imath.h --- cloog-0.18.2/isl/isl_imath.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_imath.h 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,8 @@ +#include +#include + +uint32_t isl_imath_hash(mp_int v, uint32_t hash); +int isl_imath_fits_ulong_p(mp_int op); +int isl_imath_fits_slong_p(mp_int op); +void isl_imath_addmul_ui(mp_int rop, mp_int op1, unsigned long op2); +void isl_imath_submul_ui(mp_int rop, mp_int op1, unsigned long op2); diff -Nru cloog-0.18.2/isl/isl_input.c cloog-0.18.4/isl/isl_input.c --- cloog-0.18.2/isl/isl_input.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_input.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,7 +1,7 @@ /* * Copyright 2008-2009 Katholieke Universiteit Leuven * Copyright 2010 INRIA Saclay - * Copyright 2012 Ecole Normale Superieure + * Copyright 2012-2013 Ecole Normale Superieure * * Use of this software is governed by the MIT license * @@ -18,13 +18,15 @@ #include #include #include -#include +#include #include #include #include "isl_polynomial_private.h" +#include #include #include #include +#include #include #include @@ -144,7 +146,7 @@ * In particular, evaluate expressions of the form x^y, * with x and y values. */ -static struct isl_token *next_token(struct isl_stream *s) +static struct isl_token *next_token(__isl_keep isl_stream *s) { struct isl_token *tok, *tok2; @@ -181,7 +183,7 @@ * * where n, d and v are integer constants. */ -__isl_give isl_val *isl_stream_read_val(struct isl_stream *s) +__isl_give isl_val *isl_stream_read_val(__isl_keep isl_stream *s) { struct isl_token *tok = NULL; struct isl_token *tok2 = NULL; @@ -241,7 +243,7 @@ const char *str) { isl_val *val; - struct isl_stream *s = isl_stream_new_str(ctx, str); + isl_stream *s = isl_stream_new_str(ctx, str); if (!s) return NULL; val = isl_stream_read_val(s); @@ -249,7 +251,7 @@ return val; } -static int accept_cst_factor(struct isl_stream *s, isl_int *f) +static int accept_cst_factor(__isl_keep isl_stream *s, isl_int *f) { struct isl_token *tok; @@ -279,7 +281,7 @@ * We introduce an integer division q = [aff/d] and the result * is set to aff - d q. */ -static __isl_give isl_pw_aff *affine_mod(struct isl_stream *s, +static __isl_give isl_pw_aff *affine_mod(__isl_keep isl_stream *s, struct vars *v, __isl_take isl_pw_aff *aff) { struct isl_token *tok; @@ -306,12 +308,12 @@ return NULL; } -static __isl_give isl_pw_aff *accept_affine(struct isl_stream *s, - __isl_take isl_space *dim, struct vars *v); -static __isl_give isl_pw_aff_list *accept_affine_list(struct isl_stream *s, +static __isl_give isl_pw_aff *accept_affine(__isl_keep isl_stream *s, + __isl_take isl_space *space, struct vars *v); +static __isl_give isl_pw_aff_list *accept_affine_list(__isl_keep isl_stream *s, __isl_take isl_space *dim, struct vars *v); -static __isl_give isl_pw_aff *accept_minmax(struct isl_stream *s, +static __isl_give isl_pw_aff *accept_minmax(__isl_keep isl_stream *s, __isl_take isl_space *dim, struct vars *v) { struct isl_token *tok; @@ -371,7 +373,7 @@ * floord(,) * ceild(,) */ -static __isl_give isl_pw_aff *accept_div(struct isl_stream *s, +static __isl_give isl_pw_aff *accept_div(__isl_keep isl_stream *s, __isl_take isl_space *dim, struct vars *v) { struct isl_token *tok; @@ -435,7 +437,7 @@ return NULL; } -static __isl_give isl_pw_aff *accept_affine_factor(struct isl_stream *s, +static __isl_give isl_pw_aff *accept_affine_factor(__isl_keep isl_stream *s, __isl_take isl_space *dim, struct vars *v) { struct isl_token *tok = NULL; @@ -552,15 +554,26 @@ return isl_pw_aff_add(pwaff, isl_pw_aff_from_aff(aff)); } -static __isl_give isl_pw_aff *accept_affine(struct isl_stream *s, - __isl_take isl_space *dim, struct vars *v) +/* Return a piecewise affine expression defined on the specified domain + * that represents NaN. + */ +static __isl_give isl_pw_aff *nan_on_domain(__isl_keep isl_space *space) +{ + isl_local_space *ls; + + ls = isl_local_space_from_space(isl_space_copy(space)); + return isl_pw_aff_nan_on_domain(ls); +} + +static __isl_give isl_pw_aff *accept_affine(__isl_keep isl_stream *s, + __isl_take isl_space *space, struct vars *v) { struct isl_token *tok = NULL; isl_local_space *ls; isl_pw_aff *res; int sign = 1; - ls = isl_local_space_from_space(isl_space_copy(dim)); + ls = isl_local_space_from_space(isl_space_copy(space)); res = isl_pw_aff_from_aff(isl_aff_zero_on_domain(ls)); if (!res) goto error; @@ -583,7 +596,8 @@ isl_pw_aff *term; isl_stream_push_token(s, tok); tok = NULL; - term = accept_affine_factor(s, isl_space_copy(dim), v); + term = accept_affine_factor(s, + isl_space_copy(space), v); if (sign < 0) res = isl_pw_aff_sub(res, term); else @@ -598,7 +612,7 @@ isl_stream_next_token_is(s, ISL_TOKEN_IDENT)) { isl_pw_aff *term; term = accept_affine_factor(s, - isl_space_copy(dim), v); + isl_space_copy(space), v); term = isl_pw_aff_scale(term, tok->u.v); res = isl_pw_aff_add(res, term); if (!res) @@ -607,11 +621,13 @@ res = add_cst(res, tok->u.v); } sign = 1; + } else if (tok->type == ISL_TOKEN_NAN) { + res = isl_pw_aff_add(res, nan_on_domain(space)); } else { isl_stream_error(s, tok, "unexpected isl_token"); isl_stream_push_token(s, tok); isl_pw_aff_free(res); - isl_space_free(dim); + isl_space_free(space); return NULL; } isl_token_free(tok); @@ -633,10 +649,10 @@ } } - isl_space_free(dim); + isl_space_free(space); return res; error: - isl_space_free(dim); + isl_space_free(space); isl_token_free(tok); isl_pw_aff_free(res); return NULL; @@ -660,14 +676,14 @@ } } -static __isl_give isl_map *read_formula(struct isl_stream *s, +static __isl_give isl_map *read_formula(__isl_keep isl_stream *s, struct vars *v, __isl_take isl_map *map, int rational); -static __isl_give isl_pw_aff *accept_extended_affine(struct isl_stream *s, +static __isl_give isl_pw_aff *accept_extended_affine(__isl_keep isl_stream *s, __isl_take isl_space *dim, struct vars *v, int rational); /* Accept a ternary operator, given the first argument. */ -static __isl_give isl_pw_aff *accept_ternary(struct isl_stream *s, +static __isl_give isl_pw_aff *accept_ternary(__isl_keep isl_stream *s, __isl_take isl_map *cond, struct vars *v, int rational) { isl_space *dim; @@ -701,13 +717,49 @@ return NULL; } +/* Set *line and *col to those of the next token, if any. + */ +static void set_current_line_col(__isl_keep isl_stream *s, int *line, int *col) +{ + struct isl_token *tok; + + tok = isl_stream_next_token(s); + if (!tok) + return; + + *line = tok->line; + *col = tok->col; + isl_stream_push_token(s, tok); +} + +/* Push a token encapsulating "pa" onto "s", with the given + * line and column. + */ +static int push_aff(__isl_keep isl_stream *s, int line, int col, + __isl_take isl_pw_aff *pa) +{ + struct isl_token *tok; + + tok = isl_token_new(s->ctx, line, col, 0); + if (!tok) + goto error; + tok->type = ISL_TOKEN_AFF; + tok->u.pwaff = pa; + isl_stream_push_token(s, tok); + + return 0; +error: + isl_pw_aff_free(pa); + return -1; +} + /* Accept an affine expression that may involve ternary operators. * We first read an affine expression. * If it is not followed by a comparison operator, we simply return it. - * Otherwise, we assume the affine epxression is part of the first + * Otherwise, we assume the affine expression is part of the first * argument of a ternary operator and try to parse that. */ -static __isl_give isl_pw_aff *accept_extended_affine(struct isl_stream *s, +static __isl_give isl_pw_aff *accept_extended_affine(__isl_keep isl_stream *s, __isl_take isl_space *dim, struct vars *v, int rational) { isl_space *space; @@ -717,12 +769,7 @@ int line = -1, col = -1; int is_comp; - tok = isl_stream_next_token(s); - if (tok) { - line = tok->line; - col = tok->col; - isl_stream_push_token(s, tok); - } + set_current_line_col(s, &line, &col); pwaff = accept_affine(s, dim, v); if (rational) @@ -739,23 +786,20 @@ if (!is_comp) return pwaff; - tok = isl_token_new(s->ctx, line, col, 0); - if (!tok) - return isl_pw_aff_free(pwaff); - tok->type = ISL_TOKEN_AFF; - tok->u.pwaff = pwaff; - space = isl_pw_aff_get_domain_space(pwaff); cond = isl_map_universe(isl_space_unwrap(space)); - isl_stream_push_token(s, tok); + if (push_aff(s, line, col, pwaff) < 0) + cond = isl_map_free(cond); + if (!cond) + return NULL; cond = read_formula(s, v, cond, rational); return accept_ternary(s, cond, v, rational); } -static __isl_give isl_map *read_var_def(struct isl_stream *s, +static __isl_give isl_map *read_var_def(__isl_keep isl_stream *s, __isl_take isl_map *map, enum isl_dim_type type, struct vars *v, int rational) { @@ -784,7 +828,7 @@ return map; } -static __isl_give isl_pw_aff_list *accept_affine_list(struct isl_stream *s, +static __isl_give isl_pw_aff_list *accept_affine_list(__isl_keep isl_stream *s, __isl_take isl_space *dim, struct vars *v) { isl_pw_aff *pwaff; @@ -823,7 +867,7 @@ return NULL; } -static __isl_give isl_map *read_defined_var_list(struct isl_stream *s, +static __isl_give isl_map *read_defined_var_list(__isl_keep isl_stream *s, struct vars *v, __isl_take isl_map *map, int rational) { struct isl_token *tok; @@ -868,7 +912,7 @@ return NULL; } -static int next_is_tuple(struct isl_stream *s) +static int next_is_tuple(__isl_keep isl_stream *s) { struct isl_token *tok; int is_tuple; @@ -892,21 +936,6 @@ return is_tuple; } -/* Allocate an initial tuple with zero dimensions and an anonymous, - * unstructured space. - * A tuple is represented as an isl_multi_pw_aff. - * The range space is the space of the tuple. - * The domain space is an anonymous space - * with a dimension for each variable in the set of variables in "v". - * If a given dimension is not defined in terms of earlier dimensions in - * the input, then the corresponding isl_pw_aff is set equal to one time - * the variable corresponding to the dimension being defined. - */ -static __isl_give isl_multi_pw_aff *tuple_alloc(struct vars *v) -{ - return isl_multi_pw_aff_alloc(isl_space_alloc(v->ctx, 0, v->n, 0)); -} - /* Is "pa" an expression in term of earlier dimensions? * The alternative is that the dimension is defined to be equal to itself, * meaning that it has a universe domain and an expression that depends @@ -954,151 +983,186 @@ return has_expr; } -/* Add a dimension to the given tuple. - * The dimension is initially undefined, so it is encoded - * as one times itself. - */ -static __isl_give isl_multi_pw_aff *tuple_add_dim( - __isl_take isl_multi_pw_aff *tuple, struct vars *v) -{ - isl_space *space; - isl_aff *aff; - isl_pw_aff *pa; - - tuple = isl_multi_pw_aff_add_dims(tuple, isl_dim_in, 1); - space = isl_multi_pw_aff_get_domain_space(tuple); - aff = isl_aff_zero_on_domain(isl_local_space_from_space(space)); - aff = isl_aff_add_coefficient_si(aff, isl_dim_in, v->n, 1); - pa = isl_pw_aff_from_aff(aff); - tuple = isl_multi_pw_aff_flat_range_product(tuple, - isl_multi_pw_aff_from_pw_aff(pa)); - - return tuple; -} - -/* Set the name of dimension "pos" in "tuple" to "name". +/* Set the name of dimension "pos" in "space" to "name". * During printing, we add primes if the same name appears more than once * to distinguish the occurrences. Here, we remove those primes from "name" * before setting the name of the dimension. */ -static __isl_give isl_multi_pw_aff *tuple_set_dim_name( - __isl_take isl_multi_pw_aff *tuple, int pos, char *name) +static __isl_give isl_space *space_set_dim_name(__isl_take isl_space *space, + int pos, char *name) { char *prime; if (!name) - return tuple; + return space; prime = strchr(name, '\''); if (prime) *prime = '\0'; - tuple = isl_multi_pw_aff_set_dim_name(tuple, isl_dim_set, pos, name); + space = isl_space_set_dim_name(space, isl_dim_out, pos, name); if (prime) *prime = '\''; - return tuple; + return space; +} + +/* Accept a piecewise affine expression. + * + * At the outer level, the piecewise affine expression may be of the form + * + * aff1 : condition1; aff2 : conditions2; ... + * + * or simply + * + * aff + * + * each of the affine expressions may in turn include ternary operators. + * + * There may be parentheses around some subexpression of "aff1" + * around "aff1" itself, around "aff1 : condition1" and/or + * around the entire piecewise affine expression. + * We therefore remove the opening parenthesis (if any) from the stream + * in case the closing parenthesis follows the colon, but if the closing + * parenthesis is the first thing in the stream after the parsed affine + * expression, we push the parsed expression onto the stream and parse + * again in case the parentheses enclose some subexpression of "aff1". + */ +static __isl_give isl_pw_aff *accept_piecewise_affine(__isl_keep isl_stream *s, + __isl_take isl_space *space, struct vars *v, int rational) +{ + isl_pw_aff *res; + isl_space *res_space; + + res_space = isl_space_from_domain(isl_space_copy(space)); + res_space = isl_space_add_dims(res_space, isl_dim_out, 1); + res = isl_pw_aff_empty(res_space); + do { + isl_pw_aff *pa; + int seen_paren; + int line = -1, col = -1; + + set_current_line_col(s, &line, &col); + seen_paren = isl_stream_eat_if_available(s, '('); + if (seen_paren) + pa = accept_piecewise_affine(s, isl_space_copy(space), + v, rational); + else + pa = accept_extended_affine(s, isl_space_copy(space), + v, rational); + if (seen_paren && isl_stream_eat_if_available(s, ')')) { + seen_paren = 0; + if (push_aff(s, line, col, pa) < 0) + goto error; + pa = accept_extended_affine(s, isl_space_copy(space), + v, rational); + } + if (isl_stream_eat_if_available(s, ':')) { + isl_space *dom_space; + isl_set *dom; + + dom_space = isl_pw_aff_get_domain_space(pa); + dom = isl_set_universe(dom_space); + dom = read_formula(s, v, dom, rational); + pa = isl_pw_aff_intersect_domain(pa, dom); + } + + res = isl_pw_aff_union_add(res, pa); + + if (seen_paren && isl_stream_eat(s, ')')) + goto error; + } while (isl_stream_eat_if_available(s, ';')); + + isl_space_free(space); + + return res; +error: + isl_space_free(space); + return isl_pw_aff_free(res); } -/* Read an affine expression from "s" and replace the definition - * of dimension "pos" in "tuple" by this expression. +/* Read an affine expression from "s" for use in read_tuple. * * accept_extended_affine requires a wrapped space as input. - * The domain space of "tuple", on the other hand is an anonymous space, - * so we have to adjust the space of the isl_pw_aff before adding it - * to "tuple". + * read_tuple on the other hand expects each isl_pw_aff + * to have an anonymous space. We therefore adjust the space + * of the isl_pw_aff before returning it. */ -static __isl_give isl_multi_pw_aff *read_tuple_var_def(struct isl_stream *s, - __isl_take isl_multi_pw_aff *tuple, int pos, struct vars *v, - int rational) +static __isl_give isl_pw_aff *read_tuple_var_def(__isl_keep isl_stream *s, + struct vars *v, int rational) { isl_space *space; isl_pw_aff *def; space = isl_space_wrap(isl_space_alloc(s->ctx, 0, v->n, 0)); - def = accept_extended_affine(s, space, v, rational); + + def = accept_piecewise_affine(s, space, v, rational); + space = isl_space_set_alloc(s->ctx, 0, v->n); def = isl_pw_aff_reset_domain_space(def, space); - tuple = isl_multi_pw_aff_set_pw_aff(tuple, pos, def); - return tuple; + return def; } -/* Read a list of variables and/or affine expressions and return the list - * as an isl_multi_pw_aff. +/* Read a list of tuple elements by calling "read_el" on each of them and + * return a space with the same number of set dimensions derived from + * the parameter space "space" and possibly updated by "read_el". * The elements in the list are separated by either "," or "][". * If "comma" is set then only "," is allowed. */ -static __isl_give isl_multi_pw_aff *read_tuple_var_list(struct isl_stream *s, - struct vars *v, int rational, int comma) +static __isl_give isl_space *read_tuple_list(__isl_keep isl_stream *s, + struct vars *v, __isl_take isl_space *space, int rational, int comma, + __isl_give isl_space *(*read_el)(__isl_keep isl_stream *s, + struct vars *v, __isl_take isl_space *space, int rational, + void *user), + void *user) { - int i = 0; - struct isl_token *tok; - isl_multi_pw_aff *res; + if (!space) + return NULL; - res = tuple_alloc(v); + space = isl_space_set_from_params(space); if (isl_stream_next_token_is(s, ']')) - return res; + return space; - while ((tok = next_token(s)) != NULL) { - int new_name = 0; - - res = tuple_add_dim(res, v); + for (;;) { + struct isl_token *tok; - if (tok->type == ISL_TOKEN_IDENT) { - int n = v->n; - int p = vars_pos(v, tok->u.s, -1); - if (p < 0) - goto error; - new_name = p >= n; - } + space = isl_space_add_dims(space, isl_dim_set, 1); - if (tok->type == '*') { - if (vars_add_anon(v) < 0) - goto error; - isl_token_free(tok); - } else if (new_name) { - res = tuple_set_dim_name(res, i, v->v->name); - isl_token_free(tok); - if (isl_stream_eat_if_available(s, '=')) - res = read_tuple_var_def(s, res, i, v, - rational); - } else { - isl_stream_push_token(s, tok); - tok = NULL; - if (vars_add_anon(v) < 0) - goto error; - res = read_tuple_var_def(s, res, i, v, rational); - } + space = read_el(s, v, space, rational, user); + if (!space) + return NULL; tok = isl_stream_next_token(s); if (!comma && tok && tok->type == ']' && isl_stream_next_token_is(s, '[')) { isl_token_free(tok); tok = isl_stream_next_token(s); - } else if (!tok || tok->type != ',') + } else if (!tok || tok->type != ',') { + if (tok) + isl_stream_push_token(s, tok); break; + } isl_token_free(tok); - i++; } - if (tok) - isl_stream_push_token(s, tok); - return res; -error: - isl_token_free(tok); - return isl_multi_pw_aff_free(res); + return space; } -/* Read a tuple and represent it as an isl_multi_pw_aff. See tuple_alloc. +/* Read a tuple space from "s" derived from the parameter space "space". + * Call "read_el" on each element in the tuples. */ -static __isl_give isl_multi_pw_aff *read_tuple(struct isl_stream *s, - struct vars *v, int rational, int comma) +static __isl_give isl_space *read_tuple_space(__isl_keep isl_stream *s, + struct vars *v, __isl_take isl_space *space, int rational, int comma, + __isl_give isl_space *(*read_el)(__isl_keep isl_stream *s, + struct vars *v, __isl_take isl_space *space, int rational, + void *user), + void *user) { struct isl_token *tok; char *name = NULL; - isl_multi_pw_aff *res = NULL; + isl_space *res = NULL; tok = isl_stream_next_token(s); if (!tok) @@ -1113,50 +1177,168 @@ if (isl_stream_eat(s, '[')) goto error; if (next_is_tuple(s)) { - isl_multi_pw_aff *out; - int n; - res = read_tuple(s, v, rational, comma); + isl_space *out; + res = read_tuple_space(s, v, isl_space_copy(space), + rational, comma, read_el, user); if (isl_stream_eat(s, ISL_TOKEN_TO)) goto error; - out = read_tuple(s, v, rational, comma); - n = isl_multi_pw_aff_dim(out, isl_dim_out); - res = isl_multi_pw_aff_add_dims(res, isl_dim_in, n); - res = isl_multi_pw_aff_range_product(res, out); + out = read_tuple_space(s, v, isl_space_copy(space), + rational, comma, read_el, user); + res = isl_space_range_product(res, out); } else - res = read_tuple_var_list(s, v, rational, comma); + res = read_tuple_list(s, v, isl_space_copy(space), + rational, comma, read_el, user); if (isl_stream_eat(s, ']')) goto error; if (name) { - res = isl_multi_pw_aff_set_tuple_name(res, isl_dim_out, name); + res = isl_space_set_tuple_name(res, isl_dim_set, name); free(name); } + isl_space_free(space); return res; error: free(name); - return isl_multi_pw_aff_free(res); + isl_space_free(res); + isl_space_free(space); + return NULL; } -/* Read a tuple from "s" and add it to "map". - * The tuple is initially represented as an isl_multi_pw_aff. +/* Construct an isl_pw_aff defined on a space with v->n variables + * that is equal to the last of those variables. + */ +static __isl_give isl_pw_aff *identity_tuple_el(struct vars *v) +{ + isl_space *space; + isl_aff *aff; + + space = isl_space_set_alloc(v->ctx, 0, v->n); + aff = isl_aff_zero_on_domain(isl_local_space_from_space(space)); + aff = isl_aff_add_coefficient_si(aff, isl_dim_in, v->n - 1, 1); + return isl_pw_aff_from_aff(aff); +} + +/* This function is called for each element in a tuple inside read_tuple. + * Add a new variable to "v" and construct a corresponding isl_pw_aff defined + * over a space containing all variables in "v" defined so far. + * The isl_pw_aff expresses the new variable in terms of earlier variables + * if a definition is provided. Otherwise, it is represented as being + * equal to itself. + * Add the isl_pw_aff to *list. + * If the new variable was named, then adjust "space" accordingly and + * return the updated space. + */ +static __isl_give isl_space *read_tuple_pw_aff_el(__isl_keep isl_stream *s, + struct vars *v, __isl_take isl_space *space, int rational, void *user) +{ + isl_pw_aff_list **list = (isl_pw_aff_list **) user; + isl_pw_aff *pa; + struct isl_token *tok; + int new_name = 0; + + tok = next_token(s); + if (!tok) { + isl_stream_error(s, NULL, "unexpected EOF"); + return isl_space_free(space); + } + + if (tok->type == ISL_TOKEN_IDENT) { + int n = v->n; + int p = vars_pos(v, tok->u.s, -1); + if (p < 0) + goto error; + new_name = p >= n; + } + + if (tok->type == '*') { + if (vars_add_anon(v) < 0) + goto error; + isl_token_free(tok); + pa = identity_tuple_el(v); + } else if (new_name) { + int pos = isl_space_dim(space, isl_dim_out) - 1; + space = space_set_dim_name(space, pos, v->v->name); + isl_token_free(tok); + if (isl_stream_eat_if_available(s, '=')) + pa = read_tuple_var_def(s, v, rational); + else + pa = identity_tuple_el(v); + } else { + isl_stream_push_token(s, tok); + tok = NULL; + if (vars_add_anon(v) < 0) + goto error; + pa = read_tuple_var_def(s, v, rational); + } + + *list = isl_pw_aff_list_add(*list, pa); + if (!*list) + return isl_space_free(space); + + return space; +error: + isl_token_free(tok); + return isl_space_free(space); +} + +/* Read a tuple and represent it as an isl_multi_pw_aff. + * The range space of the isl_multi_pw_aff is the space of the tuple. + * The domain space is an anonymous space + * with a dimension for each variable in the set of variables in "v", + * including the variables in the range. + * If a given dimension is not defined in terms of earlier dimensions in + * the input, then the corresponding isl_pw_aff is set equal to one time + * the variable corresponding to the dimension being defined. + * + * The elements in the tuple are collected in a list by read_tuple_pw_aff_el. + * Each element in this list is defined over a space representing + * the variables defined so far. We need to adjust the earlier + * elements to have as many variables in the domain as the final + * element in the list. + */ +static __isl_give isl_multi_pw_aff *read_tuple(__isl_keep isl_stream *s, + struct vars *v, int rational, int comma) +{ + int i, n; + isl_space *space; + isl_pw_aff_list *list; + + space = isl_space_params_alloc(v->ctx, 0); + list = isl_pw_aff_list_alloc(s->ctx, 0); + space = read_tuple_space(s, v, space, rational, comma, + &read_tuple_pw_aff_el, &list); + n = isl_space_dim(space, isl_dim_set); + for (i = 0; i + 1 < n; ++i) { + isl_pw_aff *pa; + + pa = isl_pw_aff_list_get_pw_aff(list, i); + pa = isl_pw_aff_add_dims(pa, isl_dim_in, n - (i + 1)); + list = isl_pw_aff_list_set_pw_aff(list, i, pa); + } + + space = isl_space_from_range(space); + space = isl_space_add_dims(space, isl_dim_in, v->n); + return isl_multi_pw_aff_from_pw_aff_list(space, list); +} + +/* Add the tuple represented by the isl_multi_pw_aff "tuple" to "map". * We first create the appropriate space in "map" based on the range * space of this isl_multi_pw_aff. Then, we add equalities based * on the affine expressions. These live in an anonymous space, * however, so we first need to reset the space to that of "map". */ -static __isl_give isl_map *read_map_tuple(struct isl_stream *s, +static __isl_give isl_map *map_from_tuple(__isl_take isl_multi_pw_aff *tuple, __isl_take isl_map *map, enum isl_dim_type type, struct vars *v, - int rational, int comma) + int rational) { int i, n; - isl_multi_pw_aff *tuple; + isl_ctx *ctx; isl_space *space = NULL; - tuple = read_tuple(s, v, rational, comma); - if (!tuple) + if (!map || !tuple) goto error; - + ctx = isl_multi_pw_aff_get_ctx(tuple); n = isl_multi_pw_aff_dim(tuple, isl_dim_out); space = isl_space_range(isl_multi_pw_aff_get_space(tuple)); if (!space) @@ -1165,7 +1347,7 @@ if (type == isl_dim_param) { if (isl_space_has_tuple_name(space, isl_dim_set) || isl_space_is_wrapping(space)) { - isl_die(s->ctx, isl_error_invalid, + isl_die(ctx, isl_error_invalid, "parameter tuples cannot be named or nested", goto error); } @@ -1173,7 +1355,7 @@ for (i = 0; i < n; ++i) { isl_id *id; if (!isl_space_has_dim_name(space, isl_dim_set, i)) - isl_die(s->ctx, isl_error_invalid, + isl_die(ctx, isl_error_invalid, "parameters must be named", goto error); id = isl_space_get_dim_id(space, isl_dim_set, i); @@ -1227,6 +1409,23 @@ return NULL; } +/* Read a tuple from "s" and add it to "map". + * The tuple is initially represented as an isl_multi_pw_aff and + * then added to "map". + */ +static __isl_give isl_map *read_map_tuple(__isl_keep isl_stream *s, + __isl_take isl_map *map, enum isl_dim_type type, struct vars *v, + int rational, int comma) +{ + isl_multi_pw_aff *tuple; + + tuple = read_tuple(s, v, rational, comma); + if (!tuple) + return isl_map_free(map); + + return map_from_tuple(tuple, map, type, v, rational); +} + static __isl_give isl_set *construct_constraints( __isl_take isl_set *set, int type, __isl_keep isl_pw_aff_list *left, __isl_keep isl_pw_aff_list *right, @@ -1256,7 +1455,7 @@ return isl_set_intersect(set, cond); } -static __isl_give isl_map *add_constraint(struct isl_stream *s, +static __isl_give isl_map *add_constraint(__isl_keep isl_stream *s, struct vars *v, __isl_take isl_map *map, int rational) { struct isl_token *tok = NULL; @@ -1305,7 +1504,7 @@ return NULL; } -static __isl_give isl_map *read_exists(struct isl_stream *s, +static __isl_give isl_map *read_exists(__isl_keep isl_stream *s, struct vars *v, __isl_take isl_map *map, int rational) { int n = v->n; @@ -1345,7 +1544,7 @@ * Otherwise, we assume that the affine expression is the * start of a condition and continue parsing. */ -static int resolve_paren_expr(struct isl_stream *s, +static int resolve_paren_expr(__isl_keep isl_stream *s, struct vars *v, __isl_take isl_map *map, int rational) { struct isl_token *tok, *tok2; @@ -1417,7 +1616,7 @@ return -1; } -static __isl_give isl_map *read_conjunct(struct isl_stream *s, +static __isl_give isl_map *read_conjunct(__isl_keep isl_stream *s, struct vars *v, __isl_take isl_map *map, int rational) { if (isl_stream_next_token_is(s, '(')) @@ -1453,7 +1652,7 @@ return NULL; } -static __isl_give isl_map *read_conjuncts(struct isl_stream *s, +static __isl_give isl_map *read_conjuncts(__isl_keep isl_stream *s, struct vars *v, __isl_take isl_map *map, int rational) { isl_map *res; @@ -1479,7 +1678,7 @@ return res; } -static struct isl_map *read_disjuncts(struct isl_stream *s, +static struct isl_map *read_disjuncts(__isl_keep isl_stream *s, struct vars *v, __isl_take isl_map *map, int rational) { isl_map *res; @@ -1523,7 +1722,7 @@ * * (map \setminus { [..] : a}) \cup (map \cap { [..] : b }) */ -static __isl_give isl_map *read_formula(struct isl_stream *s, +static __isl_give isl_map *read_formula(__isl_keep isl_stream *s, struct vars *v, __isl_take isl_map *map, int rational) { isl_map *res; @@ -1566,22 +1765,17 @@ } static __isl_give isl_basic_map *basic_map_read_polylib_constraint( - struct isl_stream *s, __isl_take isl_basic_map *bmap) + __isl_keep isl_stream *s, __isl_take isl_basic_map *bmap) { int j; struct isl_token *tok; int type; int k; isl_int *c; - unsigned nparam; - unsigned dim; if (!bmap) return NULL; - nparam = isl_basic_map_dim(bmap, isl_dim_param); - dim = isl_basic_map_dim(bmap, isl_dim_out); - tok = isl_stream_next_token(s); if (!tok || tok->type != ISL_TOKEN_VALUE) { isl_stream_error(s, tok, "expecting coefficient"); @@ -1635,7 +1829,8 @@ return NULL; } -static __isl_give isl_basic_map *basic_map_read_polylib(struct isl_stream *s) +static __isl_give isl_basic_map *basic_map_read_polylib( + __isl_keep isl_stream *s) { int i; struct isl_token *tok; @@ -1751,7 +1946,7 @@ return NULL; } -static struct isl_map *map_read_polylib(struct isl_stream *s) +static struct isl_map *map_read_polylib(__isl_keep isl_stream *s) { struct isl_token *tok; struct isl_token *tok2; @@ -1789,7 +1984,7 @@ return map; } -static int optional_power(struct isl_stream *s) +static int optional_power(__isl_keep isl_stream *s) { int pow; struct isl_token *tok; @@ -1814,10 +2009,10 @@ return pow; } -static __isl_give isl_pw_qpolynomial *read_term(struct isl_stream *s, +static __isl_give isl_pw_qpolynomial *read_term(__isl_keep isl_stream *s, __isl_keep isl_map *map, struct vars *v); -static __isl_give isl_pw_qpolynomial *read_factor(struct isl_stream *s, +static __isl_give isl_pw_qpolynomial *read_factor(__isl_keep isl_stream *s, __isl_keep isl_map *map, struct vars *v) { isl_pw_qpolynomial *pwqp; @@ -1925,7 +2120,7 @@ return NULL; } -static __isl_give isl_pw_qpolynomial *read_term(struct isl_stream *s, +static __isl_give isl_pw_qpolynomial *read_term(__isl_keep isl_stream *s, __isl_keep isl_map *map, struct vars *v) { struct isl_token *tok; @@ -1966,7 +2161,7 @@ return pwqp; } -static __isl_give isl_map *read_optional_formula(struct isl_stream *s, +static __isl_give isl_map *read_optional_formula(__isl_keep isl_stream *s, __isl_take isl_map *map, struct vars *v, int rational) { struct isl_token *tok; @@ -1989,7 +2184,7 @@ return NULL; } -static struct isl_obj obj_read_poly(struct isl_stream *s, +static struct isl_obj obj_read_poly(__isl_keep isl_stream *s, __isl_take isl_map *map, struct vars *v, int n) { struct isl_obj obj = { isl_obj_pw_qpolynomial, NULL }; @@ -2008,7 +2203,7 @@ return obj; } -static struct isl_obj obj_read_poly_or_fold(struct isl_stream *s, +static struct isl_obj obj_read_poly_or_fold(__isl_keep isl_stream *s, __isl_take isl_set *set, struct vars *v, int n) { struct isl_obj obj = { isl_obj_pw_qpolynomial_fold, NULL }; @@ -2049,7 +2244,7 @@ return obj; } -static int is_rational(struct isl_stream *s) +static int is_rational(__isl_keep isl_stream *s) { struct isl_token *tok; @@ -2067,7 +2262,7 @@ return 0; } -static struct isl_obj obj_read_body(struct isl_stream *s, +static struct isl_obj obj_read_body(__isl_keep isl_stream *s, __isl_take isl_map *map, struct vars *v) { struct isl_token *tok; @@ -2144,47 +2339,54 @@ return obj; } -static struct isl_obj obj_add(struct isl_ctx *ctx, +static struct isl_obj obj_add(__isl_keep isl_stream *s, struct isl_obj obj1, struct isl_obj obj2) { if (obj1.type == isl_obj_set && obj2.type == isl_obj_union_set) - obj1 = to_union(ctx, obj1); + obj1 = to_union(s->ctx, obj1); if (obj1.type == isl_obj_union_set && obj2.type == isl_obj_set) - obj2 = to_union(ctx, obj2); + obj2 = to_union(s->ctx, obj2); if (obj1.type == isl_obj_map && obj2.type == isl_obj_union_map) - obj1 = to_union(ctx, obj1); + obj1 = to_union(s->ctx, obj1); if (obj1.type == isl_obj_union_map && obj2.type == isl_obj_map) - obj2 = to_union(ctx, obj2); + obj2 = to_union(s->ctx, obj2); if (obj1.type == isl_obj_pw_qpolynomial && obj2.type == isl_obj_union_pw_qpolynomial) - obj1 = to_union(ctx, obj1); + obj1 = to_union(s->ctx, obj1); if (obj1.type == isl_obj_union_pw_qpolynomial && obj2.type == isl_obj_pw_qpolynomial) - obj2 = to_union(ctx, obj2); + obj2 = to_union(s->ctx, obj2); if (obj1.type == isl_obj_pw_qpolynomial_fold && obj2.type == isl_obj_union_pw_qpolynomial_fold) - obj1 = to_union(ctx, obj1); + obj1 = to_union(s->ctx, obj1); if (obj1.type == isl_obj_union_pw_qpolynomial_fold && obj2.type == isl_obj_pw_qpolynomial_fold) - obj2 = to_union(ctx, obj2); - isl_assert(ctx, obj1.type == obj2.type, goto error); + obj2 = to_union(s->ctx, obj2); + if (obj1.type != obj2.type) { + isl_stream_error(s, NULL, + "attempt to combine incompatible objects"); + goto error; + } + if (!obj1.type->add) + isl_die(s->ctx, isl_error_internal, + "combination not supported on object type", goto error); if (obj1.type == isl_obj_map && !isl_map_has_equal_space(obj1.v, obj2.v)) { - obj1 = to_union(ctx, obj1); - obj2 = to_union(ctx, obj2); + obj1 = to_union(s->ctx, obj1); + obj2 = to_union(s->ctx, obj2); } if (obj1.type == isl_obj_set && !isl_set_has_equal_space(obj1.v, obj2.v)) { - obj1 = to_union(ctx, obj1); - obj2 = to_union(ctx, obj2); + obj1 = to_union(s->ctx, obj1); + obj2 = to_union(s->ctx, obj2); } if (obj1.type == isl_obj_pw_qpolynomial && !isl_pw_qpolynomial_has_equal_space(obj1.v, obj2.v)) { - obj1 = to_union(ctx, obj1); - obj2 = to_union(ctx, obj2); + obj1 = to_union(s->ctx, obj1); + obj2 = to_union(s->ctx, obj2); } if (obj1.type == isl_obj_pw_qpolynomial_fold && !isl_pw_qpolynomial_fold_has_equal_space(obj1.v, obj2.v)) { - obj1 = to_union(ctx, obj1); - obj2 = to_union(ctx, obj2); + obj1 = to_union(s->ctx, obj1); + obj2 = to_union(s->ctx, obj2); } obj1.v = obj1.type->add(obj1.v, obj2.v); return obj1; @@ -2196,13 +2398,80 @@ return obj1; } -static struct isl_obj obj_read(struct isl_stream *s) +/* Are the first two tokens on "s", "domain" (either as a string + * or as an identifier) followed by ":"? + */ +static int next_is_domain_colon(__isl_keep isl_stream *s) +{ + struct isl_token *tok; + char *name; + int res; + + tok = isl_stream_next_token(s); + if (!tok) + return 0; + if (tok->type != ISL_TOKEN_IDENT && tok->type != ISL_TOKEN_STRING) { + isl_stream_push_token(s, tok); + return 0; + } + + name = isl_token_get_str(s->ctx, tok); + res = !strcmp(name, "domain") && isl_stream_next_token_is(s, ':'); + free(name); + + isl_stream_push_token(s, tok); + + return res; +} + +/* Do the first tokens on "s" look like a schedule? + * + * The root of a schedule is always a domain node, so the first thing + * we expect in the stream is a domain key, i.e., "domain" followed + * by ":". If the schedule was printed in YAML flow style, then + * we additionally expect a "{" to open the outer mapping. + */ +static int next_is_schedule(__isl_keep isl_stream *s) +{ + struct isl_token *tok; + int is_schedule; + + tok = isl_stream_next_token(s); + if (!tok) + return 0; + if (tok->type != '{') { + isl_stream_push_token(s, tok); + return next_is_domain_colon(s); + } + + is_schedule = next_is_domain_colon(s); + isl_stream_push_token(s, tok); + + return is_schedule; +} + +/* Read an isl_schedule from "s" and store it in an isl_obj. + */ +static struct isl_obj schedule_read(__isl_keep isl_stream *s) +{ + struct isl_obj obj; + + obj.type = isl_obj_schedule; + obj.v = isl_stream_read_schedule(s); + + return obj; +} + +static struct isl_obj obj_read(__isl_keep isl_stream *s) { isl_map *map = NULL; struct isl_token *tok; struct vars *v = NULL; struct isl_obj obj = { isl_obj_set, NULL }; + if (next_is_schedule(s)) + return schedule_read(s); + tok = next_token(s); if (!tok) { isl_stream_error(s, NULL, "unexpected EOF"); @@ -2217,8 +2486,8 @@ isl_int_is_neg(tok2->u.v)) { if (tok2) isl_stream_push_token(s, tok2); - obj.type = isl_obj_int; - obj.v = isl_int_obj_alloc(s->ctx, tok->u.v); + obj.type = isl_obj_val; + obj.v = isl_val_int_from_isl_int(s->ctx, tok->u.v); isl_token_free(tok); return obj; } @@ -2291,7 +2560,7 @@ if (!obj.v) obj = o; else { - obj = obj_add(s->ctx, obj, o); + obj = obj_add(s, obj, o); if (obj.type == isl_obj_none || !obj.v) goto error; } @@ -2327,12 +2596,12 @@ return obj; } -struct isl_obj isl_stream_read_obj(struct isl_stream *s) +struct isl_obj isl_stream_read_obj(__isl_keep isl_stream *s) { return obj_read(s); } -__isl_give isl_map *isl_stream_read_map(struct isl_stream *s) +__isl_give isl_map *isl_stream_read_map(__isl_keep isl_stream *s) { struct isl_obj obj; @@ -2350,7 +2619,7 @@ return NULL; } -__isl_give isl_set *isl_stream_read_set(struct isl_stream *s) +__isl_give isl_set *isl_stream_read_set(__isl_keep isl_stream *s) { struct isl_obj obj; @@ -2369,7 +2638,7 @@ return NULL; } -__isl_give isl_union_map *isl_stream_read_union_map(struct isl_stream *s) +__isl_give isl_union_map *isl_stream_read_union_map(__isl_keep isl_stream *s) { struct isl_obj obj; @@ -2394,7 +2663,7 @@ return NULL; } -__isl_give isl_union_set *isl_stream_read_union_set(struct isl_stream *s) +__isl_give isl_union_set *isl_stream_read_union_set(__isl_keep isl_stream *s) { struct isl_obj obj; @@ -2412,21 +2681,27 @@ return NULL; } -static __isl_give isl_basic_map *basic_map_read(struct isl_stream *s) +static __isl_give isl_basic_map *basic_map_read(__isl_keep isl_stream *s) { struct isl_obj obj; struct isl_map *map; struct isl_basic_map *bmap; obj = obj_read(s); + if (obj.v && (obj.type != isl_obj_map && obj.type != isl_obj_set)) + isl_die(s->ctx, isl_error_invalid, "not a (basic) set or map", + goto error); map = obj.v; if (!map) return NULL; - isl_assert(map->ctx, map->n <= 1, goto error); + if (map->n > 1) + isl_die(s->ctx, isl_error_invalid, + "set or map description involves " + "more than one disjunct", goto error); if (map->n == 0) - bmap = isl_basic_map_empty_like_map(map); + bmap = isl_basic_map_empty(isl_map_get_space(map)); else bmap = isl_basic_map_copy(map->p[0]); @@ -2434,11 +2709,11 @@ return bmap; error: - isl_map_free(map); + obj.type->free(obj.v); return NULL; } -static __isl_give isl_basic_set *basic_set_read(struct isl_stream *s) +static __isl_give isl_basic_set *basic_set_read(__isl_keep isl_stream *s) { isl_basic_map *bmap; bmap = basic_map_read(s); @@ -2457,7 +2732,7 @@ FILE *input) { struct isl_basic_map *bmap; - struct isl_stream *s = isl_stream_new_file(ctx, input); + isl_stream *s = isl_stream_new_file(ctx, input); if (!s) return NULL; bmap = basic_map_read(s); @@ -2469,7 +2744,7 @@ FILE *input) { isl_basic_set *bset; - struct isl_stream *s = isl_stream_new_file(ctx, input); + isl_stream *s = isl_stream_new_file(ctx, input); if (!s) return NULL; bset = basic_set_read(s); @@ -2481,7 +2756,7 @@ const char *str) { struct isl_basic_map *bmap; - struct isl_stream *s = isl_stream_new_str(ctx, str); + isl_stream *s = isl_stream_new_str(ctx, str); if (!s) return NULL; bmap = basic_map_read(s); @@ -2493,7 +2768,7 @@ const char *str) { isl_basic_set *bset; - struct isl_stream *s = isl_stream_new_str(ctx, str); + isl_stream *s = isl_stream_new_str(ctx, str); if (!s) return NULL; bset = basic_set_read(s); @@ -2505,7 +2780,7 @@ FILE *input) { struct isl_map *map; - struct isl_stream *s = isl_stream_new_file(ctx, input); + isl_stream *s = isl_stream_new_file(ctx, input); if (!s) return NULL; map = isl_stream_read_map(s); @@ -2517,7 +2792,7 @@ const char *str) { struct isl_map *map; - struct isl_stream *s = isl_stream_new_str(ctx, str); + isl_stream *s = isl_stream_new_str(ctx, str); if (!s) return NULL; map = isl_stream_read_map(s); @@ -2529,7 +2804,7 @@ FILE *input) { isl_set *set; - struct isl_stream *s = isl_stream_new_file(ctx, input); + isl_stream *s = isl_stream_new_file(ctx, input); if (!s) return NULL; set = isl_stream_read_set(s); @@ -2541,7 +2816,7 @@ const char *str) { isl_set *set; - struct isl_stream *s = isl_stream_new_str(ctx, str); + isl_stream *s = isl_stream_new_str(ctx, str); if (!s) return NULL; set = isl_stream_read_set(s); @@ -2553,7 +2828,7 @@ FILE *input) { isl_union_map *umap; - struct isl_stream *s = isl_stream_new_file(ctx, input); + isl_stream *s = isl_stream_new_file(ctx, input); if (!s) return NULL; umap = isl_stream_read_union_map(s); @@ -2565,7 +2840,7 @@ const char *str) { isl_union_map *umap; - struct isl_stream *s = isl_stream_new_str(ctx, str); + isl_stream *s = isl_stream_new_str(ctx, str); if (!s) return NULL; umap = isl_stream_read_union_map(s); @@ -2577,7 +2852,7 @@ FILE *input) { isl_union_set *uset; - struct isl_stream *s = isl_stream_new_file(ctx, input); + isl_stream *s = isl_stream_new_file(ctx, input); if (!s) return NULL; uset = isl_stream_read_union_set(s); @@ -2589,7 +2864,7 @@ const char *str) { isl_union_set *uset; - struct isl_stream *s = isl_stream_new_str(ctx, str); + isl_stream *s = isl_stream_new_str(ctx, str); if (!s) return NULL; uset = isl_stream_read_union_set(s); @@ -2597,7 +2872,7 @@ return uset; } -static __isl_give isl_vec *isl_vec_read_polylib(struct isl_stream *s) +static __isl_give isl_vec *isl_vec_read_polylib(__isl_keep isl_stream *s) { struct isl_vec *vec = NULL; struct isl_token *tok; @@ -2632,7 +2907,7 @@ return NULL; } -static __isl_give isl_vec *vec_read(struct isl_stream *s) +static __isl_give isl_vec *vec_read(__isl_keep isl_stream *s) { return isl_vec_read_polylib(s); } @@ -2640,7 +2915,7 @@ __isl_give isl_vec *isl_vec_read_from_file(isl_ctx *ctx, FILE *input) { isl_vec *v; - struct isl_stream *s = isl_stream_new_file(ctx, input); + isl_stream *s = isl_stream_new_file(ctx, input); if (!s) return NULL; v = vec_read(s); @@ -2649,7 +2924,7 @@ } __isl_give isl_pw_qpolynomial *isl_stream_read_pw_qpolynomial( - struct isl_stream *s) + __isl_keep isl_stream *s) { struct isl_obj obj; @@ -2668,7 +2943,7 @@ const char *str) { isl_pw_qpolynomial *pwqp; - struct isl_stream *s = isl_stream_new_str(ctx, str); + isl_stream *s = isl_stream_new_str(ctx, str); if (!s) return NULL; pwqp = isl_stream_read_pw_qpolynomial(s); @@ -2680,7 +2955,7 @@ FILE *input) { isl_pw_qpolynomial *pwqp; - struct isl_stream *s = isl_stream_new_file(ctx, input); + isl_stream *s = isl_stream_new_file(ctx, input); if (!s) return NULL; pwqp = isl_stream_read_pw_qpolynomial(s); @@ -2690,7 +2965,7 @@ /* Is the next token an identifer not in "v"? */ -static int next_is_fresh_ident(struct isl_stream *s, struct vars *v) +static int next_is_fresh_ident(__isl_keep isl_stream *s, struct vars *v) { int n = v->n; int fresh; @@ -2717,7 +2992,7 @@ * or a new identifier, we again assume it's the domain. * Otherwise, we assume we are reading an affine expression. */ -static __isl_give isl_set *read_aff_domain(struct isl_stream *s, +static __isl_give isl_set *read_aff_domain(__isl_keep isl_stream *s, __isl_take isl_set *dom, struct vars *v) { struct isl_token *tok; @@ -2747,7 +3022,7 @@ /* Read an affine expression from "s". */ -__isl_give isl_aff *isl_stream_read_aff(struct isl_stream *s) +__isl_give isl_aff *isl_stream_read_aff(__isl_keep isl_stream *s) { isl_aff *aff; isl_multi_aff *ma; @@ -2770,7 +3045,7 @@ /* Read a piecewise affine expression from "s" with domain (space) "dom". */ -static __isl_give isl_pw_aff *read_pw_aff_with_dom(struct isl_stream *s, +static __isl_give isl_pw_aff *read_pw_aff_with_dom(__isl_keep isl_stream *s, __isl_take isl_set *dom, struct vars *v) { isl_pw_aff *pwaff = NULL; @@ -2796,7 +3071,7 @@ return NULL; } -__isl_give isl_pw_aff *isl_stream_read_pw_aff(struct isl_stream *s) +__isl_give isl_pw_aff *isl_stream_read_pw_aff(__isl_keep isl_stream *s) { struct vars *v; isl_set *dom = NULL; @@ -2849,7 +3124,7 @@ __isl_give isl_aff *isl_aff_read_from_str(isl_ctx *ctx, const char *str) { isl_aff *aff; - struct isl_stream *s = isl_stream_new_str(ctx, str); + isl_stream *s = isl_stream_new_str(ctx, str); if (!s) return NULL; aff = isl_stream_read_aff(s); @@ -2860,7 +3135,7 @@ __isl_give isl_pw_aff *isl_pw_aff_read_from_str(isl_ctx *ctx, const char *str) { isl_pw_aff *pa; - struct isl_stream *s = isl_stream_new_str(ctx, str); + isl_stream *s = isl_stream_new_str(ctx, str); if (!s) return NULL; pa = isl_stream_read_pw_aff(s); @@ -2874,7 +3149,8 @@ * It would be more efficient if we were to construct the isl_pw_multi_aff * directly. */ -__isl_give isl_pw_multi_aff *isl_stream_read_pw_multi_aff(struct isl_stream *s) +__isl_give isl_pw_multi_aff *isl_stream_read_pw_multi_aff( + __isl_keep isl_stream *s) { struct isl_obj obj; @@ -2896,7 +3172,7 @@ const char *str) { isl_pw_multi_aff *pma; - struct isl_stream *s = isl_stream_new_str(ctx, str); + isl_stream *s = isl_stream_new_str(ctx, str); if (!s) return NULL; pma = isl_stream_read_pw_multi_aff(s); @@ -2911,7 +3187,7 @@ * the isl_union_pw_multi_aff directly. */ __isl_give isl_union_pw_multi_aff *isl_stream_read_union_pw_multi_aff( - struct isl_stream *s) + __isl_keep isl_stream *s) { struct isl_obj obj; @@ -2937,7 +3213,7 @@ isl_ctx *ctx, const char *str) { isl_union_pw_multi_aff *upma; - struct isl_stream *s = isl_stream_new_str(ctx, str); + isl_stream *s = isl_stream_new_str(ctx, str); if (!s) return NULL; upma = isl_stream_read_union_pw_multi_aff(s); @@ -2971,15 +3247,95 @@ return NULL; } +/* This function is called for each element in a tuple inside + * isl_stream_read_multi_val. + * Read an isl_val from "s" and add it to *list. + */ +static __isl_give isl_space *read_val_el(__isl_keep isl_stream *s, + struct vars *v, __isl_take isl_space *space, int rational, void *user) +{ + isl_val_list **list = (isl_val_list **) user; + isl_val *val; + + val = isl_stream_read_val(s); + *list = isl_val_list_add(*list, val); + if (!*list) + return isl_space_free(space); + + return space; +} + +/* Read an isl_multi_val from "s". + * + * We first read a tuple space, collecting the element values in a list. + * Then we create an isl_multi_val from the space and the isl_val_list. + */ +__isl_give isl_multi_val *isl_stream_read_multi_val(__isl_keep isl_stream *s) +{ + struct vars *v; + isl_set *dom = NULL; + isl_space *space; + isl_multi_val *mv = NULL; + isl_val_list *list; + + v = vars_new(s->ctx); + if (!v) + return NULL; + + dom = isl_set_universe(isl_space_params_alloc(s->ctx, 0)); + if (next_is_tuple(s)) { + dom = read_map_tuple(s, dom, isl_dim_param, v, 1, 0); + if (isl_stream_eat(s, ISL_TOKEN_TO)) + goto error; + } + if (!isl_set_plain_is_universe(dom)) + isl_die(s->ctx, isl_error_invalid, + "expecting universe parameter domain", goto error); + if (isl_stream_eat(s, '{')) + goto error; + + space = isl_set_get_space(dom); + + list = isl_val_list_alloc(s->ctx, 0); + space = read_tuple_space(s, v, space, 1, 0, &read_val_el, &list); + mv = isl_multi_val_from_val_list(space, list); + + if (isl_stream_eat(s, '}')) + goto error; + + vars_free(v); + isl_set_free(dom); + return mv; +error: + vars_free(v); + isl_set_free(dom); + isl_multi_val_free(mv); + return NULL; +} + +/* Read an isl_multi_val from "str". + */ +__isl_give isl_multi_val *isl_multi_val_read_from_str(isl_ctx *ctx, + const char *str) +{ + isl_multi_val *mv; + isl_stream *s = isl_stream_new_str(ctx, str); + if (!s) + return NULL; + mv = isl_stream_read_multi_val(s); + isl_stream_free(s); + return mv; +} + /* Read a multi-affine expression from "s". - * If the multi-affine expression has a domain, then then tuple + * If the multi-affine expression has a domain, then the tuple * representing this domain cannot involve any affine expressions. * The tuple representing the actual expressions needs to consist * of only affine expressions. Moreover, these expressions can * only depend on parameters and input dimensions and not on other * output dimensions. */ -__isl_give isl_multi_aff *isl_stream_read_multi_aff(struct isl_stream *s) +__isl_give isl_multi_aff *isl_stream_read_multi_aff(__isl_keep isl_stream *s) { struct vars *v; isl_set *dom = NULL; @@ -3075,7 +3431,7 @@ const char *str) { isl_multi_aff *maff; - struct isl_stream *s = isl_stream_new_str(ctx, str); + isl_stream *s = isl_stream_new_str(ctx, str); if (!s) return NULL; maff = isl_stream_read_multi_aff(s); @@ -3083,8 +3439,317 @@ return maff; } +/* Read an isl_multi_pw_aff from "s". + * + * The input format is similar to that of map, except that any conditions + * on the domains should be specified inside the tuple since each + * piecewise affine expression may have a different domain. + * + * Since we do not know in advance if the isl_multi_pw_aff lives + * in a set or a map space, we first read the first tuple and check + * if it is followed by a "->". If so, we convert the tuple into + * the domain of the isl_multi_pw_aff and read in the next tuple. + * This tuple (or the first tuple if it was not followed by a "->") + * is then converted into the isl_multi_pw_aff. + * + * Note that the function read_tuple accepts tuples where some output or + * set dimensions are defined in terms of other output or set dimensions + * since this function is also used to read maps. As a special case, + * read_tuple also accept dimensions that are defined in terms of themselves + * (i.e., that are not defined). + * These cases are not allowed when reading am isl_multi_pw_aff so we check + * that the definition of the output/set dimensions does not involve any + * output/set dimensions. + * We then drop the output dimensions from the domain of the result + * of read_tuple (which is of the form [input, output] -> [output], + * with anonymous domain) and reset the space. + */ +__isl_give isl_multi_pw_aff *isl_stream_read_multi_pw_aff( + __isl_keep isl_stream *s) +{ + struct vars *v; + isl_set *dom = NULL; + isl_multi_pw_aff *tuple = NULL; + int dim, i, n; + isl_space *space, *dom_space; + isl_multi_pw_aff *mpa = NULL; + + v = vars_new(s->ctx); + if (!v) + return NULL; + + dom = isl_set_universe(isl_space_params_alloc(s->ctx, 0)); + if (next_is_tuple(s)) { + dom = read_map_tuple(s, dom, isl_dim_param, v, 1, 0); + if (isl_stream_eat(s, ISL_TOKEN_TO)) + goto error; + } + if (isl_stream_eat(s, '{')) + goto error; + + tuple = read_tuple(s, v, 0, 0); + if (!tuple) + goto error; + if (isl_stream_eat_if_available(s, ISL_TOKEN_TO)) { + isl_map *map = map_from_tuple(tuple, dom, isl_dim_in, v, 0); + dom = isl_map_domain(map); + tuple = read_tuple(s, v, 0, 0); + if (!tuple) + goto error; + } + + if (isl_stream_eat(s, '}')) + goto error; + + n = isl_multi_pw_aff_dim(tuple, isl_dim_out); + dim = isl_set_dim(dom, isl_dim_all); + dom_space = isl_set_get_space(dom); + space = isl_space_range(isl_multi_pw_aff_get_space(tuple)); + space = isl_space_align_params(space, isl_space_copy(dom_space)); + if (!isl_space_is_params(dom_space)) + space = isl_space_map_from_domain_and_range( + isl_space_copy(dom_space), space); + isl_space_free(dom_space); + mpa = isl_multi_pw_aff_alloc(space); + + for (i = 0; i < n; ++i) { + isl_pw_aff *pa; + pa = isl_multi_pw_aff_get_pw_aff(tuple, i); + if (!pa) + goto error; + if (isl_pw_aff_involves_dims(pa, isl_dim_in, dim, i + 1)) { + isl_pw_aff_free(pa); + isl_die(s->ctx, isl_error_invalid, + "not an affine expression", goto error); + } + pa = isl_pw_aff_drop_dims(pa, isl_dim_in, dim, n); + space = isl_multi_pw_aff_get_domain_space(mpa); + pa = isl_pw_aff_reset_domain_space(pa, space); + mpa = isl_multi_pw_aff_set_pw_aff(mpa, i, pa); + } + + isl_multi_pw_aff_free(tuple); + vars_free(v); + mpa = isl_multi_pw_aff_intersect_domain(mpa, dom); + return mpa; +error: + isl_multi_pw_aff_free(tuple); + vars_free(v); + isl_set_free(dom); + isl_multi_pw_aff_free(mpa); + return NULL; +} + +/* Read an isl_multi_pw_aff from "str". + */ +__isl_give isl_multi_pw_aff *isl_multi_pw_aff_read_from_str(isl_ctx *ctx, + const char *str) +{ + isl_multi_pw_aff *mpa; + isl_stream *s = isl_stream_new_str(ctx, str); + if (!s) + return NULL; + mpa = isl_stream_read_multi_pw_aff(s); + isl_stream_free(s); + return mpa; +} + +/* Read the body of an isl_union_pw_aff from "s" with parameter domain "dom". + */ +static __isl_give isl_union_pw_aff *read_union_pw_aff_with_dom( + __isl_keep isl_stream *s, __isl_take isl_set *dom, struct vars *v) +{ + isl_pw_aff *pa; + isl_union_pw_aff *upa = NULL; + isl_set *aff_dom; + int n; + + n = v->n; + aff_dom = read_aff_domain(s, isl_set_copy(dom), v); + pa = read_pw_aff_with_dom(s, aff_dom, v); + vars_drop(v, v->n - n); + + upa = isl_union_pw_aff_from_pw_aff(pa); + + while (isl_stream_eat_if_available(s, ';')) { + isl_pw_aff *pa_i; + isl_union_pw_aff *upa_i; + + n = v->n; + aff_dom = read_aff_domain(s, isl_set_copy(dom), v); + pa_i = read_pw_aff_with_dom(s, aff_dom, v); + vars_drop(v, v->n - n); + + upa_i = isl_union_pw_aff_from_pw_aff(pa_i); + upa = isl_union_pw_aff_union_add(upa, upa_i); + } + + isl_set_free(dom); + return upa; +} + +/* This function is called for each element in a tuple inside + * isl_stream_read_multi_union_pw_aff. + * + * Read a '{', the union piecewise affine expression body and a '}' and + * add the isl_union_pw_aff to *list. + */ +static __isl_give isl_space *read_union_pw_aff_el(__isl_keep isl_stream *s, + struct vars *v, __isl_take isl_space *space, int rational, void *user) +{ + isl_set *dom; + isl_union_pw_aff *upa; + isl_union_pw_aff_list **list = (isl_union_pw_aff_list **) user; + + dom = isl_set_universe(isl_space_params(isl_space_copy(space))); + if (isl_stream_eat(s, '{')) + goto error; + upa = read_union_pw_aff_with_dom(s, dom, v); + *list = isl_union_pw_aff_list_add(*list, upa); + if (isl_stream_eat(s, '}')) + return isl_space_free(space); + if (!*list) + return isl_space_free(space); + return space; +error: + isl_set_free(dom); + return isl_space_free(space); +} + +/* Do the next tokens in "s" correspond to an empty tuple? + * In particular, does the stream start with a '[', followed by a ']', + * not followed by a "->"? + */ +static int next_is_empty_tuple(__isl_keep isl_stream *s) +{ + struct isl_token *tok, *tok2, *tok3; + int is_empty_tuple = 0; + + tok = isl_stream_next_token(s); + if (!tok) + return 0; + if (tok->type != '[') { + isl_stream_push_token(s, tok); + return 0; + } + + tok2 = isl_stream_next_token(s); + if (tok2 && tok2->type == ']') { + tok3 = isl_stream_next_token(s); + is_empty_tuple = !tok || tok->type != ISL_TOKEN_TO; + if (tok3) + isl_stream_push_token(s, tok3); + } + if (tok2) + isl_stream_push_token(s, tok2); + isl_stream_push_token(s, tok); + + return is_empty_tuple; +} + +/* Do the next tokens in "s" correspond to a tuple of parameters? + * In particular, does the stream start with a '[' that is not + * followed by a '{' or a nested tuple? + */ +static int next_is_param_tuple(__isl_keep isl_stream *s) +{ + struct isl_token *tok, *tok2; + int is_tuple; + + tok = isl_stream_next_token(s); + if (!tok) + return 0; + if (tok->type != '[' || next_is_tuple(s)) { + isl_stream_push_token(s, tok); + return 0; + } + + tok2 = isl_stream_next_token(s); + is_tuple = tok2 && tok2->type != '{'; + if (tok2) + isl_stream_push_token(s, tok2); + isl_stream_push_token(s, tok); + + return is_tuple; +} + +/* Read an isl_multi_union_pw_aff from "s". + * + * The input has the form + * + * [{ [..] : ... ; [..] : ... }, { [..] : ... ; [..] : ... }] + * + * or + * + * [..] -> [{ [..] : ... ; [..] : ... }, { [..] : ... ; [..] : ... }] + * + * We first check for the special case of an empty tuple "[]". + * Then we check if there are any parameters. + * Finally, we read the tuple, collecting the individual isl_union_pw_aff + * elements in a list and construct the result from the tuple space and + * the list. + */ +__isl_give isl_multi_union_pw_aff *isl_stream_read_multi_union_pw_aff( + __isl_keep isl_stream *s) +{ + struct vars *v; + isl_set *dom = NULL; + isl_space *space; + isl_multi_union_pw_aff *mupa = NULL; + isl_union_pw_aff_list *list; + + if (next_is_empty_tuple(s)) { + if (isl_stream_eat(s, '[')) + return NULL; + if (isl_stream_eat(s, ']')) + return NULL; + space = isl_space_set_alloc(s->ctx, 0, 0); + return isl_multi_union_pw_aff_zero(space); + } + + v = vars_new(s->ctx); + if (!v) + return NULL; + + dom = isl_set_universe(isl_space_params_alloc(s->ctx, 0)); + if (next_is_param_tuple(s)) { + dom = read_map_tuple(s, dom, isl_dim_param, v, 1, 0); + if (isl_stream_eat(s, ISL_TOKEN_TO)) + goto error; + } + space = isl_set_get_space(dom); + isl_set_free(dom); + list = isl_union_pw_aff_list_alloc(s->ctx, 0); + space = read_tuple_space(s, v, space, 1, 0, + &read_union_pw_aff_el, &list); + mupa = isl_multi_union_pw_aff_from_union_pw_aff_list(space, list); + + vars_free(v); + + return mupa; +error: + vars_free(v); + isl_set_free(dom); + isl_multi_union_pw_aff_free(mupa); + return NULL; +} + +/* Read an isl_multi_union_pw_aff from "str". + */ +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_read_from_str( + isl_ctx *ctx, const char *str) +{ + isl_multi_union_pw_aff *mupa; + isl_stream *s = isl_stream_new_str(ctx, str); + if (!s) + return NULL; + mupa = isl_stream_read_multi_union_pw_aff(s); + isl_stream_free(s); + return mupa; +} + __isl_give isl_union_pw_qpolynomial *isl_stream_read_union_pw_qpolynomial( - struct isl_stream *s) + __isl_keep isl_stream *s) { struct isl_obj obj; @@ -3107,7 +3772,7 @@ isl_ctx *ctx, const char *str) { isl_union_pw_qpolynomial *upwqp; - struct isl_stream *s = isl_stream_new_str(ctx, str); + isl_stream *s = isl_stream_new_str(ctx, str); if (!s) return NULL; upwqp = isl_stream_read_union_pw_qpolynomial(s); diff -Nru cloog-0.18.2/isl/isl_int_gmp.h cloog-0.18.4/isl/isl_int_gmp.h --- cloog-0.18.2/isl/isl_int_gmp.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_int_gmp.h 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,88 @@ +#ifndef ISL_INT_GMP_H +#define ISL_INT_GMP_H + +#include + +/* isl_int is the basic integer type, implemented with GMP's mpz_t. In the + * future, different types such as long long or cln::cl_I will be supported. + */ +typedef mpz_t isl_int; + +#define isl_int_init(i) mpz_init(i) +#define isl_int_clear(i) mpz_clear(i) + +#define isl_int_set(r,i) mpz_set(r,i) +#define isl_int_set_si(r,i) mpz_set_si(r,i) +#define isl_int_set_ui(r,i) mpz_set_ui(r,i) +#define isl_int_fits_slong(r) mpz_fits_slong_p(r) +#define isl_int_get_si(r) mpz_get_si(r) +#define isl_int_fits_ulong(r) mpz_fits_ulong_p(r) +#define isl_int_get_ui(r) mpz_get_ui(r) +#define isl_int_get_d(r) mpz_get_d(r) +#define isl_int_get_str(r) mpz_get_str(0, 10, r) +#define isl_int_abs(r,i) mpz_abs(r,i) +#define isl_int_neg(r,i) mpz_neg(r,i) +#define isl_int_swap(i,j) mpz_swap(i,j) +#define isl_int_swap_or_set(i,j) mpz_swap(i,j) +#define isl_int_add_ui(r,i,j) mpz_add_ui(r,i,j) +#define isl_int_sub_ui(r,i,j) mpz_sub_ui(r,i,j) + +#define isl_int_add(r,i,j) mpz_add(r,i,j) +#define isl_int_sub(r,i,j) mpz_sub(r,i,j) +#define isl_int_mul(r,i,j) mpz_mul(r,i,j) +#define isl_int_mul_2exp(r,i,j) mpz_mul_2exp(r,i,j) +#define isl_int_mul_si(r,i,j) mpz_mul_si(r,i,j) +#define isl_int_mul_ui(r,i,j) mpz_mul_ui(r,i,j) +#define isl_int_pow_ui(r,i,j) mpz_pow_ui(r,i,j) +#define isl_int_addmul(r,i,j) mpz_addmul(r,i,j) +#define isl_int_addmul_ui(r,i,j) mpz_addmul_ui(r,i,j) +#define isl_int_submul(r,i,j) mpz_submul(r,i,j) +#define isl_int_submul_ui(r,i,j) mpz_submul_ui(r,i,j) + +#define isl_int_gcd(r,i,j) mpz_gcd(r,i,j) +#define isl_int_lcm(r,i,j) mpz_lcm(r,i,j) +#define isl_int_divexact(r,i,j) mpz_divexact(r,i,j) +#define isl_int_divexact_ui(r,i,j) mpz_divexact_ui(r,i,j) +#define isl_int_tdiv_q(r,i,j) mpz_tdiv_q(r,i,j) +#define isl_int_cdiv_q(r,i,j) mpz_cdiv_q(r,i,j) +#define isl_int_fdiv_q(r,i,j) mpz_fdiv_q(r,i,j) +#define isl_int_fdiv_r(r,i,j) mpz_fdiv_r(r,i,j) +#define isl_int_fdiv_q_ui(r,i,j) mpz_fdiv_q_ui(r,i,j) + +#define isl_int_read(r,s) mpz_set_str(r,s,10) +#define isl_int_sgn(i) mpz_sgn(i) +#define isl_int_cmp(i,j) mpz_cmp(i,j) +#define isl_int_cmp_si(i,si) mpz_cmp_si(i,si) +#define isl_int_eq(i,j) (mpz_cmp(i,j) == 0) +#define isl_int_ne(i,j) (mpz_cmp(i,j) != 0) +#define isl_int_lt(i,j) (mpz_cmp(i,j) < 0) +#define isl_int_le(i,j) (mpz_cmp(i,j) <= 0) +#define isl_int_gt(i,j) (mpz_cmp(i,j) > 0) +#define isl_int_ge(i,j) (mpz_cmp(i,j) >= 0) +#define isl_int_abs_cmp(i,j) mpz_cmpabs(i,j) +#define isl_int_abs_eq(i,j) (mpz_cmpabs(i,j) == 0) +#define isl_int_abs_ne(i,j) (mpz_cmpabs(i,j) != 0) +#define isl_int_abs_lt(i,j) (mpz_cmpabs(i,j) < 0) +#define isl_int_abs_gt(i,j) (mpz_cmpabs(i,j) > 0) +#define isl_int_abs_ge(i,j) (mpz_cmpabs(i,j) >= 0) +#define isl_int_is_divisible_by(i,j) mpz_divisible_p(i,j) + +uint32_t isl_gmp_hash(mpz_t v, uint32_t hash); +#define isl_int_hash(v,h) isl_gmp_hash(v,h) + +#ifndef mp_get_memory_functions +void mp_get_memory_functions( + void *(**alloc_func_ptr) (size_t), + void *(**realloc_func_ptr) (void *, size_t, size_t), + void (**free_func_ptr) (void *, size_t)); +#endif + +typedef void (*isl_int_print_mp_free_t)(void *, size_t); +#define isl_int_free_str(s) \ + do { \ + isl_int_print_mp_free_t mp_free; \ + mp_get_memory_functions(NULL, NULL, &mp_free); \ + (*mp_free)(s, strlen(s) + 1); \ + } while (0) + +#endif /* ISL_INT_GMP_H */ diff -Nru cloog-0.18.2/isl/isl_int.h cloog-0.18.4/isl/isl_int.h --- cloog-0.18.2/isl/isl_int.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_int.h 2014-10-02 15:48:18.000000000 +0000 @@ -9,105 +9,20 @@ #ifndef ISL_INT_H #define ISL_INT_H +#define ISL_DEPRECATED_INT_H #include +#include #include -#include #include -#ifndef mp_get_memory_functions -void mp_get_memory_functions( - void *(**alloc_func_ptr) (size_t), - void *(**realloc_func_ptr) (void *, size_t, size_t), - void (**free_func_ptr) (void *, size_t)); +#ifdef USE_GMP_FOR_MP +#include #endif -/* isl_int is the basic integer type. It currently always corresponds - * to a gmp mpz_t, but in the future, different types such as long long - * or cln::cl_I will be supported. - */ -typedef mpz_t isl_int; - -#define isl_int_init(i) mpz_init(i) -#define isl_int_clear(i) mpz_clear(i) - -#define isl_int_set(r,i) mpz_set(r,i) -#define isl_int_set_gmp(r,i) mpz_set(r,i) -#define isl_int_set_si(r,i) mpz_set_si(r,i) -#define isl_int_set_ui(r,i) mpz_set_ui(r,i) -#define isl_int_get_gmp(i,g) mpz_set(g,i) -#define isl_int_fits_slong(r) mpz_fits_slong_p(r) -#define isl_int_get_si(r) mpz_get_si(r) -#define isl_int_fits_ulong(r) mpz_fits_ulong_p(r) -#define isl_int_get_ui(r) mpz_get_ui(r) -#define isl_int_get_d(r) mpz_get_d(r) -#define isl_int_get_str(r) mpz_get_str(0, 10, r) -typedef void (*isl_int_print_gmp_free_t)(void *, size_t); -#define isl_int_free_str(s) \ - do { \ - isl_int_print_gmp_free_t gmp_free; \ - mp_get_memory_functions(NULL, NULL, &gmp_free); \ - (*gmp_free)(s, strlen(s) + 1); \ - } while (0) -#define isl_int_abs(r,i) mpz_abs(r,i) -#define isl_int_neg(r,i) mpz_neg(r,i) -#define isl_int_swap(i,j) mpz_swap(i,j) -#define isl_int_swap_or_set(i,j) mpz_swap(i,j) -#define isl_int_add_ui(r,i,j) mpz_add_ui(r,i,j) -#define isl_int_sub_ui(r,i,j) mpz_sub_ui(r,i,j) - -#define isl_int_add(r,i,j) mpz_add(r,i,j) -#define isl_int_sub(r,i,j) mpz_sub(r,i,j) -#define isl_int_mul(r,i,j) mpz_mul(r,i,j) -#define isl_int_mul_2exp(r,i,j) mpz_mul_2exp(r,i,j) -#define isl_int_mul_si(r,i,j) mpz_mul_si(r,i,j) -#define isl_int_mul_ui(r,i,j) mpz_mul_ui(r,i,j) -#define isl_int_pow_ui(r,i,j) mpz_pow_ui(r,i,j) -#define isl_int_addmul(r,i,j) mpz_addmul(r,i,j) -#define isl_int_addmul_ui(r,i,j) mpz_addmul_ui(r,i,j) -#define isl_int_submul(r,i,j) mpz_submul(r,i,j) -#define isl_int_submul_ui(r,i,j) mpz_submul_ui(r,i,j) - -#define isl_int_gcd(r,i,j) mpz_gcd(r,i,j) -#ifdef GMP_NORMALIZE_GCDEXT -void isl_gmp_gcdext(mpz_t G, mpz_t S, mpz_t T, mpz_t A, mpz_t B); -#define isl_int_gcdext(g,x,y,i,j) isl_gmp_gcdext(g,x,y,i,j) -#else -#define isl_int_gcdext(g,x,y,i,j) mpz_gcdext(g,x,y,i,j) +#ifdef USE_IMATH_FOR_MP +#include #endif -#define isl_int_lcm(r,i,j) mpz_lcm(r,i,j) -#define isl_int_divexact(r,i,j) mpz_divexact(r,i,j) -#define isl_int_divexact_ui(r,i,j) mpz_divexact_ui(r,i,j) -#define isl_int_tdiv_q(r,i,j) mpz_tdiv_q(r,i,j) -#define isl_int_cdiv_q(r,i,j) mpz_cdiv_q(r,i,j) -#define isl_int_fdiv_q(r,i,j) mpz_fdiv_q(r,i,j) -#define isl_int_fdiv_r(r,i,j) mpz_fdiv_r(r,i,j) -#define isl_int_fdiv_q_ui(r,i,j) mpz_fdiv_q_ui(r,i,j) - -#define isl_int_read(r,s) mpz_set_str(r,s,10) -#define isl_int_print(out,i,width) \ - do { \ - char *s; \ - s = mpz_get_str(0, 10, i); \ - fprintf(out, "%*s", width, s); \ - isl_int_free_str(s); \ - } while (0) - -#define isl_int_sgn(i) mpz_sgn(i) -#define isl_int_cmp(i,j) mpz_cmp(i,j) -#define isl_int_cmp_si(i,si) mpz_cmp_si(i,si) -#define isl_int_eq(i,j) (mpz_cmp(i,j) == 0) -#define isl_int_ne(i,j) (mpz_cmp(i,j) != 0) -#define isl_int_lt(i,j) (mpz_cmp(i,j) < 0) -#define isl_int_le(i,j) (mpz_cmp(i,j) <= 0) -#define isl_int_gt(i,j) (mpz_cmp(i,j) > 0) -#define isl_int_ge(i,j) (mpz_cmp(i,j) >= 0) -#define isl_int_abs_eq(i,j) (mpz_cmpabs(i,j) == 0) -#define isl_int_abs_ne(i,j) (mpz_cmpabs(i,j) != 0) -#define isl_int_abs_lt(i,j) (mpz_cmpabs(i,j) < 0) -#define isl_int_abs_gt(i,j) (mpz_cmpabs(i,j) > 0) -#define isl_int_abs_ge(i,j) (mpz_cmpabs(i,j) >= 0) - #define isl_int_is_zero(i) (isl_int_sgn(i) == 0) #define isl_int_is_one(i) (isl_int_cmp_si(i,1) == 0) @@ -116,9 +31,16 @@ #define isl_int_is_neg(i) (isl_int_sgn(i) < 0) #define isl_int_is_nonpos(i) (isl_int_sgn(i) <= 0) #define isl_int_is_nonneg(i) (isl_int_sgn(i) >= 0) -#define isl_int_is_divisible_by(i,j) mpz_divisible_p(i,j) -uint32_t isl_gmp_hash(mpz_t v, uint32_t hash); -#define isl_int_hash(v,h) isl_gmp_hash(v,h) +#define isl_int_print(out,i,width) \ + do { \ + char *s; \ + s = isl_int_get_str(i); \ + fprintf(out, "%*s", width, s); \ + isl_int_free_str(s); \ + } while (0) -#endif +__isl_give isl_printer *isl_printer_print_isl_int(__isl_take isl_printer *p, + isl_int i); + +#endif /* ISL_INT_H */ diff -Nru cloog-0.18.2/isl/isl_int_imath.h cloog-0.18.4/isl/isl_int_imath.h --- cloog-0.18.2/isl/isl_int_imath.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_int_imath.h 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,76 @@ +#ifndef ISL_INT_IMATH_H +#define ISL_INT_IMATH_H + +#include "isl_hide_deprecated.h" + +#include + +/* isl_int is the basic integer type, implemented with imath's mp_int. */ +typedef mp_int isl_int; + +#define isl_int_init(i) i = mp_int_alloc() +#define isl_int_clear(i) mp_int_free(i) + +#define isl_int_set(r,i) impz_set(r,i) +#define isl_int_set_si(r,i) impz_set_si(r,i) +#define isl_int_set_ui(r,i) impz_set_ui(r,i) +#define isl_int_fits_slong(r) isl_imath_fits_slong_p(r) +#define isl_int_get_si(r) impz_get_si(r) +#define isl_int_fits_ulong(r) isl_imath_fits_ulong_p(r) +#define isl_int_get_ui(r) impz_get_ui(r) +#define isl_int_get_d(r) impz_get_si(r) +#define isl_int_get_str(r) impz_get_str(0, 10, r) +#define isl_int_abs(r,i) impz_abs(r,i) +#define isl_int_neg(r,i) impz_neg(r,i) +#define isl_int_swap(i,j) impz_swap(i,j) +#define isl_int_swap_or_set(i,j) impz_swap(i,j) +#define isl_int_add_ui(r,i,j) impz_add_ui(r,i,j) +#define isl_int_sub_ui(r,i,j) impz_sub_ui(r,i,j) + +#define isl_int_add(r,i,j) impz_add(r,i,j) +#define isl_int_sub(r,i,j) impz_sub(r,i,j) +#define isl_int_mul(r,i,j) impz_mul(r,i,j) +#define isl_int_mul_2exp(r,i,j) impz_mul_2exp(r,i,j) +#define isl_int_mul_si(r,i,j) mp_int_mul_value(i,j,r) +#define isl_int_mul_ui(r,i,j) impz_mul_ui(r,i,j) +#define isl_int_pow_ui(r,i,j) impz_pow_ui(r,i,j) +#define isl_int_addmul(r,i,j) impz_addmul(r,i,j) +#define isl_int_addmul_ui(r,i,j) isl_imath_addmul_ui(r,i,j) +#define isl_int_submul(r,i,j) impz_submul(r,i,j) +#define isl_int_submul_ui(r,i,j) isl_imath_submul_ui(r,i,j) + +#define isl_int_gcd(r,i,j) impz_gcd(r,i,j) +#define isl_int_lcm(r,i,j) impz_lcm(r,i,j) +#define isl_int_divexact(r,i,j) impz_divexact(r,i,j) +#define isl_int_divexact_ui(r,i,j) impz_divexact_ui(r,i,j) +#define isl_int_tdiv_q(r,i,j) impz_tdiv_q(r,i,j) +#define isl_int_cdiv_q(r,i,j) impz_cdiv_q(r,i,j) +#define isl_int_fdiv_q(r,i,j) impz_fdiv_q(r,i,j) +#define isl_int_fdiv_r(r,i,j) impz_fdiv_r(r,i,j) +#define isl_int_fdiv_q_ui(r,i,j) impz_fdiv_q_ui(r,i,j) + +#define isl_int_read(r,s) impz_set_str(r,s,10) +#define isl_int_sgn(i) impz_sgn(i) +#define isl_int_cmp(i,j) impz_cmp(i,j) +#define isl_int_cmp_si(i,si) impz_cmp_si(i,si) +#define isl_int_eq(i,j) (impz_cmp(i,j) == 0) +#define isl_int_ne(i,j) (impz_cmp(i,j) != 0) +#define isl_int_lt(i,j) (impz_cmp(i,j) < 0) +#define isl_int_le(i,j) (impz_cmp(i,j) <= 0) +#define isl_int_gt(i,j) (impz_cmp(i,j) > 0) +#define isl_int_ge(i,j) (impz_cmp(i,j) >= 0) +#define isl_int_abs_cmp(i,j) impz_cmpabs(i,j) +#define isl_int_abs_eq(i,j) (impz_cmpabs(i,j) == 0) +#define isl_int_abs_ne(i,j) (impz_cmpabs(i,j) != 0) +#define isl_int_abs_lt(i,j) (impz_cmpabs(i,j) < 0) +#define isl_int_abs_gt(i,j) (impz_cmpabs(i,j) > 0) +#define isl_int_abs_ge(i,j) (impz_cmpabs(i,j) >= 0) +#define isl_int_is_divisible_by(i,j) impz_divisible_p(i,j) + +uint32_t isl_imath_hash(mp_int v, uint32_t hash); +#define isl_int_hash(v,h) isl_imath_hash(v,h) + +typedef void (*isl_int_print_mp_free_t)(void *, size_t); +#define isl_int_free_str(s) free(s) + +#endif /* ISL_INT_IMATH_H */ diff -Nru cloog-0.18.2/isl/isl_list_templ.c cloog-0.18.4/isl/isl_list_templ.c --- cloog-0.18.2/isl/isl_list_templ.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_list_templ.c 2015-07-24 12:23:09.000000000 +0000 @@ -89,6 +89,7 @@ } /* Make sure "list" has room for at least "n" more pieces. + * Always return a list with a single reference. * * If there is only one reference to list, we extend it in place. * Otherwise, we create a new LIST(EL) and copy the elements. @@ -101,7 +102,7 @@ if (!list) return NULL; - if (list->n + n <= list->size) + if (list->ref == 1 && list->n + n <= list->size) return list; ctx = FN(LIST(EL),get_ctx)(list); @@ -115,6 +116,9 @@ return res; } + if (list->n + n <= list->size && list->size < new_size) + new_size = list->size; + res = FN(LIST(EL),alloc)(ctx, new_size); if (!res) return FN(LIST(EL),free)(list); @@ -210,7 +214,7 @@ return NULL; } -void *FN(LIST(EL),free)(__isl_take LIST(EL) *list) +__isl_null LIST(EL) *FN(LIST(EL),free)(__isl_take LIST(EL) *list) { int i; @@ -269,23 +273,23 @@ return NULL; } -int FN(LIST(EL),foreach)(__isl_keep LIST(EL) *list, - int (*fn)(__isl_take EL *el, void *user), void *user) +isl_stat FN(LIST(EL),foreach)(__isl_keep LIST(EL) *list, + isl_stat (*fn)(__isl_take EL *el, void *user), void *user) { int i; if (!list) - return -1; + return isl_stat_error; for (i = 0; i < list->n; ++i) { EL *el = FN(EL,copy(list->p[i])); if (!el) - return -1; + return isl_stat_error; if (fn(el, user) < 0) - return -1; + return isl_stat_error; } - return 0; + return isl_stat_ok; } /* Internal data structure for isl_*_list_sort. @@ -340,7 +344,7 @@ */ S(LIST(EL),foreach_scc_data) { LIST(EL) *list; - int (*follows)(__isl_keep EL *a, __isl_keep EL *b, void *user); + isl_bool (*follows)(__isl_keep EL *a, __isl_keep EL *b, void *user); void *follows_user; }; @@ -348,7 +352,7 @@ * * Use the user provided callback to find out. */ -static int FN(LIST(EL),follows)(int i, int j, void *user) +static isl_bool FN(LIST(EL),follows)(int i, int j, void *user) { S(LIST(EL),foreach_scc_data) *data = user; @@ -359,8 +363,8 @@ /* Call "fn" on the sublist of "list" that consists of the elements * with indices specified by the "n" elements of "pos". */ -static int FN(LIST(EL),call_on_scc)(__isl_keep LIST(EL) *list, int *pos, int n, - int (*fn)(__isl_take LIST(EL) *scc, void *user), void *user) +static isl_stat FN(LIST(EL),call_on_scc)(__isl_keep LIST(EL) *list, int *pos, + int n, isl_stat (*fn)(__isl_take LIST(EL) *scc, void *user), void *user) { int i; isl_ctx *ctx; @@ -390,10 +394,10 @@ * We simply call isl_tarjan_graph_init, extract the SCCs from the result and * call fn on each of them. */ -int FN(LIST(EL),foreach_scc)(__isl_keep LIST(EL) *list, - int (*follows)(__isl_keep EL *a, __isl_keep EL *b, void *user), +isl_stat FN(LIST(EL),foreach_scc)(__isl_keep LIST(EL) *list, + isl_bool (*follows)(__isl_keep EL *a, __isl_keep EL *b, void *user), void *follows_user, - int (*fn)(__isl_take LIST(EL) *scc, void *user), void *fn_user) + isl_stat (*fn)(__isl_take LIST(EL) *scc, void *user), void *fn_user) { S(LIST(EL),foreach_scc_data) data = { list, follows, follows_user }; int i, n; @@ -401,9 +405,9 @@ struct isl_tarjan_graph *g; if (!list) - return -1; + return isl_stat_error; if (list->n == 0) - return 0; + return isl_stat_ok; if (list->n == 1) return fn(FN(LIST(EL),copy)(list), fn_user); @@ -411,7 +415,7 @@ n = list->n; g = isl_tarjan_graph_init(ctx, n, &FN(LIST(EL),follows), &data); if (!g) - return -1; + return isl_stat_error; i = 0; do { @@ -436,7 +440,7 @@ isl_tarjan_graph_free(g); - return n > 0 ? -1 : 0; + return n > 0 ? isl_stat_error : isl_stat_ok; } __isl_give LIST(EL) *FN(FN(LIST(EL),from),BASE)(__isl_take EL *el) diff -Nru cloog-0.18.2/isl/isl_local_space.c cloog-0.18.4/isl/isl_local_space.c --- cloog-0.18.2/isl/isl_local_space.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_local_space.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright 2011 INRIA Saclay - * Copyright 2012 Ecole Normale Superieure + * Copyright 2012-2014 Ecole Normale Superieure * * Use of this software is governed by the MIT license * @@ -16,7 +16,8 @@ #include #include #include -#include +#include +#include isl_ctx *isl_local_space_get_ctx(__isl_keep isl_local_space *ls) { @@ -101,7 +102,8 @@ return isl_local_space_dup(ls); } -void *isl_local_space_free(__isl_take isl_local_space *ls) +__isl_null isl_local_space *isl_local_space_free( + __isl_take isl_local_space *ls) { if (!ls) return NULL; @@ -117,36 +119,99 @@ return NULL; } +/* Is the local space that of a parameter domain? + */ +isl_bool isl_local_space_is_params(__isl_keep isl_local_space *ls) +{ + if (!ls) + return isl_bool_error; + return isl_space_is_params(ls->dim); +} + /* Is the local space that of a set? */ -int isl_local_space_is_set(__isl_keep isl_local_space *ls) +isl_bool isl_local_space_is_set(__isl_keep isl_local_space *ls) { - return ls ? isl_space_is_set(ls->dim) : -1; + return ls ? isl_space_is_set(ls->dim) : isl_bool_error; } /* Return true if the two local spaces are identical, with identical * expressions for the integer divisions. */ -int isl_local_space_is_equal(__isl_keep isl_local_space *ls1, +isl_bool isl_local_space_is_equal(__isl_keep isl_local_space *ls1, __isl_keep isl_local_space *ls2) { - int equal; + isl_bool equal; if (!ls1 || !ls2) - return -1; + return isl_bool_error; equal = isl_space_is_equal(ls1->dim, ls2->dim); if (equal < 0 || !equal) return equal; if (!isl_local_space_divs_known(ls1)) - return 0; + return isl_bool_false; if (!isl_local_space_divs_known(ls2)) - return 0; + return isl_bool_false; return isl_mat_is_equal(ls1->div, ls2->div); } +/* Compare two isl_local_spaces. + * + * Return -1 if "ls1" is "smaller" than "ls2", 1 if "ls1" is "greater" + * than "ls2" and 0 if they are equal. + * + * The order is fairly arbitrary. We do "prefer" divs that only involve + * earlier dimensions in the sense that we consider local spaces where + * the first differing div involves earlier dimensions to be smaller. + */ +int isl_local_space_cmp(__isl_keep isl_local_space *ls1, + __isl_keep isl_local_space *ls2) +{ + int i; + int cmp; + int known1, known2; + int last1, last2; + int n_col; + + if (ls1 == ls2) + return 0; + if (!ls1) + return -1; + if (!ls2) + return 1; + + cmp = isl_space_cmp(ls1->dim, ls2->dim); + if (cmp != 0) + return cmp; + + if (ls1->div->n_row != ls2->div->n_row) + return ls1->div->n_row - ls2->div->n_row; + + n_col = isl_mat_cols(ls1->div); + for (i = 0; i < ls1->div->n_row; ++i) { + known1 = isl_local_space_div_is_known(ls1, i); + known2 = isl_local_space_div_is_known(ls2, i); + if (!known1 && !known2) + continue; + if (!known1) + return 1; + if (!known2) + return -1; + last1 = isl_seq_last_non_zero(ls1->div->row[i] + 1, n_col - 1); + last2 = isl_seq_last_non_zero(ls2->div->row[i] + 1, n_col - 1); + if (last1 != last2) + return last1 - last2; + cmp = isl_seq_cmp(ls1->div->row[i], ls2->div->row[i], n_col); + if (cmp != 0) + return cmp; + } + + return 0; +} + int isl_local_space_dim(__isl_keep isl_local_space *ls, enum isl_dim_type type) { @@ -178,12 +243,26 @@ } } +/* Return the position of the dimension of the given type and name + * in "ls". + * Return -1 if no such dimension can be found. + */ +int isl_local_space_find_dim_by_name(__isl_keep isl_local_space *ls, + enum isl_dim_type type, const char *name) +{ + if (!ls) + return -1; + if (type == isl_dim_div) + return -1; + return isl_space_find_dim_by_name(ls->dim, type, name); +} + /* Does the given dimension have a name? */ -int isl_local_space_has_dim_name(__isl_keep isl_local_space *ls, +isl_bool isl_local_space_has_dim_name(__isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos) { - return ls ? isl_space_has_dim_name(ls->dim, type, pos) : -1; + return ls ? isl_space_has_dim_name(ls->dim, type, pos) : isl_bool_error; } const char *isl_local_space_get_dim_name(__isl_keep isl_local_space *ls, @@ -192,10 +271,10 @@ return ls ? isl_space_get_dim_name(ls->dim, type, pos) : NULL; } -int isl_local_space_has_dim_id(__isl_keep isl_local_space *ls, +isl_bool isl_local_space_has_dim_id(__isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos) { - return ls ? isl_space_has_dim_id(ls->dim, type, pos) : -1; + return ls ? isl_space_has_dim_id(ls->dim, type, pos) : isl_bool_error; } __isl_give isl_id *isl_local_space_get_dim_id(__isl_keep isl_local_space *ls, @@ -238,6 +317,24 @@ return isl_space_copy(ls->dim); } +/* Replace the identifier of the tuple of type "type" by "id". + */ +__isl_give isl_local_space *isl_local_space_set_tuple_id( + __isl_take isl_local_space *ls, + enum isl_dim_type type, __isl_take isl_id *id) +{ + ls = isl_local_space_cow(ls); + if (!ls) + goto error; + ls->dim = isl_space_set_tuple_id(ls->dim, type, id); + if (!ls->dim) + return isl_local_space_free(ls); + return ls; +error: + isl_id_free(id); + return NULL; +} + __isl_give isl_local_space *isl_local_space_set_dim_name( __isl_take isl_local_space *ls, enum isl_dim_type type, unsigned pos, const char *s) @@ -258,12 +355,15 @@ { ls = isl_local_space_cow(ls); if (!ls) - return isl_id_free(id); + goto error; ls->dim = isl_space_set_dim_id(ls->dim, type, pos, id); if (!ls->dim) return isl_local_space_free(ls); return ls; +error: + isl_id_free(id); + return NULL; } __isl_give isl_local_space *isl_local_space_reset_space( @@ -576,6 +676,7 @@ int *exp1 = NULL; int *exp2 = NULL; isl_mat *div; + int equal; if (!ls1 || !ls2) goto error; @@ -604,6 +705,14 @@ if (!div) goto error; + equal = isl_mat_is_equal(ls1->div, div); + if (equal < 0) + goto error; + if (!equal) + ls1 = isl_local_space_cow(ls1); + if (!ls1) + goto error; + free(exp1); free(exp2); isl_local_space_free(ls2); @@ -619,6 +728,18 @@ return NULL; } +/* Does "ls" have an explicit representation for div "div"? + */ +int isl_local_space_div_is_known(__isl_keep isl_local_space *ls, int div) +{ + if (!ls) + return -1; + if (div < 0 || div >= ls->div->n_row) + isl_die(isl_local_space_get_ctx(ls), isl_error_invalid, + "position out of bounds", return -1); + return !isl_int_is_zero(ls->div->row[div][0]); +} + int isl_local_space_divs_known(__isl_keep isl_local_space *ls) { int i; @@ -798,7 +919,7 @@ pos += isl_local_space_offset(ls, type); isl_int_init(v); - for (i = first; i < ls->div->n_row; ++i) { + for (i = first; i < first + n; ++i) { if (isl_int_is_zero(ls->div->row[i][1 + pos])) continue; isl_seq_substitute(ls->div->row[i], pos, subs, @@ -1038,8 +1159,7 @@ return NULL; if (!isl_local_space_is_set(ls)) isl_die(isl_local_space_get_ctx(ls), isl_error_invalid, - "lifting only defined on set spaces", - return isl_local_space_free(ls)); + "lifting only defined on set spaces", goto error); bset = isl_basic_set_from_local_space(ls); lifting = isl_basic_set_unwrap(isl_basic_set_lift(bset)); @@ -1047,6 +1167,9 @@ lifting = isl_basic_map_reverse(lifting); return lifting; +error: + isl_local_space_free(ls); + return NULL; } /* Compute the preimage of "ls" under the function represented by "ma". @@ -1130,3 +1253,128 @@ isl_local_space_free(res); return NULL; } + +/* Move the "n" dimensions of "src_type" starting at "src_pos" of "ls" + * to dimensions of "dst_type" at "dst_pos". + * + * Moving to/from local dimensions is not allowed. + * We currently assume that the dimension type changes. + */ +__isl_give isl_local_space *isl_local_space_move_dims( + __isl_take isl_local_space *ls, + enum isl_dim_type dst_type, unsigned dst_pos, + enum isl_dim_type src_type, unsigned src_pos, unsigned n) +{ + unsigned g_dst_pos; + unsigned g_src_pos; + + if (!ls) + return NULL; + if (n == 0 && + !isl_local_space_is_named_or_nested(ls, src_type) && + !isl_local_space_is_named_or_nested(ls, dst_type)) + return ls; + + if (src_pos + n > isl_local_space_dim(ls, src_type)) + isl_die(isl_local_space_get_ctx(ls), isl_error_invalid, + "range out of bounds", return isl_local_space_free(ls)); + if (dst_pos > isl_local_space_dim(ls, dst_type)) + isl_die(isl_local_space_get_ctx(ls), isl_error_invalid, + "position out of bounds", + return isl_local_space_free(ls)); + if (src_type == isl_dim_div) + isl_die(isl_local_space_get_ctx(ls), isl_error_invalid, + "cannot move divs", return isl_local_space_free(ls)); + if (dst_type == isl_dim_div) + isl_die(isl_local_space_get_ctx(ls), isl_error_invalid, + "cannot move to divs", return isl_local_space_free(ls)); + if (dst_type == src_type && dst_pos == src_pos) + return ls; + if (dst_type == src_type) + isl_die(isl_local_space_get_ctx(ls), isl_error_unsupported, + "moving dims within the same type not supported", + return isl_local_space_free(ls)); + + ls = isl_local_space_cow(ls); + if (!ls) + return NULL; + + g_src_pos = 1 + isl_local_space_offset(ls, src_type) + src_pos; + g_dst_pos = 1 + isl_local_space_offset(ls, dst_type) + dst_pos; + if (dst_type > src_type) + g_dst_pos -= n; + ls->div = isl_mat_move_cols(ls->div, g_dst_pos, g_src_pos, n); + if (!ls->div) + return isl_local_space_free(ls); + ls->dim = isl_space_move_dims(ls->dim, dst_type, dst_pos, + src_type, src_pos, n); + if (!ls->dim) + return isl_local_space_free(ls); + + return ls; +} + +/* Remove any internal structure of the domain of "ls". + * If there is any such internal structure in the input, + * then the name of the corresponding space is also removed. + */ +__isl_give isl_local_space *isl_local_space_flatten_domain( + __isl_take isl_local_space *ls) +{ + if (!ls) + return NULL; + + if (!ls->dim->nested[0]) + return ls; + + ls = isl_local_space_cow(ls); + if (!ls) + return NULL; + + ls->dim = isl_space_flatten_domain(ls->dim); + if (!ls->dim) + return isl_local_space_free(ls); + + return ls; +} + +/* Remove any internal structure of the range of "ls". + * If there is any such internal structure in the input, + * then the name of the corresponding space is also removed. + */ +__isl_give isl_local_space *isl_local_space_flatten_range( + __isl_take isl_local_space *ls) +{ + if (!ls) + return NULL; + + if (!ls->dim->nested[1]) + return ls; + + ls = isl_local_space_cow(ls); + if (!ls) + return NULL; + + ls->dim = isl_space_flatten_range(ls->dim); + if (!ls->dim) + return isl_local_space_free(ls); + + return ls; +} + +/* Given the local space "ls" of a map, return the local space of a set + * that lives in a space that wraps the space of "ls" and that has + * the same divs. + */ +__isl_give isl_local_space *isl_local_space_wrap(__isl_take isl_local_space *ls) +{ + ls = isl_local_space_cow(ls); + if (!ls) + return NULL; + + ls->dim = isl_space_wrap(ls->dim); + if (!ls->dim) + return isl_local_space_free(ls); + + return ls; +} diff -Nru cloog-0.18.2/isl/isl_local_space_private.h cloog-0.18.4/isl/isl_local_space_private.h --- cloog-0.18.2/isl/isl_local_space_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_local_space_private.h 2014-10-02 15:33:27.000000000 +0000 @@ -31,6 +31,7 @@ __isl_give isl_local_space *isl_local_space_replace_divs( __isl_take isl_local_space *ls, __isl_take isl_mat *div); +int isl_local_space_div_is_known(__isl_keep isl_local_space *ls, int div); int isl_local_space_divs_known(__isl_keep isl_local_space *ls); __isl_give isl_local_space *isl_local_space_substitute_equalities( @@ -63,4 +64,12 @@ __isl_give isl_local_space *isl_local_space_preimage_multi_aff( __isl_take isl_local_space *ls, __isl_take isl_multi_aff *ma); +__isl_give isl_local_space *isl_local_space_move_dims( + __isl_take isl_local_space *ls, + enum isl_dim_type dst_type, unsigned dst_pos, + enum isl_dim_type src_type, unsigned src_pos, unsigned n); + +int isl_local_space_cmp(__isl_keep isl_local_space *ls1, + __isl_keep isl_local_space *ls2); + #endif diff -Nru cloog-0.18.2/isl/isl_lp.c cloog-0.18.4/isl/isl_lp.c --- cloog-0.18.2/isl/isl_lp.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_lp.c 2014-10-02 15:33:27.000000000 +0000 @@ -10,14 +10,14 @@ #include #include #include -#include "isl_lp_piplib.h" -#include +#include #include "isl_tab.h" #include #include #include #include #include +#include enum isl_lp_result isl_tab_solve_lp(struct isl_basic_map *bmap, int maximize, isl_int *f, isl_int denom, isl_int *opt, @@ -70,14 +70,7 @@ if (!bmap) return isl_lp_error; - switch (bmap->ctx->opt->lp_solver) { - case ISL_LP_PIP: - return isl_pip_solve_lp(bmap, max, f, d, opt, opt_denom, sol); - case ISL_LP_TAB: - return isl_tab_solve_lp(bmap, max, f, d, opt, opt_denom, sol); - default: - return isl_lp_error; - } + return isl_tab_solve_lp(bmap, max, f, d, opt, opt_denom, sol); } enum isl_lp_result isl_basic_set_solve_lp(struct isl_basic_set *bset, int max, diff -Nru cloog-0.18.2/isl/isl_lp_no_piplib.c cloog-0.18.4/isl/isl_lp_no_piplib.c --- cloog-0.18.2/isl/isl_lp_no_piplib.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_lp_no_piplib.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -/* - * Copyright 2008-2009 Katholieke Universiteit Leuven - * - * Use of this software is governed by the MIT license - * - * Written by Sven Verdoolaege, K.U.Leuven, Departement - * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium - */ - -#include "isl_lp_piplib.h" - -enum isl_lp_result isl_pip_solve_lp(struct isl_basic_map *bmap, int maximize, - isl_int *f, isl_int denom, isl_int *opt, - isl_int *opt_denom, - struct isl_vec **sol) -{ - return isl_lp_error; -} diff -Nru cloog-0.18.2/isl/isl_lp_piplib.c cloog-0.18.4/isl/isl_lp_piplib.c --- cloog-0.18.2/isl/isl_lp_piplib.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_lp_piplib.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,106 +0,0 @@ -/* - * Copyright 2008-2009 Katholieke Universiteit Leuven - * - * Use of this software is governed by the MIT license - * - * Written by Sven Verdoolaege, K.U.Leuven, Departement - * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium - */ - -#include -#include -#include -#include "isl_piplib.h" -#include "isl_map_piplib.h" - -static void copy_solution(struct isl_vec *vec, int maximize, isl_int *opt, - isl_int *opt_denom, PipQuast *sol) -{ - int i; - PipList *list; - isl_int tmp; - - if (opt) { - if (opt_denom) { - isl_seq_cpy_from_pip(opt, - &sol->list->vector->the_vector[0], 1); - isl_seq_cpy_from_pip(opt_denom, - &sol->list->vector->the_deno[0], 1); - } else if (maximize) - mpz_fdiv_q(*opt, sol->list->vector->the_vector[0], - sol->list->vector->the_deno[0]); - else - mpz_cdiv_q(*opt, sol->list->vector->the_vector[0], - sol->list->vector->the_deno[0]); - } - - if (!vec) - return; - - isl_int_init(tmp); - isl_int_set_si(vec->el[0], 1); - for (i = 0, list = sol->list->next; list; ++i, list = list->next) { - isl_seq_cpy_from_pip(&vec->el[1 + i], - &list->vector->the_deno[0], 1); - isl_int_lcm(vec->el[0], vec->el[0], vec->el[1 + i]); - } - for (i = 0, list = sol->list->next; list; ++i, list = list->next) { - isl_seq_cpy_from_pip(&tmp, &list->vector->the_deno[0], 1); - isl_int_divexact(tmp, vec->el[0], tmp); - isl_seq_cpy_from_pip(&vec->el[1 + i], - &list->vector->the_vector[0], 1); - isl_int_mul(vec->el[1 + i], vec->el[1 + i], tmp); - } - isl_int_clear(tmp); -} - -enum isl_lp_result isl_pip_solve_lp(struct isl_basic_map *bmap, int maximize, - isl_int *f, isl_int denom, isl_int *opt, - isl_int *opt_denom, - struct isl_vec **vec) -{ - enum isl_lp_result res = isl_lp_ok; - PipMatrix *domain = NULL; - PipOptions *options; - PipQuast *sol; - unsigned total; - - total = isl_basic_map_total_dim(bmap); - domain = isl_basic_map_to_pip(bmap, 0, 1, 0); - if (!domain) - goto error; - entier_set_si(domain->p[0][1], -1); - isl_int_set(domain->p[0][domain->NbColumns - 1], f[0]); - isl_seq_cpy_to_pip(domain->p[0]+2, f+1, total); - - options = pip_options_init(); - if (!options) - goto error; - options->Urs_unknowns = -1; - options->Maximize = maximize; - options->Nq = 0; - sol = pip_solve(domain, NULL, -1, options); - pip_options_free(options); - if (!sol) - goto error; - - if (vec) { - isl_ctx *ctx = isl_basic_map_get_ctx(bmap); - *vec = isl_vec_alloc(ctx, 1 + total); - } - if (vec && !*vec) - res = isl_lp_error; - else if (!sol->list) - res = isl_lp_empty; - else if (entier_zero_p(sol->list->vector->the_deno[0])) - res = isl_lp_unbounded; - else - copy_solution(*vec, maximize, opt, opt_denom, sol); - pip_matrix_free(domain); - pip_quast_free(sol); - return res; -error: - if (domain) - pip_matrix_free(domain); - return isl_lp_error; -} diff -Nru cloog-0.18.2/isl/isl_lp_piplib.h cloog-0.18.4/isl/isl_lp_piplib.h --- cloog-0.18.2/isl/isl_lp_piplib.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_lp_piplib.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -/* - * Copyright 2008-2009 Katholieke Universiteit Leuven - * - * Use of this software is governed by the MIT license - * - * Written by Sven Verdoolaege, K.U.Leuven, Departement - * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium - */ - -#ifndef ISL_LP_PIPLIB_H -#define ISL_LP_PIPLIB_H - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - -enum isl_lp_result isl_pip_solve_lp(struct isl_basic_map *bmap, int maximize, - isl_int *f, isl_int denom, isl_int *opt, - isl_int *opt_denom, - struct isl_vec **sol); - -#if defined(__cplusplus) -} -#endif - -#endif diff -Nru cloog-0.18.2/isl/isl_lp_private.h cloog-0.18.4/isl/isl_lp_private.h --- cloog-0.18.2/isl/isl_lp_private.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_lp_private.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,21 @@ +#ifndef ISL_LP_PRIVATE_H +#define ISL_LP_PRIVATE_H + +#include +#include +#include + +enum isl_lp_result isl_basic_map_solve_lp(__isl_keep isl_basic_map *bmap, + int max, isl_int *f, isl_int denom, isl_int *opt, isl_int *opt_denom, + __isl_give isl_vec **sol); +enum isl_lp_result isl_basic_set_solve_lp(__isl_keep isl_basic_set *bset, + int max, isl_int *f, isl_int denom, isl_int *opt, isl_int *opt_denom, + __isl_give isl_vec **sol); +enum isl_lp_result isl_map_solve_lp(__isl_keep isl_map *map, int max, + isl_int *f, isl_int denom, isl_int *opt, isl_int *opt_denom, + __isl_give isl_vec **sol); +enum isl_lp_result isl_set_solve_lp(__isl_keep isl_set *set, int max, + isl_int *f, isl_int denom, isl_int *opt, isl_int *opt_denom, + __isl_give isl_vec **sol); + +#endif diff -Nru cloog-0.18.2/isl/isl_map.c cloog-0.18.4/isl/isl_map.c --- cloog-0.18.2/isl/isl_map.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_map.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,7 +1,8 @@ /* * Copyright 2008-2009 Katholieke Universiteit Leuven * Copyright 2010 INRIA Saclay - * Copyright 2012-2013 Ecole Normale Superieure + * Copyright 2012-2014 Ecole Normale Superieure + * Copyright 2014 INRIA Rocquencourt * * Use of this software is governed by the MIT license * @@ -10,30 +11,36 @@ * and INRIA Saclay - Ile-de-France, Parc Club Orsay Universite, * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France * and Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France + * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, + * B.P. 105 - 78153 Le Chesnay, France */ #include #include #include -#include +#include +#include #include "isl_space_private.h" #include "isl_equalities.h" -#include -#include +#include +#include #include #include -#include "isl_map_piplib.h" #include #include "isl_sample.h" +#include #include "isl_tab.h" #include #include +#include #include #include #include #include #include #include +#include +#include static unsigned n(__isl_keep isl_space *dim, enum isl_dim_type type) { @@ -188,7 +195,8 @@ m = isl_space_match(map->dim, isl_dim_param, set->dim, isl_dim_param); if (m < 0 || !m) return m; - return isl_space_tuple_match(map->dim, isl_dim_in, set->dim, isl_dim_set); + return isl_space_tuple_is_equal(map->dim, isl_dim_in, + set->dim, isl_dim_set); } int isl_basic_map_compatible_domain(struct isl_basic_map *bmap, @@ -200,7 +208,8 @@ m = isl_space_match(bmap->dim, isl_dim_param, bset->dim, isl_dim_param); if (m < 0 || !m) return m; - return isl_space_tuple_match(bmap->dim, isl_dim_in, bset->dim, isl_dim_set); + return isl_space_tuple_is_equal(bmap->dim, isl_dim_in, + bset->dim, isl_dim_set); } int isl_map_compatible_range(__isl_keep isl_map *map, __isl_keep isl_set *set) @@ -211,7 +220,8 @@ m = isl_space_match(map->dim, isl_dim_param, set->dim, isl_dim_param); if (m < 0 || !m) return m; - return isl_space_tuple_match(map->dim, isl_dim_out, set->dim, isl_dim_set); + return isl_space_tuple_is_equal(map->dim, isl_dim_out, + set->dim, isl_dim_set); } int isl_basic_map_compatible_range(struct isl_basic_map *bmap, @@ -223,7 +233,8 @@ m = isl_space_match(bmap->dim, isl_dim_param, bset->dim, isl_dim_param); if (m < 0 || !m) return m; - return isl_space_tuple_match(bmap->dim, isl_dim_out, bset->dim, isl_dim_set); + return isl_space_tuple_is_equal(bmap->dim, isl_dim_out, + bset->dim, isl_dim_set); } isl_ctx *isl_basic_map_get_ctx(__isl_keep isl_basic_map *bmap) @@ -416,11 +427,38 @@ return NULL; } +/* Replace the identifier of the tuple of type "type" by "id". + */ +__isl_give isl_basic_map *isl_basic_map_set_tuple_id( + __isl_take isl_basic_map *bmap, + enum isl_dim_type type, __isl_take isl_id *id) +{ + bmap = isl_basic_map_cow(bmap); + if (!bmap) + goto error; + bmap->dim = isl_space_set_tuple_id(bmap->dim, type, id); + if (!bmap->dim) + return isl_basic_map_free(bmap); + bmap = isl_basic_map_finalize(bmap); + return bmap; +error: + isl_id_free(id); + return NULL; +} + +/* Replace the identifier of the tuple by "id". + */ +__isl_give isl_basic_set *isl_basic_set_set_tuple_id( + __isl_take isl_basic_set *bset, __isl_take isl_id *id) +{ + return isl_basic_map_set_tuple_id(bset, isl_dim_set, id); +} + /* Does the input or output tuple have a name? */ -int isl_map_has_tuple_name(__isl_keep isl_map *map, enum isl_dim_type type) +isl_bool isl_map_has_tuple_name(__isl_keep isl_map *map, enum isl_dim_type type) { - return map ? isl_space_has_tuple_name(map->dim, type) : -1; + return map ? isl_space_has_tuple_name(map->dim, type) : isl_bool_error; } const char *isl_map_get_tuple_name(__isl_keep isl_map *map, @@ -440,11 +478,14 @@ { map = isl_map_cow(map); if (!map) - return isl_id_free(id); + goto error; map->dim = isl_space_set_tuple_id(map->dim, type, id); return isl_map_reset_space(map, isl_space_copy(map->dim)); +error: + isl_id_free(id); + return NULL; } __isl_give isl_set *isl_set_set_tuple_id(__isl_take isl_set *set, @@ -470,9 +511,9 @@ return isl_map_reset_tuple_id(set, isl_dim_set); } -int isl_map_has_tuple_id(__isl_keep isl_map *map, enum isl_dim_type type) +isl_bool isl_map_has_tuple_id(__isl_keep isl_map *map, enum isl_dim_type type) { - return map ? isl_space_has_tuple_id(map->dim, type) : -1; + return map ? isl_space_has_tuple_id(map->dim, type) : isl_bool_error; } __isl_give isl_id *isl_map_get_tuple_id(__isl_keep isl_map *map, @@ -481,7 +522,7 @@ return map ? isl_space_get_tuple_id(map->dim, type) : NULL; } -int isl_set_has_tuple_id(__isl_keep isl_set *set) +isl_bool isl_set_has_tuple_id(__isl_keep isl_set *set) { return isl_map_has_tuple_id(set, isl_dim_set); } @@ -493,9 +534,11 @@ /* Does the set tuple have a name? */ -int isl_set_has_tuple_name(__isl_keep isl_set *set) +isl_bool isl_set_has_tuple_name(__isl_keep isl_set *set) { - return set ? isl_space_has_tuple_name(set->dim, isl_dim_set) : -1; + if (!set) + return isl_bool_error; + return isl_space_has_tuple_name(set->dim, isl_dim_set); } @@ -523,10 +566,12 @@ /* Does the given dimension have a name? */ -int isl_map_has_dim_name(__isl_keep isl_map *map, +isl_bool isl_map_has_dim_name(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos) { - return map ? isl_space_has_dim_name(map->dim, type, pos) : -1; + if (!map) + return isl_bool_error; + return isl_space_has_dim_name(map->dim, type, pos); } const char *isl_map_get_dim_name(__isl_keep isl_map *map, @@ -543,10 +588,12 @@ /* Does the given dimension have a name? */ -int isl_set_has_dim_name(__isl_keep isl_set *set, +isl_bool isl_set_has_dim_name(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos) { - return set ? isl_space_has_dim_name(set->dim, type, pos) : -1; + if (!set) + return isl_bool_error; + return isl_space_has_dim_name(set->dim, type, pos); } __isl_give isl_basic_map *isl_basic_map_set_dim_name( @@ -604,10 +651,12 @@ return (isl_set *)isl_map_set_dim_name((isl_map *)set, type, pos, s); } -int isl_basic_map_has_dim_id(__isl_keep isl_basic_map *bmap, +isl_bool isl_basic_map_has_dim_id(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos) { - return bmap ? isl_space_has_dim_id(bmap->dim, type, pos) : -1; + if (!bmap) + return isl_bool_error; + return isl_space_has_dim_id(bmap->dim, type, pos); } __isl_give isl_id *isl_basic_set_get_dim_id(__isl_keep isl_basic_set *bset, @@ -616,10 +665,10 @@ return bset ? isl_space_get_dim_id(bset->dim, type, pos) : NULL; } -int isl_map_has_dim_id(__isl_keep isl_map *map, +isl_bool isl_map_has_dim_id(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos) { - return map ? isl_space_has_dim_id(map->dim, type, pos) : -1; + return map ? isl_space_has_dim_id(map->dim, type, pos) : isl_bool_error; } __isl_give isl_id *isl_map_get_dim_id(__isl_keep isl_map *map, @@ -628,7 +677,7 @@ return map ? isl_space_get_dim_id(map->dim, type, pos) : NULL; } -int isl_set_has_dim_id(__isl_keep isl_set *set, +isl_bool isl_set_has_dim_id(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos) { return isl_map_has_dim_id(set, type, pos); @@ -645,11 +694,14 @@ { map = isl_map_cow(map); if (!map) - return isl_id_free(id); + goto error; map->dim = isl_space_set_dim_id(map->dim, type, pos, id); return isl_map_reset_space(map, isl_space_copy(map->dim)); +error: + isl_id_free(id); + return NULL; } __isl_give isl_set *isl_set_set_dim_id(__isl_take isl_set *set, @@ -672,6 +724,18 @@ return isl_map_find_dim_by_id(set, type, id); } +/* Return the position of the dimension of the given type and name + * in "bmap". + * Return -1 if no such dimension can be found. + */ +int isl_basic_map_find_dim_by_name(__isl_keep isl_basic_map *bmap, + enum isl_dim_type type, const char *name) +{ + if (!bmap) + return -1; + return isl_space_find_dim_by_name(bmap->dim, type, name); +} + int isl_map_find_dim_by_name(__isl_keep isl_map *map, enum isl_dim_type type, const char *name) { @@ -686,6 +750,28 @@ return isl_map_find_dim_by_name(set, type, name); } +/* Reset the user pointer on all identifiers of parameters and tuples + * of the space of "map". + */ +__isl_give isl_map *isl_map_reset_user(__isl_take isl_map *map) +{ + isl_space *space; + + space = isl_map_get_space(map); + space = isl_space_reset_user(space); + map = isl_map_reset_space(map, space); + + return map; +} + +/* Reset the user pointer on all identifiers of parameters and tuples + * of the space of "set". + */ +__isl_give isl_set *isl_set_reset_user(__isl_take isl_set *set) +{ + return isl_map_reset_user(set); +} + int isl_basic_map_is_rational(__isl_keep isl_basic_map *bmap) { if (!bmap) @@ -779,10 +865,10 @@ /* Is this set a parameter domain? */ -int isl_set_is_params(__isl_keep isl_set *set) +isl_bool isl_set_is_params(__isl_keep isl_set *set) { if (!set) - return -1; + return isl_bool_error; return isl_space_is_params(set->dim); } @@ -1004,7 +1090,7 @@ return map; } -void *isl_basic_map_free(__isl_take isl_basic_map *bmap) +__isl_null isl_basic_map *isl_basic_map_free(__isl_take isl_basic_map *bmap) { if (!bmap) return NULL; @@ -1024,7 +1110,7 @@ return NULL; } -void *isl_basic_set_free(struct isl_basic_set *bset) +__isl_null isl_basic_set *isl_basic_set_free(__isl_take isl_basic_set *bset) { return isl_basic_map_free((struct isl_basic_map *)bset); } @@ -1056,20 +1142,20 @@ return NULL; } -int isl_map_align_params_map_map_and_test(__isl_keep isl_map *map1, +isl_bool isl_map_align_params_map_map_and_test(__isl_keep isl_map *map1, __isl_keep isl_map *map2, - int (*fn)(__isl_keep isl_map *map1, __isl_keep isl_map *map2)) + isl_bool (*fn)(__isl_keep isl_map *map1, __isl_keep isl_map *map2)) { - int r; + isl_bool r; if (!map1 || !map2) - return -1; + return isl_bool_error; if (isl_space_match(map1->dim, isl_dim_param, map2->dim, isl_dim_param)) return fn(map1, map2); if (!isl_space_has_named_params(map1->dim) || !isl_space_has_named_params(map2->dim)) isl_die(map1->ctx, isl_error_invalid, - "unaligned unnamed parameters", return -1); + "unaligned unnamed parameters", return isl_bool_error); map1 = isl_map_copy(map1); map2 = isl_map_copy(map2); map1 = isl_map_align_params(map1, isl_map_get_space(map2)); @@ -1549,8 +1635,10 @@ bmap->ref--; bmap = isl_basic_map_dup(bmap); } - if (bmap) + if (bmap) { ISL_F_CLR(bmap, ISL_BASIC_SET_FINAL); + ISL_F_CLR(bmap, ISL_BASIC_MAP_REDUCED_COEFFICIENTS); + } return bmap; } @@ -1629,25 +1717,6 @@ return NULL; } -static __isl_give isl_basic_set *isl_basic_set_swap_vars( - __isl_take isl_basic_set *bset, unsigned n) -{ - unsigned dim; - unsigned nparam; - - if (!bset) - return NULL; - - nparam = isl_basic_set_n_param(bset); - dim = isl_basic_set_n_dim(bset); - isl_assert(bset->ctx, n <= dim, goto error); - - return isl_basic_map_swap_vars(bset, 1 + nparam, n, dim - n); -error: - isl_basic_set_free(bset); - return NULL; -} - struct isl_basic_map *isl_basic_map_set_to_empty(struct isl_basic_map *bmap) { int i = 0; @@ -1929,6 +1998,7 @@ if (!lb && !ub) return bmap; + bmap = isl_basic_map_cow(bmap); bmap = isl_basic_map_extend_constraints(bmap, 0, lb + ub); if (lb) { int k = isl_basic_map_alloc_inequality(bmap); @@ -1955,6 +2025,7 @@ isl_int_set_si(bmap->ineq[k][1 + total + div], -1); } + ISL_F_CLR(bmap, ISL_BASIC_MAP_NORMALIZED); return bmap; error: isl_basic_map_free(bmap); @@ -2127,64 +2198,64 @@ * in a div definition, they also appear in the defining constraints of that * div. */ -int isl_basic_map_involves_dims(__isl_keep isl_basic_map *bmap, +isl_bool isl_basic_map_involves_dims(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned first, unsigned n) { int i; if (!bmap) - return -1; + return isl_bool_error; if (first + n > isl_basic_map_dim(bmap, type)) isl_die(bmap->ctx, isl_error_invalid, - "index out of bounds", return -1); + "index out of bounds", return isl_bool_error); first += isl_basic_map_offset(bmap, type); for (i = 0; i < bmap->n_eq; ++i) if (isl_seq_first_non_zero(bmap->eq[i] + first, n) >= 0) - return 1; + return isl_bool_true; for (i = 0; i < bmap->n_ineq; ++i) if (isl_seq_first_non_zero(bmap->ineq[i] + first, n) >= 0) - return 1; + return isl_bool_true; for (i = 0; i < bmap->n_div; ++i) { if (isl_int_is_zero(bmap->div[i][0])) continue; if (isl_seq_first_non_zero(bmap->div[i] + 1 + first, n) >= 0) - return 1; + return isl_bool_true; } - return 0; + return isl_bool_false; } -int isl_map_involves_dims(__isl_keep isl_map *map, +isl_bool isl_map_involves_dims(__isl_keep isl_map *map, enum isl_dim_type type, unsigned first, unsigned n) { int i; if (!map) - return -1; + return isl_bool_error; if (first + n > isl_map_dim(map, type)) isl_die(map->ctx, isl_error_invalid, - "index out of bounds", return -1); + "index out of bounds", return isl_bool_error); for (i = 0; i < map->n; ++i) { - int involves = isl_basic_map_involves_dims(map->p[i], + isl_bool involves = isl_basic_map_involves_dims(map->p[i], type, first, n); if (involves < 0 || involves) return involves; } - return 0; + return isl_bool_false; } -int isl_basic_set_involves_dims(__isl_keep isl_basic_set *bset, +isl_bool isl_basic_set_involves_dims(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned first, unsigned n) { return isl_basic_map_involves_dims(bset, type, first, n); } -int isl_set_involves_dims(__isl_keep isl_set *set, +isl_bool isl_set_involves_dims(__isl_keep isl_set *set, enum isl_dim_type type, unsigned first, unsigned n) { return isl_map_involves_dims(set, type, first, n); @@ -2595,7 +2666,7 @@ (struct isl_basic_map *)bset); } -void *isl_set_free(__isl_take isl_set *set) +__isl_null isl_set *isl_set_free(__isl_take isl_set *set) { int i; @@ -2722,18 +2793,19 @@ return NULL; } -int isl_basic_map_contains(struct isl_basic_map *bmap, struct isl_vec *vec) +isl_bool isl_basic_map_contains(__isl_keep isl_basic_map *bmap, + __isl_keep isl_vec *vec) { int i; unsigned total; isl_int s; if (!bmap || !vec) - return -1; + return isl_bool_error; total = 1 + isl_basic_map_total_dim(bmap); if (total != vec->size) - return -1; + return isl_bool_error; isl_int_init(s); @@ -2741,7 +2813,7 @@ isl_seq_inner_product(vec->el, bmap->eq[i], total, &s); if (!isl_int_is_zero(s)) { isl_int_clear(s); - return 0; + return isl_bool_false; } } @@ -2749,16 +2821,17 @@ isl_seq_inner_product(vec->el, bmap->ineq[i], total, &s); if (isl_int_is_neg(s)) { isl_int_clear(s); - return 0; + return isl_bool_false; } } isl_int_clear(s); - return 1; + return isl_bool_true; } -int isl_basic_set_contains(struct isl_basic_set *bset, struct isl_vec *vec) +isl_bool isl_basic_set_contains(__isl_keep isl_basic_set *bset, + __isl_keep isl_vec *vec) { return isl_basic_map_contains((struct isl_basic_map *)bset, vec); } @@ -3002,20 +3075,20 @@ struct isl_basic_map *isl_basic_map_reverse(struct isl_basic_map *bmap) { - isl_space *dim; - struct isl_basic_set *bset; - unsigned in; + isl_space *space; + unsigned pos, n1, n2; if (!bmap) return NULL; bmap = isl_basic_map_cow(bmap); if (!bmap) return NULL; - dim = isl_space_reverse(isl_space_copy(bmap->dim)); - in = isl_basic_map_n_in(bmap); - bset = isl_basic_set_from_basic_map(bmap); - bset = isl_basic_set_swap_vars(bset, in); - return isl_basic_map_from_basic_set(bset, dim); + space = isl_space_reverse(isl_space_copy(bmap->dim)); + pos = isl_basic_map_offset(bmap, isl_dim_in); + n1 = isl_basic_map_dim(bmap, isl_dim_in); + n2 = isl_basic_map_dim(bmap, isl_dim_out); + bmap = isl_basic_map_swap_vars(bmap, pos, n1, n2); + return isl_basic_map_reset_space(bmap, space); } static __isl_give isl_basic_map *basic_map_space_reset( @@ -3089,7 +3162,7 @@ return isl_basic_map_insert_dims(bset, type, pos, n); } -__isl_give isl_basic_map *isl_basic_map_add(__isl_take isl_basic_map *bmap, +__isl_give isl_basic_map *isl_basic_map_add_dims(__isl_take isl_basic_map *bmap, enum isl_dim_type type, unsigned n) { if (!bmap) @@ -3104,7 +3177,7 @@ if (!bset) return NULL; isl_assert(bset->ctx, type != isl_dim_in, goto error); - return (isl_basic_set *)isl_basic_map_add((isl_basic_map *)bset, type, n); + return isl_basic_map_add_dims(bset, type, n); error: isl_basic_set_free(bset); return NULL; @@ -3543,7 +3616,7 @@ bmap2->dim, isl_dim_param)) isl_die(isl_basic_map_get_ctx(bmap1), isl_error_invalid, "parameters don't match", goto error); - if (!isl_space_tuple_match(bmap1->dim, isl_dim_out, + if (!isl_space_tuple_is_equal(bmap1->dim, isl_dim_out, bmap2->dim, isl_dim_in)) isl_die(isl_basic_map_get_ctx(bmap1), isl_error_invalid, "spaces don't match", goto error); @@ -4280,23 +4353,44 @@ return NULL; } -struct isl_basic_set *isl_basic_set_from_basic_map(struct isl_basic_map *bmap) +/* For a div d = floor(f/m), add the constraint + * + * f - m d >= 0 + */ +static int add_upper_div_constraint(__isl_keep isl_basic_map *bmap, + unsigned pos, isl_int *div) { - if (!bmap) - goto error; - if (bmap->dim->n_in == 0) - return (struct isl_basic_set *)bmap; - bmap = isl_basic_map_cow(bmap); - if (!bmap) - goto error; - bmap->dim = isl_space_as_set_space(bmap->dim); - if (!bmap->dim) - goto error; - bmap = isl_basic_map_finalize(bmap); - return (struct isl_basic_set *)bmap; -error: - isl_basic_map_free(bmap); - return NULL; + int i; + unsigned total = isl_basic_map_total_dim(bmap); + + i = isl_basic_map_alloc_inequality(bmap); + if (i < 0) + return -1; + isl_seq_cpy(bmap->ineq[i], div + 1, 1 + total); + isl_int_neg(bmap->ineq[i][1 + pos], div[0]); + + return 0; +} + +/* For a div d = floor(f/m), add the constraint + * + * -(f-(n-1)) + m d >= 0 + */ +static int add_lower_div_constraint(__isl_keep isl_basic_map *bmap, + unsigned pos, isl_int *div) +{ + int i; + unsigned total = isl_basic_map_total_dim(bmap); + + i = isl_basic_map_alloc_inequality(bmap); + if (i < 0) + return -1; + isl_seq_neg(bmap->ineq[i], div + 1, 1 + total); + isl_int_set(bmap->ineq[i][1 + pos], div[0]); + isl_int_add(bmap->ineq[i][0], bmap->ineq[i][0], bmap->ineq[i][1 + pos]); + isl_int_sub_ui(bmap->ineq[i][0], bmap->ineq[i][0], 1); + + return 0; } /* For a div d = floor(f/m), add the constraints @@ -4311,22 +4405,11 @@ int isl_basic_map_add_div_constraints_var(__isl_keep isl_basic_map *bmap, unsigned pos, isl_int *div) { - int i, j; - unsigned total = isl_basic_map_total_dim(bmap); - - i = isl_basic_map_alloc_inequality(bmap); - if (i < 0) + if (add_upper_div_constraint(bmap, pos, div) < 0) return -1; - isl_seq_cpy(bmap->ineq[i], div + 1, 1 + total); - isl_int_neg(bmap->ineq[i][1 + pos], div[0]); - - j = isl_basic_map_alloc_inequality(bmap); - if (j < 0) + if (add_lower_div_constraint(bmap, pos, div) < 0) return -1; - isl_seq_neg(bmap->ineq[j], bmap->ineq[i], 1 + total); - isl_int_add(bmap->ineq[j][0], bmap->ineq[j][0], bmap->ineq[j][1 + pos]); - isl_int_sub_ui(bmap->ineq[j][0], bmap->ineq[j][0], 1); - return j; + return 0; } int isl_basic_set_add_div_constraints_var(__isl_keep isl_basic_set *bset, @@ -4345,6 +4428,69 @@ bmap->div[div]); } +/* For each known div d = floor(f/m), add the constraints + * + * f - m d >= 0 + * -(f-(n-1)) + m d >= 0 + */ +__isl_give isl_basic_map *isl_basic_map_add_known_div_constraints( + __isl_take isl_basic_map *bmap) +{ + int i; + unsigned n_div; + + if (!bmap) + return NULL; + n_div = isl_basic_map_dim(bmap, isl_dim_div); + if (n_div == 0) + return bmap; + bmap = isl_basic_map_cow(bmap); + bmap = isl_basic_map_extend_constraints(bmap, 0, 2 * n_div); + if (!bmap) + return NULL; + for (i = 0; i < n_div; ++i) { + if (isl_int_is_zero(bmap->div[i][0])) + continue; + if (isl_basic_map_add_div_constraints(bmap, i) < 0) + return isl_basic_map_free(bmap); + } + + bmap = isl_basic_map_remove_duplicate_constraints(bmap, NULL, 0); + bmap = isl_basic_map_finalize(bmap); + return bmap; +} + +/* Add the div constraint of sign "sign" for div "div" of "bmap". + * + * In particular, if this div is of the form d = floor(f/m), + * then add the constraint + * + * f - m d >= 0 + * + * if sign < 0 or the constraint + * + * -(f-(n-1)) + m d >= 0 + * + * if sign > 0. + */ +int isl_basic_map_add_div_constraint(__isl_keep isl_basic_map *bmap, + unsigned div, int sign) +{ + unsigned total; + unsigned div_pos; + + if (!bmap) + return -1; + + total = isl_basic_map_total_dim(bmap); + div_pos = total - bmap->n_div + div; + + if (sign < 0) + return add_upper_div_constraint(bmap, div_pos, bmap->div[div]); + else + return add_lower_div_constraint(bmap, div_pos, bmap->div[div]); +} + int isl_basic_set_add_div_constraints(struct isl_basic_set *bset, unsigned div) { return isl_basic_map_add_div_constraints(bset, div); @@ -4381,6 +4527,30 @@ return isl_basic_map_underlying_set((isl_basic_map *)bset); } +/* Replace each element in "list" by the result of applying + * isl_basic_map_underlying_set to the element. + */ +__isl_give isl_basic_set_list *isl_basic_map_list_underlying_set( + __isl_take isl_basic_map_list *list) +{ + int i, n; + + if (!list) + return NULL; + + n = isl_basic_map_list_n_basic_map(list); + for (i = 0; i < n; ++i) { + isl_basic_map *bmap; + isl_basic_set *bset; + + bmap = isl_basic_map_list_get_basic_map(list, i); + bset = isl_basic_set_underlying_set(bmap); + list = isl_basic_set_list_set_basic_set(list, i, bset); + } + + return list; +} + struct isl_basic_map *isl_basic_map_overlying_set( struct isl_basic_set *bset, struct isl_basic_map *like) { @@ -4431,16 +4601,7 @@ isl_seq_cpy(bmap->div[i], like->div[i], 1 + 1 + ltotal); isl_seq_clr(bmap->div[i]+1+1+ltotal, total - ltotal); } - bmap = isl_basic_map_extend_constraints(bmap, - 0, 2 * like->n_div); - for (i = 0; i < like->n_div; ++i) { - if (!bmap) - break; - if (isl_int_is_zero(bmap->div[i][0])) - continue; - if (isl_basic_map_add_div_constraints(bmap, i) < 0) - bmap = isl_basic_map_free(bmap); - } + bmap = isl_basic_map_add_known_div_constraints(bmap); } isl_basic_map_free(like); bmap = isl_basic_map_simplify(bmap); @@ -4667,23 +4828,17 @@ struct isl_basic_set *isl_basic_map_domain(struct isl_basic_map *bmap) { - isl_space *dim; - struct isl_basic_set *domain; - unsigned n_in; + isl_space *space; unsigned n_out; if (!bmap) return NULL; - dim = isl_space_domain(isl_basic_map_get_space(bmap)); + space = isl_space_domain(isl_basic_map_get_space(bmap)); - n_in = isl_basic_map_n_in(bmap); n_out = isl_basic_map_n_out(bmap); - domain = isl_basic_set_from_basic_map(bmap); - domain = isl_basic_set_project_out(domain, isl_dim_set, n_in, n_out); - - domain = isl_basic_set_reset_space(domain, dim); + bmap = isl_basic_map_project_out(bmap, isl_dim_out, 0, n_out); - return domain; + return isl_basic_map_reset_space(bmap, space); } int isl_basic_map_may_be_set(__isl_keep isl_basic_map *bmap) @@ -4841,15 +4996,12 @@ __isl_give isl_map *isl_map_domain_map(__isl_take isl_map *map) { int i; - isl_space *domain_dim; map = isl_map_cow(map); if (!map) return NULL; - domain_dim = isl_space_from_range(isl_space_domain(isl_map_get_space(map))); - map->dim = isl_space_from_domain(isl_space_wrap(map->dim)); - map->dim = isl_space_join(map->dim, domain_dim); + map->dim = isl_space_domain_map(map->dim); if (!map->dim) goto error; for (i = 0; i < map->n; ++i) { @@ -4893,6 +5045,26 @@ return NULL; } +/* Given a wrapped map of the form A[B -> C], + * return the map A[B -> C] -> B. + */ +__isl_give isl_map *isl_set_wrapped_domain_map(__isl_take isl_set *set) +{ + isl_id *id; + isl_map *map; + + if (!set) + return NULL; + if (!isl_set_has_tuple_id(set)) + return isl_map_domain_map(isl_set_unwrap(set)); + + id = isl_set_get_tuple_id(set); + map = isl_map_domain_map(isl_set_unwrap(set)); + map = isl_map_set_tuple_id(map, isl_dim_in, id); + + return map; +} + __isl_give isl_map *isl_map_from_set(__isl_take isl_set *set, __isl_take isl_space *dim) { @@ -4935,7 +5107,11 @@ return (isl_basic_map *)bset; } -struct isl_map *isl_map_from_range(struct isl_set *set) +/* Create a relation with the given set as range. + * The domain of the created relation is a zero-dimensional + * flat anonymous space. + */ +__isl_give isl_map *isl_map_from_range(__isl_take isl_set *set) { isl_space *space; space = isl_set_get_space(set); @@ -4944,6 +5120,10 @@ return (struct isl_map *)set; } +/* Create a relation with the given set as domain. + * The range of the created relation is a zero-dimensional + * flat anonymous space. + */ __isl_give isl_map *isl_map_from_domain(__isl_take isl_set *set) { return isl_map_reverse(isl_map_from_range(set)); @@ -4961,31 +5141,6 @@ return isl_map_apply_range(isl_map_reverse(domain), range); } -struct isl_set *isl_set_from_map(struct isl_map *map) -{ - int i; - struct isl_set *set = NULL; - - if (!map) - return NULL; - map = isl_map_cow(map); - if (!map) - return NULL; - map->dim = isl_space_as_set_space(map->dim); - if (!map->dim) - goto error; - set = (struct isl_set *)map; - for (i = 0; i < map->n; ++i) { - set->p[i] = isl_basic_set_from_basic_map(map->p[i]); - if (!set->p[i]) - goto error; - } - return set; -error: - isl_map_free(map); - return NULL; -} - __isl_give isl_map *isl_map_alloc_space(__isl_take isl_space *dim, int n, unsigned flags) { @@ -5046,45 +5201,15 @@ return bset; } -struct isl_basic_map *isl_basic_map_empty_like(struct isl_basic_map *model) +__isl_give isl_basic_map *isl_basic_map_universe(__isl_take isl_space *dim) { struct isl_basic_map *bmap; - if (!model) - return NULL; - bmap = isl_basic_map_alloc_space(isl_space_copy(model->dim), 0, 1, 0); - bmap = isl_basic_map_set_to_empty(bmap); + bmap = isl_basic_map_alloc_space(dim, 0, 0, 0); + bmap = isl_basic_map_finalize(bmap); return bmap; } -struct isl_basic_map *isl_basic_map_empty_like_map(struct isl_map *model) -{ - struct isl_basic_map *bmap; - if (!model) - return NULL; - bmap = isl_basic_map_alloc_space(isl_space_copy(model->dim), 0, 1, 0); - bmap = isl_basic_map_set_to_empty(bmap); - return bmap; -} - -struct isl_basic_set *isl_basic_set_empty_like(struct isl_basic_set *model) -{ - struct isl_basic_set *bset; - if (!model) - return NULL; - bset = isl_basic_set_alloc_space(isl_space_copy(model->dim), 0, 1, 0); - bset = isl_basic_set_set_to_empty(bset); - return bset; -} - -__isl_give isl_basic_map *isl_basic_map_universe(__isl_take isl_space *dim) -{ - struct isl_basic_map *bmap; - bmap = isl_basic_map_alloc_space(dim, 0, 0, 0); - bmap = isl_basic_map_finalize(bmap); - return bmap; -} - -__isl_give isl_basic_set *isl_basic_set_universe(__isl_take isl_space *dim) +__isl_give isl_basic_set *isl_basic_set_universe(__isl_take isl_space *dim) { struct isl_basic_set *bset; bset = isl_basic_set_alloc_space(dim, 0, 0, 0); @@ -5127,60 +5252,16 @@ return isl_map_nat_universe(dim); } -__isl_give isl_basic_map *isl_basic_map_universe_like( - __isl_keep isl_basic_map *model) -{ - if (!model) - return NULL; - return isl_basic_map_alloc_space(isl_space_copy(model->dim), 0, 0, 0); -} - -struct isl_basic_set *isl_basic_set_universe_like(struct isl_basic_set *model) -{ - if (!model) - return NULL; - return isl_basic_set_alloc_space(isl_space_copy(model->dim), 0, 0, 0); -} - -__isl_give isl_basic_set *isl_basic_set_universe_like_set( - __isl_keep isl_set *model) -{ - if (!model) - return NULL; - return isl_basic_set_alloc_space(isl_space_copy(model->dim), 0, 0, 0); -} - __isl_give isl_map *isl_map_empty(__isl_take isl_space *dim) { return isl_map_alloc_space(dim, 0, ISL_MAP_DISJOINT); } -struct isl_map *isl_map_empty_like(struct isl_map *model) -{ - if (!model) - return NULL; - return isl_map_alloc_space(isl_space_copy(model->dim), 0, ISL_MAP_DISJOINT); -} - -struct isl_map *isl_map_empty_like_basic_map(struct isl_basic_map *model) -{ - if (!model) - return NULL; - return isl_map_alloc_space(isl_space_copy(model->dim), 0, ISL_MAP_DISJOINT); -} - __isl_give isl_set *isl_set_empty(__isl_take isl_space *dim) { return isl_set_alloc_space(dim, 0, ISL_MAP_DISJOINT); } -struct isl_set *isl_set_empty_like(struct isl_set *model) -{ - if (!model) - return NULL; - return isl_set_empty(isl_space_copy(model->dim)); -} - __isl_give isl_map *isl_map_universe(__isl_take isl_space *dim) { struct isl_map *map; @@ -5201,13 +5282,6 @@ return set; } -__isl_give isl_set *isl_set_universe_like(__isl_keep isl_set *model) -{ - if (!model) - return NULL; - return isl_set_universe(isl_space_copy(model->dim)); -} - struct isl_map *isl_map_dup(struct isl_map *map) { int i; @@ -5244,7 +5318,7 @@ return NULL; } -void *isl_map_free(struct isl_map *map) +__isl_null isl_map *isl_map_free(__isl_take isl_map *map) { int i; @@ -5263,37 +5337,6 @@ return NULL; } -struct isl_map *isl_map_extend(struct isl_map *base, - unsigned nparam, unsigned n_in, unsigned n_out) -{ - int i; - - base = isl_map_cow(base); - if (!base) - return NULL; - - base->dim = isl_space_extend(base->dim, nparam, n_in, n_out); - if (!base->dim) - goto error; - for (i = 0; i < base->n; ++i) { - base->p[i] = isl_basic_map_extend_space(base->p[i], - isl_space_copy(base->dim), 0, 0, 0); - if (!base->p[i]) - goto error; - } - return base; -error: - isl_map_free(base); - return NULL; -} - -struct isl_set *isl_set_extend(struct isl_set *base, - unsigned nparam, unsigned dim) -{ - return (struct isl_set *)isl_map_extend((struct isl_map *)base, - nparam, 0, dim); -} - static struct isl_basic_map *isl_basic_map_fix_pos_si( struct isl_basic_map *bmap, unsigned pos, int value) { @@ -5874,18 +5917,7 @@ struct isl_basic_map *bmap, struct isl_basic_set *dom, struct isl_set **empty, int max) { - if (!bmap) - goto error; - if (bmap->ctx->opt->pip == ISL_PIP_PIP) - return isl_pip_basic_map_lexopt(bmap, dom, empty, max); - else - return isl_tab_basic_map_partial_lexopt(bmap, dom, empty, max); -error: - isl_basic_map_free(bmap); - isl_basic_set_free(dom); - if (empty) - *empty = NULL; - return NULL; + return isl_tab_basic_map_partial_lexopt(bmap, dom, empty, max); } struct isl_map *isl_basic_map_partial_lexmax( @@ -6345,7 +6377,6 @@ if (map->n == 0) { isl_space *dim = isl_map_get_space(map); - dim = isl_space_domain(isl_space_from_range(dim)); isl_map_free(map); return isl_pw_aff_empty(dim); } @@ -6994,6 +7025,10 @@ if (!map1 || !map2) goto error; + if (!isl_space_is_equal(map1->dim, map2->dim)) + isl_die(isl_map_get_ctx(map1), isl_error_invalid, + "spaces don't match", goto error); + if (map1->n == 0) { isl_map_free(map1); return map2; @@ -7019,8 +7054,6 @@ return map2; } - isl_assert(map1->ctx, isl_space_is_equal(map1->dim, map2->dim), goto error); - if (ISL_F_ISSET(map1, ISL_MAP_DISJOINT) && ISL_F_ISSET(map2, ISL_MAP_DISJOINT)) ISL_FL_SET(flags, ISL_MAP_DISJOINT); @@ -7051,20 +7084,66 @@ return NULL; } +/* Return the union of "map1" and "map2", where "map1" and "map2" are + * guaranteed to be disjoint by the caller. + * + * Note that this functions is called from within isl_map_make_disjoint, + * so we have to be careful not to touch the constraints of the inputs + * in any way. + */ __isl_give isl_map *isl_map_union_disjoint(__isl_take isl_map *map1, __isl_take isl_map *map2) { return isl_map_align_params_map_map_and(map1, map2, &map_union_disjoint); } -struct isl_map *isl_map_union(struct isl_map *map1, struct isl_map *map2) +/* Return the union of "map1" and "map2", where "map1" and "map2" may + * not be disjoint. The parameters are assumed to have been aligned. + * + * We currently simply call map_union_disjoint, the internal operation + * of which does not really depend on the inputs being disjoint. + * If the result contains more than one basic map, then we clear + * the disjoint flag since the result may contain basic maps from + * both inputs and these are not guaranteed to be disjoint. + * + * As a special case, if "map1" and "map2" are obviously equal, + * then we simply return "map1". + */ +static __isl_give isl_map *map_union_aligned(__isl_take isl_map *map1, + __isl_take isl_map *map2) { - map1 = isl_map_union_disjoint(map1, map2); + int equal; + + if (!map1 || !map2) + goto error; + + equal = isl_map_plain_is_equal(map1, map2); + if (equal < 0) + goto error; + if (equal) { + isl_map_free(map2); + return map1; + } + + map1 = map_union_disjoint(map1, map2); if (!map1) return NULL; if (map1->n > 1) ISL_F_CLR(map1, ISL_MAP_DISJOINT); return map1; +error: + isl_map_free(map1); + isl_map_free(map2); + return NULL; +} + +/* Return the union of "map1" and "map2", where "map1" and "map2" may + * not be disjoint. + */ +__isl_give isl_map *isl_map_union(__isl_take isl_map *map1, + __isl_take isl_map *map2) +{ + return isl_map_align_params_map_map_and(map1, map2, &map_union_aligned); } struct isl_set *isl_set_union_disjoint( @@ -7234,7 +7313,7 @@ */ struct isl_basic_set *isl_basic_map_deltas(struct isl_basic_map *bmap) { - isl_space *dims, *target_dim; + isl_space *target_space; struct isl_basic_set *bset; unsigned dim; unsigned nparam; @@ -7242,32 +7321,28 @@ if (!bmap) goto error; - isl_assert(bmap->ctx, isl_space_tuple_match(bmap->dim, isl_dim_in, + isl_assert(bmap->ctx, isl_space_tuple_is_equal(bmap->dim, isl_dim_in, bmap->dim, isl_dim_out), goto error); - target_dim = isl_space_domain(isl_basic_map_get_space(bmap)); + target_space = isl_space_domain(isl_basic_map_get_space(bmap)); dim = isl_basic_map_n_in(bmap); nparam = isl_basic_map_n_param(bmap); - bset = isl_basic_set_from_basic_map(bmap); - bset = isl_basic_set_cow(bset); - dims = isl_basic_set_get_space(bset); - dims = isl_space_add_dims(dims, isl_dim_set, dim); - bset = isl_basic_set_extend_space(bset, dims, 0, dim, 0); - bset = isl_basic_set_swap_vars(bset, 2*dim); + bmap = isl_basic_map_from_range(isl_basic_map_wrap(bmap)); + bmap = isl_basic_map_add_dims(bmap, isl_dim_in, dim); + bmap = isl_basic_map_extend_constraints(bmap, dim, 0); for (i = 0; i < dim; ++i) { - int j = isl_basic_map_alloc_equality( - (struct isl_basic_map *)bset); + int j = isl_basic_map_alloc_equality(bmap); if (j < 0) { - bset = isl_basic_set_free(bset); + bmap = isl_basic_map_free(bmap); break; } - isl_seq_clr(bset->eq[j], 1 + isl_basic_set_total_dim(bset)); - isl_int_set_si(bset->eq[j][1+nparam+i], 1); - isl_int_set_si(bset->eq[j][1+nparam+dim+i], 1); - isl_int_set_si(bset->eq[j][1+nparam+2*dim+i], -1); + isl_seq_clr(bmap->eq[j], 1 + isl_basic_map_total_dim(bmap)); + isl_int_set_si(bmap->eq[j][1+nparam+i], 1); + isl_int_set_si(bmap->eq[j][1+nparam+dim+i], 1); + isl_int_set_si(bmap->eq[j][1+nparam+2*dim+i], -1); } - bset = isl_basic_set_project_out(bset, isl_dim_set, dim, 2*dim); - bset = isl_basic_set_reset_space(bset, target_dim); + bset = isl_basic_map_domain(bmap); + bset = isl_basic_set_reset_space(bset, target_space); return bset; error: isl_basic_map_free(bmap); @@ -7286,7 +7361,7 @@ if (!map) return NULL; - isl_assert(map->ctx, isl_space_tuple_match(map->dim, isl_dim_in, + isl_assert(map->ctx, isl_space_tuple_is_equal(map->dim, isl_dim_in, map->dim, isl_dim_out), goto error); dim = isl_map_get_space(map); @@ -7316,7 +7391,8 @@ int nparam, n; unsigned total; - if (!isl_space_tuple_match(bmap->dim, isl_dim_in, bmap->dim, isl_dim_out)) + if (!isl_space_tuple_is_equal(bmap->dim, isl_dim_in, + bmap->dim, isl_dim_out)) isl_die(bmap->ctx, isl_error_invalid, "domain and range don't match", goto error); @@ -7360,7 +7436,8 @@ if (!map) return NULL; - if (!isl_space_tuple_match(map->dim, isl_dim_in, map->dim, isl_dim_out)) + if (!isl_space_tuple_is_equal(map->dim, isl_dim_in, + map->dim, isl_dim_out)) isl_die(map->ctx, isl_error_invalid, "domain and range don't match", goto error); @@ -7429,32 +7506,11 @@ return NULL; } -struct isl_basic_map *isl_basic_map_identity_like(struct isl_basic_map *model) -{ - if (!model || !model->dim) - return NULL; - return isl_basic_map_identity(isl_space_copy(model->dim)); -} - __isl_give isl_map *isl_map_identity(__isl_take isl_space *dim) { return isl_map_from_basic_map(isl_basic_map_identity(dim)); } -struct isl_map *isl_map_identity_like(struct isl_map *model) -{ - if (!model || !model->dim) - return NULL; - return isl_map_identity(isl_space_copy(model->dim)); -} - -struct isl_map *isl_map_identity_like_basic_map(struct isl_basic_map *model) -{ - if (!model || !model->dim) - return NULL; - return isl_map_identity(isl_space_copy(model->dim)); -} - __isl_give isl_map *isl_set_identity(__isl_take isl_set *set) { isl_space *dim = isl_set_get_space(set); @@ -7540,6 +7596,7 @@ enum isl_dim_type type, unsigned first, unsigned n) { int i; + unsigned offset; isl_basic_set *nonneg; isl_basic_set *neg; @@ -7550,11 +7607,11 @@ isl_assert(set->ctx, first + n <= isl_set_dim(set, type), goto error); + offset = pos(set->dim, type); for (i = 0; i < n; ++i) { nonneg = nonneg_halfspace(isl_set_get_space(set), - pos(set->dim, type) + first + i); - neg = neg_halfspace(isl_set_get_space(set), - pos(set->dim, type) + first + i); + offset + first + i); + neg = neg_halfspace(isl_set_get_space(set), offset + first + i); set = isl_set_intersect(set, isl_basic_set_union(nonneg, neg)); } @@ -7629,20 +7686,20 @@ return r; } -int isl_set_is_equal(struct isl_set *set1, struct isl_set *set2) +isl_bool isl_set_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2) { return isl_map_is_equal((struct isl_map *)set1, (struct isl_map *)set2); } -int isl_basic_map_is_subset( - struct isl_basic_map *bmap1, struct isl_basic_map *bmap2) +isl_bool isl_basic_map_is_subset(__isl_keep isl_basic_map *bmap1, + __isl_keep isl_basic_map *bmap2) { int is_subset; struct isl_map *map1; struct isl_map *map2; if (!bmap1 || !bmap2) - return -1; + return isl_bool_error; map1 = isl_map_from_basic_map(isl_basic_map_copy(bmap1)); map2 = isl_map_from_basic_map(isl_basic_map_copy(bmap2)); @@ -7655,71 +7712,61 @@ return is_subset; } -int isl_basic_set_is_subset(__isl_keep isl_basic_set *bset1, +isl_bool isl_basic_set_is_subset(__isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2) { return isl_basic_map_is_subset(bset1, bset2); } -int isl_basic_map_is_equal( - struct isl_basic_map *bmap1, struct isl_basic_map *bmap2) +isl_bool isl_basic_map_is_equal(__isl_keep isl_basic_map *bmap1, + __isl_keep isl_basic_map *bmap2) { - int is_subset; + isl_bool is_subset; if (!bmap1 || !bmap2) - return -1; + return isl_bool_error; is_subset = isl_basic_map_is_subset(bmap1, bmap2); - if (is_subset != 1) + if (is_subset != isl_bool_true) return is_subset; is_subset = isl_basic_map_is_subset(bmap2, bmap1); return is_subset; } -int isl_basic_set_is_equal( - struct isl_basic_set *bset1, struct isl_basic_set *bset2) +isl_bool isl_basic_set_is_equal(__isl_keep isl_basic_set *bset1, + __isl_keep isl_basic_set *bset2) { return isl_basic_map_is_equal( (struct isl_basic_map *)bset1, (struct isl_basic_map *)bset2); } -int isl_map_is_empty(struct isl_map *map) +isl_bool isl_map_is_empty(__isl_keep isl_map *map) { int i; int is_empty; if (!map) - return -1; + return isl_bool_error; for (i = 0; i < map->n; ++i) { is_empty = isl_basic_map_is_empty(map->p[i]); if (is_empty < 0) - return -1; + return isl_bool_error; if (!is_empty) - return 0; + return isl_bool_false; } - return 1; -} - -int isl_map_plain_is_empty(__isl_keep isl_map *map) -{ - return map ? map->n == 0 : -1; -} - -int isl_map_fast_is_empty(__isl_keep isl_map *map) -{ - return isl_map_plain_is_empty(map); + return isl_bool_true; } -int isl_set_plain_is_empty(struct isl_set *set) +isl_bool isl_map_plain_is_empty(__isl_keep isl_map *map) { - return set ? set->n == 0 : -1; + return map ? map->n == 0 : isl_bool_error; } -int isl_set_fast_is_empty(__isl_keep isl_set *set) +isl_bool isl_set_plain_is_empty(__isl_keep isl_set *set) { - return isl_set_plain_is_empty(set); + return set ? set->n == 0 : isl_bool_error; } -int isl_set_is_empty(struct isl_set *set) +isl_bool isl_set_is_empty(__isl_keep isl_set *set) { return isl_map_is_empty((struct isl_map *)set); } @@ -7740,115 +7787,112 @@ return isl_space_is_equal(set1->dim, set2->dim); } -static int map_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2) +static isl_bool map_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2) { - int is_subset; + isl_bool is_subset; if (!map1 || !map2) - return -1; + return isl_bool_error; is_subset = isl_map_is_subset(map1, map2); - if (is_subset != 1) + if (is_subset != isl_bool_true) return is_subset; is_subset = isl_map_is_subset(map2, map1); return is_subset; } -int isl_map_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2) +isl_bool isl_map_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2) { return isl_map_align_params_map_map_and_test(map1, map2, &map_is_equal); } -int isl_basic_map_is_strict_subset( +isl_bool isl_basic_map_is_strict_subset( struct isl_basic_map *bmap1, struct isl_basic_map *bmap2) { - int is_subset; + isl_bool is_subset; if (!bmap1 || !bmap2) - return -1; + return isl_bool_error; is_subset = isl_basic_map_is_subset(bmap1, bmap2); - if (is_subset != 1) + if (is_subset != isl_bool_true) return is_subset; is_subset = isl_basic_map_is_subset(bmap2, bmap1); - if (is_subset == -1) + if (is_subset == isl_bool_error) return is_subset; return !is_subset; } -int isl_map_is_strict_subset(struct isl_map *map1, struct isl_map *map2) +isl_bool isl_map_is_strict_subset(__isl_keep isl_map *map1, + __isl_keep isl_map *map2) { - int is_subset; + isl_bool is_subset; if (!map1 || !map2) - return -1; + return isl_bool_error; is_subset = isl_map_is_subset(map1, map2); - if (is_subset != 1) + if (is_subset != isl_bool_true) return is_subset; is_subset = isl_map_is_subset(map2, map1); - if (is_subset == -1) + if (is_subset == isl_bool_error) return is_subset; return !is_subset; } -int isl_set_is_strict_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2) +isl_bool isl_set_is_strict_subset(__isl_keep isl_set *set1, + __isl_keep isl_set *set2) { return isl_map_is_strict_subset((isl_map *)set1, (isl_map *)set2); } -int isl_basic_map_is_universe(struct isl_basic_map *bmap) +isl_bool isl_basic_map_is_universe(__isl_keep isl_basic_map *bmap) { if (!bmap) - return -1; + return isl_bool_error; return bmap->n_eq == 0 && bmap->n_ineq == 0; } -int isl_basic_set_is_universe(struct isl_basic_set *bset) +isl_bool isl_basic_set_is_universe(__isl_keep isl_basic_set *bset) { if (!bset) - return -1; + return isl_bool_error; return bset->n_eq == 0 && bset->n_ineq == 0; } -int isl_map_plain_is_universe(__isl_keep isl_map *map) +isl_bool isl_map_plain_is_universe(__isl_keep isl_map *map) { int i; if (!map) - return -1; + return isl_bool_error; for (i = 0; i < map->n; ++i) { - int r = isl_basic_map_is_universe(map->p[i]); + isl_bool r = isl_basic_map_is_universe(map->p[i]); if (r < 0 || r) return r; } - return 0; + return isl_bool_false; } -int isl_set_plain_is_universe(__isl_keep isl_set *set) +isl_bool isl_set_plain_is_universe(__isl_keep isl_set *set) { return isl_map_plain_is_universe((isl_map *) set); } -int isl_set_fast_is_universe(__isl_keep isl_set *set) -{ - return isl_set_plain_is_universe(set); -} - -int isl_basic_map_is_empty(struct isl_basic_map *bmap) +isl_bool isl_basic_map_is_empty(__isl_keep isl_basic_map *bmap) { struct isl_basic_set *bset = NULL; struct isl_vec *sample = NULL; - int empty; + isl_bool empty; unsigned total; if (!bmap) - return -1; + return isl_bool_error; if (ISL_F_ISSET(bmap, ISL_BASIC_MAP_EMPTY)) - return 1; + return isl_bool_true; if (isl_basic_map_is_universe(bmap)) - return 0; + return isl_bool_false; if (ISL_F_ISSET(bmap, ISL_BASIC_MAP_RATIONAL)) { struct isl_basic_map *copy = isl_basic_map_copy(bmap); @@ -7862,18 +7906,18 @@ if (bmap->sample && bmap->sample->size == total) { int contains = isl_basic_map_contains(bmap, bmap->sample); if (contains < 0) - return -1; + return isl_bool_error; if (contains) - return 0; + return isl_bool_false; } isl_vec_free(bmap->sample); bmap->sample = NULL; bset = isl_basic_map_underlying_set(isl_basic_map_copy(bmap)); if (!bset) - return -1; + return isl_bool_error; sample = isl_basic_set_sample_vec(bset); if (!sample) - return -1; + return isl_bool_error; empty = sample->size == 0; isl_vec_free(bmap->sample); bmap->sample = sample; @@ -7883,31 +7927,21 @@ return empty; } -int isl_basic_map_plain_is_empty(__isl_keep isl_basic_map *bmap) +isl_bool isl_basic_map_plain_is_empty(__isl_keep isl_basic_map *bmap) { if (!bmap) - return -1; + return isl_bool_error; return ISL_F_ISSET(bmap, ISL_BASIC_MAP_EMPTY); } -int isl_basic_map_fast_is_empty(__isl_keep isl_basic_map *bmap) -{ - return isl_basic_map_plain_is_empty(bmap); -} - -int isl_basic_set_plain_is_empty(__isl_keep isl_basic_set *bset) +isl_bool isl_basic_set_plain_is_empty(__isl_keep isl_basic_set *bset) { if (!bset) - return -1; + return isl_bool_error; return ISL_F_ISSET(bset, ISL_BASIC_SET_EMPTY); } -int isl_basic_set_fast_is_empty(__isl_keep isl_basic_set *bset) -{ - return isl_basic_set_plain_is_empty(bset); -} - -int isl_basic_set_is_empty(struct isl_basic_set *bset) +isl_bool isl_basic_set_is_empty(__isl_keep isl_basic_set *bset) { return isl_basic_map_is_empty((struct isl_basic_map *)bset); } @@ -8061,48 +8095,63 @@ return -1; } -struct isl_basic_map *isl_basic_map_align_divs( - struct isl_basic_map *dst, struct isl_basic_map *src) +/* Align the divs of "dst" to those of "src", adding divs from "src" + * if needed. That is, make sure that the first src->n_div divs + * of the result are equal to those of src. + * + * The result is not finalized as by design it will have redundant + * divs if any divs from "src" were copied. + */ +__isl_give isl_basic_map *isl_basic_map_align_divs( + __isl_take isl_basic_map *dst, __isl_keep isl_basic_map *src) { int i; + int known, extended; unsigned total; if (!dst || !src) - goto error; + return isl_basic_map_free(dst); if (src->n_div == 0) return dst; - for (i = 0; i < src->n_div; ++i) - isl_assert(src->ctx, !isl_int_is_zero(src->div[i][0]), goto error); + known = isl_basic_map_divs_known(src); + if (known < 0) + return isl_basic_map_free(dst); + if (!known) + isl_die(isl_basic_map_get_ctx(src), isl_error_invalid, + "some src divs are unknown", + return isl_basic_map_free(dst)); src = isl_basic_map_order_divs(src); - dst = isl_basic_map_cow(dst); - if (!dst) - return NULL; - dst = isl_basic_map_extend_space(dst, isl_space_copy(dst->dim), - src->n_div, 0, 2 * src->n_div); - if (!dst) - return NULL; + + extended = 0; total = isl_space_dim(src->dim, isl_dim_all); for (i = 0; i < src->n_div; ++i) { int j = find_div(dst, src, i); if (j < 0) { + if (!extended) { + int extra = src->n_div - i; + dst = isl_basic_map_cow(dst); + if (!dst) + return NULL; + dst = isl_basic_map_extend_space(dst, + isl_space_copy(dst->dim), + extra, 0, 2 * extra); + extended = 1; + } j = isl_basic_map_alloc_div(dst); if (j < 0) - goto error; + return isl_basic_map_free(dst); isl_seq_cpy(dst->div[j], src->div[i], 1+1+total+i); isl_seq_clr(dst->div[j]+1+1+total+i, dst->n_div - i); if (isl_basic_map_add_div_constraints(dst, j) < 0) - goto error; + return isl_basic_map_free(dst); } if (j != i) isl_basic_map_swap_div(dst, i, j); } return dst; -error: - isl_basic_map_free(dst); - return NULL; } struct isl_basic_set *isl_basic_set_align_divs( @@ -8142,6 +8191,59 @@ return (struct isl_set *)isl_map_align_divs((struct isl_map *)set); } +/* Align the divs of the basic maps in "map" to those + * of the basic maps in "list", as well as to the other basic maps in "map". + * The elements in "list" are assumed to have known divs. + */ +__isl_give isl_map *isl_map_align_divs_to_basic_map_list( + __isl_take isl_map *map, __isl_keep isl_basic_map_list *list) +{ + int i, n; + + map = isl_map_compute_divs(map); + map = isl_map_cow(map); + if (!map || !list) + return isl_map_free(map); + if (map->n == 0) + return map; + + n = isl_basic_map_list_n_basic_map(list); + for (i = 0; i < n; ++i) { + isl_basic_map *bmap; + + bmap = isl_basic_map_list_get_basic_map(list, i); + map->p[0] = isl_basic_map_align_divs(map->p[0], bmap); + isl_basic_map_free(bmap); + } + if (!map->p[0]) + return isl_map_free(map); + + return isl_map_align_divs(map); +} + +/* Align the divs of each element of "list" to those of "bmap". + * Both "bmap" and the elements of "list" are assumed to have known divs. + */ +__isl_give isl_basic_map_list *isl_basic_map_list_align_divs_to_basic_map( + __isl_take isl_basic_map_list *list, __isl_keep isl_basic_map *bmap) +{ + int i, n; + + if (!list || !bmap) + return isl_basic_map_list_free(list); + + n = isl_basic_map_list_n_basic_map(list); + for (i = 0; i < n; ++i) { + isl_basic_map *bmap_i; + + bmap_i = isl_basic_map_list_get_basic_map(list, i); + bmap_i = isl_basic_map_align_divs(bmap_i, bmap); + list = isl_basic_map_list_set_basic_map(list, i, bmap_i); + } + + return list; +} + static __isl_give isl_set *set_apply( __isl_take isl_set *set, __isl_take isl_map *map) { @@ -8271,7 +8373,7 @@ bmap2->n_div, bmap2->n_eq, bmap2->n_ineq); bmap1 = add_constraints(bmap1, bmap2, 0, dim1 - pos); if (!bmap1) - goto error; + goto error2; total = isl_basic_map_total_dim(bmap1); ctx = bmap1->ctx; obj = isl_vec_alloc(ctx, 1 + total); @@ -8561,12 +8663,6 @@ return isl_map_plain_is_fixed(set, type, pos, val); } -int isl_map_fast_is_fixed(__isl_keep isl_map *map, - enum isl_dim_type type, unsigned pos, isl_int *val) -{ - return isl_map_plain_is_fixed(map, type, pos, val); -} - /* Check if dimension dim has fixed value and if so and if val is not NULL, * then return this fixed value in *val. */ @@ -8586,12 +8682,6 @@ return isl_set_plain_has_fixed_var(set, isl_set_n_param(set) + dim, val); } -int isl_set_fast_dim_is_fixed(__isl_keep isl_set *set, - unsigned dim, isl_int *val) -{ - return isl_set_plain_dim_is_fixed(set, dim, val); -} - /* Check if input variable in has fixed value and if so and if val is not NULL, * then return this fixed value in *val. */ @@ -8678,57 +8768,41 @@ return fixed; } -struct constraint { - unsigned size; - isl_int *c; -}; - /* uset_gist depends on constraints without existentially quantified * variables sorting first. */ -static int qsort_constraint_cmp(const void *p1, const void *p2) +static int sort_constraint_cmp(const void *p1, const void *p2, void *arg) { - const struct constraint *c1 = (const struct constraint *)p1; - const struct constraint *c2 = (const struct constraint *)p2; + isl_int **c1 = (isl_int **) p1; + isl_int **c2 = (isl_int **) p2; int l1, l2; - unsigned size = isl_min(c1->size, c2->size); + unsigned size = *(unsigned *) arg; - l1 = isl_seq_last_non_zero(c1->c + 1, size); - l2 = isl_seq_last_non_zero(c2->c + 1, size); + l1 = isl_seq_last_non_zero(*c1 + 1, size); + l2 = isl_seq_last_non_zero(*c2 + 1, size); if (l1 != l2) return l1 - l2; - return isl_seq_cmp(c1->c + 1, c2->c + 1, size); + return isl_seq_cmp(*c1 + 1, *c2 + 1, size); } static struct isl_basic_map *isl_basic_map_sort_constraints( struct isl_basic_map *bmap) { - int i; - struct constraint *c; unsigned total; if (!bmap) return NULL; if (bmap->n_ineq == 0) return bmap; + if (ISL_F_ISSET(bmap, ISL_BASIC_MAP_NORMALIZED)) + return bmap; total = isl_basic_map_total_dim(bmap); - c = isl_alloc_array(bmap->ctx, struct constraint, bmap->n_ineq); - if (!c) - goto error; - for (i = 0; i < bmap->n_ineq; ++i) { - c[i].size = total; - c[i].c = bmap->ineq[i]; - } - qsort(c, bmap->n_ineq, sizeof(struct constraint), qsort_constraint_cmp); - for (i = 0; i < bmap->n_ineq; ++i) - bmap->ineq[i] = c[i].c; - free(c); + if (isl_sort(bmap->ineq, bmap->n_ineq, sizeof(isl_int *), + &sort_constraint_cmp, &total) < 0) + return isl_basic_map_free(bmap); return bmap; -error: - isl_basic_map_free(bmap); - return NULL; } __isl_give isl_basic_set *isl_basic_set_sort_constraints( @@ -8763,6 +8837,9 @@ int i, cmp; unsigned total; + if (!bmap1 || !bmap2) + return -1; + if (bmap1 == bmap2) return 0; if (ISL_F_ISSET(bmap1, ISL_BASIC_MAP_RATIONAL) != @@ -8830,13 +8907,15 @@ return 0; } -int isl_basic_map_plain_is_equal(__isl_keep isl_basic_map *bmap1, +isl_bool isl_basic_map_plain_is_equal(__isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2) { + if (!bmap1 || !bmap2) + return isl_bool_error; return isl_basic_map_plain_cmp(bmap1, bmap2) == 0; } -int isl_basic_set_plain_is_equal(__isl_keep isl_basic_set *bset1, +isl_bool isl_basic_set_plain_is_equal(__isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2) { return isl_basic_map_plain_is_equal((isl_basic_map *)bset1, @@ -8851,63 +8930,114 @@ return isl_basic_map_plain_cmp(bmap1, bmap2); } -/* We normalize in place, but if anything goes wrong we need - * to return NULL, so we need to make sure we don't change the - * meaning of any possible other copies of map. +/* Sort the basic maps of "map" and remove duplicate basic maps. + * + * While removing basic maps, we make sure that the basic maps remain + * sorted because isl_map_normalize expects the basic maps of the result + * to be sorted. */ -struct isl_map *isl_map_normalize(struct isl_map *map) +static __isl_give isl_map *sort_and_remove_duplicates(__isl_take isl_map *map) { int i, j; - struct isl_basic_map *bmap; - if (!map) - return NULL; - if (ISL_F_ISSET(map, ISL_MAP_NORMALIZED)) - return map; - for (i = 0; i < map->n; ++i) { - bmap = isl_basic_map_normalize(isl_basic_map_copy(map->p[i])); - if (!bmap) - goto error; - isl_basic_map_free(map->p[i]); - map->p[i] = bmap; - } - qsort(map->p, map->n, sizeof(struct isl_basic_map *), qsort_bmap_cmp); - ISL_F_SET(map, ISL_MAP_NORMALIZED); map = isl_map_remove_empty_parts(map); if (!map) return NULL; + qsort(map->p, map->n, sizeof(struct isl_basic_map *), qsort_bmap_cmp); for (i = map->n - 1; i >= 1; --i) { - if (!isl_basic_map_plain_is_equal(map->p[i-1], map->p[i])) + if (!isl_basic_map_plain_is_equal(map->p[i - 1], map->p[i])) continue; isl_basic_map_free(map->p[i-1]); for (j = i; j < map->n; ++j) - map->p[j-1] = map->p[j]; + map->p[j - 1] = map->p[j]; map->n--; } - return map; -error: - isl_map_free(map); - return NULL; + return map; } -struct isl_set *isl_set_normalize(struct isl_set *set) -{ +/* Remove obvious duplicates among the basic maps of "map". + * + * Unlike isl_map_normalize, this function does not remove redundant + * constraints and only removes duplicates that have exactly the same + * constraints in the input. It does sort the constraints and + * the basic maps to ease the detection of duplicates. + * + * If "map" has already been normalized or if the basic maps are + * disjoint, then there can be no duplicates. + */ +__isl_give isl_map *isl_map_remove_obvious_duplicates(__isl_take isl_map *map) +{ + int i; + isl_basic_map *bmap; + + if (!map) + return NULL; + if (map->n <= 1) + return map; + if (ISL_F_ISSET(map, ISL_MAP_NORMALIZED | ISL_MAP_DISJOINT)) + return map; + for (i = 0; i < map->n; ++i) { + bmap = isl_basic_map_copy(map->p[i]); + bmap = isl_basic_map_sort_constraints(bmap); + if (!bmap) + return isl_map_free(map); + isl_basic_map_free(map->p[i]); + map->p[i] = bmap; + } + + map = sort_and_remove_duplicates(map); + return map; +} + +/* We normalize in place, but if anything goes wrong we need + * to return NULL, so we need to make sure we don't change the + * meaning of any possible other copies of map. + */ +__isl_give isl_map *isl_map_normalize(__isl_take isl_map *map) +{ + int i; + struct isl_basic_map *bmap; + + if (!map) + return NULL; + if (ISL_F_ISSET(map, ISL_MAP_NORMALIZED)) + return map; + for (i = 0; i < map->n; ++i) { + bmap = isl_basic_map_normalize(isl_basic_map_copy(map->p[i])); + if (!bmap) + goto error; + isl_basic_map_free(map->p[i]); + map->p[i] = bmap; + } + + map = sort_and_remove_duplicates(map); + if (map) + ISL_F_SET(map, ISL_MAP_NORMALIZED); + return map; +error: + isl_map_free(map); + return NULL; +} + +struct isl_set *isl_set_normalize(struct isl_set *set) +{ return (struct isl_set *)isl_map_normalize((struct isl_map *)set); } -int isl_map_plain_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2) +isl_bool isl_map_plain_is_equal(__isl_keep isl_map *map1, + __isl_keep isl_map *map2) { int i; - int equal; + isl_bool equal; if (!map1 || !map2) - return -1; + return isl_bool_error; if (map1 == map2) - return 1; + return isl_bool_true; if (!isl_space_is_equal(map1->dim, map2->dim)) - return 0; + return isl_bool_false; map1 = isl_map_copy(map1); map2 = isl_map_copy(map2); @@ -8927,25 +9057,16 @@ error: isl_map_free(map1); isl_map_free(map2); - return -1; + return isl_bool_error; } -int isl_map_fast_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2) -{ - return isl_map_plain_is_equal(map1, map2); -} - -int isl_set_plain_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2) +isl_bool isl_set_plain_is_equal(__isl_keep isl_set *set1, + __isl_keep isl_set *set2) { return isl_map_plain_is_equal((struct isl_map *)set1, (struct isl_map *)set2); } -int isl_set_fast_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2) -{ - return isl_set_plain_is_equal(set1, set2); -} - /* Return an interval that ranges from min to max (inclusive) */ struct isl_basic_set *isl_basic_set_interval(struct isl_ctx *ctx, @@ -8976,6 +9097,70 @@ return NULL; } +/* Return the basic maps in "map" as a list. + */ +__isl_give isl_basic_map_list *isl_map_get_basic_map_list( + __isl_keep isl_map *map) +{ + int i; + isl_ctx *ctx; + isl_basic_map_list *list; + + if (!map) + return NULL; + ctx = isl_map_get_ctx(map); + list = isl_basic_map_list_alloc(ctx, map->n); + + for (i = 0; i < map->n; ++i) { + isl_basic_map *bmap; + + bmap = isl_basic_map_copy(map->p[i]); + list = isl_basic_map_list_add(list, bmap); + } + + return list; +} + +/* Return the intersection of the elements in the non-empty list "list". + * All elements are assumed to live in the same space. + */ +__isl_give isl_basic_map *isl_basic_map_list_intersect( + __isl_take isl_basic_map_list *list) +{ + int i, n; + isl_basic_map *bmap; + + if (!list) + return NULL; + n = isl_basic_map_list_n_basic_map(list); + if (n < 1) + isl_die(isl_basic_map_list_get_ctx(list), isl_error_invalid, + "expecting non-empty list", goto error); + + bmap = isl_basic_map_list_get_basic_map(list, 0); + for (i = 1; i < n; ++i) { + isl_basic_map *bmap_i; + + bmap_i = isl_basic_map_list_get_basic_map(list, i); + bmap = isl_basic_map_intersect(bmap, bmap_i); + } + + isl_basic_map_list_free(list); + return bmap; +error: + isl_basic_map_list_free(list); + return NULL; +} + +/* Return the intersection of the elements in the non-empty list "list". + * All elements are assumed to live in the same space. + */ +__isl_give isl_basic_set *isl_basic_set_list_intersect( + __isl_take isl_basic_set_list *list) +{ + return isl_basic_map_list_intersect(list); +} + /* Return the Cartesian product of the basic sets in list (in the given order). */ __isl_give isl_basic_set *isl_basic_set_list_product( @@ -9194,12 +9379,22 @@ return prod; } +/* Apply "basic_map_product" to each pair of basic maps in "map1" and "map2" + * and collect the results. + * The result live in the space obtained by calling "space_product" + * on the spaces of "map1" and "map2". + * If "remove_duplicates" is set then the result may contain duplicates + * (even if the inputs do not) and so we try and remove the obvious + * duplicates. + */ static __isl_give isl_map *map_product(__isl_take isl_map *map1, __isl_take isl_map *map2, - __isl_give isl_space *(*dim_product)(__isl_take isl_space *left, + __isl_give isl_space *(*space_product)(__isl_take isl_space *left, __isl_take isl_space *right), __isl_give isl_basic_map *(*basic_map_product)( - __isl_take isl_basic_map *left, __isl_take isl_basic_map *right)) + __isl_take isl_basic_map *left, + __isl_take isl_basic_map *right), + int remove_duplicates) { unsigned flags = 0; struct isl_map *result; @@ -9215,7 +9410,7 @@ ISL_F_ISSET(map2, ISL_MAP_DISJOINT)) ISL_FL_SET(flags, ISL_MAP_DISJOINT); - result = isl_map_alloc_space(dim_product(isl_space_copy(map1->dim), + result = isl_map_alloc_space(space_product(isl_space_copy(map1->dim), isl_space_copy(map2->dim)), map1->n * map2->n, flags); if (!result) @@ -9232,6 +9427,8 @@ if (!result) goto error; } + if (remove_duplicates) + result = isl_map_remove_obvious_duplicates(result); isl_map_free(map1); isl_map_free(map2); return result; @@ -9246,7 +9443,8 @@ static __isl_give isl_map *map_product_aligned(__isl_take isl_map *map1, __isl_take isl_map *map2) { - return map_product(map1, map2, &isl_space_product, &isl_basic_map_product); + return map_product(map1, map2, &isl_space_product, + &isl_basic_map_product, 0); } __isl_give isl_map *isl_map_product(__isl_take isl_map *map1, @@ -9286,7 +9484,7 @@ __isl_take isl_map *map2) { return map_product(map1, map2, &isl_space_domain_product, - &isl_basic_map_domain_product); + &isl_basic_map_domain_product, 1); } /* Given two maps A -> B and C -> D, construct a map (A * C) -> [B -> D] @@ -9295,7 +9493,7 @@ __isl_take isl_map *map2) { return map_product(map1, map2, &isl_space_range_product, - &isl_basic_map_range_product); + &isl_basic_map_range_product, 1); } __isl_give isl_map *isl_map_domain_product(__isl_take isl_map *map1, @@ -9312,6 +9510,152 @@ &map_range_product_aligned); } +/* Given a map of the form [A -> B] -> [C -> D], return the map A -> C. + */ +__isl_give isl_map *isl_map_factor_domain(__isl_take isl_map *map) +{ + isl_space *space; + int total1, keep1, total2, keep2; + + if (!map) + return NULL; + if (!isl_space_domain_is_wrapping(map->dim) || + !isl_space_range_is_wrapping(map->dim)) + isl_die(isl_map_get_ctx(map), isl_error_invalid, + "not a product", return isl_map_free(map)); + + space = isl_map_get_space(map); + total1 = isl_space_dim(space, isl_dim_in); + total2 = isl_space_dim(space, isl_dim_out); + space = isl_space_factor_domain(space); + keep1 = isl_space_dim(space, isl_dim_in); + keep2 = isl_space_dim(space, isl_dim_out); + map = isl_map_project_out(map, isl_dim_in, keep1, total1 - keep1); + map = isl_map_project_out(map, isl_dim_out, keep2, total2 - keep2); + map = isl_map_reset_space(map, space); + + return map; +} + +/* Given a map of the form [A -> B] -> [C -> D], return the map B -> D. + */ +__isl_give isl_map *isl_map_factor_range(__isl_take isl_map *map) +{ + isl_space *space; + int total1, keep1, total2, keep2; + + if (!map) + return NULL; + if (!isl_space_domain_is_wrapping(map->dim) || + !isl_space_range_is_wrapping(map->dim)) + isl_die(isl_map_get_ctx(map), isl_error_invalid, + "not a product", return isl_map_free(map)); + + space = isl_map_get_space(map); + total1 = isl_space_dim(space, isl_dim_in); + total2 = isl_space_dim(space, isl_dim_out); + space = isl_space_factor_range(space); + keep1 = isl_space_dim(space, isl_dim_in); + keep2 = isl_space_dim(space, isl_dim_out); + map = isl_map_project_out(map, isl_dim_in, 0, total1 - keep1); + map = isl_map_project_out(map, isl_dim_out, 0, total2 - keep2); + map = isl_map_reset_space(map, space); + + return map; +} + +/* Given a map of the form [A -> B] -> C, return the map A -> C. + */ +__isl_give isl_map *isl_map_domain_factor_domain(__isl_take isl_map *map) +{ + isl_space *space; + int total, keep; + + if (!map) + return NULL; + if (!isl_space_domain_is_wrapping(map->dim)) + isl_die(isl_map_get_ctx(map), isl_error_invalid, + "domain is not a product", return isl_map_free(map)); + + space = isl_map_get_space(map); + total = isl_space_dim(space, isl_dim_in); + space = isl_space_domain_factor_domain(space); + keep = isl_space_dim(space, isl_dim_in); + map = isl_map_project_out(map, isl_dim_in, keep, total - keep); + map = isl_map_reset_space(map, space); + + return map; +} + +/* Given a map of the form [A -> B] -> C, return the map B -> C. + */ +__isl_give isl_map *isl_map_domain_factor_range(__isl_take isl_map *map) +{ + isl_space *space; + int total, keep; + + if (!map) + return NULL; + if (!isl_space_domain_is_wrapping(map->dim)) + isl_die(isl_map_get_ctx(map), isl_error_invalid, + "domain is not a product", return isl_map_free(map)); + + space = isl_map_get_space(map); + total = isl_space_dim(space, isl_dim_in); + space = isl_space_domain_factor_range(space); + keep = isl_space_dim(space, isl_dim_in); + map = isl_map_project_out(map, isl_dim_in, 0, total - keep); + map = isl_map_reset_space(map, space); + + return map; +} + +/* Given a map A -> [B -> C], extract the map A -> B. + */ +__isl_give isl_map *isl_map_range_factor_domain(__isl_take isl_map *map) +{ + isl_space *space; + int total, keep; + + if (!map) + return NULL; + if (!isl_space_range_is_wrapping(map->dim)) + isl_die(isl_map_get_ctx(map), isl_error_invalid, + "range is not a product", return isl_map_free(map)); + + space = isl_map_get_space(map); + total = isl_space_dim(space, isl_dim_out); + space = isl_space_range_factor_domain(space); + keep = isl_space_dim(space, isl_dim_out); + map = isl_map_project_out(map, isl_dim_out, keep, total - keep); + map = isl_map_reset_space(map, space); + + return map; +} + +/* Given a map A -> [B -> C], extract the map A -> C. + */ +__isl_give isl_map *isl_map_range_factor_range(__isl_take isl_map *map) +{ + isl_space *space; + int total, keep; + + if (!map) + return NULL; + if (!isl_space_range_is_wrapping(map->dim)) + isl_die(isl_map_get_ctx(map), isl_error_invalid, + "range is not a product", return isl_map_free(map)); + + space = isl_map_get_space(map); + total = isl_space_dim(space, isl_dim_out); + space = isl_space_range_factor_range(space); + keep = isl_space_dim(space, isl_dim_out); + map = isl_map_project_out(map, isl_dim_out, 0, total - keep); + map = isl_map_reset_space(map, space); + + return map; +} + /* Given two maps A -> B and C -> D, construct a map (A, C) -> (B * D) */ __isl_give isl_map *isl_map_flat_domain_product(__isl_take isl_map *map1, @@ -9446,39 +9790,46 @@ return 1; } +/* Return the number of basic maps in the (current) representation of "map". + */ +int isl_map_n_basic_map(__isl_keep isl_map *map) +{ + return map ? map->n : 0; +} + int isl_set_n_basic_set(__isl_keep isl_set *set) { return set ? set->n : 0; } -int isl_map_foreach_basic_map(__isl_keep isl_map *map, - int (*fn)(__isl_take isl_basic_map *bmap, void *user), void *user) +isl_stat isl_map_foreach_basic_map(__isl_keep isl_map *map, + isl_stat (*fn)(__isl_take isl_basic_map *bmap, void *user), void *user) { int i; if (!map) - return -1; + return isl_stat_error; for (i = 0; i < map->n; ++i) if (fn(isl_basic_map_copy(map->p[i]), user) < 0) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } -int isl_set_foreach_basic_set(__isl_keep isl_set *set, - int (*fn)(__isl_take isl_basic_set *bset, void *user), void *user) +isl_stat isl_set_foreach_basic_set(__isl_keep isl_set *set, + isl_stat (*fn)(__isl_take isl_basic_set *bset, void *user), void *user) { int i; if (!set) - return -1; + return isl_stat_error; for (i = 0; i < set->n; ++i) if (fn(isl_basic_set_copy(set->p[i]), user) < 0) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } __isl_give isl_basic_set *isl_basic_set_lift(__isl_take isl_basic_set *bset) @@ -9638,15 +9989,16 @@ /* Check if there is any lower bound (if lower == 0) and/or upper * bound (if upper == 0) on the specified dim. */ -static int basic_map_dim_is_bounded(__isl_keep isl_basic_map *bmap, +static isl_bool basic_map_dim_is_bounded(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos, int lower, int upper) { int i; if (!bmap) - return -1; + return isl_bool_error; - isl_assert(bmap->ctx, pos < isl_basic_map_dim(bmap, type), return -1); + isl_assert(bmap->ctx, pos < isl_basic_map_dim(bmap, type), + return isl_bool_error); pos += isl_basic_map_offset(bmap, type); @@ -9654,12 +10006,12 @@ if (isl_int_is_zero(bmap->div[i][0])) continue; if (!isl_int_is_zero(bmap->div[i][1 + pos])) - return 1; + return isl_bool_true; } for (i = 0; i < bmap->n_eq; ++i) if (!isl_int_is_zero(bmap->eq[i][pos])) - return 1; + return isl_bool_true; for (i = 0; i < bmap->n_ineq; ++i) { int sgn = isl_int_sgn(bmap->ineq[i][pos]); @@ -9678,13 +10030,13 @@ return basic_map_dim_is_bounded(bmap, type, pos, 0, 0); } -int isl_basic_map_dim_has_lower_bound(__isl_keep isl_basic_map *bmap, +isl_bool isl_basic_map_dim_has_lower_bound(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos) { return basic_map_dim_is_bounded(bmap, type, pos, 0, 1); } -int isl_basic_map_dim_has_upper_bound(__isl_keep isl_basic_map *bmap, +isl_bool isl_basic_map_dim_has_upper_bound(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos) { return basic_map_dim_is_bounded(bmap, type, pos, 1, 0); @@ -9719,29 +10071,29 @@ /* Does "map" have a bound (according to "fn") for any of its basic maps? */ -static int has_any_bound(__isl_keep isl_map *map, +static isl_bool has_any_bound(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos, - int (*fn)(__isl_keep isl_basic_map *bmap, + isl_bool (*fn)(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos)) { int i; if (!map) - return -1; + return isl_bool_error; for (i = 0; i < map->n; ++i) { - int bounded; + isl_bool bounded; bounded = fn(map->p[i], type, pos); if (bounded < 0 || bounded) return bounded; } - return 0; + return isl_bool_false; } /* Return 1 if the specified dim is involved in any lower bound. */ -int isl_set_dim_has_any_lower_bound(__isl_keep isl_set *set, +isl_bool isl_set_dim_has_any_lower_bound(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos) { return has_any_bound(set, type, pos, @@ -9750,7 +10102,7 @@ /* Return 1 if the specified dim is involved in any upper bound. */ -int isl_set_dim_has_any_upper_bound(__isl_keep isl_set *set, +isl_bool isl_set_dim_has_any_upper_bound(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos) { return has_any_bound(set, type, pos, @@ -9759,29 +10111,29 @@ /* Does "map" have a bound (according to "fn") for all of its basic maps? */ -static int has_bound(__isl_keep isl_map *map, +static isl_bool has_bound(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos, - int (*fn)(__isl_keep isl_basic_map *bmap, + isl_bool (*fn)(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos)) { int i; if (!map) - return -1; + return isl_bool_error; for (i = 0; i < map->n; ++i) { - int bounded; + isl_bool bounded; bounded = fn(map->p[i], type, pos); if (bounded < 0 || !bounded) return bounded; } - return 1; + return isl_bool_true; } /* Return 1 if the specified dim has a lower bound (in each of its basic sets). */ -int isl_set_dim_has_lower_bound(__isl_keep isl_set *set, +isl_bool isl_set_dim_has_lower_bound(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos) { return has_bound(set, type, pos, &isl_basic_map_dim_has_lower_bound); @@ -9789,7 +10141,7 @@ /* Return 1 if the specified dim has an upper bound (in each of its basic sets). */ -int isl_set_dim_has_upper_bound(__isl_keep isl_set *set, +isl_bool isl_set_dim_has_upper_bound(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos) { return has_bound(set, type, pos, &isl_basic_map_dim_has_upper_bound); @@ -9871,38 +10223,110 @@ return isl_basic_set_vars_get_sign(bset, first, n, signs); } +/* Is it possible for the integer division "div" to depend (possibly + * indirectly) on any output dimensions? + * + * If the div is undefined, then we conservatively assume that it + * may depend on them. + * Otherwise, we check if it actually depends on them or on any integer + * divisions that may depend on them. + */ +static int div_may_involve_output(__isl_keep isl_basic_map *bmap, int div) +{ + int i; + unsigned n_out, o_out; + unsigned n_div, o_div; + + if (isl_int_is_zero(bmap->div[div][0])) + return 1; + + n_out = isl_basic_map_dim(bmap, isl_dim_out); + o_out = isl_basic_map_offset(bmap, isl_dim_out); + + if (isl_seq_first_non_zero(bmap->div[div] + 1 + o_out, n_out) != -1) + return 1; + + n_div = isl_basic_map_dim(bmap, isl_dim_div); + o_div = isl_basic_map_offset(bmap, isl_dim_div); + + for (i = 0; i < n_div; ++i) { + if (isl_int_is_zero(bmap->div[div][1 + o_div + i])) + continue; + if (div_may_involve_output(bmap, i)) + return 1; + } + + return 0; +} + +/* Return the index of the equality of "bmap" that defines + * the output dimension "pos" in terms of earlier dimensions. + * The equality may also involve integer divisions, as long + * as those integer divisions are defined in terms of + * parameters or input dimensions. + * Return bmap->n_eq if there is no such equality. + * Return -1 on error. + */ +int isl_basic_map_output_defining_equality(__isl_keep isl_basic_map *bmap, + int pos) +{ + int j, k; + unsigned n_out, o_out; + unsigned n_div, o_div; + + if (!bmap) + return -1; + + n_out = isl_basic_map_dim(bmap, isl_dim_out); + o_out = isl_basic_map_offset(bmap, isl_dim_out); + n_div = isl_basic_map_dim(bmap, isl_dim_div); + o_div = isl_basic_map_offset(bmap, isl_dim_div); + + for (j = 0; j < bmap->n_eq; ++j) { + if (isl_int_is_zero(bmap->eq[j][o_out + pos])) + continue; + if (isl_seq_first_non_zero(bmap->eq[j] + o_out + pos + 1, + n_out - (pos + 1)) != -1) + continue; + for (k = 0; k < n_div; ++k) { + if (isl_int_is_zero(bmap->eq[j][o_div + k])) + continue; + if (div_may_involve_output(bmap, k)) + break; + } + if (k >= n_div) + return j; + } + + return bmap->n_eq; +} + /* Check if the given basic map is obviously single-valued. * In particular, for each output dimension, check that there is * an equality that defines the output dimension in terms of * earlier dimensions. */ -int isl_basic_map_plain_is_single_valued(__isl_keep isl_basic_map *bmap) +isl_bool isl_basic_map_plain_is_single_valued(__isl_keep isl_basic_map *bmap) { - int i, j; - unsigned total; + int i; unsigned n_out; - unsigned o_out; if (!bmap) - return -1; + return isl_bool_error; - total = 1 + isl_basic_map_total_dim(bmap); n_out = isl_basic_map_dim(bmap, isl_dim_out); - o_out = isl_basic_map_offset(bmap, isl_dim_out); for (i = 0; i < n_out; ++i) { - for (j = 0; j < bmap->n_eq; ++j) { - if (isl_int_is_zero(bmap->eq[j][o_out + i])) - continue; - if (isl_seq_first_non_zero(bmap->eq[j] + o_out + i + 1, - total - (o_out + i + 1)) == -1) - break; - } - if (j >= bmap->n_eq) - return 0; + int eq; + + eq = isl_basic_map_output_defining_equality(bmap, i); + if (eq < 0) + return isl_bool_error; + if (eq >= bmap->n_eq) + return isl_bool_false; } - return 1; + return isl_bool_true; } /* Check if the given basic map is single-valued. @@ -9912,12 +10336,12 @@ * * and check if the result is a subset of the identity mapping. */ -int isl_basic_map_is_single_valued(__isl_keep isl_basic_map *bmap) +isl_bool isl_basic_map_is_single_valued(__isl_keep isl_basic_map *bmap) { isl_space *space; isl_basic_map *test; isl_basic_map *id; - int sv; + isl_bool sv; sv = isl_basic_map_plain_is_single_valued(bmap); if (sv < 0 || sv) @@ -9940,14 +10364,14 @@ /* Check if the given map is obviously single-valued. */ -int isl_map_plain_is_single_valued(__isl_keep isl_map *map) +isl_bool isl_map_plain_is_single_valued(__isl_keep isl_map *map) { if (!map) - return -1; + return isl_bool_error; if (map->n == 0) - return 1; + return isl_bool_true; if (map->n >= 2) - return 0; + return isl_bool_false; return isl_basic_map_plain_is_single_valued(map->p[0]); } @@ -9959,12 +10383,12 @@ * * and check if the result is a subset of the identity mapping. */ -int isl_map_is_single_valued(__isl_keep isl_map *map) +isl_bool isl_map_is_single_valued(__isl_keep isl_map *map) { isl_space *dim; isl_map *test; isl_map *id; - int sv; + isl_bool sv; sv = isl_map_plain_is_single_valued(map); if (sv < 0 || sv) @@ -9984,9 +10408,9 @@ return sv; } -int isl_map_is_injective(__isl_keep isl_map *map) +isl_bool isl_map_is_injective(__isl_keep isl_map *map) { - int in; + isl_bool in; map = isl_map_copy(map); map = isl_map_reverse(map); @@ -9998,9 +10422,9 @@ /* Check if the given map is obviously injective. */ -int isl_map_plain_is_injective(__isl_keep isl_map *map) +isl_bool isl_map_plain_is_injective(__isl_keep isl_map *map) { - int in; + isl_bool in; map = isl_map_copy(map); map = isl_map_reverse(map); @@ -10010,9 +10434,9 @@ return in; } -int isl_map_is_bijective(__isl_keep isl_map *map) +isl_bool isl_map_is_bijective(__isl_keep isl_map *map) { - int sv; + isl_bool sv; sv = isl_map_is_single_valued(map); if (sv < 0 || !sv) @@ -10021,7 +10445,7 @@ return isl_map_is_injective(map); } -int isl_set_is_singleton(__isl_keep isl_set *set) +isl_bool isl_set_is_singleton(__isl_keep isl_set *set) { return isl_map_is_single_valued((isl_map *)set); } @@ -10099,22 +10523,42 @@ return isl_basic_set_is_box(set->p[0]); } -int isl_basic_set_is_wrapping(__isl_keep isl_basic_set *bset) +isl_bool isl_basic_set_is_wrapping(__isl_keep isl_basic_set *bset) { if (!bset) - return -1; + return isl_bool_error; return isl_space_is_wrapping(bset->dim); } -int isl_set_is_wrapping(__isl_keep isl_set *set) +isl_bool isl_set_is_wrapping(__isl_keep isl_set *set) { if (!set) - return -1; + return isl_bool_error; return isl_space_is_wrapping(set->dim); } +/* Is the domain of "map" a wrapped relation? + */ +isl_bool isl_map_domain_is_wrapping(__isl_keep isl_map *map) +{ + if (!map) + return isl_bool_error; + + return isl_space_domain_is_wrapping(map->dim); +} + +/* Is the range of "map" a wrapped relation? + */ +isl_bool isl_map_range_is_wrapping(__isl_keep isl_map *map) +{ + if (!map) + return isl_bool_error; + + return isl_space_range_is_wrapping(map->dim); +} + __isl_give isl_basic_set *isl_basic_map_wrap(__isl_take isl_basic_map *bmap) { bmap = isl_basic_map_cow(bmap); @@ -10776,18 +11220,18 @@ c1, c2, c3, c4, isl_dim_in); } -int isl_basic_map_can_zip(__isl_keep isl_basic_map *bmap) +isl_bool isl_basic_map_can_zip(__isl_keep isl_basic_map *bmap) { if (!bmap) - return -1; + return isl_bool_error; return isl_space_can_zip(bmap->dim); } -int isl_map_can_zip(__isl_keep isl_map *map) +isl_bool isl_map_can_zip(__isl_keep isl_map *map) { if (!map) - return -1; + return isl_bool_error; return isl_space_can_zip(map->dim); } @@ -10861,10 +11305,10 @@ /* Can we apply isl_basic_map_curry to "bmap"? * That is, does it have a nested relation in its domain? */ -int isl_basic_map_can_curry(__isl_keep isl_basic_map *bmap) +isl_bool isl_basic_map_can_curry(__isl_keep isl_basic_map *bmap) { if (!bmap) - return -1; + return isl_bool_error; return isl_space_can_curry(bmap->dim); } @@ -10872,10 +11316,10 @@ /* Can we apply isl_map_curry to "map"? * That is, does it have a nested relation in its domain? */ -int isl_map_can_curry(__isl_keep isl_map *map) +isl_bool isl_map_can_curry(__isl_keep isl_map *map) { if (!map) - return -1; + return isl_bool_error; return isl_space_can_curry(map->dim); } @@ -10941,10 +11385,10 @@ /* Can we apply isl_basic_map_uncurry to "bmap"? * That is, does it have a nested relation in its domain? */ -int isl_basic_map_can_uncurry(__isl_keep isl_basic_map *bmap) +isl_bool isl_basic_map_can_uncurry(__isl_keep isl_basic_map *bmap) { if (!bmap) - return -1; + return isl_bool_error; return isl_space_can_uncurry(bmap->dim); } @@ -10952,10 +11396,10 @@ /* Can we apply isl_map_uncurry to "map"? * That is, does it have a nested relation in its domain? */ -int isl_map_can_uncurry(__isl_keep isl_map *map) +isl_bool isl_map_can_uncurry(__isl_keep isl_map *map) { if (!map) - return -1; + return isl_bool_error; return isl_space_can_uncurry(map->dim); } @@ -11075,7 +11519,7 @@ if (isl_space_dim(maff->space, isl_dim_out) != maff->n) isl_die(isl_multi_aff_get_ctx(maff), isl_error_internal, - "invalid space", return isl_multi_aff_free(maff)); + "invalid space", goto error); space = isl_space_domain(isl_multi_aff_get_space(maff)); bmap = isl_basic_map_universe(isl_space_from_domain(space)); @@ -11094,6 +11538,9 @@ isl_multi_aff_free(maff); return bmap; +error: + isl_multi_aff_free(maff); + return NULL; } /* Construct a map mapping the domain the multi-affine expression @@ -11253,37 +11700,81 @@ return NULL; } -/* Add a constraint imposing that the value of the first dimension is +/* Construct a constraint imposing that the value of the first dimension is * greater than or equal to that of the second. */ -__isl_give isl_basic_map *isl_basic_map_order_ge(__isl_take isl_basic_map *bmap, - enum isl_dim_type type1, int pos1, enum isl_dim_type type2, int pos2) +static __isl_give isl_constraint *constraint_order_ge( + __isl_take isl_space *space, enum isl_dim_type type1, int pos1, + enum isl_dim_type type2, int pos2) { isl_constraint *c; - isl_local_space *ls; - if (!bmap) + if (!space) return NULL; - if (pos1 >= isl_basic_map_dim(bmap, type1)) - isl_die(bmap->ctx, isl_error_invalid, - "index out of bounds", return isl_basic_map_free(bmap)); - if (pos2 >= isl_basic_map_dim(bmap, type2)) - isl_die(bmap->ctx, isl_error_invalid, - "index out of bounds", return isl_basic_map_free(bmap)); + c = isl_constraint_alloc_inequality(isl_local_space_from_space(space)); + + if (pos1 >= isl_constraint_dim(c, type1)) + isl_die(isl_constraint_get_ctx(c), isl_error_invalid, + "index out of bounds", return isl_constraint_free(c)); + if (pos2 >= isl_constraint_dim(c, type2)) + isl_die(isl_constraint_get_ctx(c), isl_error_invalid, + "index out of bounds", return isl_constraint_free(c)); if (type1 == type2 && pos1 == pos2) - return bmap; + return c; - ls = isl_local_space_from_space(isl_basic_map_get_space(bmap)); - c = isl_inequality_alloc(ls); c = isl_constraint_set_coefficient_si(c, type1, pos1, 1); c = isl_constraint_set_coefficient_si(c, type2, pos2, -1); + + return c; +} + +/* Add a constraint imposing that the value of the first dimension is + * greater than or equal to that of the second. + */ +__isl_give isl_basic_map *isl_basic_map_order_ge(__isl_take isl_basic_map *bmap, + enum isl_dim_type type1, int pos1, enum isl_dim_type type2, int pos2) +{ + isl_constraint *c; + isl_space *space; + + if (type1 == type2 && pos1 == pos2) + return bmap; + space = isl_basic_map_get_space(bmap); + c = constraint_order_ge(space, type1, pos1, type2, pos2); bmap = isl_basic_map_add_constraint(bmap, c); return bmap; } +/* Add a constraint imposing that the value of the first dimension is + * greater than or equal to that of the second. + */ +__isl_give isl_map *isl_map_order_ge(__isl_take isl_map *map, + enum isl_dim_type type1, int pos1, enum isl_dim_type type2, int pos2) +{ + isl_constraint *c; + isl_space *space; + + if (type1 == type2 && pos1 == pos2) + return map; + space = isl_map_get_space(map); + c = constraint_order_ge(space, type1, pos1, type2, pos2); + map = isl_map_add_constraint(map, c); + + return map; +} + +/* Add a constraint imposing that the value of the first dimension is + * less than or equal to that of the second. + */ +__isl_give isl_map *isl_map_order_le(__isl_take isl_map *map, + enum isl_dim_type type1, int pos1, enum isl_dim_type type2, int pos2) +{ + return isl_map_order_ge(map, type2, pos2, type1, pos1); +} + /* Construct a basic map where the value of the first dimension is * greater than that of the second. */ @@ -11309,7 +11800,7 @@ bmap = isl_basic_map_alloc_space(space, 0, 0, 1); i = isl_basic_map_alloc_inequality(bmap); if (i < 0) - goto error; + return isl_basic_map_free(bmap); isl_seq_clr(bmap->ineq[i], 1 + isl_basic_map_total_dim(bmap)); pos1 += isl_basic_map_offset(bmap, type1); pos2 += isl_basic_map_offset(bmap, type2); @@ -11522,12 +12013,25 @@ isl_space *ma_space; ma_space = isl_multi_aff_get_space(ma); - m = isl_space_tuple_match(bmap->dim, type, ma_space, isl_dim_out); - isl_space_free(ma_space); - if (m >= 0 && !m) + + m = isl_space_match(bmap->dim, isl_dim_param, ma_space, isl_dim_param); + if (m < 0) + goto error; + if (!m) isl_die(isl_basic_map_get_ctx(bmap), isl_error_invalid, - "spaces don't match", return -1); + "parameters don't match", goto error); + m = isl_space_tuple_is_equal(bmap->dim, type, ma_space, isl_dim_out); + if (m < 0) + goto error; + if (!m) + isl_die(isl_basic_map_get_ctx(bmap), isl_error_invalid, + "spaces don't match", goto error); + + isl_space_free(ma_space); return m; +error: + isl_space_free(ma_space); + return -1; } /* Copy the divs from "ma" to "bmap", adding zeros for the "n_before" @@ -11829,6 +12333,30 @@ return isl_basic_map_preimage_multi_aff(bset, isl_dim_set, ma); } +/* Compute the preimage of the domain of "bmap" under the function + * represented by "ma". + * In other words, plug in "ma" in the domain of "bmap". + * The result is a basic map that lives in the same space as "bmap" + * except that the domain has been replaced by the domain space of "ma". + */ +__isl_give isl_basic_map *isl_basic_map_preimage_domain_multi_aff( + __isl_take isl_basic_map *bmap, __isl_take isl_multi_aff *ma) +{ + return isl_basic_map_preimage_multi_aff(bmap, isl_dim_in, ma); +} + +/* Compute the preimage of the range of "bmap" under the function + * represented by "ma". + * In other words, plug in "ma" in the range of "bmap". + * The result is a basic map that lives in the same space as "bmap" + * except that the range has been replaced by the domain space of "ma". + */ +__isl_give isl_basic_map *isl_basic_map_preimage_range_multi_aff( + __isl_take isl_basic_map *bmap, __isl_take isl_multi_aff *ma) +{ + return isl_basic_map_preimage_multi_aff(bmap, isl_dim_out, ma); +} + /* Check if the range of "ma" is compatible with the domain or range * (depending on "type") of "map". * Return -1 if anything is wrong. @@ -11841,7 +12369,7 @@ isl_space *ma_space; ma_space = isl_multi_aff_get_space(ma); - m = isl_space_tuple_match(map->dim, type, ma_space, isl_dim_out); + m = isl_space_tuple_is_equal(map->dim, type, ma_space, isl_dim_out); isl_space_free(ma_space); if (m >= 0 && !m) isl_die(isl_map_get_ctx(map), isl_error_invalid, @@ -11927,7 +12455,7 @@ } /* Compute the preimage of "set" under the function represented by "ma". - * In other words, plug in "ma" "set". The result is a set + * In other words, plug in "ma" in "set". The result is a set * that lives in the domain space of "ma". */ __isl_give isl_set *isl_set_preimage_multi_aff(__isl_take isl_set *set, @@ -11948,66 +12476,194 @@ return isl_map_preimage_multi_aff(map, isl_dim_in, ma); } -/* Compute the preimage of "set" under the function represented by "pma". - * In other words, plug in "pma" in "set. The result is a set - * that lives in the domain space of "pma". +/* Compute the preimage of the range of "map" under the function + * represented by "ma". + * In other words, plug in "ma" in the range of "map". + * The result is a map that lives in the same space as "map" + * except that the range has been replaced by the domain space of "ma". */ -static __isl_give isl_set *set_preimage_pw_multi_aff(__isl_take isl_set *set, +__isl_give isl_map *isl_map_preimage_range_multi_aff(__isl_take isl_map *map, + __isl_take isl_multi_aff *ma) +{ + return isl_map_preimage_multi_aff(map, isl_dim_out, ma); +} + +/* Compute the preimage of "map" under the function represented by "pma". + * In other words, plug in "pma" in the domain or range of "map". + * The result is a map that lives in the same space as "map", + * except that the space of type "type" has been replaced by + * the domain space of "pma". + * + * The parameters of "map" and "pma" are assumed to have been aligned. + */ +static __isl_give isl_map *isl_map_preimage_pw_multi_aff_aligned( + __isl_take isl_map *map, enum isl_dim_type type, __isl_take isl_pw_multi_aff *pma) { int i; - isl_set *res; + isl_map *res; if (!pma) goto error; if (pma->n == 0) { isl_pw_multi_aff_free(pma); - res = isl_set_empty(isl_set_get_space(set)); - isl_set_free(set); + res = isl_map_empty(isl_map_get_space(map)); + isl_map_free(map); return res; } - res = isl_set_preimage_multi_aff(isl_set_copy(set), + res = isl_map_preimage_multi_aff(isl_map_copy(map), type, isl_multi_aff_copy(pma->p[0].maff)); - res = isl_set_intersect(res, isl_set_copy(pma->p[0].set)); + if (type == isl_dim_in) + res = isl_map_intersect_domain(res, + isl_map_copy(pma->p[0].set)); + else + res = isl_map_intersect_range(res, + isl_map_copy(pma->p[0].set)); for (i = 1; i < pma->n; ++i) { - isl_set *res_i; + isl_map *res_i; - res_i = isl_set_preimage_multi_aff(isl_set_copy(set), + res_i = isl_map_preimage_multi_aff(isl_map_copy(map), type, isl_multi_aff_copy(pma->p[i].maff)); - res_i = isl_set_intersect(res_i, isl_set_copy(pma->p[i].set)); - res = isl_set_union(res, res_i); + if (type == isl_dim_in) + res_i = isl_map_intersect_domain(res_i, + isl_map_copy(pma->p[i].set)); + else + res_i = isl_map_intersect_range(res_i, + isl_map_copy(pma->p[i].set)); + res = isl_map_union(res, res_i); } isl_pw_multi_aff_free(pma); - isl_set_free(set); + isl_map_free(map); return res; error: isl_pw_multi_aff_free(pma); - isl_set_free(set); + isl_map_free(map); return NULL; } -__isl_give isl_set *isl_set_preimage_pw_multi_aff(__isl_take isl_set *set, - __isl_take isl_pw_multi_aff *pma) +/* Compute the preimage of "map" under the function represented by "pma". + * In other words, plug in "pma" in the domain or range of "map". + * The result is a map that lives in the same space as "map", + * except that the space of type "type" has been replaced by + * the domain space of "pma". + */ +__isl_give isl_map *isl_map_preimage_pw_multi_aff(__isl_take isl_map *map, + enum isl_dim_type type, __isl_take isl_pw_multi_aff *pma) { - if (!set || !pma) + if (!map || !pma) goto error; - if (isl_space_match(set->dim, isl_dim_param, pma->dim, isl_dim_param)) - return set_preimage_pw_multi_aff(set, pma); + if (isl_space_match(map->dim, isl_dim_param, pma->dim, isl_dim_param)) + return isl_map_preimage_pw_multi_aff_aligned(map, type, pma); - if (!isl_space_has_named_params(set->dim) || + if (!isl_space_has_named_params(map->dim) || !isl_space_has_named_params(pma->dim)) - isl_die(set->ctx, isl_error_invalid, + isl_die(map->ctx, isl_error_invalid, "unaligned unnamed parameters", goto error); - set = isl_set_align_params(set, isl_pw_multi_aff_get_space(pma)); - pma = isl_pw_multi_aff_align_params(pma, isl_set_get_space(set)); + map = isl_map_align_params(map, isl_pw_multi_aff_get_space(pma)); + pma = isl_pw_multi_aff_align_params(pma, isl_map_get_space(map)); - return set_preimage_pw_multi_aff(set, pma); + return isl_map_preimage_pw_multi_aff_aligned(map, type, pma); error: isl_pw_multi_aff_free(pma); - return isl_set_free(set); + return isl_map_free(map); +} + +/* Compute the preimage of "set" under the function represented by "pma". + * In other words, plug in "pma" in "set". The result is a set + * that lives in the domain space of "pma". + */ +__isl_give isl_set *isl_set_preimage_pw_multi_aff(__isl_take isl_set *set, + __isl_take isl_pw_multi_aff *pma) +{ + return isl_map_preimage_pw_multi_aff(set, isl_dim_set, pma); +} + +/* Compute the preimage of the domain of "map" under the function + * represented by "pma". + * In other words, plug in "pma" in the domain of "map". + * The result is a map that lives in the same space as "map", + * except that domain space has been replaced by the domain space of "pma". + */ +__isl_give isl_map *isl_map_preimage_domain_pw_multi_aff( + __isl_take isl_map *map, __isl_take isl_pw_multi_aff *pma) +{ + return isl_map_preimage_pw_multi_aff(map, isl_dim_in, pma); +} + +/* Compute the preimage of the range of "map" under the function + * represented by "pma". + * In other words, plug in "pma" in the range of "map". + * The result is a map that lives in the same space as "map", + * except that range space has been replaced by the domain space of "pma". + */ +__isl_give isl_map *isl_map_preimage_range_pw_multi_aff( + __isl_take isl_map *map, __isl_take isl_pw_multi_aff *pma) +{ + return isl_map_preimage_pw_multi_aff(map, isl_dim_out, pma); +} + +/* Compute the preimage of "map" under the function represented by "mpa". + * In other words, plug in "mpa" in the domain or range of "map". + * The result is a map that lives in the same space as "map", + * except that the space of type "type" has been replaced by + * the domain space of "mpa". + * + * If the map does not involve any constraints that refer to the + * dimensions of the substituted space, then the only possible + * effect of "mpa" on the map is to map the space to a different space. + * We create a separate isl_multi_aff to effectuate this change + * in order to avoid spurious splitting of the map along the pieces + * of "mpa". + */ +__isl_give isl_map *isl_map_preimage_multi_pw_aff(__isl_take isl_map *map, + enum isl_dim_type type, __isl_take isl_multi_pw_aff *mpa) +{ + int n; + isl_pw_multi_aff *pma; + + if (!map || !mpa) + goto error; + + n = isl_map_dim(map, type); + if (!isl_map_involves_dims(map, type, 0, n)) { + isl_space *space; + isl_multi_aff *ma; + + space = isl_multi_pw_aff_get_space(mpa); + isl_multi_pw_aff_free(mpa); + ma = isl_multi_aff_zero(space); + return isl_map_preimage_multi_aff(map, type, ma); + } + + pma = isl_pw_multi_aff_from_multi_pw_aff(mpa); + return isl_map_preimage_pw_multi_aff(map, type, pma); +error: + isl_map_free(map); + isl_multi_pw_aff_free(mpa); + return NULL; +} + +/* Compute the preimage of "map" under the function represented by "mpa". + * In other words, plug in "mpa" in the domain "map". + * The result is a map that lives in the same space as "map", + * except that domain space has been replaced by the domain space of "mpa". + */ +__isl_give isl_map *isl_map_preimage_domain_multi_pw_aff( + __isl_take isl_map *map, __isl_take isl_multi_pw_aff *mpa) +{ + return isl_map_preimage_multi_pw_aff(map, isl_dim_in, mpa); +} + +/* Compute the preimage of "set" by the function represented by "mpa". + * In other words, plug in "mpa" in "set". + */ +__isl_give isl_set *isl_set_preimage_multi_pw_aff(__isl_take isl_set *set, + __isl_take isl_multi_pw_aff *mpa) +{ + return isl_map_preimage_multi_pw_aff(set, isl_dim_set, mpa); } diff -Nru cloog-0.18.2/isl/isl_map_list.c cloog-0.18.4/isl/isl_map_list.c --- cloog-0.18.2/isl/isl_map_list.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_map_list.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,32 @@ +#include +#include + +#undef EL +#define EL isl_basic_map + +#include + +#undef BASE +#define BASE basic_map + +#include + +#undef EL +#define EL isl_map + +#include + +#undef BASE +#define BASE map + +#include + +#undef EL +#define EL isl_union_map + +#include + +#undef BASE +#define BASE union_map + +#include diff -Nru cloog-0.18.2/isl/isl_map_no_piplib.c cloog-0.18.4/isl/isl_map_no_piplib.c --- cloog-0.18.2/isl/isl_map_no_piplib.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_map_no_piplib.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -/* - * Copyright 2008-2009 Katholieke Universiteit Leuven - * - * Use of this software is governed by the MIT license - * - * Written by Sven Verdoolaege, K.U.Leuven, Departement - * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium - */ - -#include "isl_map_piplib.h" -#include - -struct isl_map *isl_pip_basic_map_lexopt( - struct isl_basic_map *bmap, struct isl_basic_set *dom, - struct isl_set **empty, int max) -{ - isl_basic_map_free(bmap); - isl_basic_set_free(dom); - return NULL; -} diff -Nru cloog-0.18.2/isl/isl_map_piplib.c cloog-0.18.4/isl/isl_map_piplib.c --- cloog-0.18.2/isl/isl_map_piplib.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_map_piplib.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,476 +0,0 @@ -/* - * Copyright 2008-2009 Katholieke Universiteit Leuven - * - * Use of this software is governed by the MIT license - * - * Written by Sven Verdoolaege, K.U.Leuven, Departement - * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium - */ - -#include -#include -#include -#include -#include -#include -#include "isl_piplib.h" -#include "isl_map_piplib.h" - -static void copy_values_from(isl_int *dst, Entier *src, unsigned n) -{ - int i; - - for (i = 0; i < n; ++i) - entier_assign(dst[i], src[i]); -} - -static void add_value(isl_int *dst, Entier *src) -{ - mpz_add(*dst, *dst, *src); -} - -static void copy_constraint_from(isl_int *dst, PipVector *src, - unsigned nparam, unsigned n_in, unsigned n_out, - unsigned extra, int *pos) -{ - int i; - - copy_values_from(dst, src->the_vector+src->nb_elements-1, 1); - copy_values_from(dst+1, src->the_vector, nparam+n_in); - isl_seq_clr(dst+1+nparam+n_in, n_out); - isl_seq_clr(dst+1+nparam+n_in+n_out, extra); - for (i = 0; i + n_in + nparam < src->nb_elements-1; ++i) { - int p = pos[i]; - add_value(&dst[1+nparam+n_in+n_out+p], - &src->the_vector[n_in+nparam+i]); - } -} - -static int add_inequality(struct isl_ctx *ctx, - struct isl_basic_map *bmap, int *pos, PipVector *vec) -{ - unsigned nparam = isl_basic_map_n_param(bmap); - unsigned n_in = isl_basic_map_n_in(bmap); - unsigned n_out = isl_basic_map_n_out(bmap); - unsigned n_div = isl_basic_map_n_div(bmap); - int i = isl_basic_map_alloc_inequality(bmap); - if (i < 0) - return -1; - copy_constraint_from(bmap->ineq[i], vec, - nparam, n_in, n_out, n_div, pos); - - return i; -} - -/* For a div d = floor(f/m), add the constraints - * - * f - m d >= 0 - * -(f-(n-1)) + m d >= 0 - * - * Note that the second constraint is the negation of - * - * f - m d >= n - */ -static int add_div_constraints(struct isl_ctx *ctx, - struct isl_basic_map *bmap, int *pos, PipNewparm *p, unsigned div) -{ - int i, j; - unsigned total = isl_basic_map_total_dim(bmap); - unsigned div_pos = 1 + total - bmap->n_div + div; - - i = add_inequality(ctx, bmap, pos, p->vector); - if (i < 0) - return -1; - copy_values_from(&bmap->ineq[i][div_pos], &p->deno, 1); - isl_int_neg(bmap->ineq[i][div_pos], bmap->ineq[i][div_pos]); - - j = isl_basic_map_alloc_inequality(bmap); - if (j < 0) - return -1; - isl_seq_neg(bmap->ineq[j], bmap->ineq[i], 1 + total); - isl_int_add(bmap->ineq[j][0], bmap->ineq[j][0], bmap->ineq[j][div_pos]); - isl_int_sub_ui(bmap->ineq[j][0], bmap->ineq[j][0], 1); - return j; -} - -static int add_equality(struct isl_ctx *ctx, - struct isl_basic_map *bmap, int *pos, - unsigned var, PipVector *vec) -{ - int i; - unsigned nparam = isl_basic_map_n_param(bmap); - unsigned n_in = isl_basic_map_n_in(bmap); - unsigned n_out = isl_basic_map_n_out(bmap); - - isl_assert(ctx, var < n_out, return -1); - - i = isl_basic_map_alloc_equality(bmap); - if (i < 0) - return -1; - copy_constraint_from(bmap->eq[i], vec, - nparam, n_in, n_out, bmap->extra, pos); - isl_int_set_si(bmap->eq[i][1+nparam+n_in+var], -1); - - return i; -} - -static int find_div(struct isl_ctx *ctx, - struct isl_basic_map *bmap, int *pos, PipNewparm *p) -{ - int i, j; - unsigned nparam = isl_basic_map_n_param(bmap); - unsigned n_in = isl_basic_map_n_in(bmap); - unsigned n_out = isl_basic_map_n_out(bmap); - - i = isl_basic_map_alloc_div(bmap); - if (i < 0) - return -1; - - copy_constraint_from(bmap->div[i]+1, p->vector, - nparam, n_in, n_out, bmap->extra, pos); - - copy_values_from(bmap->div[i], &p->deno, 1); - for (j = 0; j < i; ++j) - if (isl_seq_eq(bmap->div[i], bmap->div[j], - 1+1+isl_basic_map_total_dim(bmap)+j)) { - isl_basic_map_free_div(bmap, 1); - return j; - } - - if (add_div_constraints(ctx, bmap, pos, p, i) < 0) - return -1; - - return i; -} - -/* Count some properties of a quast - * - maximal number of new parameters - * - maximal depth - * - total number of solutions - * - total number of empty branches - */ -static void quast_count(PipQuast *q, int *maxnew, int depth, int *maxdepth, - int *sol, int *nosol) -{ - PipNewparm *p; - - for (p = q->newparm; p; p = p->next) - if (p->rank > *maxnew) - *maxnew = p->rank; - if (q->condition) { - if (++depth > *maxdepth) - *maxdepth = depth; - quast_count(q->next_else, maxnew, depth, maxdepth, sol, nosol); - quast_count(q->next_then, maxnew, depth, maxdepth, sol, nosol); - } else { - if (q->list) - ++(*sol); - else - ++(*nosol); - } -} - -/* - * pos: array of length bmap->set.extra, mapping each of the existential - * variables PIP proposes to an existential variable in bmap - * bmap: collects the currently active constraints - * rest: collects the empty leaves of the quast (if not NULL) - */ -struct scan_data { - struct isl_ctx *ctx; - struct isl_basic_map *bmap; - struct isl_set **rest; - int *pos; -}; - -/* - * New existentially quantified variables are places after the existing ones. - */ -static struct isl_map *scan_quast_r(struct scan_data *data, PipQuast *q, - struct isl_map *map) -{ - PipNewparm *p; - struct isl_basic_map *bmap = data->bmap; - unsigned old_n_div = bmap->n_div; - unsigned nparam = isl_basic_map_n_param(bmap); - unsigned n_in = isl_basic_map_n_in(bmap); - unsigned n_out = isl_basic_map_n_out(bmap); - - if (!map) - goto error; - - for (p = q->newparm; p; p = p->next) { - int pos; - unsigned pip_param = nparam + n_in; - - pos = find_div(data->ctx, bmap, data->pos, p); - if (pos < 0) - goto error; - data->pos[p->rank - pip_param] = pos; - } - - if (q->condition) { - int pos = add_inequality(data->ctx, bmap, data->pos, - q->condition); - if (pos < 0) - goto error; - map = scan_quast_r(data, q->next_then, map); - - if (isl_inequality_negate(bmap, pos)) - goto error; - map = scan_quast_r(data, q->next_else, map); - - if (isl_basic_map_free_inequality(bmap, 1)) - goto error; - } else if (q->list) { - PipList *l; - int j; - /* if bmap->n_out is zero, we are only interested in the domains - * where a solution exists and not in the actual solution - */ - for (j = 0, l = q->list; j < n_out && l; ++j, l = l->next) - if (add_equality(data->ctx, bmap, data->pos, j, - l->vector) < 0) - goto error; - map = isl_map_add_basic_map(map, isl_basic_map_copy(bmap)); - if (isl_basic_map_free_equality(bmap, n_out)) - goto error; - } else if (data->rest) { - struct isl_basic_set *bset; - bset = isl_basic_set_from_basic_map(isl_basic_map_copy(bmap)); - bset = isl_basic_set_drop_dims(bset, n_in, n_out); - if (!bset) - goto error; - *data->rest = isl_set_add_basic_set(*data->rest, bset); - } - - if (isl_basic_map_free_inequality(bmap, 2*(bmap->n_div - old_n_div))) - goto error; - if (isl_basic_map_free_div(bmap, bmap->n_div - old_n_div)) - goto error; - return map; -error: - isl_map_free(map); - return NULL; -} - -/* - * Returns a map of dimension "keep_dim" with "context" as domain and - * as range the first "isl_space_dim(keep_dim, isl_dim_out)" variables - * in the quast lists. - */ -static struct isl_map *isl_map_from_quast(struct isl_ctx *ctx, PipQuast *q, - isl_space *keep_dim, - struct isl_basic_set *context, - struct isl_set **rest) -{ - int pip_param; - int nexist; - int max_depth; - int n_sol, n_nosol; - struct scan_data data; - struct isl_map *map = NULL; - isl_space *dims; - unsigned nparam; - unsigned dim; - unsigned keep; - - data.ctx = ctx; - data.rest = rest; - data.bmap = NULL; - data.pos = NULL; - - if (!context || !keep_dim) - goto error; - - dim = isl_basic_set_n_dim(context); - nparam = isl_basic_set_n_param(context); - keep = isl_space_dim(keep_dim, isl_dim_out); - pip_param = nparam + dim; - - max_depth = 0; - n_sol = 0; - n_nosol = 0; - nexist = pip_param-1; - quast_count(q, &nexist, 0, &max_depth, &n_sol, &n_nosol); - nexist -= pip_param-1; - - if (rest) { - *rest = isl_set_alloc_space(isl_space_copy(context->dim), n_nosol, - ISL_MAP_DISJOINT); - if (!*rest) - goto error; - } - map = isl_map_alloc_space(isl_space_copy(keep_dim), n_sol, - ISL_MAP_DISJOINT); - if (!map) - goto error; - - dims = isl_space_reverse(isl_space_copy(context->dim)); - data.bmap = isl_basic_map_from_basic_set(context, dims); - data.bmap = isl_basic_map_extend_space(data.bmap, - keep_dim, nexist, keep, max_depth+2*nexist); - if (!data.bmap) - goto error2; - - if (data.bmap->extra) { - int i; - data.pos = isl_alloc_array(ctx, int, data.bmap->extra); - if (!data.pos) - goto error; - for (i = 0; i < data.bmap->n_div; ++i) - data.pos[i] = i; - } - - map = scan_quast_r(&data, q, map); - map = isl_map_finalize(map); - if (!map) - goto error2; - if (rest) { - *rest = isl_set_finalize(*rest); - if (!*rest) - goto error2; - } - isl_basic_map_free(data.bmap); - if (data.pos) - free(data.pos); - return map; -error: - isl_basic_set_free(context); - isl_space_free(keep_dim); -error2: - if (data.pos) - free(data.pos); - isl_basic_map_free(data.bmap); - isl_map_free(map); - if (rest) { - isl_set_free(*rest); - *rest = NULL; - } - return NULL; -} - -static void copy_values_to(Entier *dst, isl_int *src, unsigned n) -{ - int i; - - for (i = 0; i < n; ++i) - entier_assign(dst[i], src[i]); -} - -static void copy_constraint_to(Entier *dst, isl_int *src, - unsigned pip_param, unsigned pip_var, - unsigned extra_front, unsigned extra_back) -{ - copy_values_to(dst+1+extra_front+pip_var+pip_param+extra_back, src, 1); - copy_values_to(dst+1+extra_front+pip_var, src+1, pip_param); - copy_values_to(dst+1+extra_front, src+1+pip_param, pip_var); -} - -PipMatrix *isl_basic_map_to_pip(struct isl_basic_map *bmap, unsigned pip_param, - unsigned extra_front, unsigned extra_back) -{ - int i; - unsigned nrow; - unsigned ncol; - PipMatrix *M; - unsigned off; - unsigned pip_var = isl_basic_map_total_dim(bmap) - pip_param; - - nrow = extra_front + bmap->n_eq + bmap->n_ineq; - ncol = 1 + extra_front + pip_var + pip_param + extra_back + 1; - M = pip_matrix_alloc(nrow, ncol); - if (!M) - return NULL; - - off = extra_front; - for (i = 0; i < bmap->n_eq; ++i) { - entier_set_si(M->p[off+i][0], 0); - copy_constraint_to(M->p[off+i], bmap->eq[i], - pip_param, pip_var, extra_front, extra_back); - } - off += bmap->n_eq; - for (i = 0; i < bmap->n_ineq; ++i) { - entier_set_si(M->p[off+i][0], 1); - copy_constraint_to(M->p[off+i], bmap->ineq[i], - pip_param, pip_var, extra_front, extra_back); - } - return M; -} - -PipMatrix *isl_basic_set_to_pip(struct isl_basic_set *bset, unsigned pip_param, - unsigned extra_front, unsigned extra_back) -{ - return isl_basic_map_to_pip((struct isl_basic_map *)bset, - pip_param, extra_front, extra_back); -} - -struct isl_map *isl_pip_basic_map_lexopt( - struct isl_basic_map *bmap, struct isl_basic_set *dom, - struct isl_set **empty, int max) -{ - PipOptions *options; - PipQuast *sol; - struct isl_map *map; - struct isl_ctx *ctx; - PipMatrix *domain = NULL, *context = NULL; - unsigned nparam, n_in, n_out; - - bmap = isl_basic_map_detect_equalities(bmap); - if (!bmap || !dom) - goto error; - - ctx = bmap->ctx; - isl_assert(ctx, isl_basic_map_compatible_domain(bmap, dom), goto error); - nparam = isl_basic_map_n_param(bmap); - n_in = isl_basic_map_n_in(bmap); - n_out = isl_basic_map_n_out(bmap); - - domain = isl_basic_map_to_pip(bmap, nparam + n_in, 0, dom->n_div); - if (!domain) - goto error; - context = isl_basic_map_to_pip((struct isl_basic_map *)dom, 0, 0, 0); - if (!context) - goto error; - - options = pip_options_init(); - options->Simplify = 1; - options->Maximize = max; - options->Urs_unknowns = -1; - options->Urs_parms = -1; - sol = pip_solve(domain, context, -1, options); - - if (sol) { - struct isl_basic_set *copy; - copy = isl_basic_set_copy(dom); - map = isl_map_from_quast(ctx, sol, - isl_space_copy(bmap->dim), copy, empty); - } else { - map = isl_map_empty_like_basic_map(bmap); - if (empty) - *empty = NULL; - } - if (!map) - goto error; - if (map->n == 0 && empty) { - isl_set_free(*empty); - *empty = isl_set_from_basic_set(dom); - } else - isl_basic_set_free(dom); - isl_basic_map_free(bmap); - - pip_quast_free(sol); - pip_options_free(options); - pip_matrix_free(domain); - pip_matrix_free(context); - - return map; -error: - if (domain) - pip_matrix_free(domain); - if (context) - pip_matrix_free(context); - isl_basic_map_free(bmap); - isl_basic_set_free(dom); - return NULL; -} diff -Nru cloog-0.18.2/isl/isl_map_piplib.h cloog-0.18.4/isl/isl_map_piplib.h --- cloog-0.18.2/isl/isl_map_piplib.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_map_piplib.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -/* - * Copyright 2008-2009 Katholieke Universiteit Leuven - * - * Use of this software is governed by the MIT license - * - * Written by Sven Verdoolaege, K.U.Leuven, Departement - * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium - */ - -#ifndef ISL_MAP_PIPLIB_H -#define ISL_MAP_PIPLIB_H - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - -struct isl_map *isl_pip_basic_map_lexopt( - struct isl_basic_map *bmap, struct isl_basic_set *dom, - struct isl_set **empty, int max); - -#if defined(__cplusplus) -} -#endif - -#endif diff -Nru cloog-0.18.2/isl/isl_map_private.h cloog-0.18.4/isl/isl_map_private.h --- cloog-0.18.2/isl/isl_map_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_map_private.h 2015-07-24 12:23:09.000000000 +0000 @@ -15,12 +15,12 @@ #define isl_basic_set_list isl_basic_map_list #define isl_set_list isl_map_list #include -ISL_DECLARE_LIST(basic_map) -ISL_DECLARE_LIST(map) #include #include #include #include +#include +#include /* A "basic map" is a relation between two sets of variables, * called the "in" and "out" variables. @@ -42,6 +42,7 @@ #define ISL_BASIC_MAP_NORMALIZED (1 << 5) #define ISL_BASIC_MAP_NORMALIZED_DIVS (1 << 6) #define ISL_BASIC_MAP_ALL_EQUALITIES (1 << 7) +#define ISL_BASIC_MAP_REDUCED_COEFFICIENTS (1 << 8) #define ISL_BASIC_SET_FINAL (1 << 0) #define ISL_BASIC_SET_EMPTY (1 << 1) #define ISL_BASIC_SET_NO_IMPLICIT (1 << 2) @@ -50,6 +51,7 @@ #define ISL_BASIC_SET_NORMALIZED (1 << 5) #define ISL_BASIC_SET_NORMALIZED_DIVS (1 << 6) #define ISL_BASIC_SET_ALL_EQUALITIES (1 << 7) +#define ISL_BASIC_SET_REDUCED_COEFFICIENTS (1 << 8) unsigned flags; struct isl_ctx *ctx; @@ -109,6 +111,53 @@ #include +__isl_give isl_basic_set *isl_basic_set_alloc(isl_ctx *ctx, + unsigned nparam, unsigned dim, unsigned extra, + unsigned n_eq, unsigned n_ineq); +__isl_give isl_basic_set *isl_basic_set_extend(__isl_take isl_basic_set *base, + unsigned nparam, unsigned dim, unsigned extra, + unsigned n_eq, unsigned n_ineq); +__isl_give isl_basic_set *isl_basic_set_extend_constraints( + __isl_take isl_basic_set *base, unsigned n_eq, unsigned n_ineq); +__isl_give isl_basic_set *isl_basic_set_finalize( + __isl_take isl_basic_set *bset); +__isl_give isl_basic_set *isl_basic_set_dup(__isl_keep isl_basic_set *bset); +__isl_give isl_basic_set *isl_basic_set_simplify( + __isl_take isl_basic_set *bset); + +__isl_give isl_basic_map *isl_basic_map_alloc(isl_ctx *ctx, + unsigned nparam, unsigned in, unsigned out, unsigned extra, + unsigned n_eq, unsigned n_ineq); +__isl_give isl_basic_map *isl_basic_map_finalize( + __isl_take isl_basic_map *bmap); +__isl_give isl_basic_map *isl_basic_map_extend(__isl_take isl_basic_map *base, + unsigned nparam, unsigned n_in, unsigned n_out, unsigned extra, + unsigned n_eq, unsigned n_ineq); +__isl_give isl_basic_map *isl_basic_map_extend_constraints( + __isl_take isl_basic_map *base, unsigned n_eq, unsigned n_ineq); +__isl_give isl_basic_map *isl_basic_map_simplify( + __isl_take isl_basic_map *bmap); + +__isl_give isl_set *isl_set_alloc(isl_ctx *ctx, + unsigned nparam, unsigned dim, int n, unsigned flags); +__isl_give isl_set *isl_set_add_basic_set(__isl_take isl_set *set, + __isl_take isl_basic_set *bset); +__isl_give isl_set *isl_set_finalize(__isl_take isl_set *set); +__isl_give isl_set *isl_set_dup(__isl_keep isl_set *set); + +__isl_give isl_map *isl_map_alloc(isl_ctx *ctx, + unsigned nparam, unsigned in, unsigned out, int n, unsigned flags); +__isl_give isl_map *isl_map_add_basic_map(__isl_take isl_map *map, + __isl_take isl_basic_map *bmap); +__isl_give isl_map *isl_map_dup(__isl_keep isl_map *map); +__isl_give isl_map *isl_map_finalize(__isl_take isl_map *map); + +__isl_give isl_basic_set *isl_basic_set_from_underlying_set( + __isl_take isl_basic_set *bset, __isl_take isl_basic_set *like); +__isl_give isl_set *isl_set_from_underlying_set( + __isl_take isl_set *set, __isl_take isl_basic_set *like); +__isl_give isl_set *isl_set_to_underlying_set(__isl_take isl_set *set); + __isl_give isl_map *isl_map_realign(__isl_take isl_map *map, __isl_take isl_reordering *r); __isl_give isl_set *isl_set_realign(__isl_take isl_set *set, @@ -149,8 +198,10 @@ struct isl_map *isl_map_grow(struct isl_map *map, int n); struct isl_set *isl_set_grow(struct isl_set *set, int n); -int isl_basic_set_contains(struct isl_basic_set *bset, struct isl_vec *vec); -int isl_basic_map_contains(struct isl_basic_map *bmap, struct isl_vec *vec); +isl_bool isl_basic_set_contains(__isl_keep isl_basic_set *bset, + __isl_keep isl_vec *vec); +isl_bool isl_basic_map_contains(__isl_keep isl_basic_map *bmap, + __isl_keep isl_vec *vec); __isl_give isl_basic_set *isl_basic_set_alloc_space(__isl_take isl_space *dim, unsigned extra, unsigned n_eq, unsigned n_ineq); @@ -197,6 +248,8 @@ struct isl_set *isl_set_cow(struct isl_set *set); struct isl_map *isl_map_cow(struct isl_map *map); +uint32_t isl_basic_map_get_hash(__isl_keep isl_basic_map *bmap); + struct isl_basic_map *isl_basic_map_set_to_empty(struct isl_basic_map *bmap); struct isl_basic_set *isl_basic_set_set_to_empty(struct isl_basic_set *bset); struct isl_basic_set *isl_basic_set_order_divs(struct isl_basic_set *bset); @@ -207,6 +260,10 @@ struct isl_basic_map *dst, struct isl_basic_map *src); struct isl_basic_set *isl_basic_set_align_divs( struct isl_basic_set *dst, struct isl_basic_set *src); +__isl_give isl_map *isl_map_align_divs_to_basic_map_list( + __isl_take isl_map *map, __isl_keep isl_basic_map_list *list); +__isl_give isl_basic_map_list *isl_basic_map_list_align_divs_to_basic_map( + __isl_take isl_basic_map_list *list, __isl_keep isl_basic_map *bmap); __isl_give isl_basic_map *isl_basic_map_sort_divs( __isl_take isl_basic_map *bmap); __isl_give isl_map *isl_map_sort_divs(__isl_take isl_map *map); @@ -218,9 +275,7 @@ __isl_take isl_basic_set *bset); int isl_basic_map_plain_cmp(const __isl_keep isl_basic_map *bmap1, const __isl_keep isl_basic_map *bmap2); -int isl_basic_set_plain_is_equal(__isl_keep isl_basic_set *bset1, - __isl_keep isl_basic_set *bset2); -int isl_basic_map_plain_is_equal(__isl_keep isl_basic_map *bmap1, +isl_bool isl_basic_map_plain_is_equal(__isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2); struct isl_basic_map *isl_basic_map_normalize_constraints( struct isl_basic_map *bmap); @@ -231,6 +286,8 @@ struct isl_basic_set *isl_basic_map_underlying_set(struct isl_basic_map *bmap); __isl_give isl_basic_set *isl_basic_set_underlying_set( __isl_take isl_basic_set *bset); +__isl_give isl_basic_set_list *isl_basic_map_list_underlying_set( + __isl_take isl_basic_map_list *list); struct isl_set *isl_map_underlying_set(struct isl_map *map); struct isl_basic_map *isl_basic_map_overlying_set(struct isl_basic_set *bset, struct isl_basic_map *like); @@ -251,8 +308,14 @@ struct isl_map *isl_map_drop(struct isl_map *map, enum isl_dim_type type, unsigned first, unsigned n); +__isl_give isl_basic_map *isl_basic_map_remove_duplicate_constraints( + __isl_take isl_basic_map *bmap, int *progress, int detect_divs); +__isl_give isl_basic_map *isl_basic_map_detect_inequality_pairs( + __isl_take isl_basic_map *bmap, int *progress); + struct isl_map *isl_map_remove_empty_parts(struct isl_map *map); struct isl_set *isl_set_remove_empty_parts(struct isl_set *set); +__isl_give isl_map *isl_map_remove_obvious_duplicates(__isl_take isl_map *map); struct isl_set *isl_set_normalize(struct isl_set *set); @@ -272,7 +335,11 @@ int isl_basic_set_constraint_is_redundant(struct isl_basic_set **bset, isl_int *c, isl_int *opt_n, isl_int *opt_d); +int isl_basic_map_add_div_constraint(__isl_keep isl_basic_map *bmap, + unsigned div, int sign); int isl_basic_map_add_div_constraints(struct isl_basic_map *bmap, unsigned div); +__isl_give isl_basic_map *isl_basic_map_add_known_div_constraints( + __isl_take isl_basic_map *bmap); struct isl_basic_map *isl_basic_map_drop_redundant_divs( struct isl_basic_map *bmap); struct isl_basic_set *isl_basic_set_drop_redundant_divs( @@ -303,9 +370,10 @@ isl_int *isl_set_wrap_facet(__isl_keep isl_set *set, isl_int *facet, isl_int *ridge); -int isl_basic_map_contains_point(__isl_keep isl_basic_map *bmap, +isl_bool isl_basic_map_contains_point(__isl_keep isl_basic_map *bmap, + __isl_keep isl_point *point); +isl_bool isl_set_contains_point(__isl_keep isl_set *set, __isl_keep isl_point *point); -int isl_set_contains_point(__isl_keep isl_set *set, __isl_keep isl_point *point); int isl_basic_set_vars_get_sign(__isl_keep isl_basic_set *bset, unsigned first, unsigned n, int *signs); @@ -340,9 +408,9 @@ __isl_take isl_map *map1, __isl_take isl_map *map2, __isl_give isl_map *(*fn)(__isl_take isl_map *map1, __isl_take isl_map *map2)); -int isl_map_align_params_map_map_and_test(__isl_keep isl_map *map1, +isl_bool isl_map_align_params_map_map_and_test(__isl_keep isl_map *map1, __isl_keep isl_map *map2, - int (*fn)(__isl_keep isl_map *map1, __isl_keep isl_map *map2)); + isl_bool (*fn)(__isl_keep isl_map *map1, __isl_keep isl_map *map2)); int isl_basic_map_foreach_lexopt(__isl_keep isl_basic_map *bmap, int max, int (*fn)(__isl_take isl_basic_set *dom, __isl_take isl_aff_list *list, @@ -361,8 +429,44 @@ int isl_map_compatible_range(__isl_keep isl_map *map, __isl_keep isl_set *set); -int isl_basic_map_plain_is_single_valued(__isl_keep isl_basic_map *bmap); +isl_bool isl_basic_map_plain_is_single_valued(__isl_keep isl_basic_map *bmap); int isl_map_is_set(__isl_keep isl_map *map); +int isl_basic_set_plain_dim_is_fixed(__isl_keep isl_basic_set *bset, + unsigned dim, isl_int *val); + +__isl_give isl_basic_map *isl_basic_map_plain_affine_hull( + __isl_take isl_basic_map *bmap); + +int isl_basic_set_dim_residue_class(struct isl_basic_set *bset, + int pos, isl_int *modulo, isl_int *residue); +int isl_set_dim_residue_class(struct isl_set *set, + int pos, isl_int *modulo, isl_int *residue); + +__isl_give isl_basic_set *isl_basic_set_fix(__isl_take isl_basic_set *bset, + enum isl_dim_type type, unsigned pos, isl_int value); +__isl_give isl_set *isl_set_fix(__isl_take isl_set *set, + enum isl_dim_type type, unsigned pos, isl_int value); +int isl_map_plain_is_fixed(__isl_keep isl_map *map, + enum isl_dim_type type, unsigned pos, isl_int *val); + +int isl_basic_map_output_defining_equality(__isl_keep isl_basic_map *bmap, + int pos); + +__isl_give isl_basic_map *isl_basic_map_reduce_coefficients( + __isl_take isl_basic_map *bmap); + +__isl_give isl_basic_map *isl_basic_map_shift_div( + __isl_take isl_basic_map *bmap, int div, isl_int shift); + +__isl_give isl_basic_map_list *isl_map_get_basic_map_list( + __isl_keep isl_map *map); + +__isl_give isl_map *isl_map_fixed_power(__isl_take isl_map *map, isl_int exp); + +int isl_basic_set_count_upto(__isl_keep isl_basic_set *bset, + isl_int max, isl_int *count); +int isl_set_count_upto(__isl_keep isl_set *set, isl_int max, isl_int *count); + #endif diff -Nru cloog-0.18.2/isl/isl_map_simplify.c cloog-0.18.4/isl/isl_map_simplify.c --- cloog-0.18.2/isl/isl_map_simplify.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_map_simplify.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,12 +1,15 @@ /* * Copyright 2008-2009 Katholieke Universiteit Leuven - * Copyright 2012 Ecole Normale Superieure + * Copyright 2012-2013 Ecole Normale Superieure + * Copyright 2014 INRIA Rocquencourt * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, K.U.Leuven, Departement * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium * and Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France + * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, + * B.P. 105 - 78153 Le Chesnay, France */ #include @@ -14,10 +17,11 @@ #include #include "isl_equalities.h" #include -#include +#include #include "isl_tab.h" #include #include +#include static void swap_equality(struct isl_basic_map *bmap, int a, int b) { @@ -493,14 +497,16 @@ /* Assumes divs have been ordered if keep_divs is set. */ -static void eliminate_div(struct isl_basic_map *bmap, isl_int *eq, - unsigned div, int keep_divs) +static __isl_give isl_basic_map *eliminate_div(__isl_take isl_basic_map *bmap, + isl_int *eq, unsigned div, int keep_divs) { unsigned pos = isl_space_dim(bmap->dim, isl_dim_all) + div; eliminate_var_using_equality(bmap, pos, eq, keep_divs, NULL); - isl_basic_map_drop_div(bmap, div); + bmap = isl_basic_map_drop_div(bmap, div); + + return bmap; } /* Check if elimination of div "div" using equality "eq" would not @@ -554,8 +560,9 @@ continue; modified = 1; *progress = 1; - eliminate_div(bmap, bmap->eq[i], d, 1); - isl_basic_map_drop_equality(bmap, i); + bmap = eliminate_div(bmap, bmap->eq[i], d, 1); + if (isl_basic_map_drop_equality(bmap, i) < 0) + return isl_basic_map_free(bmap); break; } } @@ -731,12 +738,14 @@ if (k <= 0) return bmap; - elim_for = isl_calloc_array(ctx, int, bmap->n_div); size = round_up(4 * bmap->n_div / 3 - 1); + if (size == 0) + return bmap; + elim_for = isl_calloc_array(ctx, int, bmap->n_div); bits = ffs(size) - 1; index = isl_calloc_array(ctx, int, size); - if (!index) - return bmap; + if (!elim_for || !index) + goto out; eq = isl_blk_alloc(ctx, 1+total); if (isl_blk_is_error(eq)) goto out; @@ -767,7 +776,9 @@ k = elim_for[l] - 1; isl_int_set_si(eq.data[1+total_var+k], -1); isl_int_set_si(eq.data[1+total_var+l], 1); - eliminate_div(bmap, eq.data, l, 1); + bmap = eliminate_div(bmap, eq.data, l, 1); + if (!bmap) + break; isl_int_set_si(eq.data[1+total_var+k], 0); isl_int_set_si(eq.data[1+total_var+l], 0); } @@ -1109,8 +1120,8 @@ return bmap; } -static struct isl_basic_map *remove_duplicate_constraints( - struct isl_basic_map *bmap, int *progress, int detect_divs) +__isl_give isl_basic_map *isl_basic_map_remove_duplicate_constraints( + __isl_take isl_basic_map *bmap, int *progress, int detect_divs) { unsigned int size; isl_int ***index; @@ -1124,6 +1135,8 @@ return bmap; size = round_up(4 * (bmap->n_ineq+1) / 3 - 1); + if (size == 0) + return bmap; bits = ffs(size) - 1; ctx = isl_basic_map_get_ctx(bmap); index = isl_calloc_array(ctx, isl_int **, size); @@ -1180,6 +1193,26 @@ return bmap; } +/* Detect all pairs of inequalities that form an equality. + * + * isl_basic_map_remove_duplicate_constraints detects at most one such pair. + * Call it repeatedly while it is making progress. + */ +__isl_give isl_basic_map *isl_basic_map_detect_inequality_pairs( + __isl_take isl_basic_map *bmap, int *progress) +{ + int duplicate; + + do { + duplicate = 0; + bmap = isl_basic_map_remove_duplicate_constraints(bmap, + &duplicate, 0); + if (progress && duplicate) + *progress = 1; + } while (duplicate); + + return bmap; +} /* Eliminate knowns divs from constraints where they appear with * a (positive or negative) unit coefficient. @@ -1207,6 +1240,12 @@ * -floor(e/m) = ceil(-e/m) = floor((-e + m - 1)/m) * * + * Note that one of the div constraints may have been eliminated + * due to being redundant with respect to the constraint that is + * being modified by this function. The modified constraint may + * no longer imply this div constraint, so we add it back to make + * sure we do not lose any information. + * * We skip integral divs, i.e., those with denominator 1, as we would * risk eliminating the div from the div constraints. We do not need * to handle those divs here anyway since the div constraints will turn @@ -1258,6 +1297,10 @@ isl_int_sub_ui(bmap->ineq[j][0], bmap->ineq[j][0], 1); } + + bmap = isl_basic_map_extend_constraints(bmap, 0, 1); + if (isl_basic_map_add_div_constraint(bmap, i, s) < 0) + return isl_basic_map_free(bmap); } } @@ -1284,7 +1327,10 @@ bmap = isl_basic_map_gauss(bmap, &progress); /* requires equalities in normal form */ bmap = normalize_divs(bmap, &progress); - bmap = remove_duplicate_constraints(bmap, &progress, 1); + bmap = isl_basic_map_remove_duplicate_constraints(bmap, + &progress, 1); + if (bmap && progress) + ISL_F_CLR(bmap, ISL_BASIC_MAP_REDUCED_COEFFICIENTS); } return bmap; } @@ -1375,8 +1421,9 @@ /* * Remove divs that don't occur in any of the constraints or other divs. - * These can arise when dropping some of the variables in a quast - * returned by piplib. + * These can arise when dropping constraints from a basic map or + * when the divs of a basic map have been temporarily aligned + * with the divs of another basic map. */ static struct isl_basic_map *remove_redundant_divs(struct isl_basic_map *bmap) { @@ -1543,7 +1590,8 @@ } if (n_lower > 0 && n_upper > 0) { bmap = isl_basic_map_normalize_constraints(bmap); - bmap = remove_duplicate_constraints(bmap, NULL, 0); + bmap = isl_basic_map_remove_duplicate_constraints(bmap, + NULL, 0); bmap = isl_basic_map_gauss(bmap, NULL); bmap = isl_basic_map_remove_redundancies(bmap); need_gauss = 0; @@ -1715,10 +1763,12 @@ int k, h, l; isl_ctx *ctx; - if (!bset) - return NULL; + if (!bset || !context) + return bset; size = round_up(4 * (context->n_ineq+1) / 3 - 1); + if (size == 0) + return bset; bits = ffs(size) - 1; ctx = isl_basic_set_get_ctx(bset); index = isl_calloc_array(ctx, isl_int **, size); @@ -1749,6 +1799,42 @@ return bset; } +/* Remove constraints from "bmap" that are identical to constraints + * in "context" or that are more relaxed (greater constant term). + * + * We perform the test for shifted copies on the pure constraints + * in remove_shifted_constraints. + */ +static __isl_give isl_basic_map *isl_basic_map_remove_shifted_constraints( + __isl_take isl_basic_map *bmap, __isl_take isl_basic_map *context) +{ + isl_basic_set *bset, *bset_context; + + if (!bmap || !context) + goto error; + + if (bmap->n_ineq == 0 || context->n_ineq == 0) { + isl_basic_map_free(context); + return bmap; + } + + context = isl_basic_map_align_divs(context, bmap); + bmap = isl_basic_map_align_divs(bmap, context); + + bset = isl_basic_map_underlying_set(isl_basic_map_copy(bmap)); + bset_context = isl_basic_map_underlying_set(context); + bset = remove_shifted_constraints(bset, bset_context); + isl_basic_set_free(bset_context); + + bmap = isl_basic_map_overlying_set(bset, bmap); + + return bmap; +error: + isl_basic_map_free(bmap); + isl_basic_map_free(context); + return NULL; +} + /* Does the (linear part of a) constraint "c" involve any of the "len" * "relevant" dimensions? */ @@ -1979,7 +2065,8 @@ for (i = 0; i < context_ineq; ++i) if (isl_tab_freeze_constraint(tab, i) < 0) goto error; - tab = isl_tab_extend(tab, bset->n_ineq); + if (isl_tab_extend_cons(tab, bset->n_ineq) < 0) + goto error; for (i = 0; i < bset->n_ineq; ++i) if (isl_tab_add_ineq(tab, bset->ineq[i]) < 0) goto error; @@ -2068,20 +2155,17 @@ context = drop_irrelevant_constraints(context, bset); - bset = isl_basic_set_intersect(bset, isl_basic_set_copy(context)); - if (isl_basic_set_plain_is_empty(bset)) { - isl_basic_set_free(context); - return bset; - } - bset = isl_basic_set_sort_constraints(bset); - aff = isl_basic_set_affine_hull(isl_basic_set_copy(bset)); + aff = isl_basic_set_copy(bset); + aff = isl_basic_set_intersect(aff, isl_basic_set_copy(context)); + aff = isl_basic_set_affine_hull(aff); if (!aff) goto error; if (isl_basic_set_plain_is_empty(aff)) { - isl_basic_set_free(aff); + isl_basic_set_free(bset); isl_basic_set_free(context); - return bset; + return aff; } + bset = isl_basic_set_sort_constraints(bset); if (aff->n_eq == 0) { isl_basic_set_free(aff); return uset_gist_full(bset, context); @@ -2139,6 +2223,7 @@ if (div_eq == 0) return bmap; + bmap = isl_basic_map_cow(bmap); if (context->n_div > 0) bmap = isl_basic_map_align_divs(bmap, context); @@ -2159,10 +2244,28 @@ return bmap; } +/* Return a basic map that has the same intersection with "context" as "bmap" + * and that is as "simple" as possible. + * + * The core computation is performed on the pure constraints. + * When we add back the meaning of the integer divisions, we need + * to (re)introduce the div constraints. If we happen to have + * discovered that some of these integer divisions are equal to + * some affine combination of other variables, then these div + * constraints may end up getting simplified in terms of the equalities, + * resulting in extra inequalities on the other variables that + * may have been removed already or that may not even have been + * part of the input. We try and remove those constraints of + * this form that are most obviously redundant with respect to + * the context. We also remove those div constraints that are + * redundant with respect to the other constraints in the result. + */ struct isl_basic_map *isl_basic_map_gist(struct isl_basic_map *bmap, struct isl_basic_map *context) { - struct isl_basic_set *bset; + isl_basic_set *bset, *eq; + isl_basic_map *eq_bmap; + unsigned n_div, n_eq, n_ineq; if (!bmap || !context) goto error; @@ -2172,8 +2275,10 @@ return bmap; } if (isl_basic_map_plain_is_empty(context)) { + isl_space *space = isl_basic_map_get_space(bmap); isl_basic_map_free(bmap); - return context; + isl_basic_map_free(context); + return isl_basic_map_universe(space); } if (isl_basic_map_plain_is_empty(bmap)) { isl_basic_map_free(context); @@ -2190,11 +2295,33 @@ context = isl_basic_map_align_divs(context, bmap); bmap = isl_basic_map_align_divs(bmap, context); + n_div = isl_basic_map_dim(bmap, isl_dim_div); bset = uset_gist(isl_basic_map_underlying_set(isl_basic_map_copy(bmap)), - isl_basic_map_underlying_set(context)); + isl_basic_map_underlying_set(isl_basic_map_copy(context))); - return isl_basic_map_overlying_set(bset, bmap); + if (!bset || bset->n_eq == 0 || n_div == 0 || + isl_basic_set_plain_is_empty(bset)) { + isl_basic_map_free(context); + return isl_basic_map_overlying_set(bset, bmap); + } + + n_eq = bset->n_eq; + n_ineq = bset->n_ineq; + eq = isl_basic_set_copy(bset); + eq = isl_basic_set_cow(eq); + if (isl_basic_set_free_inequality(eq, n_ineq) < 0) + eq = isl_basic_set_free(eq); + if (isl_basic_set_free_equality(bset, n_eq) < 0) + bset = isl_basic_set_free(bset); + + eq_bmap = isl_basic_map_overlying_set(eq, isl_basic_map_copy(bmap)); + eq_bmap = isl_basic_map_remove_shifted_constraints(eq_bmap, context); + bmap = isl_basic_map_overlying_set(bset, bmap); + bmap = isl_basic_map_intersect(bmap, eq_bmap); + bmap = isl_basic_map_remove_redundancies(bmap); + + return bmap; error: isl_basic_map_free(bmap); isl_basic_map_free(context); @@ -2210,17 +2337,19 @@ int i; if (!map || !context) - goto error;; + goto error; if (isl_basic_map_plain_is_empty(context)) { + isl_space *space = isl_map_get_space(map); isl_map_free(map); - return isl_map_from_basic_map(context); + isl_basic_map_free(context); + return isl_map_universe(space); } context = isl_basic_map_remove_redundancies(context); map = isl_map_cow(map); if (!map || !context) - goto error;; + goto error; isl_assert(map->ctx, isl_space_is_equal(map->dim, context->dim), goto error); map = isl_map_compute_divs(map); if (!map) @@ -2247,7 +2376,7 @@ } /* Return a map that has the same intersection with "context" as "map" - * and that as "simple" as possible. + * and that is as "simple" as possible. * * If "map" is already the universe, then we cannot make it any simpler. * Similarly, if "context" is the universe, then we cannot exploit it @@ -2256,12 +2385,21 @@ * return the corresponding universe. * * If none of these cases apply, we have to work a bit harder. + * During this computation, we make use of a single disjunct context, + * so if the original context consists of more than one disjunct + * then we need to approximate the context by a single disjunct set. + * Simply taking the simple hull may drop constraints that are + * only implicitly available in each disjunct. We therefore also + * look for constraints among those defining "map" that are valid + * for the context. These can then be used to simplify away + * the corresponding constraints in "map". */ static __isl_give isl_map *map_gist(__isl_take isl_map *map, __isl_take isl_map *context) { int equal; int is_universe; + isl_basic_map *hull; is_universe = isl_map_plain_is_universe(map); if (is_universe >= 0 && !is_universe) @@ -2284,7 +2422,22 @@ } context = isl_map_compute_divs(context); - return isl_map_gist_basic_map(map, isl_map_simple_hull(context)); + if (!context) + goto error; + if (isl_map_n_basic_map(context) == 1) { + hull = isl_map_simple_hull(context); + } else { + isl_ctx *ctx; + isl_map_list *list; + + ctx = isl_map_get_ctx(map); + list = isl_map_list_alloc(ctx, 2); + list = isl_map_list_add(list, isl_map_copy(context)); + list = isl_map_list_add(list, isl_map_copy(map)); + hull = isl_map_unshifted_simple_hull_from_map_list(context, + list); + } + return isl_map_gist_basic_map(map, hull); error: isl_map_free(map); isl_map_free(context); @@ -2327,6 +2480,19 @@ (struct isl_map *)context); } +/* Compute the gist of "bmap" with respect to the constraints "context" + * on the domain. + */ +__isl_give isl_basic_map *isl_basic_map_gist_domain( + __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *context) +{ + isl_space *space = isl_basic_map_get_space(bmap); + isl_basic_map *bmap_context = isl_basic_map_universe(space); + + bmap_context = isl_basic_map_intersect_domain(bmap_context, context); + return isl_basic_map_gist(bmap, bmap_context); +} + __isl_give isl_map *isl_map_gist_domain(__isl_take isl_map *map, __isl_take isl_set *context) { @@ -2362,7 +2528,7 @@ * one basic map in the context of the equalities of the other * basic map and check if we get a contradiction. */ -int isl_basic_map_plain_is_disjoint(__isl_keep isl_basic_map *bmap1, +isl_bool isl_basic_map_plain_is_disjoint(__isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2) { struct isl_vec *v = NULL; @@ -2371,17 +2537,17 @@ int i; if (!bmap1 || !bmap2) - return -1; + return isl_bool_error; isl_assert(bmap1->ctx, isl_space_is_equal(bmap1->dim, bmap2->dim), - return -1); + return isl_bool_error); if (bmap1->n_div || bmap2->n_div) - return 0; + return isl_bool_false; if (!bmap1->n_eq && !bmap2->n_eq) - return 0; + return isl_bool_false; total = isl_space_dim(bmap1->dim, isl_dim_all); if (total == 0) - return 0; + return isl_bool_false; v = isl_vec_alloc(bmap1->ctx, 1 + total); if (!v) goto error; @@ -2416,15 +2582,15 @@ } isl_vec_free(v); free(elim); - return 0; + return isl_bool_false; disjoint: isl_vec_free(v); free(elim); - return 1; + return isl_bool_true; error: isl_vec_free(v); free(elim); - return -1; + return isl_bool_error; } int isl_basic_set_plain_is_disjoint(__isl_keep isl_basic_set *bset1, @@ -2447,16 +2613,16 @@ * Otherwise we check if each basic map in "map1" is obviously disjoint * from each basic map in "map2". */ -int isl_map_plain_is_disjoint(__isl_keep isl_map *map1, +isl_bool isl_map_plain_is_disjoint(__isl_keep isl_map *map1, __isl_keep isl_map *map2) { int i, j; - int disjoint; - int intersect; - int match; + isl_bool disjoint; + isl_bool intersect; + isl_bool match; if (!map1 || !map2) - return -1; + return isl_bool_error; disjoint = isl_map_plain_is_empty(map1); if (disjoint < 0 || disjoint) @@ -2466,34 +2632,34 @@ if (disjoint < 0 || disjoint) return disjoint; - match = isl_space_tuple_match(map1->dim, isl_dim_in, + match = isl_space_tuple_is_equal(map1->dim, isl_dim_in, map2->dim, isl_dim_in); if (match < 0 || !match) - return match < 0 ? -1 : 1; + return match < 0 ? isl_bool_error : isl_bool_true; - match = isl_space_tuple_match(map1->dim, isl_dim_out, + match = isl_space_tuple_is_equal(map1->dim, isl_dim_out, map2->dim, isl_dim_out); if (match < 0 || !match) - return match < 0 ? -1 : 1; + return match < 0 ? isl_bool_error : isl_bool_true; match = isl_space_match(map1->dim, isl_dim_param, map2->dim, isl_dim_param); if (match < 0 || !match) - return match < 0 ? -1 : 0; + return match < 0 ? isl_bool_error : isl_bool_false; intersect = isl_map_plain_is_equal(map1, map2); if (intersect < 0 || intersect) - return intersect < 0 ? -1 : 0; + return intersect < 0 ? isl_bool_error : isl_bool_false; for (i = 0; i < map1->n; ++i) { for (j = 0; j < map2->n; ++j) { - int d = isl_basic_map_plain_is_disjoint(map1->p[i], - map2->p[j]); - if (d != 1) + isl_bool d = isl_basic_map_plain_is_disjoint(map1->p[i], + map2->p[j]); + if (d != isl_bool_true) return d; } } - return 1; + return isl_bool_true; } /* Are "map1" and "map2" disjoint? @@ -2503,10 +2669,10 @@ * If none of these cases apply, we compute the intersection and see if * the result is empty. */ -int isl_map_is_disjoint(__isl_keep isl_map *map1, __isl_keep isl_map *map2) +isl_bool isl_map_is_disjoint(__isl_keep isl_map *map1, __isl_keep isl_map *map2) { - int disjoint; - int intersect; + isl_bool disjoint; + isl_bool intersect; isl_map *test; disjoint = isl_map_plain_is_disjoint(map1, map2); @@ -2523,11 +2689,11 @@ intersect = isl_map_plain_is_universe(map1); if (intersect < 0 || intersect) - return intersect < 0 ? -1 : 0; + return intersect < 0 ? isl_bool_error : isl_bool_false; intersect = isl_map_plain_is_universe(map2); if (intersect < 0 || intersect) - return intersect < 0 ? -1 : 0; + return intersect < 0 ? isl_bool_error : isl_bool_false; test = isl_map_intersect(isl_map_copy(map1), isl_map_copy(map2)); disjoint = isl_map_is_empty(test); @@ -2536,7 +2702,57 @@ return disjoint; } -int isl_set_plain_is_disjoint(__isl_keep isl_set *set1, +/* Are "bmap1" and "bmap2" disjoint? + * + * They are disjoint if they are "obviously disjoint" or if one of them + * is empty. Otherwise, they are not disjoint if one of them is universal. + * If none of these cases apply, we compute the intersection and see if + * the result is empty. + */ +isl_bool isl_basic_map_is_disjoint(__isl_keep isl_basic_map *bmap1, + __isl_keep isl_basic_map *bmap2) +{ + isl_bool disjoint; + isl_bool intersect; + isl_basic_map *test; + + disjoint = isl_basic_map_plain_is_disjoint(bmap1, bmap2); + if (disjoint < 0 || disjoint) + return disjoint; + + disjoint = isl_basic_map_is_empty(bmap1); + if (disjoint < 0 || disjoint) + return disjoint; + + disjoint = isl_basic_map_is_empty(bmap2); + if (disjoint < 0 || disjoint) + return disjoint; + + intersect = isl_basic_map_is_universe(bmap1); + if (intersect < 0 || intersect) + return intersect < 0 ? isl_bool_error : isl_bool_false; + + intersect = isl_basic_map_is_universe(bmap2); + if (intersect < 0 || intersect) + return intersect < 0 ? isl_bool_error : isl_bool_false; + + test = isl_basic_map_intersect(isl_basic_map_copy(bmap1), + isl_basic_map_copy(bmap2)); + disjoint = isl_basic_map_is_empty(test); + isl_basic_map_free(test); + + return disjoint; +} + +/* Are "bset1" and "bset2" disjoint? + */ +isl_bool isl_basic_set_is_disjoint(__isl_keep isl_basic_set *bset1, + __isl_keep isl_basic_set *bset2) +{ + return isl_basic_map_is_disjoint(bset1, bset2); +} + +isl_bool isl_set_plain_is_disjoint(__isl_keep isl_set *set1, __isl_keep isl_set *set2) { return isl_map_plain_is_disjoint((struct isl_map *)set1, @@ -2545,16 +2761,11 @@ /* Are "set1" and "set2" disjoint? */ -int isl_set_is_disjoint(__isl_keep isl_set *set1, __isl_keep isl_set *set2) +isl_bool isl_set_is_disjoint(__isl_keep isl_set *set1, __isl_keep isl_set *set2) { return isl_map_is_disjoint(set1, set2); } -int isl_set_fast_is_disjoint(__isl_keep isl_set *set1, __isl_keep isl_set *set2) -{ - return isl_set_plain_is_disjoint(set1, set2); -} - /* Check if we can combine a given div with lower bound l and upper * bound u with some other div and if so return that other div. * Otherwise return -1. @@ -3109,3 +3320,209 @@ return (struct isl_set *) isl_map_drop_redundant_divs((struct isl_map *)set); } + +/* Does "bmap" satisfy any equality that involves more than 2 variables + * and/or has coefficients different from -1 and 1? + */ +static int has_multiple_var_equality(__isl_keep isl_basic_map *bmap) +{ + int i; + unsigned total; + + total = isl_basic_map_dim(bmap, isl_dim_all); + + for (i = 0; i < bmap->n_eq; ++i) { + int j, k; + + j = isl_seq_first_non_zero(bmap->eq[i] + 1, total); + if (j < 0) + continue; + if (!isl_int_is_one(bmap->eq[i][1 + j]) && + !isl_int_is_negone(bmap->eq[i][1 + j])) + return 1; + + j += 1; + k = isl_seq_first_non_zero(bmap->eq[i] + 1 + j, total - j); + if (k < 0) + continue; + j += k; + if (!isl_int_is_one(bmap->eq[i][1 + j]) && + !isl_int_is_negone(bmap->eq[i][1 + j])) + return 1; + + j += 1; + k = isl_seq_first_non_zero(bmap->eq[i] + 1 + j, total - j); + if (k >= 0) + return 1; + } + + return 0; +} + +/* Remove any common factor g from the constraint coefficients in "v". + * The constant term is stored in the first position and is replaced + * by floor(c/g). If any common factor is removed and if this results + * in a tightening of the constraint, then set *tightened. + */ +static __isl_give isl_vec *normalize_constraint(__isl_take isl_vec *v, + int *tightened) +{ + isl_ctx *ctx; + + if (!v) + return NULL; + ctx = isl_vec_get_ctx(v); + isl_seq_gcd(v->el + 1, v->size - 1, &ctx->normalize_gcd); + if (isl_int_is_zero(ctx->normalize_gcd)) + return v; + if (isl_int_is_one(ctx->normalize_gcd)) + return v; + v = isl_vec_cow(v); + if (!v) + return NULL; + if (tightened && !isl_int_is_divisible_by(v->el[0], ctx->normalize_gcd)) + *tightened = 1; + isl_int_fdiv_q(v->el[0], v->el[0], ctx->normalize_gcd); + isl_seq_scale_down(v->el + 1, v->el + 1, ctx->normalize_gcd, + v->size - 1); + return v; +} + +/* If "bmap" is an integer set that satisfies any equality involving + * more than 2 variables and/or has coefficients different from -1 and 1, + * then use variable compression to reduce the coefficients by removing + * any (hidden) common factor. + * In particular, apply the variable compression to each constraint, + * factor out any common factor in the non-constant coefficients and + * then apply the inverse of the compression. + * At the end, we mark the basic map as having reduced constants. + * If this flag is still set on the next invocation of this function, + * then we skip the computation. + * + * Removing a common factor may result in a tightening of some of + * the constraints. If this happens, then we may end up with two + * opposite inequalities that can be replaced by an equality. + * We therefore call isl_basic_map_detect_inequality_pairs, + * which checks for such pairs of inequalities as well as eliminate_divs_eq + * and isl_basic_map_gauss if such a pair was found. + */ +__isl_give isl_basic_map *isl_basic_map_reduce_coefficients( + __isl_take isl_basic_map *bmap) +{ + unsigned total; + isl_ctx *ctx; + isl_vec *v; + isl_mat *eq, *T, *T2; + int i; + int tightened; + + if (!bmap) + return NULL; + if (ISL_F_ISSET(bmap, ISL_BASIC_MAP_REDUCED_COEFFICIENTS)) + return bmap; + if (isl_basic_map_is_rational(bmap)) + return bmap; + if (bmap->n_eq == 0) + return bmap; + if (!has_multiple_var_equality(bmap)) + return bmap; + + total = isl_basic_map_dim(bmap, isl_dim_all); + ctx = isl_basic_map_get_ctx(bmap); + v = isl_vec_alloc(ctx, 1 + total); + if (!v) + return isl_basic_map_free(bmap); + + eq = isl_mat_sub_alloc6(ctx, bmap->eq, 0, bmap->n_eq, 0, 1 + total); + T = isl_mat_variable_compression(eq, &T2); + if (!T || !T2) + goto error; + if (T->n_col == 0) { + isl_mat_free(T); + isl_mat_free(T2); + isl_vec_free(v); + return isl_basic_map_set_to_empty(bmap); + } + + tightened = 0; + for (i = 0; i < bmap->n_ineq; ++i) { + isl_seq_cpy(v->el, bmap->ineq[i], 1 + total); + v = isl_vec_mat_product(v, isl_mat_copy(T)); + v = normalize_constraint(v, &tightened); + v = isl_vec_mat_product(v, isl_mat_copy(T2)); + if (!v) + goto error; + isl_seq_cpy(bmap->ineq[i], v->el, 1 + total); + } + + isl_mat_free(T); + isl_mat_free(T2); + isl_vec_free(v); + + ISL_F_SET(bmap, ISL_BASIC_MAP_REDUCED_COEFFICIENTS); + + if (tightened) { + int progress = 0; + + bmap = isl_basic_map_detect_inequality_pairs(bmap, &progress); + if (progress) { + bmap = eliminate_divs_eq(bmap, &progress); + bmap = isl_basic_map_gauss(bmap, NULL); + } + } + + return bmap; +error: + isl_mat_free(T); + isl_mat_free(T2); + isl_vec_free(v); + return isl_basic_map_free(bmap); +} + +/* Shift the integer division at position "div" of "bmap" by "shift". + * + * That is, if the integer division has the form + * + * floor(f(x)/d) + * + * then replace it by + * + * floor((f(x) + shift * d)/d) - shift + */ +__isl_give isl_basic_map *isl_basic_map_shift_div( + __isl_take isl_basic_map *bmap, int div, isl_int shift) +{ + int i; + unsigned total; + + if (!bmap) + return NULL; + + total = isl_basic_map_dim(bmap, isl_dim_all); + total -= isl_basic_map_dim(bmap, isl_dim_div); + + isl_int_addmul(bmap->div[div][1], shift, bmap->div[div][0]); + + for (i = 0; i < bmap->n_eq; ++i) { + if (isl_int_is_zero(bmap->eq[i][1 + total + div])) + continue; + isl_int_submul(bmap->eq[i][0], + shift, bmap->eq[i][1 + total + div]); + } + for (i = 0; i < bmap->n_ineq; ++i) { + if (isl_int_is_zero(bmap->ineq[i][1 + total + div])) + continue; + isl_int_submul(bmap->ineq[i][0], + shift, bmap->ineq[i][1 + total + div]); + } + for (i = 0; i < bmap->n_div; ++i) { + if (isl_int_is_zero(bmap->div[i][0])) + continue; + if (isl_int_is_zero(bmap->div[i][1 + 1 + total + div])) + continue; + isl_int_submul(bmap->div[i][1], + shift, bmap->div[i][1 + 1 + total + div]); + } + + return bmap; +} diff -Nru cloog-0.18.2/isl/isl_map_subtract.c cloog-0.18.4/isl/isl_map_subtract.c --- cloog-0.18.2/isl/isl_map_subtract.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_map_subtract.c 2015-07-24 12:23:09.000000000 +0000 @@ -8,11 +8,12 @@ */ #include -#include +#include #include #include #include "isl_tab.h" #include +#include /* Expand the constraint "c" into "v". The initial "dim" dimensions * are the same, but "v" may have more divs than "c" and the divs of "c" @@ -286,14 +287,14 @@ * has been removed when we end up in a leaf, we simply pass along * the original basic map. */ -static int basic_map_collect_diff(__isl_take isl_basic_map *bmap, +static isl_stat basic_map_collect_diff(__isl_take isl_basic_map *bmap, __isl_take isl_map *map, struct isl_diff_collector *dc) { int i; int modified; int level; int init; - int empty; + isl_bool empty; isl_ctx *ctx; struct isl_tab *tab = NULL; struct isl_tab_undo **snap = NULL; @@ -306,7 +307,7 @@ if (empty) { isl_basic_map_free(bmap); isl_map_free(map); - return empty < 0 ? -1 : 0; + return empty < 0 ? isl_stat_error : isl_stat_ok; } bmap = isl_basic_map_cow(bmap); @@ -436,7 +437,7 @@ isl_basic_map_free(bmap); isl_map_free(map); - return 0; + return isl_stat_ok; error: isl_tab_free(tab); free(snap); @@ -450,7 +451,7 @@ free(div_map); isl_basic_map_free(bmap); isl_map_free(map); - return -1; + return isl_stat_error; } /* A diff collector that actually collects all parts of the @@ -482,7 +483,7 @@ { struct isl_subtract_diff_collector sdc; sdc.dc.add = &basic_map_subtract_add; - sdc.diff = isl_map_empty_like_basic_map(bmap); + sdc.diff = isl_map_empty(isl_basic_map_get_space(bmap)); if (basic_map_collect_diff(bmap, map, &sdc.dc) < 0) { isl_map_free(sdc.diff); sdc.diff = NULL; @@ -490,13 +491,32 @@ return sdc.diff; } +/* Return an empty map living in the same space as "map1" and "map2". + */ +static __isl_give isl_map *replace_pair_by_empty( __isl_take isl_map *map1, + __isl_take isl_map *map2) +{ + isl_space *space; + + space = isl_map_get_space(map1); + isl_map_free(map1); + isl_map_free(map2); + return isl_map_empty(space); +} + /* Return the set difference between map1 and map2. * (U_i A_i) \ (U_j B_j) is computed as U_i (A_i \ (U_j B_j)) + * + * If "map1" and "map2" are obviously equal to each other, + * then return an empty map in the same space. + * + * If "map1" and "map2" are disjoint, then simply return "map1". */ static __isl_give isl_map *map_subtract( __isl_take isl_map *map1, __isl_take isl_map *map2) { int i; + int equal, disjoint; struct isl_map *diff; if (!map1 || !map2) @@ -504,7 +524,16 @@ isl_assert(map1->ctx, isl_space_is_equal(map1->dim, map2->dim), goto error); - if (isl_map_is_empty(map2)) { + equal = isl_map_plain_is_equal(map1, map2); + if (equal < 0) + goto error; + if (equal) + return replace_pair_by_empty(map1, map2); + + disjoint = isl_map_is_disjoint(map1, map2); + if (disjoint < 0) + goto error; + if (disjoint) { isl_map_free(map2); return map1; } @@ -517,7 +546,7 @@ map1 = isl_map_remove_empty_parts(map1); map2 = isl_map_remove_empty_parts(map2); - diff = isl_map_empty_like(map1); + diff = isl_map_empty(isl_map_get_space(map1)); for (i = 0; i < map1->n; ++i) { struct isl_map *d; d = basic_map_subtract(isl_basic_map_copy(map1->p[i]), @@ -608,7 +637,7 @@ */ struct isl_is_empty_diff_collector { struct isl_diff_collector dc; - int empty; + isl_bool empty; }; /* isl_is_empty_diff_collector callback. @@ -628,36 +657,38 @@ /* Check if bmap \ map is empty by computing this set difference * and breaking off as soon as the difference is known to be non-empty. */ -static int basic_map_diff_is_empty(__isl_keep isl_basic_map *bmap, +static isl_bool basic_map_diff_is_empty(__isl_keep isl_basic_map *bmap, __isl_keep isl_map *map) { - int r; + isl_bool empty; + isl_stat r; struct isl_is_empty_diff_collector edc; - r = isl_basic_map_plain_is_empty(bmap); - if (r) - return r; + empty = isl_basic_map_plain_is_empty(bmap); + if (empty) + return empty; edc.dc.add = &basic_map_is_empty_add; - edc.empty = 1; + edc.empty = isl_bool_true; r = basic_map_collect_diff(isl_basic_map_copy(bmap), isl_map_copy(map), &edc.dc); if (!edc.empty) - return 0; + return isl_bool_false; - return r < 0 ? -1 : 1; + return r < 0 ? isl_bool_error : isl_bool_true; } /* Check if map1 \ map2 is empty by checking if the set difference is empty * for each of the basic maps in map1. */ -static int map_diff_is_empty(__isl_keep isl_map *map1, __isl_keep isl_map *map2) +static isl_bool map_diff_is_empty(__isl_keep isl_map *map1, + __isl_keep isl_map *map2) { int i; - int is_empty = 1; + isl_bool is_empty = isl_bool_true; if (!map1 || !map2) - return -1; + return isl_bool_error; for (i = 0; i < map1->n; ++i) { is_empty = basic_map_diff_is_empty(map1->p[i], map2); @@ -746,25 +777,27 @@ return NULL; } -/* Return 1 is the singleton map "map1" is a subset of "map2", +/* Return isl_bool_true if the singleton map "map1" is a subset of "map2", * i.e., if the single element of "map1" is also an element of "map2". * Assumes "map2" has known divs. */ -static int map_is_singleton_subset(__isl_keep isl_map *map1, +static isl_bool map_is_singleton_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2) { int i; - int is_subset = 0; + isl_bool is_subset = isl_bool_false; struct isl_point *point; if (!map1 || !map2) - return -1; + return isl_bool_error; if (map1->n != 1) - return -1; + isl_die(isl_map_get_ctx(map1), isl_error_invalid, + "expecting single-disjunct input", + return isl_bool_error); point = singleton_extract_point(map1->p[0]); if (!point) - return -1; + return isl_bool_error; for (i = 0; i < map2->n; ++i) { is_subset = isl_basic_map_contains_point(map2->p[i], point); @@ -776,39 +809,40 @@ return is_subset; } -static int map_is_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2) +static isl_bool map_is_subset(__isl_keep isl_map *map1, + __isl_keep isl_map *map2) { - int is_subset = 0; - int empty; + isl_bool is_subset = isl_bool_false; + isl_bool empty; int rat1, rat2; if (!map1 || !map2) - return -1; + return isl_bool_error; if (!isl_map_has_equal_space(map1, map2)) - return 0; + return isl_bool_false; empty = isl_map_is_empty(map1); if (empty < 0) - return -1; + return isl_bool_error; if (empty) - return 1; + return isl_bool_true; empty = isl_map_is_empty(map2); if (empty < 0) - return -1; + return isl_bool_error; if (empty) - return 0; + return isl_bool_false; rat1 = isl_map_has_rational(map1); rat2 = isl_map_has_rational(map2); if (rat1 < 0 || rat2 < 0) - return -1; + return isl_bool_error; if (rat1 && !rat2) - return 0; + return isl_bool_false; if (isl_map_plain_is_universe(map2)) - return 1; + return isl_bool_true; map2 = isl_map_compute_divs(isl_map_copy(map2)); if (isl_map_plain_is_singleton(map1)) { @@ -822,13 +856,13 @@ return is_subset; } -int isl_map_is_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2) +isl_bool isl_map_is_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2) { return isl_map_align_params_map_map_and_test(map1, map2, &map_is_subset); } -int isl_set_is_subset(struct isl_set *set1, struct isl_set *set2) +isl_bool isl_set_is_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2) { return isl_map_is_subset( (struct isl_map *)set1, (struct isl_map *)set2); diff -Nru cloog-0.18.2/isl/isl_map_to_basic_set.c cloog-0.18.4/isl/isl_map_to_basic_set.c --- cloog-0.18.2/isl/isl_map_to_basic_set.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_map_to_basic_set.c 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,10 @@ +#include +#include +#include + +#define KEY_BASE map +#define KEY_EQUAL isl_map_plain_is_equal +#define VAL_BASE basic_set +#define VAL_EQUAL isl_basic_set_plain_is_equal + +#include diff -Nru cloog-0.18.2/isl/isl_mat.c cloog-0.18.4/isl/isl_mat.c --- cloog-0.18.2/isl/isl_mat.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_mat.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,19 +1,23 @@ /* * Copyright 2008-2009 Katholieke Universiteit Leuven + * Copyright 2014 Ecole Normale Superieure * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, K.U.Leuven, Departement * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium + * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France */ #include #include #include -#include +#include #include +#include #include #include +#include isl_ctx *isl_mat_get_ctx(__isl_keep isl_mat *mat) { @@ -205,7 +209,7 @@ return mat2; } -void *isl_mat_free(struct isl_mat *mat) +__isl_null isl_mat *isl_mat_free(__isl_take isl_mat *mat) { if (!mat) return NULL; @@ -345,6 +349,30 @@ return isl_mat_diag(ctx, n_row, ctx->one); } +/* Is "mat" a (possibly scaled) identity matrix? + */ +int isl_mat_is_scaled_identity(__isl_keep isl_mat *mat) +{ + int i; + + if (!mat) + return -1; + if (mat->n_row != mat->n_col) + return 0; + + for (i = 0; i < mat->n_row; ++i) { + if (isl_seq_first_non_zero(mat->row[i], i) != -1) + return 0; + if (isl_int_ne(mat->row[0][0], mat->row[i][i])) + return 0; + if (isl_seq_first_non_zero(mat->row[i] + i + 1, + mat->n_col - (i + 1)) != -1) + return 0; + } + + return 1; +} + struct isl_vec *isl_mat_vec_product(struct isl_mat *mat, struct isl_vec *vec) { int i; @@ -530,7 +558,7 @@ * with U and Q unimodular matrices and H a matrix in column echelon form * such that on each echelon row the entries in the non-echelon column * are non-negative (if neg == 0) or non-positive (if neg == 1) - * and stricly smaller (in absolute value) than the entries in the echelon + * and strictly smaller (in absolute value) than the entries in the echelon * column. * If U or Q are NULL, then these matrices are not computed. */ @@ -1007,6 +1035,11 @@ return mat; } +/* Calculate the product of two matrices. + * + * This function is optimized for operand matrices that contain many zeros and + * skips multiplications where we know one of the operands is zero. + */ __isl_give isl_mat *isl_mat_product(__isl_take isl_mat *left, __isl_take isl_mat *right) { @@ -1027,10 +1060,13 @@ return prod; } for (i = 0; i < prod->n_row; ++i) { - for (j = 0; j < prod->n_col; ++j) { + for (j = 0; j < prod->n_col; ++j) isl_int_mul(prod->row[i][j], left->row[i][0], right->row[0][j]); - for (k = 1; k < left->n_col; ++k) + for (k = 1; k < left->n_col; ++k) { + if (isl_int_is_zero(left->row[i][k])) + continue; + for (j = 0; j < prod->n_col; ++j) isl_int_addmul(prod->row[i][j], left->row[i][k], right->row[k][j]); } @@ -1151,14 +1187,12 @@ struct isl_set *isl_set_preimage(struct isl_set *set, struct isl_mat *mat) { - struct isl_ctx *ctx; int i; set = isl_set_cow(set); if (!set) return NULL; - ctx = set->ctx; for (i = 0; i < set->n; ++i) { set->p[i] = isl_basic_set_preimage(set->p[i], isl_mat_copy(mat)); @@ -1553,6 +1587,26 @@ return NULL; } +/* Return a copy of row "row" of "mat" as an isl_vec. + */ +__isl_give isl_vec *isl_mat_get_row(__isl_keep isl_mat *mat, unsigned row) +{ + isl_vec *v; + + if (!mat) + return NULL; + if (row >= mat->n_row) + isl_die(mat->ctx, isl_error_invalid, "row out of range", + return NULL); + + v = isl_vec_alloc(isl_mat_get_ctx(mat), mat->n_col); + if (!v) + return NULL; + isl_seq_cpy(v->el, mat->row[row], mat->n_col); + + return v; +} + __isl_give isl_mat *isl_mat_vec_concat(__isl_take isl_mat *top, __isl_take isl_vec *bot) { diff -Nru cloog-0.18.2/isl/isl_mat_private.h cloog-0.18.4/isl/isl_mat_private.h --- cloog-0.18.2/isl/isl_mat_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_mat_private.h 2014-10-02 15:48:18.000000000 +0000 @@ -1,4 +1,5 @@ #include +#include struct isl_mat { int ref; @@ -28,3 +29,18 @@ void isl_mat_sub_neg(struct isl_ctx *ctx, isl_int **dst, isl_int **src, unsigned n_row, unsigned dst_col, unsigned src_col, unsigned n_col); __isl_give isl_mat *isl_mat_diag(isl_ctx *ctx, unsigned n_row, isl_int d); + +__isl_give isl_mat *isl_mat_scale_down_row(__isl_take isl_mat *mat, int row, + isl_int m); + +__isl_give isl_vec *isl_mat_get_row(__isl_keep isl_mat *mat, unsigned row); + +int isl_mat_is_scaled_identity(__isl_keep isl_mat *mat); + +void isl_mat_col_mul(struct isl_mat *mat, int dst_col, isl_int f, int src_col); +void isl_mat_col_submul(struct isl_mat *mat, + int dst_col, isl_int f, int src_col); + +int isl_mat_get_element(__isl_keep isl_mat *mat, int row, int col, isl_int *v); +__isl_give isl_mat *isl_mat_set_element(__isl_take isl_mat *mat, + int row, int col, isl_int v); diff -Nru cloog-0.18.2/isl/isl_morph.c cloog-0.18.4/isl/isl_morph.c --- cloog-0.18.2/isl/isl_morph.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_morph.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,20 +1,30 @@ /* - * Copyright 2010 INRIA Saclay + * Copyright 2010-2011 INRIA Saclay + * Copyright 2014 Ecole Normale Superieure * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, * 91893 Orsay, France + * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France */ #include +#include #include -#include +#include #include #include #include +isl_ctx *isl_morph_get_ctx(__isl_keep isl_morph *morph) +{ + if (!morph) + return NULL; + return isl_basic_set_get_ctx(morph->dom); +} + __isl_give isl_morph *isl_morph_alloc( __isl_take isl_basic_set *dom, __isl_take isl_basic_set *ran, __isl_take isl_mat *map, __isl_take isl_mat *inv) @@ -88,6 +98,87 @@ free(morph); } +/* Is "morph" an identity on the parameters? + */ +static int identity_on_parameters(__isl_keep isl_morph *morph) +{ + int is_identity; + unsigned nparam; + isl_mat *sub; + + nparam = isl_morph_dom_dim(morph, isl_dim_param); + if (nparam != isl_morph_ran_dim(morph, isl_dim_param)) + return 0; + if (nparam == 0) + return 1; + sub = isl_mat_sub_alloc(morph->map, 0, 1 + nparam, 0, 1 + nparam); + is_identity = isl_mat_is_scaled_identity(sub); + isl_mat_free(sub); + + return is_identity; +} + +/* Return an affine expression of the variables of the range of "morph" + * in terms of the parameters and the variables of the domain on "morph". + * + * In order for the space manipulations to make sense, we require + * that the parameters are not modified by "morph". + */ +__isl_give isl_multi_aff *isl_morph_get_var_multi_aff( + __isl_keep isl_morph *morph) +{ + isl_space *dom, *ran, *space; + isl_local_space *ls; + isl_multi_aff *ma; + unsigned nparam, nvar; + int i; + int is_identity; + + if (!morph) + return NULL; + + is_identity = identity_on_parameters(morph); + if (is_identity < 0) + return NULL; + if (!is_identity) + isl_die(isl_morph_get_ctx(morph), isl_error_invalid, + "cannot handle parameter compression", return NULL); + + dom = isl_morph_get_dom_space(morph); + ls = isl_local_space_from_space(isl_space_copy(dom)); + ran = isl_morph_get_ran_space(morph); + space = isl_space_map_from_domain_and_range(dom, ran); + ma = isl_multi_aff_zero(space); + + nparam = isl_multi_aff_dim(ma, isl_dim_param); + nvar = isl_multi_aff_dim(ma, isl_dim_out); + for (i = 0; i < nvar; ++i) { + isl_val *val; + isl_vec *v; + isl_aff *aff; + + v = isl_mat_get_row(morph->map, 1 + nparam + i); + v = isl_vec_insert_els(v, 0, 1); + val = isl_mat_get_element_val(morph->map, 0, 0); + v = isl_vec_set_element_val(v, 0, val); + aff = isl_aff_alloc_vec(isl_local_space_copy(ls), v); + ma = isl_multi_aff_set_aff(ma, i, aff); + } + + isl_local_space_free(ls); + return ma; +} + +/* Return the domain space of "morph". + */ +__isl_give isl_space *isl_morph_get_dom_space(__isl_keep isl_morph *morph) +{ + if (!morph) + return NULL; + + return isl_basic_set_get_space(morph->dom); +} + __isl_give isl_space *isl_morph_get_ran_space(__isl_keep isl_morph *morph) { if (!morph) @@ -213,8 +304,8 @@ if (!morph) return; - isl_basic_set_print(morph->dom, out, 0, "", "", ISL_FORMAT_ISL); - isl_basic_set_print(morph->ran, out, 0, "", "", ISL_FORMAT_ISL); + isl_basic_set_dump(morph->dom); + isl_basic_set_dump(morph->ran); isl_mat_print_internal(morph->map, out, 4); isl_mat_print_internal(morph->inv, out, 4); } diff -Nru cloog-0.18.2/isl/isl_morph.h cloog-0.18.4/isl/isl_morph.h --- cloog-0.18.2/isl/isl_morph.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_morph.h 2014-10-02 15:48:18.000000000 +0000 @@ -35,6 +35,8 @@ }; typedef struct isl_morph isl_morph; +isl_ctx *isl_morph_get_ctx(__isl_keep isl_morph *morph); + __isl_give isl_morph *isl_morph_alloc( __isl_take isl_basic_set *dom, __isl_take isl_basic_set *ran, __isl_take isl_mat *map, __isl_take isl_mat *inv); @@ -42,7 +44,10 @@ __isl_give isl_morph *isl_morph_identity(__isl_keep isl_basic_set *bset); void isl_morph_free(__isl_take isl_morph *morph); +__isl_give isl_space *isl_morph_get_dom_space(__isl_keep isl_morph *morph); __isl_give isl_space *isl_morph_get_ran_space(__isl_keep isl_morph *morph); +__isl_give isl_multi_aff *isl_morph_get_var_multi_aff( + __isl_keep isl_morph *morph); unsigned isl_morph_dom_dim(__isl_keep isl_morph *morph, enum isl_dim_type type); unsigned isl_morph_ran_dim(__isl_keep isl_morph *morph, enum isl_dim_type type); diff -Nru cloog-0.18.2/isl/isl_multi_apply_set.c cloog-0.18.4/isl/isl_multi_apply_set.c --- cloog-0.18.2/isl/isl_multi_apply_set.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_multi_apply_set.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,7 @@ +#define APPLY_DOMBASE set +#define APPLY_DOM isl_set + +#include + +#undef APPLY_DOMBASE +#undef APPLY_DOM diff -Nru cloog-0.18.2/isl/isl_multi_apply_templ.c cloog-0.18.4/isl/isl_multi_apply_templ.c --- cloog-0.18.2/isl/isl_multi_apply_templ.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_multi_apply_templ.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,81 @@ +/* + * Copyright 2011 Sven Verdoolaege + * Copyright 2012-2013 Ecole Normale Superieure + * + * Use of this software is governed by the MIT license + * + * Written by Sven Verdoolaege, + * Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France + */ + +#include + +/* Transform the elements of "multi" by applying "fn" to them + * with extra argument "set". + * + * The parameters of "multi" and "set" are assumed to have been aligned. + */ +__isl_give MULTI(BASE) *FN(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)( + __isl_take MULTI(BASE) *multi, __isl_take APPLY_DOM *set, + __isl_give EL *(*fn)(EL *el, __isl_take APPLY_DOM *set)) +{ + int i; + + if (!multi || !set) + goto error; + + if (multi->n == 0) { + FN(APPLY_DOM,free)(set); + return multi; + } + + multi = FN(MULTI(BASE),cow)(multi); + if (!multi) + goto error; + + for (i = 0; i < multi->n; ++i) { + multi->p[i] = fn(multi->p[i], FN(APPLY_DOM,copy)(set)); + if (!multi->p[i]) + goto error; + } + + FN(APPLY_DOM,free)(set); + return multi; +error: + FN(APPLY_DOM,free)(set); + FN(MULTI(BASE),free)(multi); + return NULL; +} + +/* Transform the elements of "multi" by applying "fn" to them + * with extra argument "set". + * + * Align the parameters if needed and call apply_set_aligned. + */ +static __isl_give MULTI(BASE) *FN(FN(MULTI(BASE),apply),APPLY_DOMBASE)( + __isl_take MULTI(BASE) *multi, __isl_take APPLY_DOM *set, + __isl_give EL *(*fn)(EL *el, __isl_take APPLY_DOM *set)) +{ + isl_ctx *ctx; + + if (!multi || !set) + goto error; + + if (isl_space_match(multi->space, isl_dim_param, + set->dim, isl_dim_param)) + return FN(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi, + set, fn); + ctx = FN(MULTI(BASE),get_ctx)(multi); + if (!isl_space_has_named_params(multi->space) || + !isl_space_has_named_params(set->dim)) + isl_die(ctx, isl_error_invalid, + "unaligned unnamed parameters", goto error); + multi = FN(MULTI(BASE),align_params)(multi, + FN(APPLY_DOM,get_space)(set)); + set = FN(APPLY_DOM,align_params)(set, FN(MULTI(BASE),get_space)(multi)); + return FN(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi, set, fn); +error: + FN(MULTI(BASE),free)(multi); + FN(APPLY_DOM,free)(set); + return NULL; +} diff -Nru cloog-0.18.2/isl/isl_multi_apply_union_set.c cloog-0.18.4/isl/isl_multi_apply_union_set.c --- cloog-0.18.2/isl/isl_multi_apply_union_set.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_multi_apply_union_set.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,7 @@ +#define APPLY_DOMBASE union_set +#define APPLY_DOM isl_union_set + +#include + +#undef APPLY_DOMBASE +#undef APPLY_DOM diff -Nru cloog-0.18.2/isl/isl_multi_floor.c cloog-0.18.4/isl/isl_multi_floor.c --- cloog-0.18.2/isl/isl_multi_floor.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_multi_floor.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,29 @@ +/* + * Copyright 2014 Ecole Normale Superieure + * + * Use of this software is governed by the MIT license + * + * Written by Sven Verdoolaege, + * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France + */ + +#include + +/* Given f, return floor(f). + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),floor)(__isl_take MULTI(BASE) *multi) +{ + int i; + + multi = FN(MULTI(BASE),cow)(multi); + if (!multi) + return NULL; + + for (i = 0; i < multi->n; ++i) { + multi->p[i] = FN(EL,floor)(multi->p[i]); + if (!multi->p[i]) + return FN(MULTI(BASE),free)(multi); + } + + return multi; +} diff -Nru cloog-0.18.2/isl/isl_multi_gist.c cloog-0.18.4/isl/isl_multi_gist.c --- cloog-0.18.2/isl/isl_multi_gist.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_multi_gist.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,29 @@ +/* + * Copyright 2011 Sven Verdoolaege + * Copyright 2012-2013 Ecole Normale Superieure + * + * Use of this software is governed by the MIT license + * + * Written by Sven Verdoolaege, + * Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France + */ + +#include + +/* Compute the gist of "multi" with respect to the domain constraints + * of "context". + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),gist)(__isl_take MULTI(BASE) *multi, + __isl_take DOM *context) +{ + return FN(FN(MULTI(BASE),apply),DOMBASE)(multi, context, &FN(EL,gist)); +} + +/* Compute the gist of "multi" with respect to the parameter constraints + * of "context". + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),gist_params)( + __isl_take MULTI(BASE) *multi, __isl_take isl_set *context) +{ + return FN(MULTI(BASE),apply_set)(multi, context, &FN(EL,gist_params)); +} diff -Nru cloog-0.18.2/isl/isl_multi_intersect.c cloog-0.18.4/isl/isl_multi_intersect.c --- cloog-0.18.2/isl/isl_multi_intersect.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_multi_intersect.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,29 @@ +/* + * Copyright 2011 Sven Verdoolaege + * Copyright 2012-2013 Ecole Normale Superieure + * + * Use of this software is governed by the MIT license + * + * Written by Sven Verdoolaege, + * Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France + */ + +#include + +/* Intersect the domain of "multi" with "domain". + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),intersect_domain)( + __isl_take MULTI(BASE) *multi, __isl_take DOM *domain) +{ + return FN(FN(MULTI(BASE),apply),DOMBASE)(multi, domain, + &FN(EL,intersect_domain)); +} + +/* Intersect the parameter domain of "multi" with "domain". + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),intersect_params)( + __isl_take MULTI(BASE) *multi, __isl_take isl_set *domain) +{ + return FN(MULTI(BASE),apply_set)(multi, domain, + &FN(EL,intersect_params)); +} diff -Nru cloog-0.18.2/isl/isl_multi_macro.h cloog-0.18.4/isl/isl_multi_macro.h --- cloog-0.18.2/isl/isl_multi_macro.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_multi_macro.h 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +#define xCAT(A,B) A ## B +#define CAT(A,B) xCAT(A,B) +#undef EL +#define EL CAT(isl_,BASE) +#define xFN(TYPE,NAME) TYPE ## _ ## NAME +#define FN(TYPE,NAME) xFN(TYPE,NAME) +#define xMULTI(BASE) isl_multi_ ## BASE +#define MULTI(BASE) xMULTI(BASE) +#undef DOM +#define DOM CAT(isl_,DOMBASE) diff -Nru cloog-0.18.2/isl/isl_multi_templ.c cloog-0.18.4/isl/isl_multi_templ.c --- cloog-0.18.2/isl/isl_multi_templ.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_multi_templ.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright 2011 Sven Verdoolaege - * Copyright 2012 Ecole Normale Superieure + * Copyright 2012-2013 Ecole Normale Superieure * * Use of this software is governed by the MIT license * @@ -12,14 +12,8 @@ #include #include -#define xCAT(A,B) A ## B -#define CAT(A,B) xCAT(A,B) -#undef EL -#define EL CAT(isl_,BASE) -#define xFN(TYPE,NAME) TYPE ## _ ## NAME -#define FN(TYPE,NAME) xFN(TYPE,NAME) -#define xMULTI(BASE) isl_multi_ ## BASE -#define MULTI(BASE) xMULTI(BASE) +#include + #define MULTI_NAME(BASE) "isl_multi_" #BASE #define xLIST(EL) EL ## _list #define LIST(EL) xLIST(EL) @@ -34,6 +28,18 @@ return multi ? isl_space_copy(multi->space) : NULL; } +/* Return the position of the dimension of the given type and name + * in "multi". + * Return -1 if no such dimension can be found. + */ +int FN(MULTI(BASE),find_dim_by_name)(__isl_keep MULTI(BASE) *multi, + enum isl_dim_type type, const char *name) +{ + if (!multi) + return -1; + return isl_space_find_dim_by_name(multi->space, type, name); +} + __isl_give isl_space *FN(MULTI(BASE),get_domain_space)( __isl_keep MULTI(BASE) *multi) { @@ -105,7 +111,7 @@ return multi; } -void *FN(MULTI(BASE),free)(__isl_take MULTI(BASE) *multi) +__isl_null MULTI(BASE) *FN(MULTI(BASE),free)(__isl_take MULTI(BASE) *multi) { int i; @@ -123,6 +129,32 @@ return NULL; } +#ifndef NO_DIMS +/* Check whether "multi" has non-zero coefficients for any dimension + * in the given range or if any of these dimensions appear + * with non-zero coefficients in any of the integer divisions involved. + */ +isl_bool FN(MULTI(BASE),involves_dims)(__isl_keep MULTI(BASE) *multi, + enum isl_dim_type type, unsigned first, unsigned n) +{ + int i; + + if (!multi) + return isl_bool_error; + if (multi->n == 0 || n == 0) + return isl_bool_false; + + for (i = 0; i < multi->n; ++i) { + isl_bool involves; + + involves = FN(EL,involves_dims)(multi->p[i], type, first, n); + if (involves < 0 || involves) + return involves; + } + + return isl_bool_false; +} + __isl_give MULTI(BASE) *FN(MULTI(BASE),insert_dims)( __isl_take MULTI(BASE) *multi, enum isl_dim_type type, unsigned first, unsigned n) @@ -164,6 +196,7 @@ return FN(MULTI(BASE),insert_dims)(multi, type, pos, n); } +#endif unsigned FN(MULTI(BASE),dim)(__isl_keep MULTI(BASE) *multi, enum isl_dim_type type) @@ -171,6 +204,25 @@ return multi ? isl_space_dim(multi->space, type) : 0; } +/* Return the position of the first dimension of "type" with id "id". + * Return -1 if there is no such dimension. + */ +int FN(MULTI(BASE),find_dim_by_id)(__isl_keep MULTI(BASE) *multi, + enum isl_dim_type type, __isl_keep isl_id *id) +{ + if (!multi) + return -1; + return isl_space_find_dim_by_id(multi->space, type, id); +} + +/* Return the id of the given dimension. + */ +__isl_give isl_id *FN(MULTI(BASE),get_dim_id)(__isl_keep MULTI(BASE) *multi, + enum isl_dim_type type, unsigned pos) +{ + return multi ? isl_space_get_dim_id(multi->space, type, pos) : NULL; +} + __isl_give MULTI(BASE) *FN(MULTI(BASE),set_dim_name)( __isl_take MULTI(BASE) *multi, enum isl_dim_type type, unsigned pos, const char *s) @@ -202,6 +254,24 @@ return multi ? isl_space_get_tuple_name(multi->space, type) : NULL; } +/* Does the specified tuple have an id? + */ +isl_bool FN(MULTI(BASE),has_tuple_id)(__isl_keep MULTI(BASE) *multi, + enum isl_dim_type type) +{ + if (!multi) + return isl_bool_error; + return isl_space_has_tuple_id(multi->space, type); +} + +/* Return the id of the specified tuple. + */ +__isl_give isl_id *FN(MULTI(BASE),get_tuple_id)(__isl_keep MULTI(BASE) *multi, + enum isl_dim_type type) +{ + return multi ? isl_space_get_tuple_id(multi->space, type) : NULL; +} + __isl_give EL *FN(FN(MULTI(BASE),get),BASE)(__isl_keep MULTI(BASE) *multi, int pos) { @@ -221,12 +291,23 @@ { isl_space *multi_space = NULL; isl_space *el_space = NULL; + int match; multi = FN(MULTI(BASE),cow)(multi); if (!multi || !el) goto error; multi_space = FN(MULTI(BASE),get_space)(multi); + match = FN(EL,matching_params)(el, multi_space); + if (match < 0) + goto error; + if (!match) { + multi = FN(MULTI(BASE),align_params)(multi, + FN(EL,get_space)(el)); + isl_space_free(multi_space); + multi_space = FN(MULTI(BASE),get_space)(multi); + el = FN(EL,align_params)(el, isl_space_copy(multi_space)); + } if (FN(EL,check_match_domain_space)(el, multi_space) < 0) goto error; @@ -302,6 +383,28 @@ return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain); } +/* Set the id of the given dimension of "multi" to "id". + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),set_dim_id)( + __isl_take MULTI(BASE) *multi, + enum isl_dim_type type, unsigned pos, __isl_take isl_id *id) +{ + isl_space *space; + + multi = FN(MULTI(BASE),cow)(multi); + if (!multi || !id) + goto error; + + space = FN(MULTI(BASE),get_space)(multi); + space = isl_space_set_dim_id(space, type, pos, id); + + return FN(MULTI(BASE),reset_space)(multi, space); +error: + isl_id_free(id); + FN(MULTI(BASE),free)(multi); + return NULL; +} + __isl_give MULTI(BASE) *FN(MULTI(BASE),set_tuple_name)( __isl_keep MULTI(BASE) *multi, enum isl_dim_type type, const char *s) @@ -319,19 +422,58 @@ } __isl_give MULTI(BASE) *FN(MULTI(BASE),set_tuple_id)( - __isl_keep MULTI(BASE) *multi, enum isl_dim_type type, + __isl_take MULTI(BASE) *multi, enum isl_dim_type type, __isl_take isl_id *id) { isl_space *space; multi = FN(MULTI(BASE),cow)(multi); if (!multi) - return isl_id_free(id); + goto error; space = FN(MULTI(BASE),get_space)(multi); space = isl_space_set_tuple_id(space, type, id); return FN(MULTI(BASE),reset_space)(multi, space); +error: + isl_id_free(id); + return NULL; +} + +/* Drop the id on the specified tuple. + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),reset_tuple_id)( + __isl_take MULTI(BASE) *multi, enum isl_dim_type type) +{ + isl_space *space; + + if (!multi) + return NULL; + if (!FN(MULTI(BASE),has_tuple_id)(multi, type)) + return multi; + + multi = FN(MULTI(BASE),cow)(multi); + if (!multi) + return NULL; + + space = FN(MULTI(BASE),get_space)(multi); + space = isl_space_reset_tuple_id(space, type); + + return FN(MULTI(BASE),reset_space)(multi, space); +} + +/* Reset the user pointer on all identifiers of parameters and tuples + * of the space of "multi". + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),reset_user)( + __isl_take MULTI(BASE) *multi) +{ + isl_space *space; + + space = FN(MULTI(BASE),get_space)(multi); + space = isl_space_reset_user(space); + + return FN(MULTI(BASE),reset_space)(multi, space); } __isl_give MULTI(BASE) *FN(MULTI(BASE),realign_domain)( @@ -367,10 +509,17 @@ __isl_take MULTI(BASE) *multi, __isl_take isl_space *model) { isl_ctx *ctx; + isl_reordering *exp; if (!multi || !model) goto error; + if (isl_space_match(multi->space, isl_dim_param, + model, isl_dim_param)) { + isl_space_free(model); + return multi; + } + ctx = isl_space_get_ctx(model); if (!isl_space_has_named_params(model)) isl_die(ctx, isl_error_invalid, @@ -378,16 +527,12 @@ if (!isl_space_has_named_params(multi->space)) isl_die(ctx, isl_error_invalid, "input has unnamed parameters", goto error); - if (!isl_space_match(multi->space, isl_dim_param, - model, isl_dim_param)) { - isl_reordering *exp; - model = isl_space_params(model); - exp = isl_parameter_alignment_reordering(multi->space, model); - exp = isl_reordering_extend_space(exp, + model = isl_space_params(model); + exp = isl_parameter_alignment_reordering(multi->space, model); + exp = isl_reordering_extend_space(exp, FN(MULTI(BASE),get_domain_space)(multi)); - multi = FN(MULTI(BASE),realign_domain)(multi, exp); - } + multi = FN(MULTI(BASE),realign_domain)(multi, exp); isl_space_free(model); return multi; @@ -397,73 +542,6 @@ return NULL; } -#ifndef NO_GIST -static __isl_give MULTI(BASE) *FN(MULTI(BASE),align_params_multi_set_and)( - __isl_take MULTI(BASE) *multi, __isl_take isl_set *set, - __isl_give MULTI(BASE) *(*fn)(__isl_take MULTI(BASE) *multi, - __isl_take isl_set *set)) -{ - isl_ctx *ctx; - - if (!multi || !set) - goto error; - if (isl_space_match(multi->space, isl_dim_param, - set->dim, isl_dim_param)) - return fn(multi, set); - ctx = FN(MULTI(BASE),get_ctx)(multi); - if (!isl_space_has_named_params(multi->space) || - !isl_space_has_named_params(set->dim)) - isl_die(ctx, isl_error_invalid, - "unaligned unnamed parameters", goto error); - multi = FN(MULTI(BASE),align_params)(multi, isl_set_get_space(set)); - set = isl_set_align_params(set, FN(MULTI(BASE),get_space)(multi)); - return fn(multi, set); -error: - FN(MULTI(BASE),free)(multi); - isl_set_free(set); - return NULL; -} - -__isl_give MULTI(BASE) *FN(MULTI(BASE),gist_aligned)( - __isl_take MULTI(BASE) *multi, __isl_take isl_set *context) -{ - int i; - - multi = FN(MULTI(BASE),cow)(multi); - if (!multi || !context) - goto error; - - for (i = 0; i < multi->n; ++i) { - multi->p[i] = FN(EL,gist)(multi->p[i], isl_set_copy(context)); - if (!multi->p[i]) - goto error; - } - - isl_set_free(context); - return multi; -error: - isl_set_free(context); - FN(MULTI(BASE),free)(multi); - return NULL; -} - -__isl_give MULTI(BASE) *FN(MULTI(BASE),gist)(__isl_take MULTI(BASE) *multi, - __isl_take isl_set *context) -{ - return FN(MULTI(BASE),align_params_multi_set_and)(multi, context, - &FN(MULTI(BASE),gist_aligned)); -} - -__isl_give MULTI(BASE) *FN(MULTI(BASE),gist_params)( - __isl_take MULTI(BASE) *multi, __isl_take isl_set *context) -{ - isl_space *space = FN(MULTI(BASE),get_domain_space)(multi); - isl_set *dom_context = isl_set_universe(space); - dom_context = isl_set_intersect_params(dom_context, context); - return FN(MULTI(BASE),gist)(multi, dom_context); -} -#endif - __isl_give MULTI(BASE) *FN(FN(MULTI(BASE),from),LIST(BASE))( __isl_take isl_space *space, __isl_take LIST(EL) *list) { @@ -545,6 +623,7 @@ } #endif +#ifndef NO_ZERO /* Construct a multi expression in the given space with value zero in * each of the output dimensions. */ @@ -579,13 +658,29 @@ return multi; } +#endif #ifndef NO_FROM_BASE +/* Create a multiple expression with a single output/set dimension + * equal to "el". + * For most multiple expression types, the base type has a single + * output/set dimension and the space of the result is therefore + * the same as the space of the input. + * In the case of isl_multi_union_pw_aff, however, the base type + * lives in a parameter space and we therefore need to add + * a single set dimension. + */ __isl_give MULTI(BASE) *FN(FN(MULTI(BASE),from),BASE)(__isl_take EL *el) { + isl_space *space; MULTI(BASE) *multi; - multi = FN(MULTI(BASE),alloc)(FN(EL,get_space)(el)); + space = FN(EL,get_space(el)); + if (isl_space_is_params(space)) { + space = isl_space_set_from_params(space); + space = isl_space_add_dims(space, isl_dim_set, 1); + } + multi = FN(MULTI(BASE),alloc)(space); multi = FN(FN(MULTI(BASE),set),BASE)(multi, 0, el); return multi; @@ -632,10 +727,42 @@ return multi; } +/* Align the parameters of "multi1" and "multi2" (if needed) and call "fn". + */ +static __isl_give MULTI(BASE) *FN(MULTI(BASE),align_params_multi_multi_and)( + __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2, + __isl_give MULTI(BASE) *(*fn)(__isl_take MULTI(BASE) *multi1, + __isl_take MULTI(BASE) *multi2)) +{ + isl_ctx *ctx; + + if (!multi1 || !multi2) + goto error; + if (isl_space_match(multi1->space, isl_dim_param, + multi2->space, isl_dim_param)) + return fn(multi1, multi2); + ctx = FN(MULTI(BASE),get_ctx)(multi1); + if (!isl_space_has_named_params(multi1->space) || + !isl_space_has_named_params(multi2->space)) + isl_die(ctx, isl_error_invalid, + "unaligned unnamed parameters", goto error); + multi1 = FN(MULTI(BASE),align_params)(multi1, + FN(MULTI(BASE),get_space)(multi2)); + multi2 = FN(MULTI(BASE),align_params)(multi2, + FN(MULTI(BASE),get_space)(multi1)); + return fn(multi1, multi2); +error: + FN(MULTI(BASE),free)(multi1); + FN(MULTI(BASE),free)(multi2); + return NULL; +} + /* Given two MULTI(BASE)s A -> B and C -> D, - * construct a MULTI(BASE) (A * C) -> (B, D). + * construct a MULTI(BASE) (A * C) -> [B -> D]. + * + * The parameters are assumed to have been aligned. */ -__isl_give MULTI(BASE) *FN(MULTI(BASE),range_product)( +static __isl_give MULTI(BASE) *FN(MULTI(BASE),range_product_aligned)( __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2) { int i, n1, n2; @@ -672,6 +799,131 @@ return NULL; } +/* Given two MULTI(BASE)s A -> B and C -> D, + * construct a MULTI(BASE) (A * C) -> [B -> D]. + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),range_product)( + __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2) +{ + return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2, + &FN(MULTI(BASE),range_product_aligned)); +} + +/* Is the range of "multi" a wrapped relation? + */ +isl_bool FN(MULTI(BASE),range_is_wrapping)(__isl_keep MULTI(BASE) *multi) +{ + if (!multi) + return isl_bool_error; + return isl_space_range_is_wrapping(multi->space); +} + +/* Given a function A -> [B -> C], extract the function A -> B. + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),range_factor_domain)( + __isl_take MULTI(BASE) *multi) +{ + isl_space *space; + int total, keep; + + if (!multi) + return NULL; + if (!isl_space_range_is_wrapping(multi->space)) + isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid, + "range is not a product", + return FN(MULTI(BASE),free)(multi)); + + space = FN(MULTI(BASE),get_space)(multi); + total = isl_space_dim(space, isl_dim_out); + space = isl_space_range_factor_domain(space); + keep = isl_space_dim(space, isl_dim_out); + multi = FN(MULTI(BASE),drop_dims)(multi, + isl_dim_out, keep, total - keep); + multi = FN(MULTI(BASE),reset_space)(multi, space); + + return multi; +} + +/* Given a function A -> [B -> C], extract the function A -> C. + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),range_factor_range)( + __isl_take MULTI(BASE) *multi) +{ + isl_space *space; + int total, keep; + + if (!multi) + return NULL; + if (!isl_space_range_is_wrapping(multi->space)) + isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid, + "range is not a product", + return FN(MULTI(BASE),free)(multi)); + + space = FN(MULTI(BASE),get_space)(multi); + total = isl_space_dim(space, isl_dim_out); + space = isl_space_range_factor_range(space); + keep = isl_space_dim(space, isl_dim_out); + multi = FN(MULTI(BASE),drop_dims)(multi, isl_dim_out, 0, total - keep); + multi = FN(MULTI(BASE),reset_space)(multi, space); + + return multi; +} + +#ifndef NO_PRODUCT +/* Given two MULTI(BASE)s A -> B and C -> D, + * construct a MULTI(BASE) [A -> C] -> [B -> D]. + * + * The parameters are assumed to have been aligned. + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),product_aligned)( + __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2) +{ + int i; + EL *el; + isl_space *space; + MULTI(BASE) *res; + int in1, in2, out1, out2; + + in1 = FN(MULTI(BASE),dim)(multi1, isl_dim_in); + in2 = FN(MULTI(BASE),dim)(multi2, isl_dim_in); + out1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out); + out2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out); + space = isl_space_product(FN(MULTI(BASE),get_space)(multi1), + FN(MULTI(BASE),get_space)(multi2)); + res = FN(MULTI(BASE),alloc)(isl_space_copy(space)); + space = isl_space_domain(space); + + for (i = 0; i < out1; ++i) { + el = FN(FN(MULTI(BASE),get),BASE)(multi1, i); + el = FN(EL,insert_dims)(el, isl_dim_in, in1, in2); + el = FN(EL,reset_domain_space)(el, isl_space_copy(space)); + res = FN(FN(MULTI(BASE),set),BASE)(res, i, el); + } + + for (i = 0; i < out2; ++i) { + el = FN(FN(MULTI(BASE),get),BASE)(multi2, i); + el = FN(EL,insert_dims)(el, isl_dim_in, 0, in1); + el = FN(EL,reset_domain_space)(el, isl_space_copy(space)); + res = FN(FN(MULTI(BASE),set),BASE)(res, out1 + i, el); + } + + isl_space_free(space); + FN(MULTI(BASE),free)(multi1); + FN(MULTI(BASE),free)(multi2); + return res; +} + +/* Given two MULTI(BASE)s A -> B and C -> D, + * construct a MULTI(BASE) [A -> C] -> [B -> D]. + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),product)( + __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2) +{ + return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2, + &FN(MULTI(BASE),product_aligned)); +} +#endif + __isl_give MULTI(BASE) *FN(MULTI(BASE),flatten_range)( __isl_take MULTI(BASE) *multi) { @@ -693,7 +945,7 @@ } /* Given two MULTI(BASE)s A -> B and C -> D, - * construct a MULTI(BASE) (A * C) -> [B -> D]. + * construct a MULTI(BASE) (A * C) -> (B, D). */ __isl_give MULTI(BASE) *FN(MULTI(BASE),flat_range_product)( __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2) @@ -746,6 +998,7 @@ return NULL; } +#ifndef NO_SPLICE /* Given two multi expressions, "multi1" * * [A1 A2] -> [B1 B2] @@ -797,6 +1050,7 @@ FN(MULTI(BASE),free)(multi2); return NULL; } +#endif /* This function is currently only used from isl_aff.c */ @@ -838,6 +1092,25 @@ return NULL; } +/* Subtract "multi2" from "multi1" and return the result. + * + * The parameters of "multi1" and "multi2" are assumed to have been aligned. + */ +static __isl_give MULTI(BASE) *FN(MULTI(BASE),sub_aligned)( + __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2) +{ + return FN(MULTI(BASE),bin_op)(multi1, multi2, &FN(EL,sub)); +} + +/* Subtract "multi2" from "multi1" and return the result. + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),sub)(__isl_take MULTI(BASE) *multi1, + __isl_take MULTI(BASE) *multi2) +{ + return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2, + &FN(MULTI(BASE),sub_aligned)); +} + /* Multiply the elements of "multi" by "v" and return the result. */ __isl_give MULTI(BASE) *FN(MULTI(BASE),scale_val)(__isl_take MULTI(BASE) *multi, @@ -874,6 +1147,46 @@ return FN(MULTI(BASE),free)(multi); } +/* Divide the elements of "multi" by "v" and return the result. + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),scale_down_val)( + __isl_take MULTI(BASE) *multi, __isl_take isl_val *v) +{ + int i; + + if (!multi || !v) + goto error; + + if (isl_val_is_one(v)) { + isl_val_free(v); + return multi; + } + + if (!isl_val_is_rat(v)) + isl_die(isl_val_get_ctx(v), isl_error_invalid, + "expecting rational factor", goto error); + if (isl_val_is_zero(v)) + isl_die(isl_val_get_ctx(v), isl_error_invalid, + "cannot scale down by zero", goto error); + + multi = FN(MULTI(BASE),cow)(multi); + if (!multi) + return NULL; + + for (i = 0; i < multi->n; ++i) { + multi->p[i] = FN(EL,scale_down_val)(multi->p[i], + isl_val_copy(v)); + if (!multi->p[i]) + goto error; + } + + isl_val_free(v); + return multi; +error: + isl_val_free(v); + return FN(MULTI(BASE),free)(multi); +} + /* Multiply the elements of "multi" by the corresponding element of "mv" * and return the result. */ @@ -885,7 +1198,7 @@ if (!multi || !mv) goto error; - if (!isl_space_tuple_match(multi->space, isl_dim_out, + if (!isl_space_tuple_is_equal(multi->space, isl_dim_out, mv->space, isl_dim_set)) isl_die(isl_multi_val_get_ctx(mv), isl_error_invalid, "spaces don't match", goto error); @@ -909,3 +1222,224 @@ isl_multi_val_free(mv); return FN(MULTI(BASE),free)(multi); } + +/* Divide the elements of "multi" by the corresponding element of "mv" + * and return the result. + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),scale_down_multi_val)( + __isl_take MULTI(BASE) *multi, __isl_take isl_multi_val *mv) +{ + int i; + + if (!multi || !mv) + goto error; + + if (!isl_space_tuple_is_equal(multi->space, isl_dim_out, + mv->space, isl_dim_set)) + isl_die(isl_multi_val_get_ctx(mv), isl_error_invalid, + "spaces don't match", goto error); + + multi = FN(MULTI(BASE),cow)(multi); + if (!multi) + return NULL; + + for (i = 0; i < multi->n; ++i) { + isl_val *v; + + v = isl_multi_val_get_val(mv, i); + multi->p[i] = FN(EL,scale_down_val)(multi->p[i], v); + if (!multi->p[i]) + goto error; + } + + isl_multi_val_free(mv); + return multi; +error: + isl_multi_val_free(mv); + return FN(MULTI(BASE),free)(multi); +} + +/* Compute the residues of the elements of "multi" modulo + * the corresponding element of "mv" and return the result. + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),mod_multi_val)( + __isl_take MULTI(BASE) *multi, __isl_take isl_multi_val *mv) +{ + int i; + + if (!multi || !mv) + goto error; + + if (!isl_space_tuple_is_equal(multi->space, isl_dim_out, + mv->space, isl_dim_set)) + isl_die(isl_multi_val_get_ctx(mv), isl_error_invalid, + "spaces don't match", goto error); + + multi = FN(MULTI(BASE),cow)(multi); + if (!multi) + return NULL; + + for (i = 0; i < multi->n; ++i) { + isl_val *v; + + v = isl_multi_val_get_val(mv, i); + multi->p[i] = FN(EL,mod_val)(multi->p[i], v); + if (!multi->p[i]) + goto error; + } + + isl_multi_val_free(mv); + return multi; +error: + isl_multi_val_free(mv); + return FN(MULTI(BASE),free)(multi); +} + +#ifndef NO_MOVE_DIMS +/* Move the "n" dimensions of "src_type" starting at "src_pos" of "multi" + * to dimensions of "dst_type" at "dst_pos". + * + * We only support moving input dimensions to parameters and vice versa. + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),move_dims)(__isl_take MULTI(BASE) *multi, + enum isl_dim_type dst_type, unsigned dst_pos, + enum isl_dim_type src_type, unsigned src_pos, unsigned n) +{ + int i; + + if (!multi) + return NULL; + + if (n == 0 && + !isl_space_is_named_or_nested(multi->space, src_type) && + !isl_space_is_named_or_nested(multi->space, dst_type)) + return multi; + + if (dst_type == isl_dim_out || src_type == isl_dim_out) + isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid, + "cannot move output/set dimension", + return FN(MULTI(BASE),free)(multi)); + if (dst_type == isl_dim_div || src_type == isl_dim_div) + isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid, + "cannot move divs", + return FN(MULTI(BASE),free)(multi)); + if (src_pos + n > isl_space_dim(multi->space, src_type)) + isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid, + "range out of bounds", + return FN(MULTI(BASE),free)(multi)); + if (dst_type == src_type) + isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_unsupported, + "moving dims within the same type not supported", + return FN(MULTI(BASE),free)(multi)); + + multi = FN(MULTI(BASE),cow)(multi); + if (!multi) + return NULL; + + multi->space = isl_space_move_dims(multi->space, dst_type, dst_pos, + src_type, src_pos, n); + if (!multi->space) + return FN(MULTI(BASE),free)(multi); + + for (i = 0; i < multi->n; ++i) { + multi->p[i] = FN(EL,move_dims)(multi->p[i], dst_type, dst_pos, + src_type, src_pos, n); + if (!multi->p[i]) + return FN(MULTI(BASE),free)(multi); + } + + return multi; +} +#endif + +/* Convert a multiple expression defined over a parameter domain + * into one that is defined over a zero-dimensional set. + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),from_range)( + __isl_take MULTI(BASE) *multi) +{ + isl_space *space; + + if (!multi) + return NULL; + if (!isl_space_is_set(multi->space)) + isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid, + "not living in a set space", + return FN(MULTI(BASE),free)(multi)); + + space = FN(MULTI(BASE),get_space)(multi); + space = isl_space_from_range(space); + multi = FN(MULTI(BASE),reset_space)(multi, space); + + return multi; +} + +/* Are "multi1" and "multi2" obviously equal? + */ +isl_bool FN(MULTI(BASE),plain_is_equal)(__isl_keep MULTI(BASE) *multi1, + __isl_keep MULTI(BASE) *multi2) +{ + int i; + isl_bool equal; + + if (!multi1 || !multi2) + return isl_bool_error; + if (multi1->n != multi2->n) + return isl_bool_false; + equal = isl_space_is_equal(multi1->space, multi2->space); + if (equal < 0 || !equal) + return equal; + + for (i = 0; i < multi1->n; ++i) { + equal = FN(EL,plain_is_equal)(multi1->p[i], multi2->p[i]); + if (equal < 0 || !equal) + return equal; + } + + return isl_bool_true; +} + +#ifndef NO_DOMAIN +/* Return the shared domain of the elements of "multi". + */ +__isl_give isl_set *FN(MULTI(BASE),domain)(__isl_take MULTI(BASE) *multi) +{ + int i; + isl_set *dom; + + if (!multi) + return NULL; + + dom = isl_set_universe(FN(MULTI(BASE),get_domain_space)(multi)); + for (i = 0; i < multi->n; ++i) { + isl_set *dom_i; + + dom_i = FN(EL,domain)(FN(FN(MULTI(BASE),get),BASE)(multi, i)); + dom = isl_set_intersect(dom, dom_i); + } + + FN(MULTI(BASE),free)(multi); + return dom; +} +#endif + +#ifndef NO_NEG +/* Return the opposite of "multi". + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),neg)(__isl_take MULTI(BASE) *multi) +{ + int i; + + multi = FN(MULTI(BASE),cow)(multi); + if (!multi) + return NULL; + + for (i = 0; i < multi->n; ++i) { + multi->p[i] = FN(EL,neg)(multi->p[i]); + if (!multi->p[i]) + return FN(MULTI(BASE),free)(multi); + } + + return multi; +} +#endif diff -Nru cloog-0.18.2/isl/isl_multi_templ.h cloog-0.18.4/isl/isl_multi_templ.h --- cloog-0.18.2/isl/isl_multi_templ.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_multi_templ.h 2015-07-24 12:23:09.000000000 +0000 @@ -1,11 +1,6 @@ #include -#define xCAT(A,B) A ## B -#define CAT(A,B) xCAT(A,B) -#undef EL -#define EL CAT(isl_,BASE) -#define xMULTI(BASE) isl_multi_ ## BASE -#define MULTI(BASE) xMULTI(BASE) +#include struct MULTI(BASE) { int ref; diff -Nru cloog-0.18.2/isl/isl_obj.c cloog-0.18.4/isl/isl_obj.c --- cloog-0.18.2/isl/isl_obj.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_obj.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,169 +1,27 @@ /* * Copyright 2010 INRIA Saclay + * Copyright 2014 Ecole Normale Superieure + * Copyright 2014 INRIA Rocquencourt * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, * 91893 Orsay, France + * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France + * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, + * B.P. 105 - 78153 Le Chesnay, France */ +#include #include #include +#include +#include #include +#include #include -struct isl_int_obj { - int ref; - isl_ctx *ctx; - isl_int v; -}; - -__isl_give isl_int_obj *isl_int_obj_alloc(isl_ctx *ctx, isl_int v) -{ - isl_int_obj *i; - - i = isl_alloc_type(ctx, isl_int_obj); - if (!i) - return NULL; - - i->ctx = ctx; - isl_ctx_ref(ctx); - i->ref = 1; - isl_int_init(i->v); - isl_int_set(i->v, v); - - return i; -} - -__isl_give isl_int_obj *isl_int_obj_copy(__isl_keep isl_int_obj *i) -{ - if (!i) - return NULL; - - i->ref++; - return i; -} - -__isl_give isl_int_obj *isl_int_obj_dup(__isl_keep isl_int_obj *i) -{ - if (!i) - return NULL; - - return isl_int_obj_alloc(i->ctx, i->v); -} - -__isl_give isl_int_obj *isl_int_obj_cow(__isl_take isl_int_obj *i) -{ - if (!i) - return NULL; - - if (i->ref == 1) - return i; - i->ref--; - return isl_int_obj_dup(i); -} - -void isl_int_obj_free(__isl_take isl_int_obj *i) -{ - if (!i) - return; - - if (--i->ref > 0) - return; - - isl_ctx_deref(i->ctx); - isl_int_clear(i->v); - free(i); -} - -__isl_give isl_int_obj *isl_int_obj_add(__isl_take isl_int_obj *i1, - __isl_take isl_int_obj *i2) -{ - i1 = isl_int_obj_cow(i1); - if (!i1 || !i2) - goto error; - - isl_int_add(i1->v, i1->v, i2->v); - - isl_int_obj_free(i2); - return i1; -error: - isl_int_obj_free(i1); - isl_int_obj_free(i2); - return NULL; -} - -__isl_give isl_int_obj *isl_int_obj_sub(__isl_take isl_int_obj *i1, - __isl_take isl_int_obj *i2) -{ - i1 = isl_int_obj_cow(i1); - if (!i1 || !i2) - goto error; - - isl_int_sub(i1->v, i1->v, i2->v); - - isl_int_obj_free(i2); - return i1; -error: - isl_int_obj_free(i1); - isl_int_obj_free(i2); - return NULL; -} - -__isl_give isl_int_obj *isl_int_obj_mul(__isl_take isl_int_obj *i1, - __isl_take isl_int_obj *i2) -{ - i1 = isl_int_obj_cow(i1); - if (!i1 || !i2) - goto error; - - isl_int_mul(i1->v, i1->v, i2->v); - - isl_int_obj_free(i2); - return i1; -error: - isl_int_obj_free(i1); - isl_int_obj_free(i2); - return NULL; -} - -void isl_int_obj_get_int(__isl_keep isl_int_obj *i, isl_int *v) -{ - if (!i) - return; - isl_int_set(*v, i->v); -} - -static void *isl_obj_int_copy(void *v) -{ - return isl_int_obj_copy((isl_int_obj *)v); -} - -static void isl_obj_int_free(void *v) -{ - isl_int_obj_free((isl_int_obj *)v); -} - -static __isl_give isl_printer *isl_obj_int_print(__isl_take isl_printer *p, - void *v) -{ - isl_int_obj *i = v; - return isl_printer_print_isl_int(p, i->v); -} - -static void *isl_obj_int_add(void *v1, void *v2) -{ - return isl_int_obj_add((isl_int_obj *)v1, (isl_int_obj *)v2); -} - -struct isl_obj_vtable isl_obj_int_vtable = { - isl_obj_int_copy, - isl_obj_int_add, - isl_obj_int_print, - isl_obj_int_free -}; - static void *isl_obj_val_copy(void *v) { return isl_val_copy((isl_val *)v); @@ -304,6 +162,35 @@ isl_obj_union_set_free }; +static void *isl_obj_pw_multi_aff_copy(void *v) +{ + return isl_pw_multi_aff_copy((isl_pw_multi_aff *) v); +} + +static void isl_obj_pw_multi_aff_free(void *v) +{ + isl_pw_multi_aff_free((isl_pw_multi_aff *) v); +} + +static __isl_give isl_printer *isl_obj_pw_multi_aff_print( + __isl_take isl_printer *p, void *v) +{ + return isl_printer_print_pw_multi_aff(p, (isl_pw_multi_aff *) v); +} + +static void *isl_obj_pw_multi_aff_add(void *v1, void *v2) +{ + return isl_pw_multi_aff_add((isl_pw_multi_aff *) v1, + (isl_pw_multi_aff *) v2); +} + +struct isl_obj_vtable isl_obj_pw_multi_aff_vtable = { + isl_obj_pw_multi_aff_copy, + isl_obj_pw_multi_aff_add, + isl_obj_pw_multi_aff_print, + isl_obj_pw_multi_aff_free +}; + static void *isl_obj_none_copy(void *v) { return v; @@ -452,3 +339,26 @@ isl_obj_union_pw_qpf_print, isl_obj_union_pw_qpf_free }; + +static void *isl_obj_schedule_copy(void *v) +{ + return isl_schedule_copy((isl_schedule *) v); +} + +static void isl_obj_schedule_free(void *v) +{ + isl_schedule_free((isl_schedule *) v); +} + +static __isl_give isl_printer *isl_obj_schedule_print( + __isl_take isl_printer *p, void *v) +{ + return isl_printer_print_schedule(p, (isl_schedule *) v); +} + +struct isl_obj_vtable isl_obj_schedule_vtable = { + isl_obj_schedule_copy, + NULL, + isl_obj_schedule_print, + isl_obj_schedule_free +}; diff -Nru cloog-0.18.2/isl/isl_options.c cloog-0.18.4/isl/isl_options.c --- cloog-0.18.2/isl/isl_options.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_options.c 2015-07-24 12:23:09.000000000 +0000 @@ -17,30 +17,6 @@ #include #include -struct isl_arg_choice isl_lp_solver_choice[] = { - {"tab", ISL_LP_TAB}, -#ifdef ISL_PIPLIB - {"pip", ISL_LP_PIP}, -#endif - {0} -}; - -struct isl_arg_choice isl_ilp_solver_choice[] = { - {"gbr", ISL_ILP_GBR}, -#ifdef ISL_PIPLIB - {"pip", ISL_ILP_PIP}, -#endif - {0} -}; - -struct isl_arg_choice isl_pip_solver_choice[] = { - {"tab", ISL_PIP_TAB}, -#ifdef ISL_PIPLIB - {"pip", ISL_PIP_PIP}, -#endif - {0} -}; - struct isl_arg_choice isl_pip_context_choice[] = { {"gbr", ISL_CONTEXT_GBR}, {"lexmin", ISL_CONTEXT_LEXMIN}, @@ -96,12 +72,30 @@ {0} }; +#define ISL_SCHEDULE_FUSE_MAX 0 +#define ISL_SCHEDULE_FUSE_MIN 1 + static struct isl_arg_choice fuse[] = { {"max", ISL_SCHEDULE_FUSE_MAX}, {"min", ISL_SCHEDULE_FUSE_MIN}, {0} }; +/* Callback for setting the "schedule-fuse" option. + * This (now hidden) option tries to mimic an option that was + * replaced by the schedule-serialize-sccs option. + * Setting the old option to ISL_SCHEDULE_FUSE_MIN is now + * expressed by turning on the schedule-serialize-sccs option. + */ +static int set_fuse(void *opt, unsigned val) +{ + struct isl_options *options = opt; + + options->schedule_serialize_sccs = (val == ISL_SCHEDULE_FUSE_MIN); + + return 0; +} + static struct isl_arg_choice separation_bounds[] = { {"explicit", ISL_AST_BUILD_SEPARATION_BOUNDS_EXPLICIT}, {"implicit", ISL_AST_BUILD_SEPARATION_BOUNDS_IMPLICIT}, @@ -114,12 +108,6 @@ } ISL_ARGS_START(struct isl_options, isl_options_args) -ISL_ARG_CHOICE(struct isl_options, lp_solver, 0, "lp-solver", \ - isl_lp_solver_choice, ISL_LP_TAB, "lp solver to use") -ISL_ARG_CHOICE(struct isl_options, ilp_solver, 0, "ilp-solver", \ - isl_ilp_solver_choice, ISL_ILP_GBR, "ilp solver to use") -ISL_ARG_CHOICE(struct isl_options, pip, 0, "pip", \ - isl_pip_solver_choice, ISL_PIP_TAB, "pip solver to use") ISL_ARG_CHOICE(struct isl_options, context, 0, "context", \ isl_pip_context_choice, ISL_CONTEXT_GBR, "how to handle the pip context tableau") @@ -156,10 +144,10 @@ ". A value of -1 allows arbitrary coefficients.") ISL_ARG_BOOL(struct isl_options, schedule_parametric, 0, "schedule-parametric", 1, "construct possibly parametric schedules") -ISL_ARG_BOOL(struct isl_options, schedule_outer_zero_distance, 0, - "schedule-outer-zero-distance", 0, - "try to construct schedules with outer zero distances over " - "proximity dependences") +ISL_ARG_BOOL(struct isl_options, schedule_outer_coincidence, 0, + "schedule-outer-coincidence", 0, + "try to construct schedules where the outer member of each band " + "satisfies the coincidence constraints") ISL_ARG_BOOL(struct isl_options, schedule_maximize_band_depth, 0, "schedule-maximize-band-depth", 0, "maximize the number of scheduling dimensions in a band") @@ -172,8 +160,12 @@ ISL_ARG_CHOICE(struct isl_options, schedule_algorithm, 0, "schedule-algorithm", isl_schedule_algorithm_choice, ISL_SCHEDULE_ALGORITHM_ISL, "scheduling algorithm to use") -ISL_ARG_CHOICE(struct isl_options, schedule_fuse, 0, "schedule-fuse", fuse, - ISL_SCHEDULE_FUSE_MAX, "level of fusion during scheduling") +ISL_ARG_BOOL(struct isl_options, schedule_serialize_sccs, 0, + "schedule-serialize-sccs", 0, + "serialize strongly connected components in dependence graph") +ISL_ARG_PHANTOM_USER_CHOICE_F(0, "schedule-fuse", fuse, &set_fuse, + ISL_SCHEDULE_FUSE_MAX, "level of fusion during scheduling", + ISL_ARG_HIDDEN) ISL_ARG_BOOL(struct isl_options, tile_scale_tile_loops, 0, "tile-scale-tile-loops", 1, "scale tile loops") ISL_ARG_BOOL(struct isl_options, tile_shift_point_loops, 0, @@ -181,6 +173,9 @@ ISL_ARG_STR(struct isl_options, ast_iterator_type, 0, "ast-iterator-type", "type", "int", "type used for iterators during printing of AST") +ISL_ARG_BOOL(struct isl_options, ast_always_print_block, 0, + "ast-always-print-block", 0, "print for and if bodies as a block " + "regardless of the number of statements in the body") ISL_ARG_BOOL(struct isl_options, ast_build_atomic_upper_bound, 0, "ast-build-atomic-upper-bound", 1, "generate atomic upper bounds") ISL_ARG_BOOL(struct isl_options, ast_build_prefer_pdiv, 0, @@ -202,6 +197,10 @@ "ast-build-allow-else", 1, "generate if statements with else branches") ISL_ARG_BOOL(struct isl_options, ast_build_allow_or, 0, "ast-build-allow-or", 1, "generate if conditions with disjunctions") +ISL_ARG_BOOL(struct isl_options, print_stats, 0, "print-stats", 0, + "print statistics for every isl_ctx") +ISL_ARG_ULONG(struct isl_options, max_operations, 0, + "max-operations", 0, "default number of maximal operations per isl_ctx") ISL_ARG_VERSION(print_version) ISL_ARGS_END @@ -253,19 +252,19 @@ schedule_separate_components) ISL_CTX_SET_BOOL_DEF(isl_options, struct isl_options, isl_options_args, - schedule_outer_zero_distance) + schedule_outer_coincidence) ISL_CTX_GET_BOOL_DEF(isl_options, struct isl_options, isl_options_args, - schedule_outer_zero_distance) + schedule_outer_coincidence) ISL_CTX_SET_CHOICE_DEF(isl_options, struct isl_options, isl_options_args, schedule_algorithm) ISL_CTX_GET_CHOICE_DEF(isl_options, struct isl_options, isl_options_args, schedule_algorithm) -ISL_CTX_SET_CHOICE_DEF(isl_options, struct isl_options, isl_options_args, - schedule_fuse) -ISL_CTX_GET_CHOICE_DEF(isl_options, struct isl_options, isl_options_args, - schedule_fuse) +ISL_CTX_SET_BOOL_DEF(isl_options, struct isl_options, isl_options_args, + schedule_serialize_sccs) +ISL_CTX_GET_BOOL_DEF(isl_options, struct isl_options, isl_options_args, + schedule_serialize_sccs) ISL_CTX_SET_BOOL_DEF(isl_options, struct isl_options, isl_options_args, tile_scale_tile_loops) @@ -302,6 +301,11 @@ ISL_CTX_GET_STR_DEF(isl_options, struct isl_options, isl_options_args, ast_iterator_type) +ISL_CTX_SET_BOOL_DEF(isl_options, struct isl_options, isl_options_args, + ast_always_print_block) +ISL_CTX_GET_BOOL_DEF(isl_options, struct isl_options, isl_options_args, + ast_always_print_block) + ISL_CTX_SET_CHOICE_DEF(isl_options, struct isl_options, isl_options_args, ast_build_separation_bounds) ISL_CTX_GET_CHOICE_DEF(isl_options, struct isl_options, isl_options_args, diff -Nru cloog-0.18.2/isl/isl_options_private.h cloog-0.18.4/isl/isl_options_private.h --- cloog-0.18.2/isl/isl_options_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_options_private.h 2015-07-24 12:23:09.000000000 +0000 @@ -4,18 +4,6 @@ #include struct isl_options { - #define ISL_LP_TAB 0 - #define ISL_LP_PIP 1 - unsigned lp_solver; - - #define ISL_ILP_GBR 0 - #define ISL_ILP_PIP 1 - unsigned ilp_solver; - - #define ISL_PIP_TAB 0 - #define ISL_PIP_PIP 1 - unsigned pip; - #define ISL_CONTEXT_GBR 0 #define ISL_CONTEXT_LEXMIN 1 unsigned context; @@ -50,17 +38,18 @@ int schedule_max_coefficient; int schedule_max_constant_term; int schedule_parametric; - int schedule_outer_zero_distance; + int schedule_outer_coincidence; int schedule_maximize_band_depth; int schedule_split_scaled; int schedule_separate_components; unsigned schedule_algorithm; - int schedule_fuse; + int schedule_serialize_sccs; int tile_scale_tile_loops; int tile_shift_point_loops; char *ast_iterator_type; + int ast_always_print_block; int ast_build_atomic_upper_bound; int ast_build_prefer_pdiv; @@ -70,6 +59,9 @@ int ast_build_scale_strides; int ast_build_allow_else; int ast_build_allow_or; + + int print_stats; + unsigned long max_operations; }; #endif diff -Nru cloog-0.18.2/isl/isl_output.c cloog-0.18.4/isl/isl_output.c --- cloog-0.18.2/isl/isl_output.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_output.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,6 +1,7 @@ /* * Copyright 2008-2009 Katholieke Universiteit Leuven * Copyright 2010 INRIA Saclay + * Copyright 2012-2013 Ecole Normale Superieure * * Use of this software is governed by the MIT license * @@ -8,6 +9,7 @@ * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium * and INRIA Saclay - Ile-de-France, Parc Club Orsay Universite, * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France + * and Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France */ #include @@ -15,16 +17,18 @@ #include #include #include -#include +#include #include #include #include #include +#include #include #include #include #include -#include +#include +#include #include static const char *s_to[2] = { " -> ", " \\to " }; @@ -294,152 +298,129 @@ return print_affine_of_len(dim, NULL, p, c, len); } -static int defining_equality(__isl_keep isl_basic_map *eq, - __isl_keep isl_space *dim, enum isl_dim_type type, int pos) -{ - int i; - unsigned total; - - if (!eq) - return -1; - - pos += isl_space_offset(dim, type); - total = isl_basic_map_total_dim(eq); - - for (i = 0; i < eq->n_eq; ++i) { - if (isl_seq_last_non_zero(eq->eq[i] + 1, total) != pos) - continue; - if (isl_int_is_one(eq->eq[i][1 + pos])) - isl_seq_neg(eq->eq[i], eq->eq[i], 1 + total); - return i; - } - - return -1; -} +/* Internal data structure for print_space. + * + * latex is set if that is the output format. + * print_dim (if not NULL) is called on each dimension. + * user is set by the caller of print_space and may be used inside print_dim. + * + * space is the global space that is being printed. This field is set by + * print_space. + * type is the tuple of the global space that is currently being printed. + * This field is set by print_space. + */ +struct isl_print_space_data { + int latex; + __isl_give isl_printer *(*print_dim)(__isl_take isl_printer *p, + struct isl_print_space_data *data, unsigned pos); + void *user; -static __isl_give isl_printer *print_aff_body(__isl_take isl_printer *p, - __isl_keep isl_aff *aff); + isl_space *space; + enum isl_dim_type type; +}; -/* offset is the offset of local_dim inside global_type of global_dim. +/* offset is the offset of local_dim inside data->type of data->space. */ static __isl_give isl_printer *print_nested_var_list(__isl_take isl_printer *p, - __isl_keep isl_space *global_dim, enum isl_dim_type global_type, __isl_keep isl_space *local_dim, enum isl_dim_type local_type, - int latex, __isl_keep isl_basic_map *eq, - __isl_keep isl_multi_aff *maff, int offset) + struct isl_print_space_data *data, int offset) { - int i, j; + int i; - if (global_dim != local_dim && local_type == isl_dim_out) + if (data->space != local_dim && local_type == isl_dim_out) offset += local_dim->n_in; for (i = 0; i < isl_space_dim(local_dim, local_type); ++i) { if (i) p = isl_printer_print_str(p, ", "); - if (maff && global_type == isl_dim_out) { - p = print_aff_body(p, maff->p[offset + i]); - continue; - } - j = defining_equality(eq, global_dim, global_type, offset + i); - if (j >= 0) { - int pos = 1 + isl_space_offset(global_dim, global_type) - + offset + i; - p = print_affine_of_len(eq->dim, NULL, - p, eq->eq[j], pos); - } else { - p = print_name(global_dim, p, global_type, offset + i, - latex); - } + if (data->print_dim) + p = data->print_dim(p, data, offset + i); + else + p = print_name(data->space, p, data->type, offset + i, + data->latex); } return p; } -static __isl_give isl_printer *print_var_list(__isl_keep isl_space *dim, - __isl_take isl_printer *p, enum isl_dim_type type, - int latex, __isl_keep isl_basic_map *eq, __isl_keep isl_multi_aff *maff) +static __isl_give isl_printer *print_var_list(__isl_take isl_printer *p, + __isl_keep isl_space *space, enum isl_dim_type type) { - return print_nested_var_list(p, dim, type, dim, type, latex, - eq, maff, 0); + struct isl_print_space_data data = { .space = space, .type = type }; + + return print_nested_var_list(p, space, type, &data, 0); } static __isl_give isl_printer *print_nested_map_dim(__isl_take isl_printer *p, - __isl_keep isl_space *global_dim, enum isl_dim_type global_type, __isl_keep isl_space *local_dim, - int latex, __isl_keep isl_basic_map *eq, - __isl_keep isl_multi_aff *maff, int offset); + struct isl_print_space_data *data, int offset); static __isl_give isl_printer *print_nested_tuple(__isl_take isl_printer *p, - __isl_keep isl_space *global_dim, enum isl_dim_type global_type, __isl_keep isl_space *local_dim, enum isl_dim_type local_type, - int latex, __isl_keep isl_basic_map *eq, - __isl_keep isl_multi_aff *maff, int offset) + struct isl_print_space_data *data, int offset) { const char *name = NULL; unsigned n = isl_space_dim(local_dim, local_type); if ((local_type == isl_dim_in || local_type == isl_dim_out)) { name = isl_space_get_tuple_name(local_dim, local_type); if (name) { - if (latex) + if (data->latex) p = isl_printer_print_str(p, "\\mathrm{"); p = isl_printer_print_str(p, name); - if (latex) + if (data->latex) p = isl_printer_print_str(p, "}"); } } - if (!latex || n != 1 || name) - p = isl_printer_print_str(p, s_open_list[latex]); + if (!data->latex || n != 1 || name) + p = isl_printer_print_str(p, s_open_list[data->latex]); if ((local_type == isl_dim_in || local_type == isl_dim_out) && local_dim->nested[local_type - isl_dim_in]) { - if (global_dim != local_dim && local_type == isl_dim_out) + if (data->space != local_dim && local_type == isl_dim_out) offset += local_dim->n_in; - p = print_nested_map_dim(p, global_dim, global_type, + p = print_nested_map_dim(p, local_dim->nested[local_type - isl_dim_in], - latex, eq, maff, offset); + data, offset); } else - p = print_nested_var_list(p, global_dim, global_type, - local_dim, local_type, latex, - eq, maff, offset); - if (!latex || n != 1 || name) - p = isl_printer_print_str(p, s_close_list[latex]); + p = print_nested_var_list(p, local_dim, local_type, data, + offset); + if (!data->latex || n != 1 || name) + p = isl_printer_print_str(p, s_close_list[data->latex]); return p; } static __isl_give isl_printer *print_tuple(__isl_keep isl_space *dim, __isl_take isl_printer *p, enum isl_dim_type type, - int latex, __isl_keep isl_basic_map *eq, __isl_keep isl_multi_aff *maff) + struct isl_print_space_data *data) { - return print_nested_tuple(p, dim, type, dim, type, latex, eq, maff, 0); + data->space = dim; + data->type = type; + return print_nested_tuple(p, dim, type, data, 0); } static __isl_give isl_printer *print_nested_map_dim(__isl_take isl_printer *p, - __isl_keep isl_space *global_dim, enum isl_dim_type global_type, __isl_keep isl_space *local_dim, - int latex, __isl_keep isl_basic_map *eq, - __isl_keep isl_multi_aff *maff, int offset) + struct isl_print_space_data *data, int offset) { - p = print_nested_tuple(p, global_dim, global_type, - local_dim, isl_dim_in, latex, eq, maff, offset); - p = isl_printer_print_str(p, s_to[latex]); - p = print_nested_tuple(p, global_dim, global_type, - local_dim, isl_dim_out, latex, eq, maff, offset); + p = print_nested_tuple(p, local_dim, isl_dim_in, data, offset); + p = isl_printer_print_str(p, s_to[data->latex]); + p = print_nested_tuple(p, local_dim, isl_dim_out, data, offset); return p; } static __isl_give isl_printer *print_space(__isl_keep isl_space *dim, - __isl_take isl_printer *p, int latex, int rational, - __isl_keep isl_basic_map *eq, __isl_keep isl_multi_aff *maff) + __isl_take isl_printer *p, int rational, + struct isl_print_space_data *data) { - if (rational && !latex) + if (rational && !data->latex) p = isl_printer_print_str(p, "rat: "); if (isl_space_is_params(dim)) ; else if (isl_space_is_set(dim)) - p = print_tuple(dim, p, isl_dim_set, latex, eq, maff); + p = print_tuple(dim, p, isl_dim_set, data); else { - p = print_tuple(dim, p, isl_dim_in, latex, eq, maff); - p = isl_printer_print_str(p, s_to[latex]); - p = print_tuple(dim, p, isl_dim_out, latex, eq, maff); + p = print_tuple(dim, p, isl_dim_in, data); + p = isl_printer_print_str(p, s_to[data->latex]); + p = print_tuple(dim, p, isl_dim_out, data); } return p; @@ -453,7 +434,7 @@ p = isl_printer_start_line(p); p = isl_printer_print_str(p, "symbolic "); - p = print_var_list(dim, p, isl_dim_param, 0, NULL, NULL); + p = print_var_list(p, dim, isl_dim_param); p = isl_printer_print_str(p, ";"); p = isl_printer_end_line(p); return p; @@ -531,26 +512,85 @@ return NULL; } -static __isl_give isl_printer *print_omega_constraints( - __isl_keep isl_basic_map *bmap, __isl_take isl_printer *p) +static __isl_give isl_printer *print_div(__isl_keep isl_space *dim, + __isl_keep isl_mat *div, int pos, __isl_take isl_printer *p) { - if (bmap->n_eq + bmap->n_ineq == 0) - return p; + int c = p->output_format == ISL_FORMAT_C; + p = isl_printer_print_str(p, c ? "floord(" : "floor(("); + p = print_affine_of_len(dim, div, p, + div->row[pos] + 1, div->n_col - 1); + p = isl_printer_print_str(p, c ? ", " : ")/"); + p = isl_printer_print_isl_int(p, div->row[pos][0]); + p = isl_printer_print_str(p, ")"); + return p; +} - p = isl_printer_print_str(p, ": "); +/* Print a comma separated list of div names, with their definitions + * (provided that they have a definition and we are printing in isl format). + */ +static __isl_give isl_printer *print_div_list(__isl_take isl_printer *p, + __isl_keep isl_space *space, __isl_keep isl_mat *div, int latex) +{ + int i; + unsigned n_div; + + if (!p || !space || !div) + return isl_printer_free(p); + + n_div = isl_mat_rows(div); + + for (i = 0; i < n_div; ++i) { + if (i) + p = isl_printer_print_str(p, ", "); + p = print_name(space, p, isl_dim_div, i, latex); + if (p->output_format != ISL_FORMAT_ISL || + isl_int_is_zero(div->row[i][0])) + continue; + p = isl_printer_print_str(p, " = "); + p = print_div(space, div, i, p); + } + + return p; +} + +static __isl_give isl_printer *print_disjunct(__isl_keep isl_basic_map *bmap, + __isl_keep isl_space *dim, __isl_take isl_printer *p, int latex) +{ if (bmap->n_div > 0) { - int i; - p = isl_printer_print_str(p, "exists ("); - for (i = 0; i < bmap->n_div; ++i) { - if (i) - p = isl_printer_print_str(p, ", "); - p = print_name(bmap->dim, p, isl_dim_div, i, 0); - } + isl_space *space; + isl_mat *div; + + space = isl_basic_map_get_space(bmap); + div = isl_basic_map_get_divs(bmap); + p = isl_printer_print_str(p, s_open_exists[latex]); + p = print_div_list(p, space, div, latex); + isl_space_free(space); + isl_mat_free(div); p = isl_printer_print_str(p, ": "); } - p = print_constraints(bmap, bmap->dim, p, 0); + + p = print_constraints(bmap, dim, p, latex); + if (bmap->n_div > 0) - p = isl_printer_print_str(p, ")"); + p = isl_printer_print_str(p, s_close_exists[latex]); + return p; +} + +/* Print a colon followed by the constraints of "bmap" + * to "p", provided there are any constraints. + * The names of the variables are taken from "space". + * "latex" is set if the constraints should be printed in LaTeX format. + */ +static __isl_give isl_printer *print_optional_disjunct( + __isl_keep isl_basic_map *bmap, __isl_keep isl_space *space, + __isl_take isl_printer *p, int latex) +{ + if (isl_basic_map_is_universe(bmap)) + return p; + + p = isl_printer_print_str(p, ": "); + p = print_disjunct(bmap, space, p, latex); + return p; } @@ -558,11 +598,11 @@ __isl_keep isl_basic_map *bmap, __isl_take isl_printer *p) { p = isl_printer_print_str(p, "{ ["); - p = print_var_list(bmap->dim, p, isl_dim_in, 0, NULL, NULL); + p = print_var_list(p, bmap->dim, isl_dim_in); p = isl_printer_print_str(p, "] -> ["); - p = print_var_list(bmap->dim, p, isl_dim_out, 0, NULL, NULL); + p = print_var_list(p, bmap->dim, isl_dim_out); p = isl_printer_print_str(p, "] "); - p = print_omega_constraints(bmap, p); + p = print_optional_disjunct(bmap, bmap->dim, p, 0); p = isl_printer_print_str(p, " }"); return p; } @@ -571,9 +611,9 @@ __isl_keep isl_basic_set *bset, __isl_take isl_printer *p) { p = isl_printer_print_str(p, "{ ["); - p = print_var_list(bset->dim, p, isl_dim_set, 0, NULL, NULL); + p = print_var_list(p, bset->dim, isl_dim_set); p = isl_printer_print_str(p, "] "); - p = print_omega_constraints((isl_basic_map *)bset, p); + p = print_optional_disjunct(bset, bset->dim, p, 0); p = isl_printer_print_str(p, " }"); return p; } @@ -604,45 +644,19 @@ return p; } -static __isl_give isl_printer *print_disjunct(__isl_keep isl_basic_map *bmap, - __isl_keep isl_space *dim, __isl_take isl_printer *p, int latex) -{ - if (bmap->n_div > 0) { - int i; - p = isl_printer_print_str(p, s_open_exists[latex]); - for (i = 0; i < bmap->n_div; ++i) { - if (i) - p = isl_printer_print_str(p, ", "); - p = print_name(dim, p, isl_dim_div, i, latex); - if (latex || isl_int_is_zero(bmap->div[i][0])) - continue; - p = isl_printer_print_str(p, " = [("); - p = print_affine(bmap, dim, p, bmap->div[i] + 1); - p = isl_printer_print_str(p, ")/"); - p = isl_printer_print_isl_int(p, bmap->div[i][0]); - p = isl_printer_print_str(p, "]"); - } - p = isl_printer_print_str(p, ": "); - } - - p = print_constraints(bmap, dim, p, latex); - - if (bmap->n_div > 0) - p = isl_printer_print_str(p, s_close_exists[latex]); - return p; -} - static __isl_give isl_printer *isl_basic_map_print_isl( __isl_keep isl_basic_map *bmap, __isl_take isl_printer *p, int latex) { + struct isl_print_space_data data = { .latex = latex }; int rational = ISL_F_ISSET(bmap, ISL_BASIC_MAP_RATIONAL); + if (isl_basic_map_dim(bmap, isl_dim_param) > 0) { - p = print_tuple(bmap->dim, p, isl_dim_param, latex, NULL, NULL); + p = print_tuple(bmap->dim, p, isl_dim_param, &data); p = isl_printer_print_str(p, " -> "); } p = isl_printer_print_str(p, "{ "); - p = print_space(bmap->dim, p, latex, rational, NULL, NULL); + p = print_space(bmap->dim, p, rational, &data); p = isl_printer_print_str(p, " : "); p = print_disjunct(bmap, bmap->dim, p, latex); p = isl_printer_print_str(p, " }"); @@ -826,12 +840,61 @@ return NULL; } +static int defining_equality(__isl_keep isl_basic_map *eq, + __isl_keep isl_space *dim, enum isl_dim_type type, int pos) +{ + int i; + unsigned total; + + if (!eq) + return -1; + + pos += isl_space_offset(dim, type); + total = isl_basic_map_total_dim(eq); + + for (i = 0; i < eq->n_eq; ++i) { + if (isl_seq_last_non_zero(eq->eq[i] + 1, total) != pos) + continue; + if (isl_int_is_one(eq->eq[i][1 + pos])) + isl_seq_neg(eq->eq[i], eq->eq[i], 1 + total); + return i; + } + + return -1; +} + +/* Print dimension "pos" of data->space to "p". + * + * data->user is assumed to be an isl_basic_map keeping track of equalities. + * + * If the current dimension is defined by these equalities, then print + * the corresponding expression. Otherwise, print the name of the dimension. + */ +static __isl_give isl_printer *print_dim_eq(__isl_take isl_printer *p, + struct isl_print_space_data *data, unsigned pos) +{ + isl_basic_map *eq = data->user; + int j; + + j = defining_equality(eq, data->space, data->type, pos); + if (j >= 0) { + pos += 1 + isl_space_offset(data->space, data->type); + p = print_affine_of_len(eq->dim, NULL, p, eq->eq[j], pos); + } else { + p = print_name(data->space, p, data->type, pos, data->latex); + } + + return p; +} + static __isl_give isl_printer *print_split_map(__isl_take isl_printer *p, struct isl_aff_split *split, int n) { + struct isl_print_space_data data = { 0 }; int i; int rational; + data.print_dim = &print_dim_eq; for (i = 0; i < n; ++i) { isl_space *dim; @@ -842,7 +905,8 @@ ISL_F_ISSET(split[i].map->p[0], ISL_BASIC_MAP_RATIONAL); if (i) p = isl_printer_print_str(p, "; "); - p = print_space(dim, p, 0, rational, split[i].aff, NULL); + data.user = split[i].aff; + p = print_space(dim, p, rational, &data); p = print_disjuncts_map(split[i].map, p, 0); } @@ -852,6 +916,7 @@ static __isl_give isl_printer *isl_map_print_isl_body(__isl_keep isl_map *map, __isl_take isl_printer *p) { + struct isl_print_space_data data = { 0 }; struct isl_aff_split *split = NULL; int rational; @@ -862,7 +927,7 @@ } else { rational = map->n > 0 && ISL_F_ISSET(map->p[0], ISL_BASIC_MAP_RATIONAL); - p = print_space(map->dim, p, 0, rational, NULL, NULL); + p = print_space(map->dim, p, rational, &data); p = print_disjuncts_map(map, p, 0); } free_split(split, map->n); @@ -872,8 +937,10 @@ static __isl_give isl_printer *isl_map_print_isl(__isl_keep isl_map *map, __isl_take isl_printer *p) { + struct isl_print_space_data data = { 0 }; + if (isl_map_dim(map, isl_dim_param) > 0) { - p = print_tuple(map->dim, p, isl_dim_param, 0, NULL, NULL); + p = print_tuple(map->dim, p, isl_dim_param, &data); p = isl_printer_print_str(p, s_to[0]); } p = isl_printer_print_str(p, s_open_set[0]); @@ -885,12 +952,17 @@ static __isl_give isl_printer *print_latex_map(__isl_keep isl_map *map, __isl_take isl_printer *p, __isl_keep isl_basic_map *aff) { + struct isl_print_space_data data = { 0 }; + + data.latex = 1; if (isl_map_dim(map, isl_dim_param) > 0) { - p = print_tuple(map->dim, p, isl_dim_param, 1, NULL, NULL); + p = print_tuple(map->dim, p, isl_dim_param, &data); p = isl_printer_print_str(p, s_to[1]); } p = isl_printer_print_str(p, s_open_set[1]); - p = print_space(map->dim, p, 1, 0, aff, NULL); + data.print_dim = &print_dim_eq; + data.user = aff; + p = print_space(map->dim, p, 0, &data); p = print_disjuncts_map(map, p, 1); p = isl_printer_print_str(p, s_close_set[1]); @@ -936,24 +1008,6 @@ return NULL; } -void isl_basic_map_print(__isl_keep isl_basic_map *bmap, FILE *out, int indent, - const char *prefix, const char *suffix, unsigned output_format) -{ - isl_printer *printer; - - if (!bmap) - return; - - printer = isl_printer_to_file(bmap->ctx, out); - printer = isl_printer_set_indent(printer, indent); - printer = isl_printer_set_prefix(printer, prefix); - printer = isl_printer_set_suffix(printer, suffix); - printer = isl_printer_set_output_format(printer, output_format); - isl_printer_print_basic_map(printer, bmap); - - isl_printer_free(printer); -} - __isl_give isl_printer *isl_printer_print_basic_set(__isl_take isl_printer *p, __isl_keep isl_basic_set *bset) { @@ -976,24 +1030,6 @@ return NULL; } -void isl_basic_set_print(struct isl_basic_set *bset, FILE *out, int indent, - const char *prefix, const char *suffix, unsigned output_format) -{ - isl_printer *printer; - - if (!bset) - return; - - printer = isl_printer_to_file(bset->ctx, out); - printer = isl_printer_set_indent(printer, indent); - printer = isl_printer_set_prefix(printer, prefix); - printer = isl_printer_set_suffix(printer, suffix); - printer = isl_printer_set_output_format(printer, output_format); - isl_printer_print_basic_set(printer, bset); - - isl_printer_free(printer); -} - __isl_give isl_printer *isl_printer_print_set(__isl_take isl_printer *p, __isl_keep isl_set *set) { @@ -1015,22 +1051,6 @@ return NULL; } -void isl_set_print(struct isl_set *set, FILE *out, int indent, - unsigned output_format) -{ - isl_printer *printer; - - if (!set) - return; - - printer = isl_printer_to_file(set->ctx, out); - printer = isl_printer_set_indent(printer, indent); - printer = isl_printer_set_output_format(printer, output_format); - printer = isl_printer_print_set(printer, set); - - isl_printer_free(printer); -} - __isl_give isl_printer *isl_printer_print_map(__isl_take isl_printer *p, __isl_keep isl_map *map) { @@ -1058,7 +1078,7 @@ int first; }; -static int print_map_body(__isl_take isl_map *map, void *user) +static isl_stat print_map_body(__isl_take isl_map *map, void *user) { struct isl_union_print_data *data; data = (struct isl_union_print_data *)user; @@ -1070,28 +1090,32 @@ data->p = isl_map_print_isl_body(map, data->p); isl_map_free(map); - return 0; + return isl_stat_ok; } static __isl_give isl_printer *isl_union_map_print_isl( __isl_keep isl_union_map *umap, __isl_take isl_printer *p) { - struct isl_union_print_data data = { p, 1 }; + struct isl_union_print_data data; + struct isl_print_space_data space_data = { 0 }; isl_space *dim; + dim = isl_union_map_get_space(umap); if (isl_space_dim(dim, isl_dim_param) > 0) { - p = print_tuple(dim, p, isl_dim_param, 0, NULL, NULL); + p = print_tuple(dim, p, isl_dim_param, &space_data); p = isl_printer_print_str(p, s_to[0]); } isl_space_free(dim); p = isl_printer_print_str(p, s_open_set[0]); + data.p = p; + data.first = 1; isl_union_map_foreach_map(umap, &print_map_body, &data); p = data.p; p = isl_printer_print_str(p, s_close_set[0]); return p; } -static int print_latex_map_body(__isl_take isl_map *map, void *user) +static isl_stat print_latex_map_body(__isl_take isl_map *map, void *user) { struct isl_union_print_data *data; data = (struct isl_union_print_data *)user; @@ -1103,7 +1127,7 @@ data->p = isl_map_print_latex(map, data->p); isl_map_free(map); - return 0; + return isl_stat_ok; } static __isl_give isl_printer *isl_union_map_print_latex( @@ -1151,22 +1175,6 @@ return NULL; } -void isl_map_print(__isl_keep isl_map *map, FILE *out, int indent, - unsigned output_format) -{ - isl_printer *printer; - - if (!map) - return; - - printer = isl_printer_to_file(map->ctx, out); - printer = isl_printer_set_indent(printer, indent); - printer = isl_printer_set_output_format(printer, output_format); - printer = isl_printer_print_map(printer, map); - - isl_printer_free(printer); -} - static int upoly_rec_n_non_zero(__isl_keep struct isl_upoly_rec *rec) { int i; @@ -1179,19 +1187,6 @@ return n; } -static __isl_give isl_printer *print_div(__isl_keep isl_space *dim, - __isl_keep isl_mat *div, int pos, __isl_take isl_printer *p) -{ - int c = p->output_format == ISL_FORMAT_C; - p = isl_printer_print_str(p, c ? "floord(" : "[("); - p = print_affine_of_len(dim, div, p, - div->row[pos] + 1, div->n_col - 1); - p = isl_printer_print_str(p, c ? ", " : ")/"); - p = isl_printer_print_isl_int(p, div->row[pos][0]); - p = isl_printer_print_str(p, c ? ")" : "]"); - return p; -} - static __isl_give isl_printer *upoly_print_cst(__isl_keep struct isl_upoly *up, __isl_take isl_printer *p, int first) { @@ -1327,16 +1322,18 @@ static __isl_give isl_printer *print_qpolynomial_isl(__isl_take isl_printer *p, __isl_keep isl_qpolynomial *qp) { + struct isl_print_space_data data = { 0 }; + if (!p || !qp) goto error; if (isl_space_dim(qp->dim, isl_dim_param) > 0) { - p = print_tuple(qp->dim, p, isl_dim_param, 0, NULL, NULL); + p = print_tuple(qp->dim, p, isl_dim_param, &data); p = isl_printer_print_str(p, " -> "); } p = isl_printer_print_str(p, "{ "); if (!isl_space_is_params(qp->dim)) { - p = print_space(qp->dim, p, 0, 0, NULL, NULL); + p = print_space(qp->dim, p, 0, &data); p = isl_printer_print_str(p, " -> "); } p = print_qpolynomial(p, qp); @@ -1446,13 +1443,14 @@ static __isl_give isl_printer *isl_pwqp_print_isl_body( __isl_take isl_printer *p, __isl_keep isl_pw_qpolynomial *pwqp) { + struct isl_print_space_data data = { 0 }; int i = 0; for (i = 0; i < pwqp->n; ++i) { if (i) p = isl_printer_print_str(p, "; "); if (!isl_space_is_params(pwqp->p[i].set->dim)) { - p = print_space(pwqp->p[i].set->dim, p, 0, 0, NULL, NULL); + p = print_space(pwqp->p[i].set->dim, p, 0, &data); p = isl_printer_print_str(p, " -> "); } p = print_qpolynomial(p, pwqp->p[i].qp); @@ -1465,17 +1463,19 @@ static __isl_give isl_printer *print_pw_qpolynomial_isl( __isl_take isl_printer *p, __isl_keep isl_pw_qpolynomial *pwqp) { + struct isl_print_space_data data = { 0 }; + if (!p || !pwqp) goto error; if (isl_space_dim(pwqp->dim, isl_dim_param) > 0) { - p = print_tuple(pwqp->dim, p, isl_dim_param, 0, NULL, NULL); + p = print_tuple(pwqp->dim, p, isl_dim_param, &data); p = isl_printer_print_str(p, " -> "); } p = isl_printer_print_str(p, "{ "); if (pwqp->n == 0) { if (!isl_space_is_set(pwqp->dim)) { - p = print_tuple(pwqp->dim, p, isl_dim_in, 0, NULL, NULL); + p = print_tuple(pwqp->dim, p, isl_dim_in, &data); p = isl_printer_print_str(p, " -> "); } p = isl_printer_print_str(p, "0"); @@ -1506,13 +1506,14 @@ static __isl_give isl_printer *isl_pwf_print_isl_body( __isl_take isl_printer *p, __isl_keep isl_pw_qpolynomial_fold *pwf) { + struct isl_print_space_data data = { 0 }; int i = 0; for (i = 0; i < pwf->n; ++i) { if (i) p = isl_printer_print_str(p, "; "); if (!isl_space_is_params(pwf->p[i].set->dim)) { - p = print_space(pwf->p[i].set->dim, p, 0, 0, NULL, NULL); + p = print_space(pwf->p[i].set->dim, p, 0, &data); p = isl_printer_print_str(p, " -> "); } p = qpolynomial_fold_print(pwf->p[i].fold, p); @@ -1525,14 +1526,16 @@ static __isl_give isl_printer *print_pw_qpolynomial_fold_isl( __isl_take isl_printer *p, __isl_keep isl_pw_qpolynomial_fold *pwf) { + struct isl_print_space_data data = { 0 }; + if (isl_space_dim(pwf->dim, isl_dim_param) > 0) { - p = print_tuple(pwf->dim, p, isl_dim_param, 0, NULL, NULL); + p = print_tuple(pwf->dim, p, isl_dim_param, &data); p = isl_printer_print_str(p, " -> "); } p = isl_printer_print_str(p, "{ "); if (pwf->n == 0) { if (!isl_space_is_set(pwf->dim)) { - p = print_tuple(pwf->dim, p, isl_dim_in, 0, NULL, NULL); + p = print_tuple(pwf->dim, p, isl_dim_in, &data); p = isl_printer_print_str(p, " -> "); } p = isl_printer_print_str(p, "0"); @@ -1625,10 +1628,13 @@ } /* We skip the constraint if it is implied by the div expression. + * + * *first indicates whether this is the first constraint in the conjunction and + * is updated if the constraint is actually printed. */ static __isl_give isl_printer *print_constraint_c(__isl_take isl_printer *p, __isl_keep isl_space *dim, - __isl_keep isl_basic_set *bset, isl_int *c, const char *op, int first) + __isl_keep isl_basic_set *bset, isl_int *c, const char *op, int *first) { unsigned o_div; unsigned n_div; @@ -1640,13 +1646,16 @@ if (div >= 0 && isl_basic_set_is_div_constraint(bset, c, div)) return p; - if (!first) + if (!*first) p = isl_printer_print_str(p, " && "); p = print_affine_c(p, dim, bset, c); p = isl_printer_print_str(p, " "); p = isl_printer_print_str(p, op); p = isl_printer_print_str(p, " 0"); + + *first = 0; + return p; } @@ -1654,6 +1663,7 @@ __isl_keep isl_space *dim, __isl_keep isl_basic_set *bset) { int i, j; + int first = 1; unsigned n_div = isl_basic_set_dim(bset, isl_dim_div); unsigned total = isl_basic_set_total_dim(bset) - n_div; @@ -1661,7 +1671,7 @@ j = isl_seq_last_non_zero(bset->eq[i] + 1 + total, n_div); if (j < 0) p = print_constraint_c(p, dim, bset, - bset->eq[i], "==", !i); + bset->eq[i], "==", &first); else { if (i) p = isl_printer_print_str(p, " && "); @@ -1672,11 +1682,12 @@ p = isl_printer_print_isl_int(p, bset->eq[i][1 + total + j]); p = isl_printer_print_str(p, " == 0"); + first = 0; } } for (i = 0; i < bset->n_ineq; ++i) p = print_constraint_c(p, dim, bset, bset->ineq[i], ">=", - !bset->n_eq && !i); + &first); return p; } @@ -1739,7 +1750,7 @@ return NULL; } -static int print_pwqp_body(__isl_take isl_pw_qpolynomial *pwqp, void *user) +static isl_stat print_pwqp_body(__isl_take isl_pw_qpolynomial *pwqp, void *user) { struct isl_union_print_data *data; data = (struct isl_union_print_data *)user; @@ -1751,21 +1762,25 @@ data->p = isl_pwqp_print_isl_body(data->p, pwqp); isl_pw_qpolynomial_free(pwqp); - return 0; + return isl_stat_ok; } static __isl_give isl_printer *print_union_pw_qpolynomial_isl( __isl_take isl_printer *p, __isl_keep isl_union_pw_qpolynomial *upwqp) { - struct isl_union_print_data data = { p, 1 }; + struct isl_union_print_data data; + struct isl_print_space_data space_data = { 0 }; isl_space *dim; + dim = isl_union_pw_qpolynomial_get_space(upwqp); if (isl_space_dim(dim, isl_dim_param) > 0) { - p = print_tuple(dim, p, isl_dim_param, 0, NULL, NULL); + p = print_tuple(dim, p, isl_dim_param, &space_data); p = isl_printer_print_str(p, " -> "); } isl_space_free(dim); p = isl_printer_print_str(p, "{ "); + data.p = p; + data.first = 1; isl_union_pw_qpolynomial_foreach_pw_qpolynomial(upwqp, &print_pwqp_body, &data); p = data.p; @@ -1878,7 +1893,8 @@ isl_printer_free(p); } -static int print_pwf_body(__isl_take isl_pw_qpolynomial_fold *pwf, void *user) +static isl_stat print_pwf_body(__isl_take isl_pw_qpolynomial_fold *pwf, + void *user) { struct isl_union_print_data *data; data = (struct isl_union_print_data *)user; @@ -1890,22 +1906,26 @@ data->p = isl_pwf_print_isl_body(data->p, pwf); isl_pw_qpolynomial_fold_free(pwf); - return 0; + return isl_stat_ok; } static __isl_give isl_printer *print_union_pw_qpolynomial_fold_isl( __isl_take isl_printer *p, __isl_keep isl_union_pw_qpolynomial_fold *upwf) { - struct isl_union_print_data data = { p, 1 }; + struct isl_union_print_data data; + struct isl_print_space_data space_data = { 0 }; isl_space *dim; + dim = isl_union_pw_qpolynomial_fold_get_space(upwf); if (isl_space_dim(dim, isl_dim_param) > 0) { - p = print_tuple(dim, p, isl_dim_param, 0, NULL, NULL); + p = print_tuple(dim, p, isl_dim_param, &space_data); p = isl_printer_print_str(p, " -> "); } isl_space_free(dim); p = isl_printer_print_str(p, "{ "); + data.p = p; + data.first = 1; isl_union_pw_qpolynomial_fold_foreach_pw_qpolynomial_fold(upwf, &print_pwf_body, &data); p = data.p; @@ -1950,11 +1970,13 @@ static __isl_give isl_printer *isl_printer_print_space_isl( __isl_take isl_printer *p, __isl_keep isl_space *dim) { + struct isl_print_space_data data = { 0 }; + if (!dim) goto error; if (isl_space_dim(dim, isl_dim_param) > 0) { - p = print_tuple(dim, p, isl_dim_param, 0, NULL, NULL); + p = print_tuple(dim, p, isl_dim_param, &data); p = isl_printer_print_str(p, " -> "); } @@ -1962,7 +1984,7 @@ if (isl_space_is_params(dim)) p = isl_printer_print_str(p, s_such_that[0]); else - p = print_space(dim, p, 0, 0, NULL, NULL); + p = print_space(dim, p, 0, &data); p = isl_printer_print_str(p, " }"); return p; @@ -1989,37 +2011,23 @@ __isl_give isl_printer *isl_printer_print_local_space(__isl_take isl_printer *p, __isl_keep isl_local_space *ls) { - unsigned total; + struct isl_print_space_data data = { 0 }; unsigned n_div; if (!ls) goto error; - total = isl_local_space_dim(ls, isl_dim_all); if (isl_local_space_dim(ls, isl_dim_param) > 0) { - p = print_tuple(ls->dim, p, isl_dim_param, 0, NULL, NULL); + p = print_tuple(ls->dim, p, isl_dim_param, &data); p = isl_printer_print_str(p, " -> "); } p = isl_printer_print_str(p, "{ "); - p = print_space(ls->dim, p, 0, 0, NULL, NULL); + p = print_space(ls->dim, p, 0, &data); n_div = isl_local_space_dim(ls, isl_dim_div); if (n_div > 0) { - int i; p = isl_printer_print_str(p, " : "); p = isl_printer_print_str(p, s_open_exists[0]); - for (i = 0; i < n_div; ++i) { - if (i) - p = isl_printer_print_str(p, ", "); - p = print_name(ls->dim, p, isl_dim_div, i, 0); - if (isl_int_is_zero(ls->div->row[i][0])) - continue; - p = isl_printer_print_str(p, " = [("); - p = print_affine_of_len(ls->dim, ls->div, p, - ls->div->row[i] + 1, 1 + total); - p = isl_printer_print_str(p, ")/"); - p = isl_printer_print_isl_int(p, ls->div->row[i][0]); - p = isl_printer_print_str(p, "]"); - } + p = print_div_list(p, ls->dim, ls->div, 0); } else if (isl_space_is_params(ls->dim)) p = isl_printer_print_str(p, s_such_that[0]); p = isl_printer_print_str(p, " }"); @@ -2034,6 +2042,9 @@ { unsigned total; + if (isl_aff_is_nan(aff)) + return isl_printer_print_str(p, "NaN"); + total = isl_local_space_dim(aff->ls, isl_dim_all); p = isl_printer_print_str(p, "("); p = print_affine_of_len(aff->ls->dim, aff->ls->div, p, @@ -2051,10 +2062,12 @@ static __isl_give isl_printer *print_aff(__isl_take isl_printer *p, __isl_keep isl_aff *aff) { + struct isl_print_space_data data = { 0 }; + if (isl_space_is_params(aff->ls->dim)) ; else { - p = print_tuple(aff->ls->dim, p, isl_dim_set, 0, NULL, NULL); + p = print_tuple(aff->ls->dim, p, isl_dim_set, &data); p = isl_printer_print_str(p, " -> "); } p = isl_printer_print_str(p, "["); @@ -2067,11 +2080,13 @@ static __isl_give isl_printer *print_aff_isl(__isl_take isl_printer *p, __isl_keep isl_aff *aff) { + struct isl_print_space_data data = { 0 }; + if (!aff) goto error; if (isl_local_space_dim(aff->ls, isl_dim_param) > 0) { - p = print_tuple(aff->ls->dim, p, isl_dim_param, 0, NULL, NULL); + p = print_tuple(aff->ls->dim, p, isl_dim_param, &data); p = isl_printer_print_str(p, " -> "); } p = isl_printer_print_str(p, "{ "); @@ -2083,25 +2098,41 @@ return NULL; } +/* Print the body of an isl_pw_aff, i.e., a semicolon delimited + * sequence of affine expressions, each followed by constraints. + */ +static __isl_give isl_printer *print_pw_aff_body( + __isl_take isl_printer *p, __isl_keep isl_pw_aff *pa) +{ + int i; + + if (!pa) + return isl_printer_free(p); + + for (i = 0; i < pa->n; ++i) { + if (i) + p = isl_printer_print_str(p, "; "); + p = print_aff(p, pa->p[i].aff); + p = print_disjuncts((isl_map *)pa->p[i].set, p, 0); + } + + return p; +} + static __isl_give isl_printer *print_pw_aff_isl(__isl_take isl_printer *p, __isl_keep isl_pw_aff *pwaff) { - int i; + struct isl_print_space_data data = { 0 }; if (!pwaff) goto error; if (isl_space_dim(pwaff->dim, isl_dim_param) > 0) { - p = print_tuple(pwaff->dim, p, isl_dim_param, 0, NULL, NULL); + p = print_tuple(pwaff->dim, p, isl_dim_param, &data); p = isl_printer_print_str(p, " -> "); } p = isl_printer_print_str(p, "{ "); - for (i = 0; i < pwaff->n; ++i) { - if (i) - p = isl_printer_print_str(p, "; "); - p = print_aff(p, pwaff->p[i].aff); - p = print_disjuncts((isl_map *)pwaff->p[i].set, p, 0); - } + p = print_pw_aff_body(p, pwaff); p = isl_printer_print_str(p, " }"); return p; error: @@ -2205,29 +2236,6 @@ return p; } -/* Print the affine expression "aff" in C format to "p". - * The dimension names are taken from "space" - * "set" represents the domain of the affine expression. - */ -static __isl_give isl_printer *print_aff_on_domain_c(__isl_take isl_printer *p, - __isl_keep isl_space *space, __isl_keep isl_aff *aff, - __isl_keep isl_set *set) -{ - isl_set *u; - isl_ast_build *build; - isl_ast_expr *expr; - - u = isl_set_universe(isl_space_copy(space)); - build = isl_ast_build_from_context(u); - build = isl_ast_build_restrict(build, isl_set_copy(set)); - expr = isl_ast_expr_from_aff(isl_aff_copy(aff), build); - p = isl_printer_print_ast_expr(p, expr); - isl_ast_expr_free(expr); - isl_ast_build_free(build); - - return p; -} - /* In the C format, we cannot express that "pwaff" may be undefined * on parts of the domain space. We therefore assume that the expression * will only be evaluated on its definition domain and compute the gist @@ -2236,44 +2244,23 @@ static __isl_give isl_printer *print_pw_aff_c(__isl_take isl_printer *p, __isl_keep isl_pw_aff *pwaff) { - int i; isl_set *domain; - isl_space *space; + isl_ast_build *build; + isl_ast_expr *expr; if (pwaff->n < 1) isl_die(p->ctx, isl_error_unsupported, - "cannot print empty isl_pw_aff in C format", goto error); - space = isl_pw_aff_get_domain_space(pwaff); - if (!space) - goto error; + "cannot print empty isl_pw_aff in C format", + return isl_printer_free(p)); domain = isl_pw_aff_domain(isl_pw_aff_copy(pwaff)); + build = isl_ast_build_from_context(domain); + expr = isl_ast_build_expr_from_pw_aff(build, isl_pw_aff_copy(pwaff)); + p = isl_printer_print_ast_expr(p, expr); + isl_ast_expr_free(expr); + isl_ast_build_free(build); - for (i = 0; i < pwaff->n - 1; ++i) { - isl_set *set_i; - - p = isl_printer_print_str(p, "("); - - set_i = isl_set_copy(pwaff->p[i].set); - set_i = isl_set_gist(set_i, isl_set_copy(domain)); - p = print_set_c(p, space, set_i); - isl_set_free(set_i); - - p = isl_printer_print_str(p, ") ? ("); - p = print_aff_on_domain_c(p, space, - pwaff->p[i].aff, pwaff->p[i].set); - p = isl_printer_print_str(p, ") : "); - } - - isl_set_free(domain); - - p = print_aff_on_domain_c(p, space, pwaff->p[pwaff->n - 1].aff, - pwaff->p[pwaff->n - 1].set); - isl_space_free(space); return p; -error: - isl_printer_free(p); - return NULL; } __isl_give isl_printer *isl_printer_print_aff(__isl_take isl_printer *p, @@ -2310,20 +2297,124 @@ return NULL; } +/* Print "pa" in a sequence of isl_pw_affs delimited by semicolons. + * Each isl_pw_aff itself is also printed as semicolon delimited + * sequence of pieces. + * If data->first = 1, then this is the first in the sequence. + * Update data->first to tell the next element that it is not the first. + */ +static isl_stat print_pw_aff_body_wrap(__isl_take isl_pw_aff *pa, + void *user) +{ + struct isl_union_print_data *data; + data = (struct isl_union_print_data *) user; + + if (!data->first) + data->p = isl_printer_print_str(data->p, "; "); + data->first = 0; + + data->p = print_pw_aff_body(data->p, pa); + isl_pw_aff_free(pa); + + return data->p ? isl_stat_ok : isl_stat_error; +} + +/* Print the body of an isl_union_pw_aff, i.e., a semicolon delimited + * sequence of affine expressions, each followed by constraints, + * with the sequence enclosed in braces. + */ +static __isl_give isl_printer *print_union_pw_aff_body( + __isl_take isl_printer *p, __isl_keep isl_union_pw_aff *upa) +{ + struct isl_union_print_data data = { p, 1 }; + + p = isl_printer_print_str(p, s_open_set[0]); + data.p = p; + if (isl_union_pw_aff_foreach_pw_aff(upa, + &print_pw_aff_body_wrap, &data) < 0) + data.p = isl_printer_free(p); + p = data.p; + p = isl_printer_print_str(p, s_close_set[0]); + + return p; +} + +/* Print the isl_union_pw_aff "upa" to "p" in isl format. + * + * The individual isl_pw_affs are delimited by a semicolon. + */ +static __isl_give isl_printer *print_union_pw_aff_isl( + __isl_take isl_printer *p, __isl_keep isl_union_pw_aff *upa) +{ + struct isl_print_space_data data = { 0 }; + isl_space *space; + + space = isl_union_pw_aff_get_space(upa); + if (isl_space_dim(space, isl_dim_param) > 0) { + p = print_tuple(space, p, isl_dim_param, &data); + p = isl_printer_print_str(p, s_to[0]); + } + isl_space_free(space); + p = print_union_pw_aff_body(p, upa); + return p; +} + +/* Print the isl_union_pw_aff "upa" to "p". + * + * We currently only support an isl format. + */ +__isl_give isl_printer *isl_printer_print_union_pw_aff( + __isl_take isl_printer *p, __isl_keep isl_union_pw_aff *upa) +{ + if (!p || !upa) + return isl_printer_free(p); + + if (p->output_format == ISL_FORMAT_ISL) + return print_union_pw_aff_isl(p, upa); + isl_die(isl_printer_get_ctx(p), isl_error_unsupported, + "unsupported output format", return isl_printer_free(p)); +} + +/* Print dimension "pos" of data->space to "p". + * + * data->user is assumed to be an isl_multi_aff. + * + * If the current dimension is an output dimension, then print + * the corresponding expression. Otherwise, print the name of the dimension. + */ +static __isl_give isl_printer *print_dim_ma(__isl_take isl_printer *p, + struct isl_print_space_data *data, unsigned pos) +{ + isl_multi_aff *ma = data->user; + + if (data->type == isl_dim_out) + p = print_aff_body(p, ma->p[pos]); + else + p = print_name(data->space, p, data->type, pos, data->latex); + + return p; +} + static __isl_give isl_printer *print_multi_aff(__isl_take isl_printer *p, __isl_keep isl_multi_aff *maff) { - return print_space(maff->space, p, 0, 0, NULL, maff); + struct isl_print_space_data data = { 0 }; + + data.print_dim = &print_dim_ma; + data.user = maff; + return print_space(maff->space, p, 0, &data); } static __isl_give isl_printer *print_multi_aff_isl(__isl_take isl_printer *p, __isl_keep isl_multi_aff *maff) { + struct isl_print_space_data data = { 0 }; + if (!maff) goto error; if (isl_space_dim(maff->space, isl_dim_param) > 0) { - p = print_tuple(maff->space, p, isl_dim_param, 0, NULL, NULL); + p = print_tuple(maff->space, p, isl_dim_param, &data); p = isl_printer_print_str(p, " -> "); } p = isl_printer_print_str(p, "{ "); @@ -2373,11 +2464,13 @@ static __isl_give isl_printer *print_pw_multi_aff_isl(__isl_take isl_printer *p, __isl_keep isl_pw_multi_aff *pma) { + struct isl_print_space_data data = { 0 }; + if (!pma) goto error; if (isl_space_dim(pma->dim, isl_dim_param) > 0) { - p = print_tuple(pma->dim, p, isl_dim_param, 0, NULL, NULL); + p = print_tuple(pma->dim, p, isl_dim_param, &data); p = isl_printer_print_str(p, " -> "); } p = isl_printer_print_str(p, "{ "); @@ -2454,7 +2547,7 @@ return NULL; } -static int print_pw_multi_aff_body_wrap(__isl_take isl_pw_multi_aff *pma, +static isl_stat print_pw_multi_aff_body_wrap(__isl_take isl_pw_multi_aff *pma, void *user) { struct isl_union_print_data *data; @@ -2467,22 +2560,25 @@ data->p = print_pw_multi_aff_body(data->p, pma); isl_pw_multi_aff_free(pma); - return 0; + return isl_stat_ok; } static __isl_give isl_printer *print_union_pw_multi_aff_isl( __isl_take isl_printer *p, __isl_keep isl_union_pw_multi_aff *upma) { - struct isl_union_print_data data = { p, 1 }; + struct isl_union_print_data data; + struct isl_print_space_data space_data = { 0 }; isl_space *space; space = isl_union_pw_multi_aff_get_space(upma); if (isl_space_dim(space, isl_dim_param) > 0) { - p = print_tuple(space, p, isl_dim_param, 0, NULL, NULL); + p = print_tuple(space, p, isl_dim_param, &space_data); p = isl_printer_print_str(p, s_to[0]); } isl_space_free(space); p = isl_printer_print_str(p, s_open_set[0]); + data.p = p; + data.first = 1; isl_union_pw_multi_aff_foreach_pw_multi_aff(upma, &print_pw_multi_aff_body_wrap, &data); p = data.p; @@ -2505,21 +2601,63 @@ return NULL; } +/* Print dimension "pos" of data->space to "p". + * + * data->user is assumed to be an isl_multi_pw_aff. + * + * If the current dimension is an output dimension, then print + * the corresponding piecewise affine expression. + * Otherwise, print the name of the dimension. + */ +static __isl_give isl_printer *print_dim_mpa(__isl_take isl_printer *p, + struct isl_print_space_data *data, unsigned pos) +{ + int i; + int need_parens; + isl_multi_pw_aff *mpa = data->user; + isl_pw_aff *pa; + + if (data->type != isl_dim_out) + return print_name(data->space, p, data->type, pos, data->latex); + + pa = mpa->p[pos]; + if (pa->n == 0) + return isl_printer_print_str(p, "(0 : 1 = 0)"); + + need_parens = pa->n != 1 || !isl_set_plain_is_universe(pa->p[0].set); + if (need_parens) + p = isl_printer_print_str(p, "("); + for (i = 0; i < pa->n; ++i) { + if (i) + p = isl_printer_print_str(p, "; "); + p = print_aff_body(p, pa->p[i].aff); + p = print_disjuncts(pa->p[i].set, p, 0); + } + if (need_parens) + p = isl_printer_print_str(p, ")"); + + return p; +} + +/* Print "mpa" to "p" in isl format. + */ static __isl_give isl_printer *print_multi_pw_aff_isl(__isl_take isl_printer *p, __isl_keep isl_multi_pw_aff *mpa) { - int i; + struct isl_print_space_data data = { 0 }; if (!mpa) return isl_printer_free(p); - p = isl_printer_print_str(p, "("); - for (i = 0; i < mpa->n; ++i) { - if (i) - p = isl_printer_print_str(p, ","); - p = isl_printer_print_pw_aff(p, mpa->p[i]); + if (isl_space_dim(mpa->space, isl_dim_param) > 0) { + p = print_tuple(mpa->space, p, isl_dim_param, &data); + p = isl_printer_print_str(p, " -> "); } - p = isl_printer_print_str(p, ")"); + p = isl_printer_print_str(p, "{ "); + data.print_dim = &print_dim_mpa; + data.user = mpa; + p = print_space(mpa->space, p, 0, &data); + p = isl_printer_print_str(p, " }"); return p; } @@ -2534,3 +2672,120 @@ isl_die(p->ctx, isl_error_unsupported, "unsupported output format", return isl_printer_free(p)); } + +/* Print dimension "pos" of data->space to "p". + * + * data->user is assumed to be an isl_multi_val. + * + * If the current dimension is an output dimension, then print + * the corresponding value. Otherwise, print the name of the dimension. + */ +static __isl_give isl_printer *print_dim_mv(__isl_take isl_printer *p, + struct isl_print_space_data *data, unsigned pos) +{ + isl_multi_val *mv = data->user; + + if (data->type == isl_dim_out) + return isl_printer_print_val(p, mv->p[pos]); + else + return print_name(data->space, p, data->type, pos, data->latex); +} + +/* Print the isl_multi_val "mv" to "p" in isl format. + */ +static __isl_give isl_printer *print_multi_val_isl(__isl_take isl_printer *p, + __isl_keep isl_multi_val *mv) +{ + struct isl_print_space_data data = { 0 }; + + if (!mv) + return isl_printer_free(p); + + if (isl_space_dim(mv->space, isl_dim_param) > 0) { + p = print_tuple(mv->space, p, isl_dim_param, &data); + p = isl_printer_print_str(p, " -> "); + } + p = isl_printer_print_str(p, "{ "); + data.print_dim = &print_dim_mv; + data.user = mv; + p = print_space(mv->space, p, 0, &data); + p = isl_printer_print_str(p, " }"); + return p; +} + +/* Print the isl_multi_val "mv" to "p". + * + * Currently only supported in isl format. + */ +__isl_give isl_printer *isl_printer_print_multi_val( + __isl_take isl_printer *p, __isl_keep isl_multi_val *mv) +{ + if (!p || !mv) + return isl_printer_free(p); + + if (p->output_format == ISL_FORMAT_ISL) + return print_multi_val_isl(p, mv); + isl_die(p->ctx, isl_error_unsupported, "unsupported output format", + return isl_printer_free(p)); +} + +/* Print dimension "pos" of data->space to "p". + * + * data->user is assumed to be an isl_multi_union_pw_aff. + * + * The current dimension is necessarily a set dimension, so + * we print the corresponding isl_union_pw_aff, including + * the braces. + */ +static __isl_give isl_printer *print_union_pw_aff_dim(__isl_take isl_printer *p, + struct isl_print_space_data *data, unsigned pos) +{ + isl_multi_union_pw_aff *mupa = data->user; + isl_union_pw_aff *upa; + + upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, pos); + p = print_union_pw_aff_body(p, upa); + isl_union_pw_aff_free(upa); + + return p; +} + +/* Print the isl_multi_union_pw_aff "mupa" to "p" in isl format. + */ +static __isl_give isl_printer *print_multi_union_pw_aff_isl( + __isl_take isl_printer *p, __isl_keep isl_multi_union_pw_aff *mupa) +{ + struct isl_print_space_data data = { 0 }; + isl_space *space; + + space = isl_multi_union_pw_aff_get_space(mupa); + if (isl_space_dim(space, isl_dim_param) > 0) { + struct isl_print_space_data space_data = { 0 }; + p = print_tuple(space, p, isl_dim_param, &space_data); + p = isl_printer_print_str(p, s_to[0]); + } + + data.print_dim = &print_union_pw_aff_dim; + data.user = mupa; + + p = print_space(space, p, 0, &data); + isl_space_free(space); + + return p; +} + +/* Print the isl_multi_union_pw_aff "mupa" to "p" in isl format. + * + * We currently only support an isl format. + */ +__isl_give isl_printer *isl_printer_print_multi_union_pw_aff( + __isl_take isl_printer *p, __isl_keep isl_multi_union_pw_aff *mupa) +{ + if (!p || !mupa) + return isl_printer_free(p); + + if (p->output_format == ISL_FORMAT_ISL) + return print_multi_union_pw_aff_isl(p, mupa); + isl_die(isl_printer_get_ctx(p), isl_error_unsupported, + "unsupported output format", return isl_printer_free(p)); +} diff -Nru cloog-0.18.2/isl/isl_piplib.c cloog-0.18.4/isl/isl_piplib.c --- cloog-0.18.2/isl/isl_piplib.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_piplib.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -/* - * Copyright 2008-2009 Katholieke Universiteit Leuven - * - * Use of this software is governed by the MIT license - * - * Written by Sven Verdoolaege, K.U.Leuven, Departement - * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium - */ - -#include "isl_piplib.h" - -void isl_seq_cpy_to_pip(Entier *dst, isl_int *src, unsigned len) -{ - int i; - - for (i = 0; i < len; ++i) - entier_assign(dst[i], src[i]); -} - -void isl_seq_cpy_from_pip(isl_int *dst, Entier *src, unsigned len) -{ - int i; - - for (i = 0; i < len; ++i) - entier_assign(dst[i], src[i]); -} diff -Nru cloog-0.18.2/isl/isl_piplib.h cloog-0.18.4/isl/isl_piplib.h --- cloog-0.18.2/isl/isl_piplib.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_piplib.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -/* - * Copyright 2008-2009 Katholieke Universiteit Leuven - * - * Use of this software is governed by the MIT license - * - * Written by Sven Verdoolaege, K.U.Leuven, Departement - * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium - */ - -#ifndef ISL_PIPLIB_H -#define ISL_PIPLIB_H - -#include -#include -#include -#ifndef ISL_PIPLIB -#error "no piplib" -#endif - -#include - -void isl_seq_cpy_to_pip(Entier *dst, isl_int *src, unsigned len); -void isl_seq_cpy_from_pip(isl_int *dst, Entier *src, unsigned len); - -PipMatrix *isl_basic_map_to_pip(struct isl_basic_map *bmap, unsigned pip_param, - unsigned extra_front, unsigned extra_back); - -#endif diff -Nru cloog-0.18.2/isl/isl_point.c cloog-0.18.4/isl/isl_point.c --- cloog-0.18.2/isl/isl_point.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_point.c 2015-07-24 12:23:09.000000000 +0000 @@ -3,9 +3,11 @@ #include #include #include -#include +#include #include #include +#include +#include isl_ctx *isl_point_get_ctx(__isl_keep isl_point *pnt) { @@ -118,10 +120,10 @@ return isl_point_alloc(dim, isl_vec_alloc(dim->ctx, 0)); } -int isl_point_is_void(__isl_keep isl_point *pnt) +isl_bool isl_point_is_void(__isl_keep isl_point *pnt) { if (!pnt) - return -1; + return isl_bool_error; return pnt->vec->size == 0; } @@ -296,12 +298,13 @@ struct isl_foreach_point { struct isl_scan_callback callback; - int (*fn)(__isl_take isl_point *pnt, void *user); + isl_stat (*fn)(__isl_take isl_point *pnt, void *user); void *user; isl_space *dim; }; -static int foreach_point(struct isl_scan_callback *cb, __isl_take isl_vec *sample) +static isl_stat foreach_point(struct isl_scan_callback *cb, + __isl_take isl_vec *sample) { struct isl_foreach_point *fp = (struct isl_foreach_point *)cb; isl_point *pnt; @@ -311,18 +314,18 @@ return fp->fn(pnt, fp->user); } -int isl_set_foreach_point(__isl_keep isl_set *set, - int (*fn)(__isl_take isl_point *pnt, void *user), void *user) +isl_stat isl_set_foreach_point(__isl_keep isl_set *set, + isl_stat (*fn)(__isl_take isl_point *pnt, void *user), void *user) { struct isl_foreach_point fp = { { &foreach_point }, fn, user }; int i; if (!set) - return -1; + return isl_stat_error; fp.dim = isl_set_get_space(set); if (!fp.dim) - return -1; + return isl_stat_error; set = isl_set_copy(set); set = isl_set_cow(set); @@ -339,11 +342,11 @@ isl_set_free(set); isl_space_free(fp.dim); - return 0; + return isl_stat_ok; error: isl_set_free(set); isl_space_free(fp.dim); - return -1; + return isl_stat_error; } /* Return 1 if "bmap" contains the point "point". @@ -351,24 +354,25 @@ * The point is first extended with the divs and then passed * to basic_map_contains. */ -int isl_basic_map_contains_point(__isl_keep isl_basic_map *bmap, +isl_bool isl_basic_map_contains_point(__isl_keep isl_basic_map *bmap, __isl_keep isl_point *point) { int i; struct isl_vec *vec; unsigned dim; - int contains; + isl_bool contains; if (!bmap || !point) - return -1; - isl_assert(bmap->ctx, isl_space_is_equal(bmap->dim, point->dim), return -1); + return isl_bool_error; + isl_assert(bmap->ctx, isl_space_is_equal(bmap->dim, point->dim), + return isl_bool_error); if (bmap->n_div == 0) return isl_basic_map_contains(bmap, point->vec); dim = isl_basic_map_total_dim(bmap) - bmap->n_div; vec = isl_vec_alloc(bmap->ctx, 1 + dim + bmap->n_div); if (!vec) - return -1; + return isl_bool_error; isl_seq_cpy(vec->el, point->vec->el, point->vec->size); for (i = 0; i < bmap->n_div; ++i) { @@ -412,7 +416,8 @@ return -1; } -int isl_set_contains_point(__isl_keep isl_set *set, __isl_keep isl_point *point) +isl_bool isl_set_contains_point(__isl_keep isl_set *set, + __isl_keep isl_point *point) { return isl_map_contains_point((isl_map *)set, point); } @@ -422,6 +427,9 @@ isl_basic_set *bset; isl_basic_set *model; + if (!pnt) + return NULL; + model = isl_basic_set_empty(isl_space_copy(pnt->dim)); bset = isl_basic_set_from_vec(isl_vec_copy(pnt->vec)); bset = isl_basic_set_from_underlying_set(bset, model); diff -Nru cloog-0.18.2/isl/isl_polynomial.c cloog-0.18.4/isl/isl_polynomial.c --- cloog-0.18.2/isl/isl_polynomial.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_polynomial.c 2015-07-24 12:23:09.000000000 +0000 @@ -13,19 +13,21 @@ #include #include #include -#include -#include +#include +#include #include #include #include #include #include #include +#include #include #include #include #include #include +#include static unsigned pos(__isl_keep isl_space *dim, enum isl_dim_type type) { @@ -65,24 +67,24 @@ return (struct isl_upoly_rec *)up; } -int isl_upoly_is_equal(__isl_keep struct isl_upoly *up1, +isl_bool isl_upoly_is_equal(__isl_keep struct isl_upoly *up1, __isl_keep struct isl_upoly *up2) { int i; struct isl_upoly_rec *rec1, *rec2; if (!up1 || !up2) - return -1; + return isl_bool_error; if (up1 == up2) - return 1; + return isl_bool_true; if (up1->var != up2->var) - return 0; + return isl_bool_false; if (isl_upoly_is_cst(up1)) { struct isl_upoly_cst *cst1, *cst2; cst1 = isl_upoly_as_cst(up1); cst2 = isl_upoly_as_cst(up2); if (!cst1 || !cst2) - return -1; + return isl_bool_error; return isl_int_eq(cst1->n, cst2->n) && isl_int_eq(cst1->d, cst2->d); } @@ -90,18 +92,18 @@ rec1 = isl_upoly_as_rec(up1); rec2 = isl_upoly_as_rec(up2); if (!rec1 || !rec2) - return -1; + return isl_bool_error; if (rec1->n != rec2->n) - return 0; + return isl_bool_false; for (i = 0; i < rec1->n; ++i) { - int eq = isl_upoly_is_equal(rec1->p[i], rec2->p[i]); + isl_bool eq = isl_upoly_is_equal(rec1->p[i], rec2->p[i]); if (eq < 0 || !eq) return eq; } - return 1; + return isl_bool_true; } int isl_upoly_is_zero(__isl_keep struct isl_upoly *up) @@ -410,29 +412,29 @@ return isl_space_dim(qp->dim, type); } -int isl_qpolynomial_is_zero(__isl_keep isl_qpolynomial *qp) +isl_bool isl_qpolynomial_is_zero(__isl_keep isl_qpolynomial *qp) { - return qp ? isl_upoly_is_zero(qp->upoly) : -1; + return qp ? isl_upoly_is_zero(qp->upoly) : isl_bool_error; } -int isl_qpolynomial_is_one(__isl_keep isl_qpolynomial *qp) +isl_bool isl_qpolynomial_is_one(__isl_keep isl_qpolynomial *qp) { - return qp ? isl_upoly_is_one(qp->upoly) : -1; + return qp ? isl_upoly_is_one(qp->upoly) : isl_bool_error; } -int isl_qpolynomial_is_nan(__isl_keep isl_qpolynomial *qp) +isl_bool isl_qpolynomial_is_nan(__isl_keep isl_qpolynomial *qp) { - return qp ? isl_upoly_is_nan(qp->upoly) : -1; + return qp ? isl_upoly_is_nan(qp->upoly) : isl_bool_error; } -int isl_qpolynomial_is_infty(__isl_keep isl_qpolynomial *qp) +isl_bool isl_qpolynomial_is_infty(__isl_keep isl_qpolynomial *qp) { - return qp ? isl_upoly_is_infty(qp->upoly) : -1; + return qp ? isl_upoly_is_infty(qp->upoly) : isl_bool_error; } -int isl_qpolynomial_is_neginfty(__isl_keep isl_qpolynomial *qp) +isl_bool isl_qpolynomial_is_neginfty(__isl_keep isl_qpolynomial *qp) { - return qp ? isl_upoly_is_neginfty(qp->upoly) : -1; + return qp ? isl_upoly_is_neginfty(qp->upoly) : isl_bool_error; } int isl_qpolynomial_sgn(__isl_keep isl_qpolynomial *qp) @@ -1110,7 +1112,8 @@ return isl_qpolynomial_dup(qp); } -void *isl_qpolynomial_free(__isl_take isl_qpolynomial *qp) +__isl_null isl_qpolynomial *isl_qpolynomial_free( + __isl_take isl_qpolynomial *qp) { if (!qp) return NULL; @@ -1563,6 +1566,28 @@ return NULL; } +/* Divide "qp" by "v". + */ +__isl_give isl_qpolynomial *isl_qpolynomial_scale_down_val( + __isl_take isl_qpolynomial *qp, __isl_take isl_val *v) +{ + if (!qp || !v) + goto error; + + if (!isl_val_is_rat(v)) + isl_die(isl_qpolynomial_get_ctx(qp), isl_error_invalid, + "expecting rational factor", goto error); + if (isl_val_is_zero(v)) + isl_die(isl_val_get_ctx(v), isl_error_invalid, + "cannot scale down by zero", goto error); + + return isl_qpolynomial_scale_val(qp, isl_val_inv(v)); +error: + isl_val_free(v); + isl_qpolynomial_free(qp); + return NULL; +} + __isl_give isl_qpolynomial *isl_qpolynomial_mul(__isl_take isl_qpolynomial *qp1, __isl_take isl_qpolynomial *qp2) { @@ -1867,13 +1892,20 @@ return NULL; } -int isl_qpolynomial_plain_is_equal(__isl_keep isl_qpolynomial *qp1, +/* Is "qp1" obviously equal to "qp2"? + * + * NaN is not equal to anything, not even to another NaN. + */ +isl_bool isl_qpolynomial_plain_is_equal(__isl_keep isl_qpolynomial *qp1, __isl_keep isl_qpolynomial *qp2) { - int equal; + isl_bool equal; if (!qp1 || !qp2) - return -1; + return isl_bool_error; + + if (isl_qpolynomial_is_nan(qp1) || isl_qpolynomial_is_nan(qp2)) + return isl_bool_false; equal = isl_space_is_equal(qp1->dim, qp2->dim); if (equal < 0 || !equal) @@ -2352,22 +2384,23 @@ return up_set_active(qp->upoly, active, d); } -int isl_qpolynomial_involves_dims(__isl_keep isl_qpolynomial *qp, +isl_bool isl_qpolynomial_involves_dims(__isl_keep isl_qpolynomial *qp, enum isl_dim_type type, unsigned first, unsigned n) { int i; int *active = NULL; - int involves = 0; + isl_bool involves = isl_bool_false; if (!qp) - return -1; + return isl_bool_error; if (n == 0) - return 0; + return isl_bool_false; isl_assert(qp->dim->ctx, - first + n <= isl_qpolynomial_dim(qp, type), return -1); + first + n <= isl_qpolynomial_dim(qp, type), + return isl_bool_error); isl_assert(qp->dim->ctx, type == isl_dim_param || - type == isl_dim_in, return -1); + type == isl_dim_in, return isl_bool_error); active = isl_calloc_array(qp->dim->ctx, int, isl_space_dim(qp->dim, isl_dim_all)); @@ -2378,7 +2411,7 @@ first += isl_space_dim(qp->dim, isl_dim_param); for (i = 0; i < n; ++i) if (active[first + i]) { - involves = 1; + involves = isl_bool_true; break; } @@ -2387,7 +2420,7 @@ return involves; error: free(active); - return -1; + return isl_bool_error; } /* Remove divs that do not appear in the quasi-polynomial, nor in any @@ -2783,7 +2816,6 @@ #define PART isl_pw_qpolynomial #undef PARTS #define PARTS pw_qpolynomial -#define ALIGN_DOMAIN #include @@ -2873,17 +2905,19 @@ return NULL; } -__isl_give struct isl_upoly *isl_upoly_eval( - __isl_take struct isl_upoly *up, __isl_take isl_vec *vec) +__isl_give isl_val *isl_upoly_eval(__isl_take struct isl_upoly *up, + __isl_take isl_vec *vec) { int i; struct isl_upoly_rec *rec; - struct isl_upoly *res; - struct isl_upoly *base; + isl_val *res; + isl_val *base; if (isl_upoly_is_cst(up)) { isl_vec_free(vec); - return up; + res = isl_upoly_get_constant_val(up); + isl_upoly_free(up); + return res; } rec = isl_upoly_as_rec(up); @@ -2892,19 +2926,20 @@ isl_assert(up->ctx, rec->n >= 1, goto error); - base = isl_upoly_rat_cst(up->ctx, vec->el[1 + up->var], vec->el[0]); + base = isl_val_rat_from_isl_int(up->ctx, + vec->el[1 + up->var], vec->el[0]); res = isl_upoly_eval(isl_upoly_copy(rec->p[rec->n - 1]), isl_vec_copy(vec)); for (i = rec->n - 2; i >= 0; --i) { - res = isl_upoly_mul(res, isl_upoly_copy(base)); - res = isl_upoly_sum(res, + res = isl_val_mul(res, isl_val_copy(base)); + res = isl_val_add(res, isl_upoly_eval(isl_upoly_copy(rec->p[i]), isl_vec_copy(vec))); } - isl_upoly_free(base); + isl_val_free(base); isl_upoly_free(up); isl_vec_free(vec); return res; @@ -2914,12 +2949,11 @@ return NULL; } -__isl_give isl_qpolynomial *isl_qpolynomial_eval( - __isl_take isl_qpolynomial *qp, __isl_take isl_point *pnt) +__isl_give isl_val *isl_qpolynomial_eval(__isl_take isl_qpolynomial *qp, + __isl_take isl_point *pnt) { isl_vec *ext; - struct isl_upoly *up; - isl_space *dim; + isl_val *v; if (!qp || !pnt) goto error; @@ -2943,15 +2977,12 @@ } } - up = isl_upoly_eval(isl_upoly_copy(qp->upoly), ext); - if (!up) - goto error; + v = isl_upoly_eval(isl_upoly_copy(qp->upoly), ext); - dim = isl_space_copy(qp->dim); isl_qpolynomial_free(qp); isl_point_free(pnt); - return isl_qpolynomial_alloc(dim, 0, up); + return v; error: isl_qpolynomial_free(qp); isl_point_free(pnt); @@ -2971,79 +3002,6 @@ return cmp; } -int isl_qpolynomial_le_cst(__isl_keep isl_qpolynomial *qp1, - __isl_keep isl_qpolynomial *qp2) -{ - struct isl_upoly_cst *cst1, *cst2; - - if (!qp1 || !qp2) - return -1; - isl_assert(qp1->dim->ctx, isl_upoly_is_cst(qp1->upoly), return -1); - isl_assert(qp2->dim->ctx, isl_upoly_is_cst(qp2->upoly), return -1); - if (isl_qpolynomial_is_nan(qp1)) - return -1; - if (isl_qpolynomial_is_nan(qp2)) - return -1; - cst1 = isl_upoly_as_cst(qp1->upoly); - cst2 = isl_upoly_as_cst(qp2->upoly); - - return isl_upoly_cmp(cst1, cst2) <= 0; -} - -__isl_give isl_qpolynomial *isl_qpolynomial_min_cst( - __isl_take isl_qpolynomial *qp1, __isl_take isl_qpolynomial *qp2) -{ - struct isl_upoly_cst *cst1, *cst2; - int cmp; - - if (!qp1 || !qp2) - goto error; - isl_assert(qp1->dim->ctx, isl_upoly_is_cst(qp1->upoly), goto error); - isl_assert(qp2->dim->ctx, isl_upoly_is_cst(qp2->upoly), goto error); - cst1 = isl_upoly_as_cst(qp1->upoly); - cst2 = isl_upoly_as_cst(qp2->upoly); - cmp = isl_upoly_cmp(cst1, cst2); - - if (cmp <= 0) { - isl_qpolynomial_free(qp2); - } else { - isl_qpolynomial_free(qp1); - qp1 = qp2; - } - return qp1; -error: - isl_qpolynomial_free(qp1); - isl_qpolynomial_free(qp2); - return NULL; -} - -__isl_give isl_qpolynomial *isl_qpolynomial_max_cst( - __isl_take isl_qpolynomial *qp1, __isl_take isl_qpolynomial *qp2) -{ - struct isl_upoly_cst *cst1, *cst2; - int cmp; - - if (!qp1 || !qp2) - goto error; - isl_assert(qp1->dim->ctx, isl_upoly_is_cst(qp1->upoly), goto error); - isl_assert(qp2->dim->ctx, isl_upoly_is_cst(qp2->upoly), goto error); - cst1 = isl_upoly_as_cst(qp1->upoly); - cst2 = isl_upoly_as_cst(qp2->upoly); - cmp = isl_upoly_cmp(cst1, cst2); - - if (cmp >= 0) { - isl_qpolynomial_free(qp2); - } else { - isl_qpolynomial_free(qp1); - qp1 = qp2; - } - return qp1; -error: - isl_qpolynomial_free(qp1); - isl_qpolynomial_free(qp2); - return NULL; -} - __isl_give isl_qpolynomial *isl_qpolynomial_insert_dims( __isl_take isl_qpolynomial *qp, enum isl_dim_type type, unsigned first, unsigned n) @@ -3259,7 +3217,7 @@ return qp; error: isl_aff_free(aff); - return NULL; + return isl_qpolynomial_free(qp); } __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_from_pw_aff( @@ -3783,7 +3741,7 @@ } __isl_give isl_term *isl_upoly_foreach_term(__isl_keep struct isl_upoly *up, - int (*fn)(__isl_take isl_term *term, void *user), + isl_stat (*fn)(__isl_take isl_term *term, void *user), __isl_take isl_term *term, void *user) { int i; @@ -3835,23 +3793,23 @@ return NULL; } -int isl_qpolynomial_foreach_term(__isl_keep isl_qpolynomial *qp, - int (*fn)(__isl_take isl_term *term, void *user), void *user) +isl_stat isl_qpolynomial_foreach_term(__isl_keep isl_qpolynomial *qp, + isl_stat (*fn)(__isl_take isl_term *term, void *user), void *user) { isl_term *term; if (!qp) - return -1; + return isl_stat_error; term = isl_term_alloc(isl_space_copy(qp->dim), isl_mat_copy(qp->div)); if (!term) - return -1; + return isl_stat_error; term = isl_upoly_foreach_term(qp->upoly, fn, term, user); isl_term_free(term); - return term ? 0 : -1; + return term ? isl_stat_ok : isl_stat_error; } __isl_give isl_qpolynomial *isl_qpolynomial_from_term(__isl_take isl_term *term) @@ -3996,29 +3954,29 @@ struct isl_opt_data { isl_qpolynomial *qp; int first; - isl_qpolynomial *opt; + isl_val *opt; int max; }; -static int opt_fn(__isl_take isl_point *pnt, void *user) +static isl_stat opt_fn(__isl_take isl_point *pnt, void *user) { struct isl_opt_data *data = (struct isl_opt_data *)user; - isl_qpolynomial *val; + isl_val *val; val = isl_qpolynomial_eval(isl_qpolynomial_copy(data->qp), pnt); if (data->first) { data->first = 0; data->opt = val; } else if (data->max) { - data->opt = isl_qpolynomial_max_cst(data->opt, val); + data->opt = isl_val_max(data->opt, val); } else { - data->opt = isl_qpolynomial_min_cst(data->opt, val); + data->opt = isl_val_min(data->opt, val); } - return 0; + return isl_stat_ok; } -__isl_give isl_qpolynomial *isl_qpolynomial_opt_on_domain( +__isl_give isl_val *isl_qpolynomial_opt_on_domain( __isl_take isl_qpolynomial *qp, __isl_take isl_set *set, int max) { struct isl_opt_data data = { NULL, 1, NULL, max }; @@ -4028,7 +3986,9 @@ if (isl_upoly_is_cst(qp->upoly)) { isl_set_free(set); - return qp; + data.opt = isl_qpolynomial_get_constant_val(qp); + isl_qpolynomial_free(qp); + return data.opt; } set = fix_inactive(set, qp); @@ -4037,10 +3997,8 @@ if (isl_set_foreach_point(set, opt_fn, &data) < 0) goto error; - if (data.first) { - isl_space *space = isl_qpolynomial_get_domain_space(qp); - data.opt = isl_qpolynomial_zero_on_domain(space); - } + if (data.first) + data.opt = isl_val_zero(isl_set_get_ctx(set)); isl_set_free(set); isl_qpolynomial_free(qp); @@ -4048,7 +4006,7 @@ error: isl_set_free(set); isl_qpolynomial_free(qp); - isl_qpolynomial_free(data.opt); + isl_val_free(data.opt); return NULL; } @@ -4109,37 +4067,12 @@ return NULL; } -static int neg_entry(void **entry, void *user) -{ - isl_pw_qpolynomial **pwqp = (isl_pw_qpolynomial **)entry; - - *pwqp = isl_pw_qpolynomial_neg(*pwqp); - - return *pwqp ? 0 : -1; -} - -__isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_neg( - __isl_take isl_union_pw_qpolynomial *upwqp) -{ - upwqp = isl_union_pw_qpolynomial_cow(upwqp); - if (!upwqp) - return NULL; - - if (isl_hash_table_foreach(upwqp->dim->ctx, &upwqp->table, - &neg_entry, NULL) < 0) - goto error; - - return upwqp; -error: - isl_union_pw_qpolynomial_free(upwqp); - return NULL; -} - __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_mul( __isl_take isl_union_pw_qpolynomial *upwqp1, __isl_take isl_union_pw_qpolynomial *upwqp2) { - return match_bin_op(upwqp1, upwqp2, &isl_pw_qpolynomial_mul); + return isl_union_pw_qpolynomial_match_bin_op(upwqp1, upwqp2, + &isl_pw_qpolynomial_mul); } /* Reorder the columns of the given div definitions according to the @@ -4285,14 +4218,14 @@ return NULL; } -static int split_periods(__isl_take isl_set *set, +static isl_stat split_periods(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, void *user); /* Create a slice of the domain "set" such that integer division "div" * has the fixed value "v" and add the results to data->res, * replacing the integer division by "v" in "qp". */ -static int set_div(__isl_take isl_set *set, +static isl_stat set_div(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, int div, isl_int v, struct isl_split_periods_data *data) { @@ -4331,7 +4264,7 @@ * has a fixed value (ranging from "min" to "max") on each slice * and add the results to data->res. */ -static int split_div(__isl_take isl_set *set, +static isl_stat split_div(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, int div, isl_int min, isl_int max, struct isl_split_periods_data *data) { @@ -4344,11 +4277,11 @@ } isl_set_free(set); isl_qpolynomial_free(qp); - return 0; + return isl_stat_ok; error: isl_set_free(set); isl_qpolynomial_free(qp); - return -1; + return isl_stat_error; } /* If "qp" refers to any integer division @@ -4357,7 +4290,7 @@ * Add the results (or the original if no splitting occurs) * to data->res. */ -static int split_periods(__isl_take isl_set *set, +static isl_stat split_periods(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, void *user) { int i; @@ -4365,7 +4298,7 @@ struct isl_split_periods_data *data; isl_int min, max; int total; - int r = 0; + isl_stat r = isl_stat_ok; data = (struct isl_split_periods_data *)user; @@ -4375,7 +4308,7 @@ if (qp->div->n_row == 0) { pwqp = isl_pw_qpolynomial_alloc(set, qp); data->res = isl_pw_qpolynomial_add_disjoint(data->res, pwqp); - return 0; + return isl_stat_ok; } isl_int_init(min); @@ -4428,7 +4361,7 @@ error: isl_set_free(set); isl_qpolynomial_free(qp); - return -1; + return isl_stat_error; } /* If any quasi-polynomial in pwqp refers to any integer division @@ -4837,14 +4770,14 @@ return NULL; } -static int poly_entry(void **entry, void *user) +static isl_stat poly_entry(void **entry, void *user) { int *sign = user; isl_pw_qpolynomial **pwqp = (isl_pw_qpolynomial **)entry; *pwqp = isl_pw_qpolynomial_to_polynomial(*pwqp, *sign); - return *pwqp ? 0 : -1; + return *pwqp ? isl_stat_ok : isl_stat_error; } __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_to_polynomial( @@ -4854,7 +4787,7 @@ if (!upwqp) return NULL; - if (isl_hash_table_foreach(upwqp->dim->ctx, &upwqp->table, + if (isl_hash_table_foreach(upwqp->space->ctx, &upwqp->table, &poly_entry, &sign) < 0) goto error; diff -Nru cloog-0.18.2/isl/isl_polynomial_private.h cloog-0.18.4/isl/isl_polynomial_private.h --- cloog-0.18.2/isl/isl_polynomial_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_polynomial_private.h 2015-07-24 12:23:09.000000000 +0000 @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -95,6 +96,8 @@ struct isl_pw_qpolynomial_fold_piece p[1]; }; +void isl_term_get_num(__isl_keep isl_term *term, isl_int *n); + __isl_give struct isl_upoly *isl_upoly_zero(struct isl_ctx *ctx); __isl_give struct isl_upoly *isl_upoly_copy(__isl_keep struct isl_upoly *up); __isl_give struct isl_upoly *isl_upoly_cow(__isl_take struct isl_upoly *up); @@ -122,23 +125,20 @@ __isl_give isl_qpolynomial *isl_qpolynomial_cst_on_domain(__isl_take isl_space *dim, isl_int v); +__isl_give isl_qpolynomial *isl_qpolynomial_rat_cst_on_domain( + __isl_take isl_space *space, const isl_int n, const isl_int d); __isl_give isl_qpolynomial *isl_qpolynomial_var_pow_on_domain(__isl_take isl_space *dim, int pos, int power); -int isl_qpolynomial_is_one(__isl_keep isl_qpolynomial *qp); +isl_bool isl_qpolynomial_is_one(__isl_keep isl_qpolynomial *qp); int isl_qpolynomial_is_affine(__isl_keep isl_qpolynomial *qp); +int isl_qpolynomial_is_cst(__isl_keep isl_qpolynomial *qp, + isl_int *n, isl_int *d); __isl_give isl_qpolynomial *isl_qpolynomial_add_on_domain( __isl_keep isl_set *dom, __isl_take isl_qpolynomial *qp1, __isl_take isl_qpolynomial *qp2); -int isl_qpolynomial_le_cst(__isl_keep isl_qpolynomial *qp1, - __isl_keep isl_qpolynomial *qp2); -__isl_give isl_qpolynomial *isl_qpolynomial_max_cst( - __isl_take isl_qpolynomial *qp1, __isl_take isl_qpolynomial *qp2); -__isl_give isl_qpolynomial *isl_qpolynomial_min_cst( - __isl_take isl_qpolynomial *qp1, __isl_take isl_qpolynomial *qp2); - int isl_qpolynomial_degree(__isl_keep isl_qpolynomial *poly); __isl_give isl_qpolynomial *isl_qpolynomial_coeff( __isl_keep isl_qpolynomial *poly, @@ -161,7 +161,7 @@ __isl_take isl_pw_qpolynomial *pwqp, enum isl_dim_type type, unsigned first, unsigned n); -__isl_give isl_qpolynomial *isl_qpolynomial_opt_on_domain( +__isl_give isl_val *isl_qpolynomial_opt_on_domain( __isl_take isl_qpolynomial *qp, __isl_take isl_set *set, int max); enum isl_fold isl_fold_type_negate(enum isl_fold type); @@ -183,7 +183,7 @@ __isl_take isl_qpolynomial_fold *fold1, __isl_take isl_qpolynomial_fold *fold2); -__isl_give isl_qpolynomial *isl_qpolynomial_fold_opt_on_domain( +__isl_give isl_val *isl_qpolynomial_fold_opt_on_domain( __isl_take isl_qpolynomial_fold *fold, __isl_take isl_set *set, int max); int isl_pw_qpolynomial_fold_covers(__isl_keep isl_pw_qpolynomial_fold *pwf1, @@ -219,6 +219,8 @@ __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_realign_domain( __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_reordering *r); +__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_reset_space( + __isl_take isl_pw_qpolynomial *pwqp, __isl_take isl_space *space); __isl_give isl_qpolynomial *isl_qpolynomial_reset_domain_space( __isl_take isl_qpolynomial *qp, __isl_take isl_space *dim); __isl_give isl_qpolynomial *isl_qpolynomial_reset_space_and_domain( @@ -231,3 +233,21 @@ __isl_take isl_space *domain); __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_reset_domain_space( __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_space *dim); + +void isl_qpolynomial_get_den(__isl_keep isl_qpolynomial *qp, isl_int *d); +__isl_give isl_qpolynomial *isl_qpolynomial_add_isl_int( + __isl_take isl_qpolynomial *qp, isl_int v); +__isl_give isl_qpolynomial *isl_qpolynomial_mul_isl_int( + __isl_take isl_qpolynomial *qp, isl_int v); +__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_mul_isl_int( + __isl_take isl_pw_qpolynomial *pwqp, isl_int v); + +__isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_mul_isl_int( + __isl_take isl_qpolynomial_fold *fold, isl_int v); +__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_mul_isl_int( + __isl_take isl_pw_qpolynomial_fold *pwf, isl_int v); +__isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_mul_isl_int( + __isl_take isl_union_pw_qpolynomial *upwqp, isl_int v); +__isl_give isl_union_pw_qpolynomial_fold * +isl_union_pw_qpolynomial_fold_mul_isl_int( + __isl_take isl_union_pw_qpolynomial_fold *upwf, isl_int v); diff -Nru cloog-0.18.2/isl/isl_printer.c cloog-0.18.4/isl/isl_printer.c --- cloog-0.18.2/isl/isl_printer.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_printer.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,9 +1,11 @@ #include +#include #include static __isl_give isl_printer *file_start_line(__isl_take isl_printer *p) { - fprintf(p->file, "%*s%s", p->indent, "", p->prefix ? p->prefix : ""); + fprintf(p->file, "%s%*s%s", p->indent_prefix ? p->indent_prefix : "", + p->indent, "", p->prefix ? p->prefix : ""); return p; } @@ -97,6 +99,8 @@ static __isl_give isl_printer *str_start_line(__isl_take isl_printer *p) { + if (p->indent_prefix) + p = str_print(p, p->indent_prefix, strlen(p->indent_prefix)); p = str_print_indent(p, p->indent); if (p->prefix) p = str_print(p, p->prefix, strlen(p->prefix)); @@ -114,6 +118,7 @@ static __isl_give isl_printer *str_flush(__isl_take isl_printer *p) { p->buf_n = 0; + p->buf[p->buf_n] = '\0'; return p; } @@ -208,7 +213,7 @@ __isl_give isl_printer *isl_printer_to_file(isl_ctx *ctx, FILE *file) { - struct isl_printer *p = isl_alloc_type(ctx, struct isl_printer); + struct isl_printer *p = isl_calloc_type(ctx, struct isl_printer); if (!p) return NULL; p->ctx = ctx; @@ -220,16 +225,18 @@ p->buf_size = 0; p->indent = 0; p->output_format = ISL_FORMAT_ISL; + p->indent_prefix = NULL; p->prefix = NULL; p->suffix = NULL; p->width = 0; + p->yaml_style = ISL_YAML_STYLE_FLOW; return p; } __isl_give isl_printer *isl_printer_to_str(isl_ctx *ctx) { - struct isl_printer *p = isl_alloc_type(ctx, struct isl_printer); + struct isl_printer *p = isl_calloc_type(ctx, struct isl_printer); if (!p) return NULL; p->ctx = ctx; @@ -244,9 +251,11 @@ p->buf_size = 256; p->indent = 0; p->output_format = ISL_FORMAT_ISL; + p->indent_prefix = NULL; p->prefix = NULL; p->suffix = NULL; p->width = 0; + p->yaml_style = ISL_YAML_STYLE_FLOW; return p; error: @@ -254,11 +263,15 @@ return NULL; } -void *isl_printer_free(__isl_take isl_printer *p) +__isl_null isl_printer *isl_printer_free(__isl_take isl_printer *p) { if (!p) return NULL; free(p->buf); + free(p->indent_prefix); + free(p->prefix); + free(p->suffix); + free(p->yaml_state); isl_ctx_deref(p->ctx); free(p); @@ -315,13 +328,28 @@ return p; } +/* Replace the indent prefix of "p" by "prefix". + */ +__isl_give isl_printer *isl_printer_set_indent_prefix(__isl_take isl_printer *p, + const char *prefix) +{ + if (!p) + return NULL; + + free(p->indent_prefix); + p->indent_prefix = prefix ? strdup(prefix) : NULL; + + return p; +} + __isl_give isl_printer *isl_printer_set_prefix(__isl_take isl_printer *p, const char *prefix) { if (!p) return NULL; - p->prefix = prefix; + free(p->prefix); + p->prefix = prefix ? strdup(prefix) : NULL; return p; } @@ -332,7 +360,8 @@ if (!p) return NULL; - p->suffix = suffix; + free(p->suffix); + p->suffix = suffix ? strdup(suffix) : NULL; return p; } @@ -355,6 +384,161 @@ return p->output_format; } +/* Set the YAML style of "p" to "yaml_style" and return the updated printer. + */ +__isl_give isl_printer *isl_printer_set_yaml_style(__isl_take isl_printer *p, + int yaml_style) +{ + if (!p) + return NULL; + + p->yaml_style = yaml_style; + + return p; +} + +/* Return the YAML style of "p" or -1 on error. + */ +int isl_printer_get_yaml_style(__isl_keep isl_printer *p) +{ + if (!p) + return -1; + return p->yaml_style; +} + +/* Push "state" onto the stack of currently active YAML elements and + * return the updated printer. + */ +static __isl_give isl_printer *push_state(__isl_take isl_printer *p, + enum isl_yaml_state state) +{ + if (!p) + return NULL; + + if (p->yaml_size < p->yaml_depth + 1) { + enum isl_yaml_state *state; + state = isl_realloc_array(p->ctx, p->yaml_state, + enum isl_yaml_state, p->yaml_depth + 1); + if (!state) + return isl_printer_free(p); + p->yaml_state = state; + p->yaml_size = p->yaml_depth + 1; + } + + p->yaml_state[p->yaml_depth] = state; + p->yaml_depth++; + + return p; +} + +/* Remove the innermost active YAML element from the stack and + * return the updated printer. + */ +static __isl_give isl_printer *pop_state(__isl_take isl_printer *p) +{ + if (!p) + return NULL; + p->yaml_depth--; + return p; +} + +/* Set the state of the innermost active YAML element to "state" and + * return the updated printer. + */ +static __isl_give isl_printer *update_state(__isl_take isl_printer *p, + enum isl_yaml_state state) +{ + if (!p) + return NULL; + if (p->yaml_depth < 1) + isl_die(isl_printer_get_ctx(p), isl_error_invalid, + "not in YAML construct", return isl_printer_free(p)); + + p->yaml_state[p->yaml_depth - 1] = state; + + return p; +} + +/* Return the state of the innermost active YAML element. + * Return isl_yaml_none if we are not inside any YAML element. + */ +static enum isl_yaml_state current_state(__isl_keep isl_printer *p) +{ + if (!p) + return isl_yaml_none; + if (p->yaml_depth < 1) + return isl_yaml_none; + return p->yaml_state[p->yaml_depth - 1]; +} + +/* If we are printing a YAML document and we are at the start of an element, + * print whatever is needed before we can print the actual element and + * keep track of the fact that we are now printing the element. + * If "eol" is set, then whatever we print is going to be the last + * thing that gets printed on this line. + * + * If we are about the print the first key of a mapping, then nothing + * extra needs to be printed. For any other key, however, we need + * to either move to the next line (in block format) or print a comma + * (in flow format). + * Before printing a value in a mapping, we need to print a colon. + * + * For sequences, in flow format, we only need to print a comma + * for each element except the first. + * In block format, before the first element in the sequence, + * we move to a new line, print a dash and increase the indentation. + * Before any other element, we print a dash on a new line, + * temporarily moving the indentation back. + */ +static __isl_give isl_printer *enter_state(__isl_take isl_printer *p, + int eol) +{ + enum isl_yaml_state state; + + if (!p) + return NULL; + + state = current_state(p); + if (state == isl_yaml_mapping_val_start) { + if (eol) + p = p->ops->print_str(p, ":"); + else + p = p->ops->print_str(p, ": "); + p = update_state(p, isl_yaml_mapping_val); + } else if (state == isl_yaml_mapping_first_key_start) { + p = update_state(p, isl_yaml_mapping_key); + } else if (state == isl_yaml_mapping_key_start) { + if (p->yaml_style == ISL_YAML_STYLE_FLOW) + p = p->ops->print_str(p, ", "); + else { + p = p->ops->end_line(p); + p = p->ops->start_line(p); + } + p = update_state(p, isl_yaml_mapping_key); + } else if (state == isl_yaml_sequence_first_start) { + if (p->yaml_style != ISL_YAML_STYLE_FLOW) { + p = p->ops->end_line(p); + p = p->ops->start_line(p); + p = p->ops->print_str(p, "- "); + p = isl_printer_indent(p, 2); + } + p = update_state(p, isl_yaml_sequence); + } else if (state == isl_yaml_sequence_start) { + if (p->yaml_style == ISL_YAML_STYLE_FLOW) + p = p->ops->print_str(p, ", "); + else { + p = p->ops->end_line(p); + p = isl_printer_indent(p, -2); + p = p->ops->start_line(p); + p = p->ops->print_str(p, "- "); + p = isl_printer_indent(p, 2); + } + p = update_state(p, isl_yaml_sequence); + } + + return p; +} + __isl_give isl_printer *isl_printer_print_str(__isl_take isl_printer *p, const char *s) { @@ -362,13 +546,16 @@ return NULL; if (!s) return isl_printer_free(p); - + p = enter_state(p, 0); + if (!p) + return NULL; return p->ops->print_str(p, s); } __isl_give isl_printer *isl_printer_print_double(__isl_take isl_printer *p, double d) { + p = enter_state(p, 0); if (!p) return NULL; @@ -377,6 +564,7 @@ __isl_give isl_printer *isl_printer_print_int(__isl_take isl_printer *p, int i) { + p = enter_state(p, 0); if (!p) return NULL; @@ -386,6 +574,7 @@ __isl_give isl_printer *isl_printer_print_isl_int(__isl_take isl_printer *p, isl_int i) { + p = enter_state(p, 0); if (!p) return NULL; @@ -422,3 +611,154 @@ return p->ops->flush(p); } + +/* Start a YAML mapping and push a new state to reflect that we + * are about to print the first key in a mapping. + * + * In flow style, print the opening brace. + * In block style, move to the next line with an increased indentation, + * except if this is the outer mapping or if we are inside a sequence + * (in which case we have already increased the indentation and we want + * to print the first key on the same line as the dash). + */ +__isl_give isl_printer *isl_printer_yaml_start_mapping( + __isl_take isl_printer *p) +{ + enum isl_yaml_state state; + + p = enter_state(p, p->yaml_style == ISL_YAML_STYLE_BLOCK); + if (!p) + return NULL; + state = current_state(p); + if (p->yaml_style == ISL_YAML_STYLE_FLOW) + p = p->ops->print_str(p, "{ "); + else if (state != isl_yaml_none && state != isl_yaml_sequence) { + p = p->ops->end_line(p); + p = isl_printer_indent(p, 2); + p = p->ops->start_line(p); + } + p = push_state(p, isl_yaml_mapping_first_key_start); + return p; +} + +/* Finish a YAML mapping and pop it from the state stack. + * + * In flow style, print the closing brace. + * + * In block style, first check if we are still in the + * isl_yaml_mapping_first_key_start state. If so, we have not printed + * anything yet, so print "{}" to indicate an empty mapping. + * If we increased the indentation in isl_printer_yaml_start_mapping, + * then decrease it again. + * If this is the outer mapping then print a newline. + */ +__isl_give isl_printer *isl_printer_yaml_end_mapping( + __isl_take isl_printer *p) +{ + enum isl_yaml_state state; + + state = current_state(p); + p = pop_state(p); + if (!p) + return NULL; + if (p->yaml_style == ISL_YAML_STYLE_FLOW) + return p->ops->print_str(p, " }"); + if (state == isl_yaml_mapping_first_key_start) + p = p->ops->print_str(p, "{}"); + if (!p) + return NULL; + state = current_state(p); + if (state != isl_yaml_none && state != isl_yaml_sequence) + p = isl_printer_indent(p, -2); + if (state == isl_yaml_none) + p = p->ops->end_line(p); + return p; +} + +/* Start a YAML sequence and push a new state to reflect that we + * are about to print the first element in a sequence. + * + * In flow style, print the opening bracket. + */ +__isl_give isl_printer *isl_printer_yaml_start_sequence( + __isl_take isl_printer *p) +{ + p = enter_state(p, p->yaml_style == ISL_YAML_STYLE_BLOCK); + p = push_state(p, isl_yaml_sequence_first_start); + if (!p) + return NULL; + if (p->yaml_style == ISL_YAML_STYLE_FLOW) + p = p->ops->print_str(p, "[ "); + return p; +} + +/* Finish a YAML sequence and pop it from the state stack. + * + * In flow style, print the closing bracket. + * + * In block style, check if we are still in the + * isl_yaml_sequence_first_start state. If so, we have not printed + * anything yet, so print "[]" or " []" to indicate an empty sequence. + * We print the extra space when we instructed enter_state not + * to print a space at the end of the line. + * Otherwise, undo the increase in indentation performed by + * enter_state when moving away from the isl_yaml_sequence_first_start + * state. + * If this is the outer sequence then print a newline. + */ +__isl_give isl_printer *isl_printer_yaml_end_sequence( + __isl_take isl_printer *p) +{ + enum isl_yaml_state state, up; + + state = current_state(p); + p = pop_state(p); + if (!p) + return NULL; + if (p->yaml_style == ISL_YAML_STYLE_FLOW) + return p->ops->print_str(p, " ]"); + up = current_state(p); + if (state == isl_yaml_sequence_first_start) { + if (up == isl_yaml_mapping_val) + p = p->ops->print_str(p, " []"); + else + p = p->ops->print_str(p, "[]"); + } else { + p = isl_printer_indent(p, -2); + } + if (!p) + return NULL; + state = current_state(p); + if (state == isl_yaml_none) + p = p->ops->end_line(p); + return p; +} + +/* Mark the fact that the current element is finished and that + * the next output belongs to the next element. + * In particular, if we are printing a key, then prepare for + * printing the subsequent value. If we are printing a value, + * prepare for printing the next key. If we are printing an + * element in a sequence, prepare for printing the next element. + */ +__isl_give isl_printer *isl_printer_yaml_next(__isl_take isl_printer *p) +{ + enum isl_yaml_state state; + + if (!p) + return NULL; + if (p->yaml_depth < 1) + isl_die(isl_printer_get_ctx(p), isl_error_invalid, + "not in YAML construct", return isl_printer_free(p)); + + state = current_state(p); + if (state == isl_yaml_mapping_key) + state = isl_yaml_mapping_val_start; + else if (state == isl_yaml_mapping_val) + state = isl_yaml_mapping_key_start; + else if (state == isl_yaml_sequence) + state = isl_yaml_sequence_start; + p = update_state(p, state); + + return p; +} diff -Nru cloog-0.18.2/isl/isl_printer_private.h cloog-0.18.4/isl/isl_printer_private.h --- cloog-0.18.2/isl/isl_printer_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_printer_private.h 2015-07-24 12:23:09.000000000 +0000 @@ -1,7 +1,18 @@ #include +#include struct isl_printer_ops; +/* A printer to a file or a string. + * + * yaml_style is the YAML style in which the next elements should + * be printed and may be either ISL_YAML_STYLE_BLOCK or ISL_YAML_STYLE_FLOW, + * with ISL_YAML_STYLE_FLOW being the default. + * yaml_state keeps track of the currently active YAML elements. + * yaml_size is the size of this arrays, while yaml_depth + * is the number of elements currently in use. + * yaml_state may be NULL if no YAML printing is being performed. + */ struct isl_printer { struct isl_ctx *ctx; struct isl_printer_ops *ops; @@ -11,7 +22,13 @@ char *buf; int indent; int output_format; - const char *prefix; - const char *suffix; + char *indent_prefix; + char *prefix; + char *suffix; int width; + + int yaml_style; + int yaml_depth; + int yaml_size; + enum isl_yaml_state *yaml_state; }; diff -Nru cloog-0.18.2/isl/isl_pw_templ.c cloog-0.18.4/isl/isl_pw_templ.c --- cloog-0.18.2/isl/isl_pw_templ.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_pw_templ.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,3 +1,16 @@ +/* + * Copyright 2010-2011 INRIA Saclay + * Copyright 2011 Sven Verdoolaege + * Copyright 2012-2014 Ecole Normale Superieure + * + * Use of this software is governed by the MIT license + * + * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, + * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, + * 91893 Orsay, France + * and Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France + */ + #include #include @@ -157,7 +170,7 @@ return pw; } -void *FN(PW,free)(__isl_take PW *pw) +__isl_null PW *FN(PW,free)(__isl_take PW *pw) { int i; @@ -182,9 +195,10 @@ return pw ? isl_space_get_dim_name(pw->dim, type, pos) : NULL; } -int FN(PW,has_dim_id)(__isl_keep PW *pw, enum isl_dim_type type, unsigned pos) +isl_bool FN(PW,has_dim_id)(__isl_keep PW *pw, enum isl_dim_type type, + unsigned pos) { - return pw ? isl_space_has_dim_id(pw->dim, type, pos) : -1; + return pw ? isl_space_has_dim_id(pw->dim, type, pos) : isl_bool_error; } __isl_give isl_id *FN(PW,get_dim_id)(__isl_keep PW *pw, enum isl_dim_type type, @@ -193,9 +207,9 @@ return pw ? isl_space_get_dim_id(pw->dim, type, pos) : NULL; } -int FN(PW,has_tuple_name)(__isl_keep PW *pw, enum isl_dim_type type) +isl_bool FN(PW,has_tuple_name)(__isl_keep PW *pw, enum isl_dim_type type) { - return pw ? isl_space_has_tuple_name(pw->dim, type) : -1; + return pw ? isl_space_has_tuple_name(pw->dim, type) : isl_bool_error; } const char *FN(PW,get_tuple_name)(__isl_keep PW *pw, enum isl_dim_type type) @@ -203,9 +217,9 @@ return pw ? isl_space_get_tuple_name(pw->dim, type) : NULL; } -int FN(PW,has_tuple_id)(__isl_keep PW *pw, enum isl_dim_type type) +isl_bool FN(PW,has_tuple_id)(__isl_keep PW *pw, enum isl_dim_type type) { - return pw ? isl_space_has_tuple_id(pw->dim, type) : -1; + return pw ? isl_space_has_tuple_id(pw->dim, type) : isl_bool_error; } __isl_give isl_id *FN(PW,get_tuple_id)(__isl_keep PW *pw, enum isl_dim_type type) @@ -213,10 +227,10 @@ return pw ? isl_space_get_tuple_id(pw->dim, type) : NULL; } -int FN(PW,IS_ZERO)(__isl_keep PW *pw) +isl_bool FN(PW,IS_ZERO)(__isl_keep PW *pw) { if (!pw) - return -1; + return isl_bool_error; return pw->n == 0; } @@ -631,7 +645,9 @@ return pw; } +#endif +#ifndef NO_SUB __isl_give PW *FN(PW,sub)(__isl_take PW *pw1, __isl_take PW *pw2) { return FN(PW,add)(pw1, FN(PW,neg)(pw2)); @@ -639,14 +655,13 @@ #endif #ifndef NO_EVAL -__isl_give isl_qpolynomial *FN(PW,eval)(__isl_take PW *pw, - __isl_take isl_point *pnt) +__isl_give isl_val *FN(PW,eval)(__isl_take PW *pw, __isl_take isl_point *pnt) { int i; int found = 0; isl_ctx *ctx; isl_space *pnt_dim = NULL; - isl_qpolynomial *qp; + isl_val *v; if (!pw || !pnt) goto error; @@ -663,14 +678,14 @@ break; } if (found) - qp = FN(EL,eval)(FN(EL,copy)(pw->p[i].FIELD), + v = FN(EL,eval)(FN(EL,copy)(pw->p[i].FIELD), isl_point_copy(pnt)); else - qp = isl_qpolynomial_zero_on_domain(FN(PW,get_domain_space)(pw)); + v = isl_val_zero(ctx); FN(PW,free)(pw); isl_space_free(pnt_dim); isl_point_free(pnt); - return qp; + return v; error: FN(PW,free)(pw); isl_space_free(pnt_dim); @@ -679,6 +694,13 @@ } #endif +/* Return the parameter domain of "pw". + */ +__isl_give isl_set *FN(PW,params)(__isl_take PW *pw) +{ + return isl_set_params(FN(PW,domain)(pw)); +} + __isl_give isl_set *FN(PW,domain)(__isl_take PW *pw) { int i; @@ -727,11 +749,65 @@ return 0; } +/* Convert a piecewise expression defined over a parameter domain + * into one that is defined over a zero-dimensional set. + */ +__isl_give PW *FN(PW,from_range)(__isl_take PW *pw) +{ + isl_space *space; + + if (!pw) + return NULL; + if (!isl_space_is_set(pw->dim)) + isl_die(FN(PW,get_ctx)(pw), isl_error_invalid, + "not living in a set space", return FN(PW,free)(pw)); + + space = FN(PW,get_space)(pw); + space = isl_space_from_range(space); + pw = FN(PW,reset_space)(pw, space); + + return pw; +} + +/* Fix the value of the given parameter or domain dimension of "pw" + * to be equal to "value". + */ +__isl_give PW *FN(PW,fix_si)(__isl_take PW *pw, enum isl_dim_type type, + unsigned pos, int value) +{ + int i; + + if (!pw) + return NULL; + + if (type == isl_dim_out) + isl_die(FN(PW,get_ctx)(pw), isl_error_invalid, + "cannot fix output dimension", return FN(PW,free)(pw)); + + if (pw->n == 0) + return pw; + + if (type == isl_dim_in) + type = isl_dim_set; + + pw = FN(PW,cow)(pw); + if (!pw) + return FN(PW,free)(pw); + + for (i = pw->n - 1; i >= 0; --i) { + pw->p[i].set = isl_set_fix_si(pw->p[i].set, type, pos, value); + if (FN(PW,exploit_equalities_and_remove_if_empty)(pw, i) < 0) + return FN(PW,free)(pw); + } + + return pw; +} + /* Restrict the domain of "pw" by combining each cell * with "set" through a call to "fn", where "fn" may be - * isl_set_intersect or isl_set_intersect_params. + * isl_set_intersect, isl_set_intersect_params or isl_set_subtract. */ -static __isl_give PW *FN(PW,intersect_aligned)(__isl_take PW *pw, +static __isl_give PW *FN(PW,restrict_domain_aligned)(__isl_take PW *pw, __isl_take isl_set *set, __isl_give isl_set *(*fn)(__isl_take isl_set *set1, __isl_take isl_set *set2)) @@ -767,7 +843,7 @@ static __isl_give PW *FN(PW,intersect_domain_aligned)(__isl_take PW *pw, __isl_take isl_set *set) { - return FN(PW,intersect_aligned)(pw, set, &isl_set_intersect); + return FN(PW,restrict_domain_aligned)(pw, set, &isl_set_intersect); } __isl_give PW *FN(PW,intersect_domain)(__isl_take PW *pw, @@ -780,7 +856,8 @@ static __isl_give PW *FN(PW,intersect_params_aligned)(__isl_take PW *pw, __isl_take isl_set *set) { - return FN(PW,intersect_aligned)(pw, set, &isl_set_intersect_params); + return FN(PW,restrict_domain_aligned)(pw, set, + &isl_set_intersect_params); } /* Intersect the domain of "pw" with the parameter domain "context". @@ -792,6 +869,65 @@ &FN(PW,intersect_params_aligned)); } +/* Subtract "domain' from the domain of "pw", assuming their + * parameters have been aligned. + */ +static __isl_give PW *FN(PW,subtract_domain_aligned)(__isl_take PW *pw, + __isl_take isl_set *domain) +{ + return FN(PW,restrict_domain_aligned)(pw, domain, &isl_set_subtract); +} + +/* Subtract "domain' from the domain of "pw". + */ +__isl_give PW *FN(PW,subtract_domain)(__isl_take PW *pw, + __isl_take isl_set *domain) +{ + return FN(PW,align_params_pw_set_and)(pw, domain, + &FN(PW,subtract_domain_aligned)); +} + +/* Compute the gist of "pw" with respect to the domain constraints + * of "context" for the case where the domain of the last element + * of "pw" is equal to "context". + * Call "fn_el" to compute the gist of this element, replace + * its domain by the universe and drop all other elements + * as their domains are necessarily disjoint from "context". + */ +static __isl_give PW *FN(PW,gist_last)(__isl_take PW *pw, + __isl_take isl_set *context, + __isl_give EL *(*fn_el)(__isl_take EL *el, __isl_take isl_set *set)) +{ + int i; + isl_space *space; + + for (i = 0; i < pw->n - 1; ++i) { + isl_set_free(pw->p[i].set); + FN(EL,free)(pw->p[i].FIELD); + } + pw->p[0].FIELD = pw->p[pw->n - 1].FIELD; + pw->p[0].set = pw->p[pw->n - 1].set; + pw->n = 1; + + space = isl_set_get_space(context); + pw->p[0].FIELD = fn_el(pw->p[0].FIELD, context); + context = isl_set_universe(space); + isl_set_free(pw->p[0].set); + pw->p[0].set = context; + + if (!pw->p[0].FIELD || !pw->p[0].set) + return FN(PW,free)(pw); + + return pw; +} + +/* Compute the gist of "pw" with respect to the domain constraints + * of "context". Call "fn_el" to compute the gist of the elements + * and "fn_dom" to compute the gist of the domains. + * + * If the piecewise expression is empty or the context is the universe, + * then nothing can be simplified. + */ static __isl_give PW *FN(PW,gist_aligned)(__isl_take PW *pw, __isl_take isl_set *context, __isl_give EL *(*fn_el)(__isl_take EL *el, @@ -800,6 +936,7 @@ __isl_take isl_basic_set *bset)) { int i; + int is_universe; isl_basic_set *hull = NULL; if (!pw || !context) @@ -810,29 +947,57 @@ return pw; } + is_universe = isl_set_plain_is_universe(context); + if (is_universe < 0) + goto error; + if (is_universe) { + isl_set_free(context); + return pw; + } + if (!isl_space_match(pw->dim, isl_dim_param, context->dim, isl_dim_param)) { pw = FN(PW,align_params)(pw, isl_set_get_space(context)); context = isl_set_align_params(context, FN(PW,get_space)(pw)); } - context = isl_set_compute_divs(context); - hull = isl_set_simple_hull(isl_set_copy(context)); - pw = FN(PW,cow)(pw); if (!pw) goto error; + if (pw->n == 1) { + int equal; + + equal = isl_set_plain_is_equal(pw->p[0].set, context); + if (equal < 0) + goto error; + if (equal) + return FN(PW,gist_last)(pw, context, fn_el); + } + + context = isl_set_compute_divs(context); + hull = isl_set_simple_hull(isl_set_copy(context)); + for (i = pw->n - 1; i >= 0; --i) { isl_set *set_i; int empty; + if (i == pw->n - 1) { + int equal; + equal = isl_set_plain_is_equal(pw->p[i].set, context); + if (equal < 0) + goto error; + if (equal) { + isl_basic_set_free(hull); + return FN(PW,gist_last)(pw, context, fn_el); + } + } set_i = isl_set_intersect(isl_set_copy(pw->p[i].set), isl_set_copy(context)); empty = isl_set_plain_is_empty(set_i); pw->p[i].FIELD = fn_el(pw->p[i].FIELD, set_i); pw->p[i].set = fn_dom(pw->p[i].set, isl_basic_set_copy(hull)); - if (!pw->p[i].FIELD || !pw->p[i].set) + if (empty < 0 || !pw->p[i].FIELD || !pw->p[i].set) goto error; if (empty) { isl_set_free(pw->p[i].set); @@ -922,21 +1087,21 @@ } #ifndef NO_INVOLVES_DIMS -int FN(PW,involves_dims)(__isl_keep PW *pw, enum isl_dim_type type, +isl_bool FN(PW,involves_dims)(__isl_keep PW *pw, enum isl_dim_type type, unsigned first, unsigned n) { int i; enum isl_dim_type set_type; if (!pw) - return -1; + return isl_bool_error; if (pw->n == 0 || n == 0) - return 0; + return isl_bool_false; set_type = type == isl_dim_in ? isl_dim_set : type; for (i = 0; i < pw->n; ++i) { - int involves = FN(EL,involves_dims)(pw->p[i].FIELD, + isl_bool involves = FN(EL,involves_dims)(pw->p[i].FIELD, type, first, n); if (involves < 0 || involves) return involves; @@ -945,7 +1110,7 @@ if (involves < 0 || involves) return involves; } - return 0; + return isl_bool_false; } #endif @@ -1199,42 +1364,42 @@ * In the worst case, the domain is scanned completely, * so the domain is assumed to be bounded. */ -__isl_give isl_qpolynomial *FN(PW,opt)(__isl_take PW *pw, int max) +__isl_give isl_val *FN(PW,opt)(__isl_take PW *pw, int max) { int i; - isl_qpolynomial *opt; + isl_val *opt; if (!pw) return NULL; if (pw->n == 0) { - isl_space *dim = isl_space_copy(pw->dim); + opt = isl_val_zero(FN(PW,get_ctx)(pw)); FN(PW,free)(pw); - return isl_qpolynomial_zero_on_domain(isl_space_domain(dim)); + return opt; } opt = FN(EL,opt_on_domain)(FN(EL,copy)(pw->p[0].FIELD), isl_set_copy(pw->p[0].set), max); for (i = 1; i < pw->n; ++i) { - isl_qpolynomial *opt_i; + isl_val *opt_i; opt_i = FN(EL,opt_on_domain)(FN(EL,copy)(pw->p[i].FIELD), isl_set_copy(pw->p[i].set), max); if (max) - opt = isl_qpolynomial_max_cst(opt, opt_i); + opt = isl_val_max(opt, opt_i); else - opt = isl_qpolynomial_min_cst(opt, opt_i); + opt = isl_val_min(opt, opt_i); } FN(PW,free)(pw); return opt; } -__isl_give isl_qpolynomial *FN(PW,max)(__isl_take PW *pw) +__isl_give isl_val *FN(PW,max)(__isl_take PW *pw) { return FN(PW,opt)(pw, 1); } -__isl_give isl_qpolynomial *FN(PW,min)(__isl_take PW *pw) +__isl_give isl_val *FN(PW,min)(__isl_take PW *pw) { return FN(PW,opt)(pw, 0); } @@ -1250,6 +1415,18 @@ return pw ? isl_space_domain(isl_space_copy(pw->dim)) : NULL; } +/* Return the position of the dimension of the given type and name + * in "pw". + * Return -1 if no such dimension can be found. + */ +int FN(PW,find_dim_by_name)(__isl_keep PW *pw, + enum isl_dim_type type, const char *name) +{ + if (!pw) + return -1; + return isl_space_find_dim_by_name(pw->dim, type, name); +} + #ifndef NO_RESET_DIM /* Reset the space of "pw". Since we don't know if the elements * represent the spaces themselves or their domains, we pass along @@ -1306,19 +1483,43 @@ return FN(PW,reset_space_and_domain)(pw, dim, domain); } -__isl_give PW *FN(PW,set_tuple_id)(__isl_keep PW *pw, enum isl_dim_type type, +__isl_give PW *FN(PW,set_tuple_id)(__isl_take PW *pw, enum isl_dim_type type, __isl_take isl_id *id) { isl_space *space; pw = FN(PW,cow)(pw); if (!pw) - return isl_id_free(id); + goto error; space = FN(PW,get_space)(pw); space = isl_space_set_tuple_id(space, type, id); return FN(PW,reset_space)(pw, space); +error: + isl_id_free(id); + return FN(PW,free)(pw); +} + +/* Drop the id on the specified tuple. + */ +__isl_give PW *FN(PW,reset_tuple_id)(__isl_take PW *pw, enum isl_dim_type type) +{ + isl_space *space; + + if (!pw) + return NULL; + if (!FN(PW,has_tuple_id)(pw, type)) + return pw; + + pw = FN(PW,cow)(pw); + if (!pw) + return NULL; + + space = FN(PW,get_space)(pw); + space = isl_space_reset_tuple_id(space, type); + + return FN(PW,reset_space)(pw, space); } __isl_give PW *FN(PW,set_dim_id)(__isl_take PW *pw, @@ -1326,12 +1527,28 @@ { pw = FN(PW,cow)(pw); if (!pw) - return isl_id_free(id); + goto error; pw->dim = isl_space_set_dim_id(pw->dim, type, pos, id); return FN(PW,reset_space)(pw, isl_space_copy(pw->dim)); +error: + isl_id_free(id); + return FN(PW,free)(pw); } #endif +/* Reset the user pointer on all identifiers of parameters and tuples + * of the space of "pw". + */ +__isl_give PW *FN(PW,reset_user)(__isl_take PW *pw) +{ + isl_space *space; + + space = FN(PW,get_space)(pw); + space = isl_space_reset_user(space); + + return FN(PW,reset_space)(pw, space); +} + int FN(PW,has_equal_space)(__isl_keep PW *pw1, __isl_keep PW *pw2) { if (!pw1 || !pw2) @@ -1387,21 +1604,21 @@ return pw ? pw->n : 0; } -int FN(PW,foreach_piece)(__isl_keep PW *pw, - int (*fn)(__isl_take isl_set *set, __isl_take EL *el, void *user), +isl_stat FN(PW,foreach_piece)(__isl_keep PW *pw, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take EL *el, void *user), void *user) { int i; if (!pw) - return -1; + return isl_stat_error; for (i = 0; i < pw->n; ++i) if (fn(isl_set_copy(pw->p[i].set), FN(EL,copy)(pw->p[i].FIELD), user) < 0) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } #ifndef NO_LIFT @@ -1419,9 +1636,10 @@ return 0; } -static int foreach_lifted_subset(__isl_take isl_set *set, __isl_take EL *el, - int (*fn)(__isl_take isl_set *set, __isl_take EL *el, - void *user), void *user) +static isl_stat foreach_lifted_subset(__isl_take isl_set *set, + __isl_take EL *el, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take EL *el, + void *user), void *user) { int i; @@ -1445,21 +1663,21 @@ isl_set_free(set); FN(EL,free)(el); - return 0; + return isl_stat_ok; error: isl_set_free(set); FN(EL,free)(el); - return -1; + return isl_stat_error; } -int FN(PW,foreach_lifted_piece)(__isl_keep PW *pw, - int (*fn)(__isl_take isl_set *set, __isl_take EL *el, +isl_stat FN(PW,foreach_lifted_piece)(__isl_keep PW *pw, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take EL *el, void *user), void *user) { int i; if (!pw) - return -1; + return isl_stat_error; for (i = 0; i < pw->n; ++i) { isl_set *set; @@ -1469,14 +1687,14 @@ el = FN(EL,copy)(pw->p[i].FIELD); if (!any_divs(set)) { if (fn(set, el, user) < 0) - return -1; + return isl_stat_error; continue; } if (foreach_lifted_subset(set, el, fn, user) < 0) - return -1; + return isl_stat_error; } - return 0; + return isl_stat_ok; } #endif @@ -1613,6 +1831,54 @@ return NULL; } +/* Divide the pieces of "pw" by "v" and return the result. + */ +__isl_give PW *FN(PW,scale_down_val)(__isl_take PW *pw, __isl_take isl_val *v) +{ + int i; + + if (!pw || !v) + goto error; + + if (isl_val_is_one(v)) { + isl_val_free(v); + return pw; + } + + if (!isl_val_is_rat(v)) + isl_die(isl_val_get_ctx(v), isl_error_invalid, + "expecting rational factor", goto error); + if (isl_val_is_zero(v)) + isl_die(isl_val_get_ctx(v), isl_error_invalid, + "cannot scale down by zero", goto error); + + if (pw->n == 0) { + isl_val_free(v); + return pw; + } + pw = FN(PW,cow)(pw); + if (!pw) + goto error; + +#ifdef HAS_TYPE + if (isl_val_is_neg(v)) + pw->type = isl_fold_type_negate(pw->type); +#endif + for (i = 0; i < pw->n; ++i) { + pw->p[i].FIELD = FN(EL,scale_down_val)(pw->p[i].FIELD, + isl_val_copy(v)); + if (!pw->p[i].FIELD) + goto error; + } + + isl_val_free(v); + return pw; +error: + isl_val_free(v); + FN(PW,free)(pw); + return NULL; +} + __isl_give PW *FN(PW,scale)(__isl_take PW *pw, isl_int v) { return FN(PW,mul_isl_int)(pw, v); @@ -1670,18 +1936,18 @@ * That is, do they have obviously identical cells and obviously identical * elements on each cell? */ -int FN(PW,plain_is_equal)(__isl_keep PW *pw1, __isl_keep PW *pw2) +isl_bool FN(PW,plain_is_equal)(__isl_keep PW *pw1, __isl_keep PW *pw2) { int i; - int equal; + isl_bool equal; if (!pw1 || !pw2) - return -1; + return isl_bool_error; if (pw1 == pw2) - return 1; + return isl_bool_true; if (!isl_space_is_equal(pw1->dim, pw2->dim)) - return 0; + return isl_bool_false; pw1 = FN(PW,copy)(pw1); pw2 = FN(PW,copy)(pw2); @@ -1708,7 +1974,7 @@ error: FN(PW,free)(pw1); FN(PW,free)(pw2); - return -1; + return isl_bool_error; } #ifndef NO_PULLBACK @@ -1829,8 +2095,11 @@ goto error; if (pma->n == 0) { + isl_space *space; + space = isl_space_join(isl_pw_multi_aff_get_space(pma), + FN(PW,get_space)(pw)); isl_pw_multi_aff_free(pma); - res = FN(PW,empty)(FN(PW,get_space)(pw)); + res = FN(PW,empty)(space); FN(PW,free)(pw); return res; } diff -Nru cloog-0.18.2/isl/isl_range.c cloog-0.18.4/isl/isl_range.c --- cloog-0.18.2/isl/isl_range.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_range.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include @@ -17,7 +17,7 @@ isl_pw_qpolynomial_fold *pwf_tight; }; -static int propagate_on_domain(__isl_take isl_basic_set *bset, +static isl_stat propagate_on_domain(__isl_take isl_basic_set *bset, __isl_take isl_qpolynomial *poly, struct range_data *data); /* Check whether the polynomial "poly" has sign "sign" over "bset", @@ -29,15 +29,13 @@ __isl_keep isl_qpolynomial *poly, int sign, int *signs) { struct range_data data_m; - unsigned nvar; unsigned nparam; isl_space *dim; - isl_qpolynomial *opt; + isl_val *opt; int r; enum isl_fold type; nparam = isl_basic_set_dim(bset, isl_dim_param); - nvar = isl_basic_set_dim(bset, isl_dim_set); bset = isl_basic_set_copy(bset); poly = isl_qpolynomial_copy(poly); @@ -70,14 +68,14 @@ if (!opt) r = -1; - else if (isl_qpolynomial_is_nan(opt) || - isl_qpolynomial_is_infty(opt) || - isl_qpolynomial_is_neginfty(opt)) + else if (isl_val_is_nan(opt) || + isl_val_is_infty(opt) || + isl_val_is_neginfty(opt)) r = 0; else - r = sign * isl_qpolynomial_sgn(opt) >= 0; + r = sign * isl_val_sgn(opt) >= 0; - isl_qpolynomial_free(opt); + isl_val_free(opt); return r; error: @@ -179,7 +177,7 @@ * and variables in data->signs. The integer divisions, if * any, are assumed to be non-negative. */ -static int collect_fixed_sign_terms(__isl_take isl_term *term, void *user) +static isl_stat collect_fixed_sign_terms(__isl_take isl_term *term, void *user) { struct isl_fixed_sign_data *data = (struct isl_fixed_sign_data *)user; isl_int n; @@ -189,7 +187,7 @@ unsigned nvar; if (!term) - return -1; + return isl_stat_error; nparam = isl_term_dim(term, isl_dim_param); nvar = isl_term_dim(term, isl_dim_set); @@ -221,7 +219,7 @@ isl_int_clear(n); - return 0; + return isl_stat_ok; } /* Construct and return a polynomial that consists of the terms @@ -249,7 +247,7 @@ /* Helper function to add a guarded polynomial to either pwf_tight or pwf, * depending on whether the result has been determined to be tight. */ -static int add_guarded_poly(__isl_take isl_basic_set *bset, +static isl_stat add_guarded_poly(__isl_take isl_basic_set *bset, __isl_take isl_qpolynomial *poly, struct range_data *data) { enum isl_fold type = data->sign < 0 ? isl_fold_min : isl_fold_max; @@ -269,7 +267,7 @@ else data->pwf = isl_pw_qpolynomial_fold_fold(data->pwf, pwf); - return 0; + return isl_stat_ok; } /* Given a lower and upper bound on the final variable and constraints @@ -287,14 +285,14 @@ * If all variables have been eliminated, then record the result. * Ohterwise, recurse on the next variable. */ -static int propagate_on_bound_pair(__isl_take isl_constraint *lower, +static isl_stat propagate_on_bound_pair(__isl_take isl_constraint *lower, __isl_take isl_constraint *upper, __isl_take isl_basic_set *bset, void *user) { struct range_data *data = (struct range_data *)user; int save_tight = data->tight; isl_qpolynomial *poly; - int r; + isl_stat r; unsigned nvar; nvar = isl_basic_set_dim(bset, isl_dim_set); @@ -356,7 +354,7 @@ /* Recursively perform range propagation on the polynomial "poly" * defined over the basic set "bset" and collect the results in "data". */ -static int propagate_on_domain(__isl_take isl_basic_set *bset, +static isl_stat propagate_on_domain(__isl_take isl_basic_set *bset, __isl_take isl_qpolynomial *poly, struct range_data *data) { isl_ctx *ctx; @@ -394,22 +392,23 @@ data->monotonicity = save_monotonicity; data->poly = save_poly; - return 0; + return isl_stat_ok; error: isl_basic_set_free(bset); isl_qpolynomial_free(poly); data->monotonicity = save_monotonicity; data->poly = save_poly; - return -1; + return isl_stat_error; } -static int basic_guarded_poly_bound(__isl_take isl_basic_set *bset, void *user) +static isl_stat basic_guarded_poly_bound(__isl_take isl_basic_set *bset, + void *user) { struct range_data *data = (struct range_data *)user; isl_ctx *ctx; unsigned nparam = isl_basic_set_dim(bset, isl_dim_param); unsigned dim = isl_basic_set_dim(bset, isl_dim_set); - int r; + isl_stat r; data->signs = NULL; @@ -432,7 +431,7 @@ error: free(data->signs); isl_basic_set_free(bset); - return -1; + return isl_stat_error; } static int qpolynomial_bound_on_domain_range(__isl_take isl_basic_set *bset, diff -Nru cloog-0.18.2/isl/isl_reordering.c cloog-0.18.4/isl/isl_reordering.c --- cloog-0.18.2/isl/isl_reordering.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_reordering.c 2014-10-02 15:48:18.000000000 +0000 @@ -198,6 +198,7 @@ { int i; + isl_space_dump(exp->dim); for (i = 0; i < exp->len; ++i) fprintf(stderr, "%d -> %d; ", i, exp->pos[i]); fprintf(stderr, "\n"); diff -Nru cloog-0.18.2/isl/isl_sample.c cloog-0.18.4/isl/isl_sample.c --- cloog-0.18.2/isl/isl_sample.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_sample.c 2015-07-24 12:23:09.000000000 +0000 @@ -10,16 +10,16 @@ #include #include #include "isl_sample.h" -#include "isl_sample_piplib.h" #include #include -#include +#include #include "isl_equalities.h" #include "isl_tab.h" #include "isl_basis_reduction.h" #include #include #include +#include static struct isl_vec *empty_sample(struct isl_basic_set *bset) { @@ -109,146 +109,6 @@ return NULL; } -static struct isl_mat *independent_bounds(struct isl_basic_set *bset) -{ - int i, j, n; - struct isl_mat *dirs = NULL; - struct isl_mat *bounds = NULL; - unsigned dim; - - if (!bset) - return NULL; - - dim = isl_basic_set_n_dim(bset); - bounds = isl_mat_alloc(bset->ctx, 1+dim, 1+dim); - if (!bounds) - return NULL; - - isl_int_set_si(bounds->row[0][0], 1); - isl_seq_clr(bounds->row[0]+1, dim); - bounds->n_row = 1; - - if (bset->n_ineq == 0) - return bounds; - - dirs = isl_mat_alloc(bset->ctx, dim, dim); - if (!dirs) { - isl_mat_free(bounds); - return NULL; - } - isl_seq_cpy(dirs->row[0], bset->ineq[0]+1, dirs->n_col); - isl_seq_cpy(bounds->row[1], bset->ineq[0], bounds->n_col); - for (j = 1, n = 1; n < dim && j < bset->n_ineq; ++j) { - int pos; - - isl_seq_cpy(dirs->row[n], bset->ineq[j]+1, dirs->n_col); - - pos = isl_seq_first_non_zero(dirs->row[n], dirs->n_col); - if (pos < 0) - continue; - for (i = 0; i < n; ++i) { - int pos_i; - pos_i = isl_seq_first_non_zero(dirs->row[i], dirs->n_col); - if (pos_i < pos) - continue; - if (pos_i > pos) - break; - isl_seq_elim(dirs->row[n], dirs->row[i], pos, - dirs->n_col, NULL); - pos = isl_seq_first_non_zero(dirs->row[n], dirs->n_col); - if (pos < 0) - break; - } - if (pos < 0) - continue; - if (i < n) { - int k; - isl_int *t = dirs->row[n]; - for (k = n; k > i; --k) - dirs->row[k] = dirs->row[k-1]; - dirs->row[i] = t; - } - ++n; - isl_seq_cpy(bounds->row[n], bset->ineq[j], bounds->n_col); - } - isl_mat_free(dirs); - bounds->n_row = 1+n; - return bounds; -} - -static void swap_inequality(struct isl_basic_set *bset, int a, int b) -{ - isl_int *t = bset->ineq[a]; - bset->ineq[a] = bset->ineq[b]; - bset->ineq[b] = t; -} - -/* Skew into positive orthant and project out lineality space. - * - * We perform a unimodular transformation that turns a selected - * maximal set of linearly independent bounds into constraints - * on the first dimensions that impose that these first dimensions - * are non-negative. In particular, the constraint matrix is lower - * triangular with positive entries on the diagonal and negative - * entries below. - * If "bset" has a lineality space then these constraints (and therefore - * all constraints in bset) only involve the first dimensions. - * The remaining dimensions then do not appear in any constraints and - * we can select any value for them, say zero. We therefore project - * out this final dimensions and plug in the value zero later. This - * is accomplished by simply dropping the final columns of - * the unimodular transformation. - */ -static struct isl_basic_set *isl_basic_set_skew_to_positive_orthant( - struct isl_basic_set *bset, struct isl_mat **T) -{ - struct isl_mat *U = NULL; - struct isl_mat *bounds = NULL; - int i, j; - unsigned old_dim, new_dim; - - *T = NULL; - if (!bset) - return NULL; - - isl_assert(bset->ctx, isl_basic_set_n_param(bset) == 0, goto error); - isl_assert(bset->ctx, bset->n_div == 0, goto error); - isl_assert(bset->ctx, bset->n_eq == 0, goto error); - - old_dim = isl_basic_set_n_dim(bset); - /* Try to move (multiples of) unit rows up. */ - for (i = 0, j = 0; i < bset->n_ineq; ++i) { - int pos = isl_seq_first_non_zero(bset->ineq[i]+1, old_dim); - if (pos < 0) - continue; - if (isl_seq_first_non_zero(bset->ineq[i]+1+pos+1, - old_dim-pos-1) >= 0) - continue; - if (i != j) - swap_inequality(bset, i, j); - ++j; - } - bounds = independent_bounds(bset); - if (!bounds) - goto error; - new_dim = bounds->n_row - 1; - bounds = isl_mat_left_hermite(bounds, 1, &U, NULL); - if (!bounds) - goto error; - U = isl_mat_drop_cols(U, 1 + new_dim, old_dim - new_dim); - bset = isl_basic_set_preimage(bset, isl_mat_copy(U)); - if (!bset) - goto error; - *T = U; - isl_mat_free(bounds); - return bset; -error: - isl_mat_free(bounds); - isl_mat_free(U); - isl_basic_set_free(bset); - return NULL; -} - /* Find a sample integer point, if any, in bset, which is known * to have equalities. If bset contains no integer points, then * return a zero-length vector. @@ -735,7 +595,6 @@ static struct isl_vec *sample_bounded(struct isl_basic_set *bset) { unsigned dim; - struct isl_ctx *ctx; struct isl_vec *sample; struct isl_tab *tab = NULL; isl_factorizer *f; @@ -760,14 +619,12 @@ if (f->n_group != 0) return factored_sample(bset, f); isl_factorizer_free(f); - - ctx = bset->ctx; tab = isl_tab_from_basic_set(bset, 1); if (tab && tab->empty) { isl_tab_free(tab); ISL_F_SET(bset, ISL_BASIC_SET_EMPTY); - sample = isl_vec_alloc(bset->ctx, 0); + sample = isl_vec_alloc(isl_basic_set_get_ctx(bset), 0); isl_basic_set_free(bset); return sample; } @@ -1064,11 +921,11 @@ if (!bset || !cone) goto error; - ctx = bset->ctx; + ctx = isl_basic_set_get_ctx(bset); total = isl_basic_set_total_dim(cone); cone_dim = total - cone->n_eq; - M = isl_mat_sub_alloc6(bset->ctx, cone->eq, 0, cone->n_eq, 1, total); + M = isl_mat_sub_alloc6(ctx, cone->eq, 0, cone->n_eq, 1, total); M = isl_mat_left_hermite(M, 0, &U, NULL); if (!M) goto error; @@ -1160,7 +1017,8 @@ isl_vec_free(row); if (isl_int_is_zero(v)) continue; - tab = isl_tab_extend(tab, 1); + if (isl_tab_extend_cons(tab, 1) < 0) + goto error; isl_int_add(bset->ineq[i][0], bset->ineq[i][0], v); ok = isl_tab_add_ineq(tab, bset->ineq[i]) >= 0; isl_int_sub(bset->ineq[i][0], bset->ineq[i][0], v); @@ -1254,27 +1112,6 @@ return NULL; } -static struct isl_vec *pip_sample(struct isl_basic_set *bset) -{ - struct isl_mat *T; - struct isl_ctx *ctx; - struct isl_vec *sample; - - bset = isl_basic_set_skew_to_positive_orthant(bset, &T); - if (!bset) - return NULL; - - ctx = bset->ctx; - sample = isl_pip_basic_set_sample(bset); - - if (sample && sample->size != 0) - sample = isl_mat_vec_product(T, sample); - else - isl_mat_free(T); - - return sample; -} - static struct isl_vec *basic_set_sample(struct isl_basic_set *bset, int bounded) { struct isl_ctx *ctx; @@ -1311,13 +1148,7 @@ if (dim == 1) return interval_sample(bset); - switch (bset->ctx->opt->ilp_solver) { - case ISL_ILP_PIP: - return pip_sample(bset); - case ISL_ILP_GBR: - return bounded ? sample_bounded(bset) : gbr_sample(bset); - } - isl_assert(bset->ctx, 0, ); + return bounded ? sample_bounded(bset) : gbr_sample(bset); error: isl_basic_set_free(bset); return NULL; @@ -1380,11 +1211,8 @@ if (!sample_vec) goto error; if (sample_vec->size == 0) { - struct isl_basic_map *sample; - sample = isl_basic_map_empty_like(bmap); isl_vec_free(sample_vec); - isl_basic_map_free(bmap); - return sample; + return isl_basic_map_set_to_empty(bmap); } bset = isl_basic_set_from_vec(sample_vec); return isl_basic_map_overlying_set(bset, bmap); @@ -1415,7 +1243,7 @@ isl_basic_map_free(sample); } if (i == map->n) - sample = isl_basic_map_empty_like_map(map); + sample = isl_basic_map_empty(isl_map_get_space(map)); isl_map_free(map); return sample; error: diff -Nru cloog-0.18.2/isl/isl_sample.h cloog-0.18.4/isl/isl_sample.h --- cloog-0.18.2/isl/isl_sample.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_sample.h 2014-10-02 15:33:27.000000000 +0000 @@ -8,7 +8,7 @@ */ #ifndef ISL_SAMPLE_H -#define ISL_SAMPLE +#define ISL_SAMPLE_H #include #include diff -Nru cloog-0.18.2/isl/isl_sample_no_piplib.c cloog-0.18.4/isl/isl_sample_no_piplib.c --- cloog-0.18.2/isl/isl_sample_no_piplib.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_sample_no_piplib.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -/* - * Copyright 2008-2009 Katholieke Universiteit Leuven - * - * Use of this software is governed by the MIT license - * - * Written by Sven Verdoolaege, K.U.Leuven, Departement - * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium - */ - -#include "isl_sample_piplib.h" - -struct isl_vec *isl_pip_basic_set_sample(struct isl_basic_set *bset) -{ - isl_basic_set_free(bset); - return NULL; -} diff -Nru cloog-0.18.2/isl/isl_sample_piplib.c cloog-0.18.4/isl/isl_sample_piplib.c --- cloog-0.18.2/isl/isl_sample_piplib.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_sample_piplib.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -/* - * Copyright 2008-2009 Katholieke Universiteit Leuven - * - * Use of this software is governed by the MIT license - * - * Written by Sven Verdoolaege, K.U.Leuven, Departement - * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium - */ - -#include -#include -#include -#include "isl_piplib.h" -#include "isl_sample_piplib.h" - -struct isl_vec *isl_pip_basic_set_sample(struct isl_basic_set *bset) -{ - PipOptions *options = NULL; - PipMatrix *domain = NULL; - PipQuast *sol = NULL; - struct isl_vec *vec = NULL; - unsigned dim; - struct isl_ctx *ctx; - - if (!bset) - goto error; - ctx = isl_basic_set_get_ctx(bset); - isl_assert(ctx, isl_basic_set_n_param(bset) == 0, goto error); - isl_assert(ctx, isl_basic_set_dim(bset, isl_dim_div) == 0, goto error); - dim = isl_basic_set_n_dim(bset); - domain = isl_basic_map_to_pip((struct isl_basic_map *)bset, 0, 0, 0); - if (!domain) - goto error; - - options = pip_options_init(); - if (!options) - goto error; - sol = pip_solve(domain, NULL, -1, options); - if (!sol) - goto error; - if (!sol->list) - vec = isl_vec_alloc(ctx, 0); - else { - PipList *l; - int i; - vec = isl_vec_alloc(ctx, 1 + dim); - if (!vec) - goto error; - isl_int_set_si(vec->block.data[0], 1); - for (i = 0, l = sol->list; l && i < dim; ++i, l = l->next) { - isl_seq_cpy_from_pip(&vec->block.data[1+i], - &l->vector->the_vector[0], 1); - isl_assert(ctx, !entier_zero_p(l->vector->the_deno[0]), - goto error); - } - isl_assert(ctx, i == dim, goto error); - } - - pip_quast_free(sol); - pip_options_free(options); - pip_matrix_free(domain); - - isl_basic_set_free(bset); - return vec; -error: - isl_vec_free(vec); - isl_basic_set_free(bset); - if (sol) - pip_quast_free(sol); - if (domain) - pip_matrix_free(domain); - return NULL; -} diff -Nru cloog-0.18.2/isl/isl_sample_piplib.h cloog-0.18.4/isl/isl_sample_piplib.h --- cloog-0.18.2/isl/isl_sample_piplib.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_sample_piplib.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -/* - * Copyright 2008-2009 Katholieke Universiteit Leuven - * - * Use of this software is governed by the MIT license - * - * Written by Sven Verdoolaege, K.U.Leuven, Departement - * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium - */ - -#ifndef ISL_SAMPLE_PIP_H -#define ISL_SAMPLE_PIP - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - -struct isl_vec *isl_pip_basic_set_sample(struct isl_basic_set *bset); - -#if defined(__cplusplus) -} -#endif - -#endif diff -Nru cloog-0.18.2/isl/isl_scan.c cloog-0.18.4/isl/isl_scan.c --- cloog-0.18.2/isl/isl_scan.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_scan.c 2015-07-24 12:23:09.000000000 +0000 @@ -11,9 +11,10 @@ #include #include "isl_basis_reduction.h" #include "isl_scan.h" -#include +#include #include "isl_tab.h" #include +#include struct isl_counter { struct isl_scan_callback callback; @@ -21,7 +22,7 @@ isl_int max; }; -static int increment_counter(struct isl_scan_callback *cb, +static isl_stat increment_counter(struct isl_scan_callback *cb, __isl_take isl_vec *sample) { struct isl_counter *cnt = (struct isl_counter *)cb; @@ -31,8 +32,8 @@ isl_vec_free(sample); if (isl_int_is_zero(cnt->max) || isl_int_lt(cnt->count, cnt->max)) - return 0; - return -1; + return isl_stat_ok; + return isl_stat_error; } static int increment_range(struct isl_scan_callback *cb, isl_int min, isl_int max) diff -Nru cloog-0.18.2/isl/isl_scan.h cloog-0.18.4/isl/isl_scan.h --- cloog-0.18.2/isl/isl_scan.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_scan.h 2015-07-24 12:23:09.000000000 +0000 @@ -14,7 +14,8 @@ #include struct isl_scan_callback { - int (*add)(struct isl_scan_callback *cb, __isl_take isl_vec *sample); + isl_stat (*add)(struct isl_scan_callback *cb, + __isl_take isl_vec *sample); }; int isl_basic_set_scan(struct isl_basic_set *bset, diff -Nru cloog-0.18.2/isl/isl_schedule_band.c cloog-0.18.4/isl/isl_schedule_band.c --- cloog-0.18.2/isl/isl_schedule_band.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_schedule_band.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,1189 @@ +/* + * Copyright 2013-2014 Ecole Normale Superieure + * Copyright 2014 INRIA Rocquencourt + * + * Use of this software is governed by the MIT license + * + * Written by Sven Verdoolaege, + * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France + * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, + * B.P. 105 - 78153 Le Chesnay, France + */ + +#include +#include +#include +#include +#include + +isl_ctx *isl_schedule_band_get_ctx(__isl_keep isl_schedule_band *band) +{ + return band ? isl_multi_union_pw_aff_get_ctx(band->mupa) : NULL; +} + +/* Return a new uninitialized isl_schedule_band. + */ +static __isl_give isl_schedule_band *isl_schedule_band_alloc(isl_ctx *ctx) +{ + isl_schedule_band *band; + + band = isl_calloc_type(ctx, isl_schedule_band); + if (!band) + return NULL; + + band->ref = 1; + + return band; +} + +/* Return a new isl_schedule_band with partial schedule "mupa". + * First replace "mupa" by its greatest integer part to ensure + * that the schedule is always integral. + * The band is not marked permutable, the dimensions are not + * marked coincident and the AST build options are empty. + * Since there are no build options, the node is not anchored. + */ +__isl_give isl_schedule_band *isl_schedule_band_from_multi_union_pw_aff( + __isl_take isl_multi_union_pw_aff *mupa) +{ + isl_ctx *ctx; + isl_schedule_band *band; + isl_space *space; + + mupa = isl_multi_union_pw_aff_floor(mupa); + if (!mupa) + return NULL; + ctx = isl_multi_union_pw_aff_get_ctx(mupa); + band = isl_schedule_band_alloc(ctx); + if (!band) + goto error; + + band->n = isl_multi_union_pw_aff_dim(mupa, isl_dim_set); + band->coincident = isl_calloc_array(ctx, int, band->n); + band->mupa = mupa; + space = isl_space_params_alloc(ctx, 0); + band->ast_build_options = isl_union_set_empty(space); + band->anchored = 0; + + if ((band->n && !band->coincident) || !band->ast_build_options) + return isl_schedule_band_free(band); + + return band; +error: + isl_multi_union_pw_aff_free(mupa); + return NULL; +} + +/* Create a duplicate of the given isl_schedule_band. + */ +__isl_give isl_schedule_band *isl_schedule_band_dup( + __isl_keep isl_schedule_band *band) +{ + int i; + isl_ctx *ctx; + isl_schedule_band *dup; + + if (!band) + return NULL; + + ctx = isl_schedule_band_get_ctx(band); + dup = isl_schedule_band_alloc(ctx); + if (!dup) + return NULL; + + dup->n = band->n; + dup->coincident = isl_alloc_array(ctx, int, band->n); + if (band->n && !dup->coincident) + return isl_schedule_band_free(dup); + + for (i = 0; i < band->n; ++i) + dup->coincident[i] = band->coincident[i]; + dup->permutable = band->permutable; + + dup->mupa = isl_multi_union_pw_aff_copy(band->mupa); + dup->ast_build_options = isl_union_set_copy(band->ast_build_options); + if (!dup->mupa || !dup->ast_build_options) + return isl_schedule_band_free(dup); + + if (band->loop_type) { + dup->loop_type = isl_alloc_array(ctx, + enum isl_ast_loop_type, band->n); + if (band->n && !dup->loop_type) + return isl_schedule_band_free(dup); + for (i = 0; i < band->n; ++i) + dup->loop_type[i] = band->loop_type[i]; + } + if (band->isolate_loop_type) { + dup->isolate_loop_type = isl_alloc_array(ctx, + enum isl_ast_loop_type, band->n); + if (band->n && !dup->isolate_loop_type) + return isl_schedule_band_free(dup); + for (i = 0; i < band->n; ++i) + dup->isolate_loop_type[i] = band->isolate_loop_type[i]; + } + + return dup; +} + +/* Return an isl_schedule_band that is equal to "band" and that has only + * a single reference. + */ +__isl_give isl_schedule_band *isl_schedule_band_cow( + __isl_take isl_schedule_band *band) +{ + if (!band) + return NULL; + + if (band->ref == 1) + return band; + band->ref--; + return isl_schedule_band_dup(band); +} + +/* Return a new reference to "band". + */ +__isl_give isl_schedule_band *isl_schedule_band_copy( + __isl_keep isl_schedule_band *band) +{ + if (!band) + return NULL; + + band->ref++; + return band; +} + +/* Free a reference to "band" and return NULL. + */ +__isl_null isl_schedule_band *isl_schedule_band_free( + __isl_take isl_schedule_band *band) +{ + if (!band) + return NULL; + + if (--band->ref > 0) + return NULL; + + isl_multi_union_pw_aff_free(band->mupa); + isl_union_set_free(band->ast_build_options); + free(band->loop_type); + free(band->isolate_loop_type); + free(band->coincident); + free(band); + + return NULL; +} + +/* Are "band1" and "band2" obviously equal? + */ +isl_bool isl_schedule_band_plain_is_equal(__isl_keep isl_schedule_band *band1, + __isl_keep isl_schedule_band *band2) +{ + int i; + isl_bool equal; + + if (!band1 || !band2) + return isl_bool_error; + if (band1 == band2) + return isl_bool_true; + + if (band1->n != band2->n) + return isl_bool_false; + for (i = 0; i < band1->n; ++i) + if (band1->coincident[i] != band2->coincident[i]) + return isl_bool_false; + if (band1->permutable != band2->permutable) + return isl_bool_false; + + equal = isl_multi_union_pw_aff_plain_is_equal(band1->mupa, band2->mupa); + if (equal < 0 || !equal) + return equal; + + if (!band1->loop_type != !band2->loop_type) + return isl_bool_false; + if (band1->loop_type) + for (i = 0; i < band1->n; ++i) + if (band1->loop_type[i] != band2->loop_type[i]) + return isl_bool_false; + + if (!band1->isolate_loop_type != !band2->isolate_loop_type) + return isl_bool_false; + if (band1->isolate_loop_type) + for (i = 0; i < band1->n; ++i) + if (band1->isolate_loop_type[i] != + band2->isolate_loop_type[i]) + return isl_bool_false; + + return isl_union_set_is_equal(band1->ast_build_options, + band2->ast_build_options); +} + +/* Return the number of scheduling dimensions in the band. + */ +int isl_schedule_band_n_member(__isl_keep isl_schedule_band *band) +{ + return band ? band->n : 0; +} + +/* Is the given scheduling dimension coincident within the band and + * with respect to the coincidence constraints? + */ +isl_bool isl_schedule_band_member_get_coincident( + __isl_keep isl_schedule_band *band, int pos) +{ + if (!band) + return isl_bool_error; + + if (pos < 0 || pos >= band->n) + isl_die(isl_schedule_band_get_ctx(band), isl_error_invalid, + "invalid member position", return isl_bool_error); + + return band->coincident[pos]; +} + +/* Mark the given scheduling dimension as being coincident or not + * according to "coincident". + */ +__isl_give isl_schedule_band *isl_schedule_band_member_set_coincident( + __isl_take isl_schedule_band *band, int pos, int coincident) +{ + if (!band) + return NULL; + if (isl_schedule_band_member_get_coincident(band, pos) == coincident) + return band; + band = isl_schedule_band_cow(band); + if (!band) + return NULL; + + if (pos < 0 || pos >= band->n) + isl_die(isl_schedule_band_get_ctx(band), isl_error_invalid, + "invalid member position", + isl_schedule_band_free(band)); + + band->coincident[pos] = coincident; + + return band; +} + +/* Is the schedule band mark permutable? + */ +isl_bool isl_schedule_band_get_permutable(__isl_keep isl_schedule_band *band) +{ + if (!band) + return isl_bool_error; + return band->permutable; +} + +/* Mark the schedule band permutable or not according to "permutable"? + */ +__isl_give isl_schedule_band *isl_schedule_band_set_permutable( + __isl_take isl_schedule_band *band, int permutable) +{ + if (!band) + return NULL; + if (band->permutable == permutable) + return band; + band = isl_schedule_band_cow(band); + if (!band) + return NULL; + + band->permutable = permutable; + + return band; +} + +/* Is the band node "node" anchored? That is, does it reference + * the outer band nodes? + */ +int isl_schedule_band_is_anchored(__isl_keep isl_schedule_band *band) +{ + return band ? band->anchored : -1; +} + +/* Return the schedule space of the band. + */ +__isl_give isl_space *isl_schedule_band_get_space( + __isl_keep isl_schedule_band *band) +{ + if (!band) + return NULL; + return isl_multi_union_pw_aff_get_space(band->mupa); +} + +/* Intersect the domain of the band schedule of "band" with "domain". + */ +__isl_give isl_schedule_band *isl_schedule_band_intersect_domain( + __isl_take isl_schedule_band *band, __isl_take isl_union_set *domain) +{ + band = isl_schedule_band_cow(band); + if (!band || !domain) + goto error; + + band->mupa = isl_multi_union_pw_aff_intersect_domain(band->mupa, + domain); + if (!band->mupa) + return isl_schedule_band_free(band); + + return band; +error: + isl_schedule_band_free(band); + isl_union_set_free(domain); + return NULL; +} + +/* Return the schedule of the band in isolation. + */ +__isl_give isl_multi_union_pw_aff *isl_schedule_band_get_partial_schedule( + __isl_keep isl_schedule_band *band) +{ + return band ? isl_multi_union_pw_aff_copy(band->mupa) : NULL; +} + +/* Replace the schedule of "band" by "schedule". + */ +__isl_give isl_schedule_band *isl_schedule_band_set_partial_schedule( + __isl_take isl_schedule_band *band, + __isl_take isl_multi_union_pw_aff *schedule) +{ + band = isl_schedule_band_cow(band); + if (!band || !schedule) + goto error; + + isl_multi_union_pw_aff_free(band->mupa); + band->mupa = schedule; + + return band; +error: + isl_schedule_band_free(band); + isl_multi_union_pw_aff_free(schedule); + return NULL; +} + +/* Return the loop AST generation type for the band member of "band" + * at position "pos". + */ +enum isl_ast_loop_type isl_schedule_band_member_get_ast_loop_type( + __isl_keep isl_schedule_band *band, int pos) +{ + if (!band) + return isl_ast_loop_error; + + if (pos < 0 || pos >= band->n) + isl_die(isl_schedule_band_get_ctx(band), isl_error_invalid, + "invalid member position", return -1); + + if (!band->loop_type) + return isl_ast_loop_default; + + return band->loop_type[pos]; +} + +/* Set the loop AST generation type for the band member of "band" + * at position "pos" to "type". + */ +__isl_give isl_schedule_band *isl_schedule_band_member_set_ast_loop_type( + __isl_take isl_schedule_band *band, int pos, + enum isl_ast_loop_type type) +{ + if (!band) + return NULL; + if (isl_schedule_band_member_get_ast_loop_type(band, pos) == type) + return band; + + if (pos < 0 || pos >= band->n) + isl_die(isl_schedule_band_get_ctx(band), isl_error_invalid, + "invalid member position", + isl_schedule_band_free(band)); + + band = isl_schedule_band_cow(band); + if (!band) + return isl_schedule_band_free(band); + + if (!band->loop_type) { + isl_ctx *ctx; + + ctx = isl_schedule_band_get_ctx(band); + band->loop_type = isl_calloc_array(ctx, + enum isl_ast_loop_type, band->n); + if (band->n && !band->loop_type) + return isl_schedule_band_free(band); + } + + band->loop_type[pos] = type; + + return band; +} + +/* Return the loop AST generation type for the band member of "band" + * at position "pos" for the part that has been isolated by the isolate option. + */ +enum isl_ast_loop_type isl_schedule_band_member_get_isolate_ast_loop_type( + __isl_keep isl_schedule_band *band, int pos) +{ + if (!band) + return isl_ast_loop_error; + + if (pos < 0 || pos >= band->n) + isl_die(isl_schedule_band_get_ctx(band), isl_error_invalid, + "invalid member position", return -1); + + if (!band->isolate_loop_type) + return isl_ast_loop_default; + + return band->isolate_loop_type[pos]; +} + +/* Set the loop AST generation type for the band member of "band" + * at position "pos" to "type" for the part that has been isolated + * by the isolate option. + */ +__isl_give isl_schedule_band * +isl_schedule_band_member_set_isolate_ast_loop_type( + __isl_take isl_schedule_band *band, int pos, + enum isl_ast_loop_type type) +{ + if (!band) + return NULL; + if (isl_schedule_band_member_get_isolate_ast_loop_type(band, pos) == + type) + return band; + + if (pos < 0 || pos >= band->n) + isl_die(isl_schedule_band_get_ctx(band), isl_error_invalid, + "invalid member position", + isl_schedule_band_free(band)); + + band = isl_schedule_band_cow(band); + if (!band) + return isl_schedule_band_free(band); + + if (!band->isolate_loop_type) { + isl_ctx *ctx; + + ctx = isl_schedule_band_get_ctx(band); + band->isolate_loop_type = isl_calloc_array(ctx, + enum isl_ast_loop_type, band->n); + if (band->n && !band->isolate_loop_type) + return isl_schedule_band_free(band); + } + + band->isolate_loop_type[pos] = type; + + return band; +} + +static const char *option_str[] = { + [isl_ast_loop_atomic] = "atomic", + [isl_ast_loop_unroll] = "unroll", + [isl_ast_loop_separate] = "separate" +}; + +/* Given a parameter space "space", extend it to a set space + * + * { type[x] } + * + * or + * + * { [isolate[] -> type[x]] } + * + * depending on whether "isolate" is set. + * These can be used to encode loop AST generation options of the given type. + */ +static __isl_give isl_space *loop_type_space(__isl_take isl_space *space, + enum isl_ast_loop_type type, int isolate) +{ + const char *name; + + name = option_str[type]; + space = isl_space_set_from_params(space); + space = isl_space_add_dims(space, isl_dim_set, 1); + space = isl_space_set_tuple_name(space, isl_dim_set, name); + if (!isolate) + return space; + space = isl_space_from_range(space); + space = isl_space_set_tuple_name(space, isl_dim_in, "isolate"); + space = isl_space_wrap(space); + + return space; +} + +/* Add encodings of the "n" loop AST generation options "type" to "options". + * If "isolate" is set, then these options refer to the isolated part. + * + * In particular, for each sequence of consecutive identical types "t", + * different from the default, add an option + * + * { t[x] : first <= x <= last } + * + * or + * + * { [isolate[] -> t[x]] : first <= x <= last } + */ +static __isl_give isl_union_set *add_loop_types( + __isl_take isl_union_set *options, int n, enum isl_ast_loop_type *type, + int isolate) +{ + int i; + isl_ctx *ctx; + + if (!type) + return options; + if (!options) + return NULL; + + ctx = isl_union_set_get_ctx(options); + for (i = 0; i < n; ++i) { + int first; + isl_space *space; + isl_set *option; + + if (type[i] == isl_ast_loop_default) + continue; + + first = i; + while (i + 1 < n && type[i + 1] == type[i]) + ++i; + + space = isl_union_set_get_space(options); + space = loop_type_space(space, type[i], isolate); + option = isl_set_universe(space); + option = isl_set_lower_bound_si(option, isl_dim_set, 0, first); + option = isl_set_upper_bound_si(option, isl_dim_set, 0, i); + options = isl_union_set_add_set(options, option); + } + + return options; +} + +/* Return the AST build options associated to "band". + */ +__isl_give isl_union_set *isl_schedule_band_get_ast_build_options( + __isl_keep isl_schedule_band *band) +{ + isl_union_set *options; + + if (!band) + return NULL; + + options = isl_union_set_copy(band->ast_build_options); + options = add_loop_types(options, band->n, band->loop_type, 0); + options = add_loop_types(options, band->n, band->isolate_loop_type, 1); + + return options; +} + +/* Does "uset" contain any set that satisfies "is"? + * "is" is assumed to set its integer argument to 1 if it is satisfied. + */ +static int has_any(__isl_keep isl_union_set *uset, + isl_stat (*is)(__isl_take isl_set *set, void *user)) +{ + int found = 0; + + if (isl_union_set_foreach_set(uset, is, &found) < 0 && !found) + return -1; + + return found; +} + +/* Does "set" live in a space of the form + * + * isolate[[...] -> [...]] + * + * ? + * + * If so, set *found and abort the search. + */ +static isl_stat is_isolate(__isl_take isl_set *set, void *user) +{ + int *found = user; + + if (isl_set_has_tuple_name(set)) { + const char *name; + name = isl_set_get_tuple_name(set); + if (isl_set_is_wrapping(set) && !strcmp(name, "isolate")) + *found = 1; + } + isl_set_free(set); + + return *found ? isl_stat_error : isl_stat_ok; +} + +/* Does "options" include an option of the ofrm + * + * isolate[[...] -> [...]] + * + * ? + */ +static int has_isolate_option(__isl_keep isl_union_set *options) +{ + return has_any(options, &is_isolate); +} + +/* Does "set" encode a loop AST generation option? + */ +static isl_stat is_loop_type_option(__isl_take isl_set *set, void *user) +{ + int *found = user; + + if (isl_set_dim(set, isl_dim_set) == 1 && + isl_set_has_tuple_name(set)) { + const char *name; + enum isl_ast_loop_type type; + name = isl_set_get_tuple_name(set); + for (type = isl_ast_loop_atomic; + type <= isl_ast_loop_separate; ++type) { + if (strcmp(name, option_str[type])) + continue; + *found = 1; + break; + } + } + isl_set_free(set); + + return *found ? isl_stat_error : isl_stat_ok; +} + +/* Does "set" encode a loop AST generation option for the isolated part? + * That is, is of the form + * + * { [isolate[] -> t[x]] } + * + * with t equal to "atomic", "unroll" or "separate"? + */ +static isl_stat is_isolate_loop_type_option(__isl_take isl_set *set, void *user) +{ + int *found = user; + const char *name; + enum isl_ast_loop_type type; + isl_map *map; + + if (!isl_set_is_wrapping(set)) { + isl_set_free(set); + return isl_stat_ok; + } + map = isl_set_unwrap(set); + if (!isl_map_has_tuple_name(map, isl_dim_in) || + !isl_map_has_tuple_name(map, isl_dim_out)) { + isl_map_free(map); + return isl_stat_ok; + } + name = isl_map_get_tuple_name(map, isl_dim_in); + if (!strcmp(name, "isolate")) { + name = isl_map_get_tuple_name(map, isl_dim_out); + for (type = isl_ast_loop_atomic; + type <= isl_ast_loop_separate; ++type) { + if (strcmp(name, option_str[type])) + continue; + *found = 1; + break; + } + } + isl_map_free(map); + + return *found ? isl_stat_error : isl_stat_ok; +} + +/* Does "options" encode any loop AST generation options + * for the isolated part? + */ +static int has_isolate_loop_type_options(__isl_keep isl_union_set *options) +{ + return has_any(options, &is_isolate_loop_type_option); +} + +/* Does "options" encode any loop AST generation options? + */ +static int has_loop_type_options(__isl_keep isl_union_set *options) +{ + return has_any(options, &is_loop_type_option); +} + +/* Extract the loop AST generation type for the band member + * at position "pos" from "options". + * If "isolate" is set, then extract the loop types for the isolated part. + */ +static enum isl_ast_loop_type extract_loop_type( + __isl_keep isl_union_set *options, int pos, int isolate) +{ + isl_ctx *ctx; + enum isl_ast_loop_type type, res = isl_ast_loop_default; + + ctx = isl_union_set_get_ctx(options); + for (type = isl_ast_loop_atomic; + type <= isl_ast_loop_separate; ++type) { + isl_space *space; + isl_set *option; + int empty; + + space = isl_union_set_get_space(options); + space = loop_type_space(space, type, isolate); + option = isl_union_set_extract_set(options, space); + option = isl_set_fix_si(option, isl_dim_set, 0, pos); + empty = isl_set_is_empty(option); + isl_set_free(option); + + if (empty < 0) + return isl_ast_loop_error; + if (empty) + continue; + if (res != isl_ast_loop_default) + isl_die(ctx, isl_error_invalid, + "conflicting loop type options", + return isl_ast_loop_error); + res = type; + } + + return res; +} + +/* Extract the loop AST generation types for the members of "band" + * from "options" and store them in band->loop_type. + * Return -1 on error. + */ +static int extract_loop_types(__isl_keep isl_schedule_band *band, + __isl_keep isl_union_set *options) +{ + int i; + + if (!band->loop_type) { + isl_ctx *ctx = isl_schedule_band_get_ctx(band); + band->loop_type = isl_alloc_array(ctx, + enum isl_ast_loop_type, band->n); + if (band->n && !band->loop_type) + return -1; + } + for (i = 0; i < band->n; ++i) { + band->loop_type[i] = extract_loop_type(options, i, 0); + if (band->loop_type[i] == isl_ast_loop_error) + return -1; + } + + return 0; +} + +/* Extract the loop AST generation types for the members of "band" + * from "options" for the isolated part and + * store them in band->isolate_loop_type. + * Return -1 on error. + */ +static int extract_isolate_loop_types(__isl_keep isl_schedule_band *band, + __isl_keep isl_union_set *options) +{ + int i; + + if (!band->isolate_loop_type) { + isl_ctx *ctx = isl_schedule_band_get_ctx(band); + band->isolate_loop_type = isl_alloc_array(ctx, + enum isl_ast_loop_type, band->n); + if (band->n && !band->isolate_loop_type) + return -1; + } + for (i = 0; i < band->n; ++i) { + band->isolate_loop_type[i] = extract_loop_type(options, i, 1); + if (band->isolate_loop_type[i] == isl_ast_loop_error) + return -1; + } + + return 0; +} + +/* Construct universe sets of the spaces that encode loop AST generation + * types (for the isolated part if "isolate" is set). That is, construct + * + * { atomic[x]; separate[x]; unroll[x] } + * + * or + * + * { [isolate[] -> atomic[x]]; [isolate[] -> separate[x]]; + * [isolate[] -> unroll[x]] } + */ +static __isl_give isl_union_set *loop_types(__isl_take isl_space *space, + int isolate) +{ + enum isl_ast_loop_type type; + isl_union_set *types; + + types = isl_union_set_empty(space); + for (type = isl_ast_loop_atomic; + type <= isl_ast_loop_separate; ++type) { + isl_set *set; + + space = isl_union_set_get_space(types); + space = loop_type_space(space, type, isolate); + set = isl_set_universe(space); + types = isl_union_set_add_set(types, set); + } + + return types; +} + +/* Remove all elements from spaces that encode loop AST generation types + * from "options". + */ +static __isl_give isl_union_set *clear_loop_types( + __isl_take isl_union_set *options) +{ + isl_union_set *types; + + types = loop_types(isl_union_set_get_space(options), 0); + options = isl_union_set_subtract(options, types); + + return options; +} + +/* Remove all elements from spaces that encode loop AST generation types + * for the isolated part from "options". + */ +static __isl_give isl_union_set *clear_isolate_loop_types( + __isl_take isl_union_set *options) +{ + isl_union_set *types; + + types = loop_types(isl_union_set_get_space(options), 1); + options = isl_union_set_subtract(options, types); + + return options; +} + +/* Replace the AST build options associated to "band" by "options". + * If there are any loop AST generation type options, then they + * are extracted and stored in band->loop_type. Otherwise, + * band->loop_type is removed to indicate that the default applies + * to all members. Similarly for the loop AST generation type options + * for the isolated part, which are stored in band->isolate_loop_type. + * The remaining options are stored in band->ast_build_options. + * + * Set anchored if the options include an isolate option since the + * domain of the wrapped map references the outer band node schedules. + */ +__isl_give isl_schedule_band *isl_schedule_band_set_ast_build_options( + __isl_take isl_schedule_band *band, __isl_take isl_union_set *options) +{ + int has_isolate, has_loop_type, has_isolate_loop_type; + + band = isl_schedule_band_cow(band); + if (!band || !options) + goto error; + has_isolate = has_isolate_option(options); + if (has_isolate < 0) + goto error; + has_loop_type = has_loop_type_options(options); + if (has_loop_type < 0) + goto error; + has_isolate_loop_type = has_isolate_loop_type_options(options); + if (has_isolate_loop_type < 0) + goto error; + + if (!has_loop_type) { + free(band->loop_type); + band->loop_type = NULL; + } else { + if (extract_loop_types(band, options) < 0) + goto error; + options = clear_loop_types(options); + if (!options) + goto error; + } + + if (!has_isolate_loop_type) { + free(band->isolate_loop_type); + band->isolate_loop_type = NULL; + } else { + if (extract_isolate_loop_types(band, options) < 0) + goto error; + options = clear_isolate_loop_types(options); + if (!options) + goto error; + } + + isl_union_set_free(band->ast_build_options); + band->ast_build_options = options; + band->anchored = has_isolate; + + return band; +error: + isl_schedule_band_free(band); + isl_union_set_free(options); + return NULL; +} + +/* Multiply the partial schedule of "band" with the factors in "mv". + * Replace the result by its greatest integer part to ensure + * that the schedule is always integral. + */ +__isl_give isl_schedule_band *isl_schedule_band_scale( + __isl_take isl_schedule_band *band, __isl_take isl_multi_val *mv) +{ + band = isl_schedule_band_cow(band); + if (!band || !mv) + goto error; + band->mupa = isl_multi_union_pw_aff_scale_multi_val(band->mupa, mv); + band->mupa = isl_multi_union_pw_aff_floor(band->mupa); + if (!band->mupa) + return isl_schedule_band_free(band); + return band; +error: + isl_schedule_band_free(band); + isl_multi_val_free(mv); + return NULL; +} + +/* Divide the partial schedule of "band" by the factors in "mv". + * Replace the result by its greatest integer part to ensure + * that the schedule is always integral. + */ +__isl_give isl_schedule_band *isl_schedule_band_scale_down( + __isl_take isl_schedule_band *band, __isl_take isl_multi_val *mv) +{ + band = isl_schedule_band_cow(band); + if (!band || !mv) + goto error; + band->mupa = isl_multi_union_pw_aff_scale_down_multi_val(band->mupa, + mv); + band->mupa = isl_multi_union_pw_aff_floor(band->mupa); + if (!band->mupa) + return isl_schedule_band_free(band); + return band; +error: + isl_schedule_band_free(band); + isl_multi_val_free(mv); + return NULL; +} + +/* Given the schedule of a band, construct the corresponding + * schedule for the tile loops based on the given tile sizes + * and return the result. + * + * If the scale tile loops options is set, then the tile loops + * are scaled by the tile sizes. + * + * That is replace each schedule dimension "i" by either + * "floor(i/s)" or "s * floor(i/s)". + */ +static isl_multi_union_pw_aff *isl_multi_union_pw_aff_tile( + __isl_take isl_multi_union_pw_aff *sched, + __isl_take isl_multi_val *sizes) +{ + isl_ctx *ctx; + int i, n; + isl_val *v; + int scale; + + ctx = isl_multi_val_get_ctx(sizes); + scale = isl_options_get_tile_scale_tile_loops(ctx); + + n = isl_multi_union_pw_aff_dim(sched, isl_dim_set); + for (i = 0; i < n; ++i) { + isl_union_pw_aff *upa; + + upa = isl_multi_union_pw_aff_get_union_pw_aff(sched, i); + v = isl_multi_val_get_val(sizes, i); + + upa = isl_union_pw_aff_scale_down_val(upa, isl_val_copy(v)); + upa = isl_union_pw_aff_floor(upa); + if (scale) + upa = isl_union_pw_aff_scale_val(upa, isl_val_copy(v)); + isl_val_free(v); + + sched = isl_multi_union_pw_aff_set_union_pw_aff(sched, i, upa); + } + + isl_multi_val_free(sizes); + return sched; +} + +/* Replace "band" by a band corresponding to the tile loops of a tiling + * with the given tile sizes. + */ +__isl_give isl_schedule_band *isl_schedule_band_tile( + __isl_take isl_schedule_band *band, __isl_take isl_multi_val *sizes) +{ + band = isl_schedule_band_cow(band); + if (!band || !sizes) + goto error; + band->mupa = isl_multi_union_pw_aff_tile(band->mupa, sizes); + if (!band->mupa) + return isl_schedule_band_free(band); + return band; +error: + isl_schedule_band_free(band); + isl_multi_val_free(sizes); + return NULL; +} + +/* Replace "band" by a band corresponding to the point loops of a tiling + * with the given tile sizes. + * "tile" is the corresponding tile loop band. + * + * If the shift point loops option is set, then the point loops + * are shifted to start at zero. That is, each schedule dimension "i" + * is replaced by "i - s * floor(i/s)". + * The expression "floor(i/s)" (or "s * floor(i/s)") is extracted from + * the tile band. + * + * Otherwise, the band is left untouched. + */ +__isl_give isl_schedule_band *isl_schedule_band_point( + __isl_take isl_schedule_band *band, __isl_keep isl_schedule_band *tile, + __isl_take isl_multi_val *sizes) +{ + isl_ctx *ctx; + isl_multi_union_pw_aff *scaled; + + if (!band || !sizes) + goto error; + + ctx = isl_schedule_band_get_ctx(band); + if (!isl_options_get_tile_shift_point_loops(ctx)) { + isl_multi_val_free(sizes); + return band; + } + band = isl_schedule_band_cow(band); + if (!band) + goto error; + + scaled = isl_schedule_band_get_partial_schedule(tile); + if (!isl_options_get_tile_scale_tile_loops(ctx)) + scaled = isl_multi_union_pw_aff_scale_multi_val(scaled, sizes); + else + isl_multi_val_free(sizes); + band->mupa = isl_multi_union_pw_aff_sub(band->mupa, scaled); + if (!band->mupa) + return isl_schedule_band_free(band); + return band; +error: + isl_schedule_band_free(band); + isl_multi_val_free(sizes); + return NULL; +} + +/* Drop the "n" dimensions starting at "pos" from "band". + * + * We apply the transformation even if "n" is zero to ensure consistent + * behavior with respect to changes in the schedule space. + * + * The loop AST generation types for the isolated part become + * meaningless after dropping dimensions, so we remove them. + */ +__isl_give isl_schedule_band *isl_schedule_band_drop( + __isl_take isl_schedule_band *band, int pos, int n) +{ + int i; + + if (pos < 0 || n < 0 || pos + n > band->n) + isl_die(isl_schedule_band_get_ctx(band), isl_error_internal, + "range out of bounds", + return isl_schedule_band_free(band)); + + band = isl_schedule_band_cow(band); + if (!band) + return NULL; + + band->mupa = isl_multi_union_pw_aff_drop_dims(band->mupa, + isl_dim_set, pos, n); + if (!band->mupa) + return isl_schedule_band_free(band); + + for (i = pos + n; i < band->n; ++i) + band->coincident[i - n] = band->coincident[i]; + if (band->loop_type) + for (i = pos + n; i < band->n; ++i) + band->loop_type[i - n] = band->loop_type[i]; + free(band->isolate_loop_type); + band->isolate_loop_type = NULL; + + band->n -= n; + + return band; +} + +/* Reset the user pointer on all identifiers of parameters and tuples + * in "band". + */ +__isl_give isl_schedule_band *isl_schedule_band_reset_user( + __isl_take isl_schedule_band *band) +{ + band = isl_schedule_band_cow(band); + if (!band) + return NULL; + + band->mupa = isl_multi_union_pw_aff_reset_user(band->mupa); + band->ast_build_options = + isl_union_set_reset_user(band->ast_build_options); + if (!band->mupa || !band->ast_build_options) + return isl_schedule_band_free(band); + + return band; +} + +/* Align the parameters of "band" to those of "space". + */ +__isl_give isl_schedule_band *isl_schedule_band_align_params( + __isl_take isl_schedule_band *band, __isl_take isl_space *space) +{ + band = isl_schedule_band_cow(band); + if (!band || !space) + goto error; + + band->mupa = isl_multi_union_pw_aff_align_params(band->mupa, + isl_space_copy(space)); + band->ast_build_options = + isl_union_set_align_params(band->ast_build_options, space); + if (!band->mupa || !band->ast_build_options) + return isl_schedule_band_free(band); + + return band; +error: + isl_space_free(space); + isl_schedule_band_free(band); + return NULL; +} + +/* Compute the pullback of "band" by the function represented by "upma". + * In other words, plug in "upma" in the iteration domains of "band". + */ +__isl_give isl_schedule_band *isl_schedule_band_pullback_union_pw_multi_aff( + __isl_take isl_schedule_band *band, + __isl_take isl_union_pw_multi_aff *upma) +{ + band = isl_schedule_band_cow(band); + if (!band || !upma) + goto error; + + band->mupa = + isl_multi_union_pw_aff_pullback_union_pw_multi_aff(band->mupa, + upma); + if (!band->mupa) + return isl_schedule_band_free(band); + + return band; +error: + isl_union_pw_multi_aff_free(upma); + isl_schedule_band_free(band); + return NULL; +} + +/* Compute the gist of "band" with respect to "context". + * In particular, compute the gist of the associated partial schedule. + */ +__isl_give isl_schedule_band *isl_schedule_band_gist( + __isl_take isl_schedule_band *band, __isl_take isl_union_set *context) +{ + if (!band || !context) + goto error; + if (band->n == 0) { + isl_union_set_free(context); + return band; + } + band = isl_schedule_band_cow(band); + if (!band) + goto error; + band->mupa = isl_multi_union_pw_aff_gist(band->mupa, context); + if (!band->mupa) + return isl_schedule_band_free(band); + return band; +error: + isl_union_set_free(context); + isl_schedule_band_free(band); + return NULL; +} diff -Nru cloog-0.18.2/isl/isl_schedule_band.h cloog-0.18.4/isl/isl_schedule_band.h --- cloog-0.18.2/isl/isl_schedule_band.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_schedule_band.h 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,115 @@ +#ifndef ISL_SCHEDULE_BAND_H +#define ISL_SCHEDULE_BAND_H + +#include +#include +#include + +/* Information about a band within a schedule. + * + * n is the number of scheduling dimensions within the band. + * coincident is an array of length n, indicating whether a scheduling dimension + * satisfies the coincidence constraints in the sense that + * the corresponding dependence distances are zero. + * permutable is set if the band is permutable. + * mupa is the partial schedule corresponding to this band. The dimension + * of mupa is equal to n. + * loop_type contains the loop AST generation types for the members + * in the band. It may be NULL, if all members are + * of type isl_ast_loop_default. + * isolate_loop_type contains the loop AST generation types for the members + * in the band for the isolated part. It may be NULL, if all members are + * of type isl_ast_loop_default. + * ast_build_options are the remaining AST build options associated + * to the band. + * anchored is set if the node depends on its position in the schedule tree. + * In particular, it is set if the AST build options include + * an isolate option. + */ +struct isl_schedule_band { + int ref; + + int n; + int *coincident; + int permutable; + + isl_multi_union_pw_aff *mupa; + + int anchored; + isl_union_set *ast_build_options; + enum isl_ast_loop_type *loop_type; + enum isl_ast_loop_type *isolate_loop_type; +}; +typedef struct isl_schedule_band isl_schedule_band; + +__isl_give isl_schedule_band *isl_schedule_band_from_multi_union_pw_aff( + __isl_take isl_multi_union_pw_aff *mupa); +__isl_give isl_schedule_band *isl_schedule_band_copy( + __isl_keep isl_schedule_band *band); +__isl_null isl_schedule_band *isl_schedule_band_free( + __isl_take isl_schedule_band *band); + +isl_ctx *isl_schedule_band_get_ctx(__isl_keep isl_schedule_band *band); + +isl_bool isl_schedule_band_plain_is_equal(__isl_keep isl_schedule_band *band1, + __isl_keep isl_schedule_band *band2); + +int isl_schedule_band_is_anchored(__isl_keep isl_schedule_band *band); + +__isl_give isl_space *isl_schedule_band_get_space( + __isl_keep isl_schedule_band *band); +__isl_give isl_schedule_band *isl_schedule_band_intersect_domain( + __isl_take isl_schedule_band *band, __isl_take isl_union_set *domain); +__isl_give isl_multi_union_pw_aff *isl_schedule_band_get_partial_schedule( + __isl_keep isl_schedule_band *band); +__isl_give isl_schedule_band *isl_schedule_band_set_partial_schedule( + __isl_take isl_schedule_band *band, + __isl_take isl_multi_union_pw_aff *schedule); +enum isl_ast_loop_type isl_schedule_band_member_get_ast_loop_type( + __isl_keep isl_schedule_band *band, int pos); +__isl_give isl_schedule_band *isl_schedule_band_member_set_ast_loop_type( + __isl_take isl_schedule_band *band, int pos, + enum isl_ast_loop_type type); +enum isl_ast_loop_type isl_schedule_band_member_get_isolate_ast_loop_type( + __isl_keep isl_schedule_band *band, int pos); +__isl_give isl_schedule_band * +isl_schedule_band_member_set_isolate_ast_loop_type( + __isl_take isl_schedule_band *band, int pos, + enum isl_ast_loop_type type); +__isl_give isl_union_set *isl_schedule_band_get_ast_build_options( + __isl_keep isl_schedule_band *band); +__isl_give isl_schedule_band *isl_schedule_band_set_ast_build_options( + __isl_take isl_schedule_band *band, __isl_take isl_union_set *options); + +int isl_schedule_band_n_member(__isl_keep isl_schedule_band *band); +isl_bool isl_schedule_band_member_get_coincident( + __isl_keep isl_schedule_band *band, int pos); +__isl_give isl_schedule_band *isl_schedule_band_member_set_coincident( + __isl_take isl_schedule_band *band, int pos, int coincident); +isl_bool isl_schedule_band_get_permutable(__isl_keep isl_schedule_band *band); +__isl_give isl_schedule_band *isl_schedule_band_set_permutable( + __isl_take isl_schedule_band *band, int permutable); + +__isl_give isl_schedule_band *isl_schedule_band_scale( + __isl_take isl_schedule_band *band, __isl_take isl_multi_val *mv); +__isl_give isl_schedule_band *isl_schedule_band_scale_down( + __isl_take isl_schedule_band *band, __isl_take isl_multi_val *mv); +__isl_give isl_schedule_band *isl_schedule_band_tile( + __isl_take isl_schedule_band *band, __isl_take isl_multi_val *sizes); +__isl_give isl_schedule_band *isl_schedule_band_point( + __isl_take isl_schedule_band *band, __isl_keep isl_schedule_band *tile, + __isl_take isl_multi_val *sizes); +__isl_give isl_schedule_band *isl_schedule_band_drop( + __isl_take isl_schedule_band *band, int pos, int n); +__isl_give isl_schedule_band *isl_schedule_band_gist( + __isl_take isl_schedule_band *band, __isl_take isl_union_set *context); + +__isl_give isl_schedule_band *isl_schedule_band_reset_user( + __isl_take isl_schedule_band *band); +__isl_give isl_schedule_band *isl_schedule_band_align_params( + __isl_take isl_schedule_band *band, __isl_take isl_space *space); +__isl_give isl_schedule_band *isl_schedule_band_pullback_union_pw_multi_aff( + __isl_take isl_schedule_band *band, + __isl_take isl_union_pw_multi_aff *upma); + +#endif diff -Nru cloog-0.18.2/isl/isl_schedule.c cloog-0.18.4/isl/isl_schedule.c --- cloog-0.18.2/isl/isl_schedule.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_schedule.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright 2011 INRIA Saclay - * Copyright 2012-2013 Ecole Normale Superieure + * Copyright 2012-2014 Ecole Normale Superieure * * Use of this software is governed by the MIT license * @@ -10,2972 +10,245 @@ * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include -#include -#include -#include -#include +#include +#include #include #include +#include +#include #include -#include -#include - -/* - * The scheduling algorithm implemented in this file was inspired by - * Bondhugula et al., "Automatic Transformations for Communication-Minimized - * Parallelization and Locality Optimization in the Polyhedral Model". - */ - - -/* Internal information about a node that is used during the construction - * of a schedule. - * dim represents the space in which the domain lives - * sched is a matrix representation of the schedule being constructed - * for this node - * sched_map is an isl_map representation of the same (partial) schedule - * sched_map may be NULL - * rank is the number of linearly independent rows in the linear part - * of sched - * the columns of cmap represent a change of basis for the schedule - * coefficients; the first rank columns span the linear part of - * the schedule rows - * start is the first variable in the LP problem in the sequences that - * represents the schedule coefficients of this node - * nvar is the dimension of the domain - * nparam is the number of parameters or 0 if we are not constructing - * a parametric schedule - * - * scc is the index of SCC (or WCC) this node belongs to - * - * band contains the band index for each of the rows of the schedule. - * band_id is used to differentiate between separate bands at the same - * level within the same parent band, i.e., bands that are separated - * by the parent band or bands that are independent of each other. - * zero contains a boolean for each of the rows of the schedule, - * indicating whether the corresponding scheduling dimension results - * in zero dependence distances within its band and with respect - * to the proximity edges. - */ -struct isl_sched_node { - isl_space *dim; - isl_mat *sched; - isl_map *sched_map; - int rank; - isl_mat *cmap; - int start; - int nvar; - int nparam; - - int scc; - - int *band; - int *band_id; - int *zero; -}; - -static int node_has_dim(const void *entry, const void *val) -{ - struct isl_sched_node *node = (struct isl_sched_node *)entry; - isl_space *dim = (isl_space *)val; - - return isl_space_is_equal(node->dim, dim); -} - -/* An edge in the dependence graph. An edge may be used to - * ensure validity of the generated schedule, to minimize the dependence - * distance or both - * - * map is the dependence relation - * src is the source node - * dst is the sink node - * validity is set if the edge is used to ensure correctness - * proximity is set if the edge is used to minimize dependence distances - * - * For validity edges, start and end mark the sequence of inequality - * constraints in the LP problem that encode the validity constraint - * corresponding to this edge. - */ -struct isl_sched_edge { - isl_map *map; - - struct isl_sched_node *src; - struct isl_sched_node *dst; - - int validity; - int proximity; - - int start; - int end; -}; - -enum isl_edge_type { - isl_edge_validity = 0, - isl_edge_first = isl_edge_validity, - isl_edge_proximity, - isl_edge_last = isl_edge_proximity -}; -/* Internal information about the dependence graph used during - * the construction of the schedule. +/* Return a schedule encapsulating the given schedule tree. * - * intra_hmap is a cache, mapping dependence relations to their dual, - * for dependences from a node to itself - * inter_hmap is a cache, mapping dependence relations to their dual, - * for dependences between distinct nodes + * We currently only allow schedule trees with a domain or extension as root. * - * n is the number of nodes - * node is the list of nodes - * maxvar is the maximal number of variables over all nodes - * max_row is the allocated number of rows in the schedule - * n_row is the current (maximal) number of linearly independent - * rows in the node schedules - * n_total_row is the current number of rows in the node schedules - * n_band is the current number of completed bands - * band_start is the starting row in the node schedules of the current band - * root is set if this graph is the original dependence graph, - * without any splitting - * - * sorted contains a list of node indices sorted according to the - * SCC to which a node belongs - * - * n_edge is the number of edges - * edge is the list of edges - * max_edge contains the maximal number of edges of each type; - * in particular, it contains the number of edges in the inital graph. - * edge_table contains pointers into the edge array, hashed on the source - * and sink spaces; there is one such table for each type; - * a given edge may be referenced from more than one table - * if the corresponding relation appears in more than of the - * sets of dependences - * - * node_table contains pointers into the node array, hashed on the space - * - * region contains a list of variable sequences that should be non-trivial - * - * lp contains the (I)LP problem used to obtain new schedule rows - * - * src_scc and dst_scc are the source and sink SCCs of an edge with - * conflicting constraints - * - * scc represents the number of components - */ -struct isl_sched_graph { - isl_hmap_map_basic_set *intra_hmap; - isl_hmap_map_basic_set *inter_hmap; - - struct isl_sched_node *node; - int n; - int maxvar; - int max_row; - int n_row; - - int *sorted; - - int n_band; - int n_total_row; - int band_start; - - int root; - - struct isl_sched_edge *edge; - int n_edge; - int max_edge[isl_edge_last + 1]; - struct isl_hash_table *edge_table[isl_edge_last + 1]; - - struct isl_hash_table *node_table; - struct isl_region *region; - - isl_basic_set *lp; - - int src_scc; - int dst_scc; - - int scc; -}; - -/* Initialize node_table based on the list of nodes. - */ -static int graph_init_table(isl_ctx *ctx, struct isl_sched_graph *graph) -{ - int i; - - graph->node_table = isl_hash_table_alloc(ctx, graph->n); - if (!graph->node_table) - return -1; - - for (i = 0; i < graph->n; ++i) { - struct isl_hash_table_entry *entry; - uint32_t hash; - - hash = isl_space_get_hash(graph->node[i].dim); - entry = isl_hash_table_find(ctx, graph->node_table, hash, - &node_has_dim, - graph->node[i].dim, 1); - if (!entry) - return -1; - entry->data = &graph->node[i]; - } - - return 0; -} - -/* Return a pointer to the node that lives within the given space, - * or NULL if there is no such node. - */ -static struct isl_sched_node *graph_find_node(isl_ctx *ctx, - struct isl_sched_graph *graph, __isl_keep isl_space *dim) -{ - struct isl_hash_table_entry *entry; - uint32_t hash; - - hash = isl_space_get_hash(dim); - entry = isl_hash_table_find(ctx, graph->node_table, hash, - &node_has_dim, dim, 0); - - return entry ? entry->data : NULL; -} - -static int edge_has_src_and_dst(const void *entry, const void *val) -{ - const struct isl_sched_edge *edge = entry; - const struct isl_sched_edge *temp = val; - - return edge->src == temp->src && edge->dst == temp->dst; -} - -/* Add the given edge to graph->edge_table[type]. - */ -static int graph_edge_table_add(isl_ctx *ctx, struct isl_sched_graph *graph, - enum isl_edge_type type, struct isl_sched_edge *edge) -{ - struct isl_hash_table_entry *entry; - uint32_t hash; - - hash = isl_hash_init(); - hash = isl_hash_builtin(hash, edge->src); - hash = isl_hash_builtin(hash, edge->dst); - entry = isl_hash_table_find(ctx, graph->edge_table[type], hash, - &edge_has_src_and_dst, edge, 1); - if (!entry) - return -1; - entry->data = edge; - - return 0; -} - -/* Allocate the edge_tables based on the maximal number of edges of - * each type. - */ -static int graph_init_edge_tables(isl_ctx *ctx, struct isl_sched_graph *graph) -{ - int i; - - for (i = 0; i <= isl_edge_last; ++i) { - graph->edge_table[i] = isl_hash_table_alloc(ctx, - graph->max_edge[i]); - if (!graph->edge_table[i]) - return -1; - } - - return 0; -} - -/* If graph->edge_table[type] contains an edge from the given source - * to the given destination, then return the hash table entry of this edge. - * Otherwise, return NULL. - */ -static struct isl_hash_table_entry *graph_find_edge_entry( - struct isl_sched_graph *graph, - enum isl_edge_type type, - struct isl_sched_node *src, struct isl_sched_node *dst) -{ - isl_ctx *ctx = isl_space_get_ctx(src->dim); - uint32_t hash; - struct isl_sched_edge temp = { .src = src, .dst = dst }; - - hash = isl_hash_init(); - hash = isl_hash_builtin(hash, temp.src); - hash = isl_hash_builtin(hash, temp.dst); - return isl_hash_table_find(ctx, graph->edge_table[type], hash, - &edge_has_src_and_dst, &temp, 0); -} - - -/* If graph->edge_table[type] contains an edge from the given source - * to the given destination, then return this edge. - * Otherwise, return NULL. + * The leaf field is initialized as a leaf node so that it can be + * used to represent leaves in the constructed schedule. + * The reference count is set to -1 since the isl_schedule_tree + * should never be freed. It is up to the (internal) users of + * these leaves to ensure that they are only used while the schedule + * is still alive. */ -static struct isl_sched_edge *graph_find_edge(struct isl_sched_graph *graph, - enum isl_edge_type type, - struct isl_sched_node *src, struct isl_sched_node *dst) +__isl_give isl_schedule *isl_schedule_from_schedule_tree(isl_ctx *ctx, + __isl_take isl_schedule_tree *tree) { - struct isl_hash_table_entry *entry; + enum isl_schedule_node_type type; + isl_schedule *schedule; - entry = graph_find_edge_entry(graph, type, src, dst); - if (!entry) + if (!tree) return NULL; + type = isl_schedule_tree_get_type(tree); + if (type != isl_schedule_node_domain && + type != isl_schedule_node_extension) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_unsupported, + "root of schedule tree should be a domain or extension", + goto error); - return entry->data; -} - -/* Check whether the dependence graph has an edge of the given type - * between the given two nodes. - */ -static int graph_has_edge(struct isl_sched_graph *graph, - enum isl_edge_type type, - struct isl_sched_node *src, struct isl_sched_node *dst) -{ - struct isl_sched_edge *edge; - int empty; - - edge = graph_find_edge(graph, type, src, dst); - if (!edge) - return 0; - - empty = isl_map_plain_is_empty(edge->map); - if (empty < 0) - return -1; - - return !empty; -} - -/* If there is an edge from the given source to the given destination - * of any type then return this edge. - * Otherwise, return NULL. - */ -static struct isl_sched_edge *graph_find_any_edge(struct isl_sched_graph *graph, - struct isl_sched_node *src, struct isl_sched_node *dst) -{ - enum isl_edge_type i; - struct isl_sched_edge *edge; + schedule = isl_calloc_type(ctx, isl_schedule); + if (!schedule) + goto error; - for (i = isl_edge_first; i <= isl_edge_last; ++i) { - edge = graph_find_edge(graph, i, src, dst); - if (edge) - return edge; - } + schedule->leaf.ctx = ctx; + isl_ctx_ref(ctx); + schedule->ref = 1; + schedule->root = tree; + schedule->leaf.ref = -1; + schedule->leaf.type = isl_schedule_node_leaf; + return schedule; +error: + isl_schedule_tree_free(tree); return NULL; } -/* Remove the given edge from all the edge_tables that refer to it. - */ -static void graph_remove_edge(struct isl_sched_graph *graph, - struct isl_sched_edge *edge) -{ - isl_ctx *ctx = isl_map_get_ctx(edge->map); - enum isl_edge_type i; - - for (i = isl_edge_first; i <= isl_edge_last; ++i) { - struct isl_hash_table_entry *entry; - - entry = graph_find_edge_entry(graph, i, edge->src, edge->dst); - if (!entry) - continue; - if (entry->data != edge) - continue; - isl_hash_table_remove(ctx, graph->edge_table[i], entry); - } -} - -/* Check whether the dependence graph has any edge - * between the given two nodes. - */ -static int graph_has_any_edge(struct isl_sched_graph *graph, - struct isl_sched_node *src, struct isl_sched_node *dst) -{ - enum isl_edge_type i; - int r; - - for (i = isl_edge_first; i <= isl_edge_last; ++i) { - r = graph_has_edge(graph, i, src, dst); - if (r < 0 || r) - return r; - } - - return r; -} - -/* Check whether the dependence graph has a validity edge - * between the given two nodes. +/* Return a pointer to a schedule with as single node + * a domain node with the given domain. */ -static int graph_has_validity_edge(struct isl_sched_graph *graph, - struct isl_sched_node *src, struct isl_sched_node *dst) -{ - return graph_has_edge(graph, isl_edge_validity, src, dst); -} - -static int graph_alloc(isl_ctx *ctx, struct isl_sched_graph *graph, - int n_node, int n_edge) -{ - int i; - - graph->n = n_node; - graph->n_edge = n_edge; - graph->node = isl_calloc_array(ctx, struct isl_sched_node, graph->n); - graph->sorted = isl_calloc_array(ctx, int, graph->n); - graph->region = isl_alloc_array(ctx, struct isl_region, graph->n); - graph->edge = isl_calloc_array(ctx, - struct isl_sched_edge, graph->n_edge); - - graph->intra_hmap = isl_hmap_map_basic_set_alloc(ctx, 2 * n_edge); - graph->inter_hmap = isl_hmap_map_basic_set_alloc(ctx, 2 * n_edge); - - if (!graph->node || !graph->region || (graph->n_edge && !graph->edge) || - !graph->sorted) - return -1; - - for(i = 0; i < graph->n; ++i) - graph->sorted[i] = i; - - return 0; -} - -static void graph_free(isl_ctx *ctx, struct isl_sched_graph *graph) +__isl_give isl_schedule *isl_schedule_from_domain( + __isl_take isl_union_set *domain) { - int i; - - isl_hmap_map_basic_set_free(ctx, graph->intra_hmap); - isl_hmap_map_basic_set_free(ctx, graph->inter_hmap); + isl_ctx *ctx; + isl_schedule_tree *tree; - for (i = 0; i < graph->n; ++i) { - isl_space_free(graph->node[i].dim); - isl_mat_free(graph->node[i].sched); - isl_map_free(graph->node[i].sched_map); - isl_mat_free(graph->node[i].cmap); - if (graph->root) { - free(graph->node[i].band); - free(graph->node[i].band_id); - free(graph->node[i].zero); - } - } - free(graph->node); - free(graph->sorted); - for (i = 0; i < graph->n_edge; ++i) - isl_map_free(graph->edge[i].map); - free(graph->edge); - free(graph->region); - for (i = 0; i <= isl_edge_last; ++i) - isl_hash_table_free(ctx, graph->edge_table[i]); - isl_hash_table_free(ctx, graph->node_table); - isl_basic_set_free(graph->lp); + ctx = isl_union_set_get_ctx(domain); + tree = isl_schedule_tree_from_domain(domain); + return isl_schedule_from_schedule_tree(ctx, tree); } -/* For each "set" on which this function is called, increment - * graph->n by one and update graph->maxvar. +/* Return a pointer to a schedule with as single node + * a domain node with an empty domain. */ -static int init_n_maxvar(__isl_take isl_set *set, void *user) +__isl_give isl_schedule *isl_schedule_empty(__isl_take isl_space *space) { - struct isl_sched_graph *graph = user; - int nvar = isl_set_dim(set, isl_dim_set); - - graph->n++; - if (nvar > graph->maxvar) - graph->maxvar = nvar; - - isl_set_free(set); - - return 0; + return isl_schedule_from_domain(isl_union_set_empty(space)); } -/* Compute the number of rows that should be allocated for the schedule. - * The graph can be split at most "n - 1" times, there can be at most - * two rows for each dimension in the iteration domains (in particular, - * we usually have one row, but it may be split by split_scaled), - * and there can be one extra row for ordering the statements. - * Note that if we have actually split "n - 1" times, then no ordering - * is needed, so in principle we could use "graph->n + 2 * graph->maxvar - 1". +/* Return a new reference to "sched". */ -static int compute_max_row(struct isl_sched_graph *graph, - __isl_keep isl_union_set *domain) +__isl_give isl_schedule *isl_schedule_copy(__isl_keep isl_schedule *sched) { - graph->n = 0; - graph->maxvar = 0; - if (isl_union_set_foreach_set(domain, &init_n_maxvar, graph) < 0) - return -1; - graph->max_row = graph->n + 2 * graph->maxvar; + if (!sched) + return NULL; - return 0; + sched->ref++; + return sched; } -/* Add a new node to the graph representing the given set. +/* Return an isl_schedule that is equal to "schedule" and that has only + * a single reference. + * + * We only need and support this function when the schedule is represented + * as a schedule tree. */ -static int extract_node(__isl_take isl_set *set, void *user) +__isl_give isl_schedule *isl_schedule_cow(__isl_take isl_schedule *schedule) { - int nvar, nparam; isl_ctx *ctx; - isl_space *dim; - isl_mat *sched; - struct isl_sched_graph *graph = user; - int *band, *band_id, *zero; - - ctx = isl_set_get_ctx(set); - dim = isl_set_get_space(set); - isl_set_free(set); - nvar = isl_space_dim(dim, isl_dim_set); - nparam = isl_space_dim(dim, isl_dim_param); - if (!ctx->opt->schedule_parametric) - nparam = 0; - sched = isl_mat_alloc(ctx, 0, 1 + nparam + nvar); - graph->node[graph->n].dim = dim; - graph->node[graph->n].nvar = nvar; - graph->node[graph->n].nparam = nparam; - graph->node[graph->n].sched = sched; - graph->node[graph->n].sched_map = NULL; - band = isl_alloc_array(ctx, int, graph->max_row); - graph->node[graph->n].band = band; - band_id = isl_calloc_array(ctx, int, graph->max_row); - graph->node[graph->n].band_id = band_id; - zero = isl_calloc_array(ctx, int, graph->max_row); - graph->node[graph->n].zero = zero; - graph->n++; - - if (!sched || (graph->max_row && (!band || !band_id || !zero))) - return -1; - - return 0; -} + isl_schedule_tree *tree; -struct isl_extract_edge_data { - enum isl_edge_type type; - struct isl_sched_graph *graph; -}; - -/* Add a new edge to the graph based on the given map - * and add it to data->graph->edge_table[data->type]. - * If a dependence relation of a given type happens to be identical - * to one of the dependence relations of a type that was added before, - * then we don't create a new edge, but instead mark the original edge - * as also representing a dependence of the current type. - */ -static int extract_edge(__isl_take isl_map *map, void *user) -{ - isl_ctx *ctx = isl_map_get_ctx(map); - struct isl_extract_edge_data *data = user; - struct isl_sched_graph *graph = data->graph; - struct isl_sched_node *src, *dst; - isl_space *dim; - struct isl_sched_edge *edge; - int is_equal; - - dim = isl_space_domain(isl_map_get_space(map)); - src = graph_find_node(ctx, graph, dim); - isl_space_free(dim); - dim = isl_space_range(isl_map_get_space(map)); - dst = graph_find_node(ctx, graph, dim); - isl_space_free(dim); - - if (!src || !dst) { - isl_map_free(map); - return 0; - } - - graph->edge[graph->n_edge].src = src; - graph->edge[graph->n_edge].dst = dst; - graph->edge[graph->n_edge].map = map; - if (data->type == isl_edge_validity) { - graph->edge[graph->n_edge].validity = 1; - graph->edge[graph->n_edge].proximity = 0; - } - if (data->type == isl_edge_proximity) { - graph->edge[graph->n_edge].validity = 0; - graph->edge[graph->n_edge].proximity = 1; - } - graph->n_edge++; - - edge = graph_find_any_edge(graph, src, dst); - if (!edge) - return graph_edge_table_add(ctx, graph, data->type, - &graph->edge[graph->n_edge - 1]); - is_equal = isl_map_plain_is_equal(map, edge->map); - if (is_equal < 0) - return -1; - if (!is_equal) - return graph_edge_table_add(ctx, graph, data->type, - &graph->edge[graph->n_edge - 1]); - - graph->n_edge--; - edge->validity |= graph->edge[graph->n_edge].validity; - edge->proximity |= graph->edge[graph->n_edge].proximity; - isl_map_free(map); + if (!schedule) + return NULL; + if (schedule->ref == 1) + return schedule; - return graph_edge_table_add(ctx, graph, data->type, edge); + ctx = isl_schedule_get_ctx(schedule); + if (!schedule->root) + isl_die(ctx, isl_error_internal, + "only for schedule tree based schedules", + return isl_schedule_free(schedule)); + schedule->ref--; + tree = isl_schedule_tree_copy(schedule->root); + return isl_schedule_from_schedule_tree(ctx, tree); } -/* Check whether there is any dependence from node[j] to node[i] - * or from node[i] to node[j]. - */ -static int node_follows_weak(int i, int j, void *user) +__isl_null isl_schedule *isl_schedule_free(__isl_take isl_schedule *sched) { - int f; - struct isl_sched_graph *graph = user; - - f = graph_has_any_edge(graph, &graph->node[j], &graph->node[i]); - if (f < 0 || f) - return f; - return graph_has_any_edge(graph, &graph->node[i], &graph->node[j]); -} + if (!sched) + return NULL; -/* Check whether there is a validity dependence from node[j] to node[i], - * forcing node[i] to follow node[j]. - */ -static int node_follows_strong(int i, int j, void *user) -{ - struct isl_sched_graph *graph = user; + if (--sched->ref > 0) + return NULL; - return graph_has_validity_edge(graph, &graph->node[j], &graph->node[i]); + isl_band_list_free(sched->band_forest); + isl_schedule_tree_free(sched->root); + isl_ctx_deref(sched->leaf.ctx); + free(sched); + return NULL; } -/* Use Tarjan's algorithm for computing the strongly connected components - * in the dependence graph (only validity edges). - * If weak is set, we consider the graph to be undirected and - * we effectively compute the (weakly) connected components. - * Additionally, we also consider other edges when weak is set. +/* Replace the root of "schedule" by "tree". */ -static int detect_ccs(isl_ctx *ctx, struct isl_sched_graph *graph, int weak) +__isl_give isl_schedule *isl_schedule_set_root( + __isl_take isl_schedule *schedule, __isl_take isl_schedule_tree *tree) { - int i, n; - struct isl_tarjan_graph *g = NULL; - - g = isl_tarjan_graph_init(ctx, graph->n, - weak ? &node_follows_weak : &node_follows_strong, graph); - if (!g) - return -1; - - graph->scc = 0; - i = 0; - n = graph->n; - while (n) { - while (g->order[i] != -1) { - graph->node[g->order[i]].scc = graph->scc; - --n; - ++i; - } - ++i; - graph->scc++; + if (!schedule || !tree) + goto error; + if (schedule->root == tree) { + isl_schedule_tree_free(tree); + return schedule; } - isl_tarjan_graph_free(g); - - return 0; -} - -/* Apply Tarjan's algorithm to detect the strongly connected components - * in the dependence graph. - */ -static int detect_sccs(isl_ctx *ctx, struct isl_sched_graph *graph) -{ - return detect_ccs(ctx, graph, 0); -} - -/* Apply Tarjan's algorithm to detect the (weakly) connected components - * in the dependence graph. - */ -static int detect_wccs(isl_ctx *ctx, struct isl_sched_graph *graph) -{ - return detect_ccs(ctx, graph, 1); -} - -static int cmp_scc(const void *a, const void *b, void *data) -{ - struct isl_sched_graph *graph = data; - const int *i1 = a; - const int *i2 = b; + schedule = isl_schedule_cow(schedule); + if (!schedule) + goto error; + isl_schedule_tree_free(schedule->root); + schedule->root = tree; - return graph->node[*i1].scc - graph->node[*i2].scc; + return schedule; +error: + isl_schedule_free(schedule); + isl_schedule_tree_free(tree); + return NULL; } -/* Sort the elements of graph->sorted according to the corresponding SCCs. - */ -static int sort_sccs(struct isl_sched_graph *graph) +isl_ctx *isl_schedule_get_ctx(__isl_keep isl_schedule *schedule) { - return isl_sort(graph->sorted, graph->n, sizeof(int), &cmp_scc, graph); + return schedule ? schedule->leaf.ctx : NULL; } -/* Given a dependence relation R from a node to itself, - * construct the set of coefficients of valid constraints for elements - * in that dependence relation. - * In particular, the result contains tuples of coefficients - * c_0, c_n, c_x such that - * - * c_0 + c_n n + c_x y - c_x x >= 0 for each (x,y) in R +/* Return a pointer to the leaf of "schedule". * - * or, equivalently, - * - * c_0 + c_n n + c_x d >= 0 for each d in delta R = { y - x | (x,y) in R } - * - * We choose here to compute the dual of delta R. - * Alternatively, we could have computed the dual of R, resulting - * in a set of tuples c_0, c_n, c_x, c_y, and then - * plugged in (c_0, c_n, c_x, -c_x). + * Even though these leaves are not reference counted, we still + * indicate that this function does not return a copy. */ -static __isl_give isl_basic_set *intra_coefficients( - struct isl_sched_graph *graph, __isl_take isl_map *map) +__isl_keep isl_schedule_tree *isl_schedule_peek_leaf( + __isl_keep isl_schedule *schedule) { - isl_ctx *ctx = isl_map_get_ctx(map); - isl_set *delta; - isl_basic_set *coef; - - if (isl_hmap_map_basic_set_has(ctx, graph->intra_hmap, map)) - return isl_hmap_map_basic_set_get(ctx, graph->intra_hmap, map); - - delta = isl_set_remove_divs(isl_map_deltas(isl_map_copy(map))); - coef = isl_set_coefficients(delta); - isl_hmap_map_basic_set_set(ctx, graph->intra_hmap, map, - isl_basic_set_copy(coef)); - - return coef; + return schedule ? &schedule->leaf : NULL; } -/* Given a dependence relation R, * construct the set of coefficients - * of valid constraints for elements in that dependence relation. - * In particular, the result contains tuples of coefficients - * c_0, c_n, c_x, c_y such that - * - * c_0 + c_n n + c_x x + c_y y >= 0 for each (x,y) in R - * +/* Are "schedule1" and "schedule2" obviously equal to each other? */ -static __isl_give isl_basic_set *inter_coefficients( - struct isl_sched_graph *graph, __isl_take isl_map *map) +isl_bool isl_schedule_plain_is_equal(__isl_keep isl_schedule *schedule1, + __isl_keep isl_schedule *schedule2) { - isl_ctx *ctx = isl_map_get_ctx(map); - isl_set *set; - isl_basic_set *coef; - - if (isl_hmap_map_basic_set_has(ctx, graph->inter_hmap, map)) - return isl_hmap_map_basic_set_get(ctx, graph->inter_hmap, map); - - set = isl_map_wrap(isl_map_remove_divs(isl_map_copy(map))); - coef = isl_set_coefficients(set); - isl_hmap_map_basic_set_set(ctx, graph->inter_hmap, map, - isl_basic_set_copy(coef)); - - return coef; -} - -/* Add constraints to graph->lp that force validity for the given - * dependence from a node i to itself. - * That is, add constraints that enforce - * - * (c_i_0 + c_i_n n + c_i_x y) - (c_i_0 + c_i_n n + c_i_x x) - * = c_i_x (y - x) >= 0 - * - * for each (x,y) in R. - * We obtain general constraints on coefficients (c_0, c_n, c_x) - * of valid constraints for (y - x) and then plug in (0, 0, c_i_x^+ - c_i_x^-), - * where c_i_x = c_i_x^+ - c_i_x^-, with c_i_x^+ and c_i_x^- non-negative. - * In graph->lp, the c_i_x^- appear before their c_i_x^+ counterpart. - * - * Actually, we do not construct constraints for the c_i_x themselves, - * but for the coefficients of c_i_x written as a linear combination - * of the columns in node->cmap. - */ -static int add_intra_validity_constraints(struct isl_sched_graph *graph, - struct isl_sched_edge *edge) -{ - unsigned total; - isl_map *map = isl_map_copy(edge->map); - isl_ctx *ctx = isl_map_get_ctx(map); - isl_space *dim; - isl_dim_map *dim_map; - isl_basic_set *coef; - struct isl_sched_node *node = edge->src; - - coef = intra_coefficients(graph, map); - - dim = isl_space_domain(isl_space_unwrap(isl_basic_set_get_space(coef))); - - coef = isl_basic_set_transform_dims(coef, isl_dim_set, - isl_space_dim(dim, isl_dim_set), isl_mat_copy(node->cmap)); - if (!coef) - goto error; - - total = isl_basic_set_total_dim(graph->lp); - dim_map = isl_dim_map_alloc(ctx, total); - isl_dim_map_range(dim_map, node->start + 2 * node->nparam + 1, 2, - isl_space_dim(dim, isl_dim_set), 1, - node->nvar, -1); - isl_dim_map_range(dim_map, node->start + 2 * node->nparam + 2, 2, - isl_space_dim(dim, isl_dim_set), 1, - node->nvar, 1); - graph->lp = isl_basic_set_extend_constraints(graph->lp, - coef->n_eq, coef->n_ineq); - graph->lp = isl_basic_set_add_constraints_dim_map(graph->lp, - coef, dim_map); - isl_space_free(dim); - - return 0; -error: - isl_space_free(dim); - return -1; -} - -/* Add constraints to graph->lp that force validity for the given - * dependence from node i to node j. - * That is, add constraints that enforce - * - * (c_j_0 + c_j_n n + c_j_x y) - (c_i_0 + c_i_n n + c_i_x x) >= 0 - * - * for each (x,y) in R. - * We obtain general constraints on coefficients (c_0, c_n, c_x, c_y) - * of valid constraints for R and then plug in - * (c_j_0 - c_i_0, c_j_n^+ - c_j_n^- - (c_i_n^+ - c_i_n^-), - * c_j_x^+ - c_j_x^- - (c_i_x^+ - c_i_x^-)), - * where c_* = c_*^+ - c_*^-, with c_*^+ and c_*^- non-negative. - * In graph->lp, the c_*^- appear before their c_*^+ counterpart. - * - * Actually, we do not construct constraints for the c_*_x themselves, - * but for the coefficients of c_*_x written as a linear combination - * of the columns in node->cmap. - */ -static int add_inter_validity_constraints(struct isl_sched_graph *graph, - struct isl_sched_edge *edge) -{ - unsigned total; - isl_map *map = isl_map_copy(edge->map); - isl_ctx *ctx = isl_map_get_ctx(map); - isl_space *dim; - isl_dim_map *dim_map; - isl_basic_set *coef; - struct isl_sched_node *src = edge->src; - struct isl_sched_node *dst = edge->dst; - - coef = inter_coefficients(graph, map); - - dim = isl_space_domain(isl_space_unwrap(isl_basic_set_get_space(coef))); - - coef = isl_basic_set_transform_dims(coef, isl_dim_set, - isl_space_dim(dim, isl_dim_set), isl_mat_copy(src->cmap)); - coef = isl_basic_set_transform_dims(coef, isl_dim_set, - isl_space_dim(dim, isl_dim_set) + src->nvar, - isl_mat_copy(dst->cmap)); - if (!coef) - goto error; - - total = isl_basic_set_total_dim(graph->lp); - dim_map = isl_dim_map_alloc(ctx, total); - - isl_dim_map_range(dim_map, dst->start, 0, 0, 0, 1, 1); - isl_dim_map_range(dim_map, dst->start + 1, 2, 1, 1, dst->nparam, -1); - isl_dim_map_range(dim_map, dst->start + 2, 2, 1, 1, dst->nparam, 1); - isl_dim_map_range(dim_map, dst->start + 2 * dst->nparam + 1, 2, - isl_space_dim(dim, isl_dim_set) + src->nvar, 1, - dst->nvar, -1); - isl_dim_map_range(dim_map, dst->start + 2 * dst->nparam + 2, 2, - isl_space_dim(dim, isl_dim_set) + src->nvar, 1, - dst->nvar, 1); - - isl_dim_map_range(dim_map, src->start, 0, 0, 0, 1, -1); - isl_dim_map_range(dim_map, src->start + 1, 2, 1, 1, src->nparam, 1); - isl_dim_map_range(dim_map, src->start + 2, 2, 1, 1, src->nparam, -1); - isl_dim_map_range(dim_map, src->start + 2 * src->nparam + 1, 2, - isl_space_dim(dim, isl_dim_set), 1, - src->nvar, 1); - isl_dim_map_range(dim_map, src->start + 2 * src->nparam + 2, 2, - isl_space_dim(dim, isl_dim_set), 1, - src->nvar, -1); - - edge->start = graph->lp->n_ineq; - graph->lp = isl_basic_set_extend_constraints(graph->lp, - coef->n_eq, coef->n_ineq); - graph->lp = isl_basic_set_add_constraints_dim_map(graph->lp, - coef, dim_map); - if (!graph->lp) - goto error; - isl_space_free(dim); - edge->end = graph->lp->n_ineq; - - return 0; -error: - isl_space_free(dim); - return -1; -} - -/* Add constraints to graph->lp that bound the dependence distance for the given - * dependence from a node i to itself. - * If s = 1, we add the constraint - * - * c_i_x (y - x) <= m_0 + m_n n - * - * or - * - * -c_i_x (y - x) + m_0 + m_n n >= 0 - * - * for each (x,y) in R. - * If s = -1, we add the constraint - * - * -c_i_x (y - x) <= m_0 + m_n n - * - * or - * - * c_i_x (y - x) + m_0 + m_n n >= 0 - * - * for each (x,y) in R. - * We obtain general constraints on coefficients (c_0, c_n, c_x) - * of valid constraints for (y - x) and then plug in (m_0, m_n, -s * c_i_x), - * with each coefficient (except m_0) represented as a pair of non-negative - * coefficients. - * - * Actually, we do not construct constraints for the c_i_x themselves, - * but for the coefficients of c_i_x written as a linear combination - * of the columns in node->cmap. - */ -static int add_intra_proximity_constraints(struct isl_sched_graph *graph, - struct isl_sched_edge *edge, int s) -{ - unsigned total; - unsigned nparam; - isl_map *map = isl_map_copy(edge->map); - isl_ctx *ctx = isl_map_get_ctx(map); - isl_space *dim; - isl_dim_map *dim_map; - isl_basic_set *coef; - struct isl_sched_node *node = edge->src; - - coef = intra_coefficients(graph, map); - - dim = isl_space_domain(isl_space_unwrap(isl_basic_set_get_space(coef))); - - coef = isl_basic_set_transform_dims(coef, isl_dim_set, - isl_space_dim(dim, isl_dim_set), isl_mat_copy(node->cmap)); - if (!coef) - goto error; - - nparam = isl_space_dim(node->dim, isl_dim_param); - total = isl_basic_set_total_dim(graph->lp); - dim_map = isl_dim_map_alloc(ctx, total); - isl_dim_map_range(dim_map, 1, 0, 0, 0, 1, 1); - isl_dim_map_range(dim_map, 4, 2, 1, 1, nparam, -1); - isl_dim_map_range(dim_map, 5, 2, 1, 1, nparam, 1); - isl_dim_map_range(dim_map, node->start + 2 * node->nparam + 1, 2, - isl_space_dim(dim, isl_dim_set), 1, - node->nvar, s); - isl_dim_map_range(dim_map, node->start + 2 * node->nparam + 2, 2, - isl_space_dim(dim, isl_dim_set), 1, - node->nvar, -s); - graph->lp = isl_basic_set_extend_constraints(graph->lp, - coef->n_eq, coef->n_ineq); - graph->lp = isl_basic_set_add_constraints_dim_map(graph->lp, - coef, dim_map); - isl_space_free(dim); - - return 0; -error: - isl_space_free(dim); - return -1; -} - -/* Add constraints to graph->lp that bound the dependence distance for the given - * dependence from node i to node j. - * If s = 1, we add the constraint - * - * (c_j_0 + c_j_n n + c_j_x y) - (c_i_0 + c_i_n n + c_i_x x) - * <= m_0 + m_n n - * - * or - * - * -(c_j_0 + c_j_n n + c_j_x y) + (c_i_0 + c_i_n n + c_i_x x) + - * m_0 + m_n n >= 0 - * - * for each (x,y) in R. - * If s = -1, we add the constraint - * - * -((c_j_0 + c_j_n n + c_j_x y) - (c_i_0 + c_i_n n + c_i_x x)) - * <= m_0 + m_n n - * - * or - * - * (c_j_0 + c_j_n n + c_j_x y) - (c_i_0 + c_i_n n + c_i_x x) + - * m_0 + m_n n >= 0 - * - * for each (x,y) in R. - * We obtain general constraints on coefficients (c_0, c_n, c_x, c_y) - * of valid constraints for R and then plug in - * (m_0 - s*c_j_0 + s*c_i_0, m_n - s*c_j_n + s*c_i_n, - * -s*c_j_x+s*c_i_x) - * with each coefficient (except m_0, c_j_0 and c_i_0) - * represented as a pair of non-negative coefficients. - * - * Actually, we do not construct constraints for the c_*_x themselves, - * but for the coefficients of c_*_x written as a linear combination - * of the columns in node->cmap. - */ -static int add_inter_proximity_constraints(struct isl_sched_graph *graph, - struct isl_sched_edge *edge, int s) -{ - unsigned total; - unsigned nparam; - isl_map *map = isl_map_copy(edge->map); - isl_ctx *ctx = isl_map_get_ctx(map); - isl_space *dim; - isl_dim_map *dim_map; - isl_basic_set *coef; - struct isl_sched_node *src = edge->src; - struct isl_sched_node *dst = edge->dst; - - coef = inter_coefficients(graph, map); - - dim = isl_space_domain(isl_space_unwrap(isl_basic_set_get_space(coef))); - - coef = isl_basic_set_transform_dims(coef, isl_dim_set, - isl_space_dim(dim, isl_dim_set), isl_mat_copy(src->cmap)); - coef = isl_basic_set_transform_dims(coef, isl_dim_set, - isl_space_dim(dim, isl_dim_set) + src->nvar, - isl_mat_copy(dst->cmap)); - if (!coef) - goto error; - - nparam = isl_space_dim(src->dim, isl_dim_param); - total = isl_basic_set_total_dim(graph->lp); - dim_map = isl_dim_map_alloc(ctx, total); - - isl_dim_map_range(dim_map, 1, 0, 0, 0, 1, 1); - isl_dim_map_range(dim_map, 4, 2, 1, 1, nparam, -1); - isl_dim_map_range(dim_map, 5, 2, 1, 1, nparam, 1); - - isl_dim_map_range(dim_map, dst->start, 0, 0, 0, 1, -s); - isl_dim_map_range(dim_map, dst->start + 1, 2, 1, 1, dst->nparam, s); - isl_dim_map_range(dim_map, dst->start + 2, 2, 1, 1, dst->nparam, -s); - isl_dim_map_range(dim_map, dst->start + 2 * dst->nparam + 1, 2, - isl_space_dim(dim, isl_dim_set) + src->nvar, 1, - dst->nvar, s); - isl_dim_map_range(dim_map, dst->start + 2 * dst->nparam + 2, 2, - isl_space_dim(dim, isl_dim_set) + src->nvar, 1, - dst->nvar, -s); - - isl_dim_map_range(dim_map, src->start, 0, 0, 0, 1, s); - isl_dim_map_range(dim_map, src->start + 1, 2, 1, 1, src->nparam, -s); - isl_dim_map_range(dim_map, src->start + 2, 2, 1, 1, src->nparam, s); - isl_dim_map_range(dim_map, src->start + 2 * src->nparam + 1, 2, - isl_space_dim(dim, isl_dim_set), 1, - src->nvar, -s); - isl_dim_map_range(dim_map, src->start + 2 * src->nparam + 2, 2, - isl_space_dim(dim, isl_dim_set), 1, - src->nvar, s); - - graph->lp = isl_basic_set_extend_constraints(graph->lp, - coef->n_eq, coef->n_ineq); - graph->lp = isl_basic_set_add_constraints_dim_map(graph->lp, - coef, dim_map); - isl_space_free(dim); - - return 0; -error: - isl_space_free(dim); - return -1; + if (!schedule1 || !schedule2) + return isl_bool_error; + if (schedule1 == schedule2) + return isl_bool_true; + return isl_schedule_tree_plain_is_equal(schedule1->root, + schedule2->root); } -static int add_all_validity_constraints(struct isl_sched_graph *graph) +/* Return the (parameter) space of the schedule, i.e., the space + * of the root domain. + */ +__isl_give isl_space *isl_schedule_get_space( + __isl_keep isl_schedule *schedule) { - int i; - - for (i = 0; i < graph->n_edge; ++i) { - struct isl_sched_edge *edge= &graph->edge[i]; - if (!edge->validity) - continue; - if (edge->src != edge->dst) - continue; - if (add_intra_validity_constraints(graph, edge) < 0) - return -1; - } - - for (i = 0; i < graph->n_edge; ++i) { - struct isl_sched_edge *edge = &graph->edge[i]; - if (!edge->validity) - continue; - if (edge->src == edge->dst) - continue; - if (add_inter_validity_constraints(graph, edge) < 0) - return -1; - } - - return 0; -} - -/* Add constraints to graph->lp that bound the dependence distance - * for all dependence relations. - * If a given proximity dependence is identical to a validity - * dependence, then the dependence distance is already bounded - * from below (by zero), so we only need to bound the distance - * from above. - * Otherwise, we need to bound the distance both from above and from below. - */ -static int add_all_proximity_constraints(struct isl_sched_graph *graph) -{ - int i; - - for (i = 0; i < graph->n_edge; ++i) { - struct isl_sched_edge *edge= &graph->edge[i]; - if (!edge->proximity) - continue; - if (edge->src == edge->dst && - add_intra_proximity_constraints(graph, edge, 1) < 0) - return -1; - if (edge->src != edge->dst && - add_inter_proximity_constraints(graph, edge, 1) < 0) - return -1; - if (edge->validity) - continue; - if (edge->src == edge->dst && - add_intra_proximity_constraints(graph, edge, -1) < 0) - return -1; - if (edge->src != edge->dst && - add_inter_proximity_constraints(graph, edge, -1) < 0) - return -1; - } - - return 0; -} - -/* Compute a basis for the rows in the linear part of the schedule - * and extend this basis to a full basis. The remaining rows - * can then be used to force linear independence from the rows - * in the schedule. - * - * In particular, given the schedule rows S, we compute - * - * S = H Q - * - * with H the Hermite normal form of S. That is, all but the - * first rank columns of Q are zero and so each row in S is - * a linear combination of the first rank rows of Q. - * The matrix Q is then transposed because we will write the - * coefficients of the next schedule row as a column vector s - * and express this s as a linear combination s = Q c of the - * computed basis. - */ -static int node_update_cmap(struct isl_sched_node *node) -{ - isl_mat *H, *Q; - int n_row = isl_mat_rows(node->sched); - - H = isl_mat_sub_alloc(node->sched, 0, n_row, - 1 + node->nparam, node->nvar); - - H = isl_mat_left_hermite(H, 0, NULL, &Q); - isl_mat_free(node->cmap); - node->cmap = isl_mat_transpose(Q); - node->rank = isl_mat_initial_non_zero_cols(H); - isl_mat_free(H); - - if (!node->cmap || node->rank < 0) - return -1; - return 0; -} - -/* Count the number of equality and inequality constraints - * that will be added for the given map. - * If carry is set, then we are counting the number of (validity) - * constraints that will be added in setup_carry_lp and we count - * each edge exactly once. Otherwise, we count as follows - * validity -> 1 (>= 0) - * validity+proximity -> 2 (>= 0 and upper bound) - * proximity -> 2 (lower and upper bound) - */ -static int count_map_constraints(struct isl_sched_graph *graph, - struct isl_sched_edge *edge, __isl_take isl_map *map, - int *n_eq, int *n_ineq, int carry) -{ - isl_basic_set *coef; - int f = carry ? 1 : edge->proximity ? 2 : 1; - - if (carry && !edge->validity) { - isl_map_free(map); - return 0; - } - - if (edge->src == edge->dst) - coef = intra_coefficients(graph, map); - else - coef = inter_coefficients(graph, map); - if (!coef) - return -1; - *n_eq += f * coef->n_eq; - *n_ineq += f * coef->n_ineq; - isl_basic_set_free(coef); - - return 0; -} - -/* Count the number of equality and inequality constraints - * that will be added to the main lp problem. - * We count as follows - * validity -> 1 (>= 0) - * validity+proximity -> 2 (>= 0 and upper bound) - * proximity -> 2 (lower and upper bound) - */ -static int count_constraints(struct isl_sched_graph *graph, - int *n_eq, int *n_ineq) -{ - int i; - - *n_eq = *n_ineq = 0; - for (i = 0; i < graph->n_edge; ++i) { - struct isl_sched_edge *edge= &graph->edge[i]; - isl_map *map = isl_map_copy(edge->map); - - if (count_map_constraints(graph, edge, map, - n_eq, n_ineq, 0) < 0) - return -1; - } - - return 0; -} - -/* Add constraints that bound the values of the variable and parameter - * coefficients of the schedule. - * - * The maximal value of the coefficients is defined by the option - * 'schedule_max_coefficient'. - */ -static int add_bound_coefficient_constraints(isl_ctx *ctx, - struct isl_sched_graph *graph) -{ - int i, j, k; - int max_coefficient; - int total; - - max_coefficient = ctx->opt->schedule_max_coefficient; - - if (max_coefficient == -1) - return 0; - - total = isl_basic_set_total_dim(graph->lp); - - for (i = 0; i < graph->n; ++i) { - struct isl_sched_node *node = &graph->node[i]; - for (j = 0; j < 2 * node->nparam + 2 * node->nvar; ++j) { - int dim; - k = isl_basic_set_alloc_inequality(graph->lp); - if (k < 0) - return -1; - dim = 1 + node->start + 1 + j; - isl_seq_clr(graph->lp->ineq[k], 1 + total); - isl_int_set_si(graph->lp->ineq[k][dim], -1); - isl_int_set_si(graph->lp->ineq[k][0], max_coefficient); - } - } - - return 0; -} - -/* Construct an ILP problem for finding schedule coefficients - * that result in non-negative, but small dependence distances - * over all dependences. - * In particular, the dependence distances over proximity edges - * are bounded by m_0 + m_n n and we compute schedule coefficients - * with small values (preferably zero) of m_n and m_0. - * - * All variables of the ILP are non-negative. The actual coefficients - * may be negative, so each coefficient is represented as the difference - * of two non-negative variables. The negative part always appears - * immediately before the positive part. - * Other than that, the variables have the following order - * - * - sum of positive and negative parts of m_n coefficients - * - m_0 - * - sum of positive and negative parts of all c_n coefficients - * (unconstrained when computing non-parametric schedules) - * - sum of positive and negative parts of all c_x coefficients - * - positive and negative parts of m_n coefficients - * - for each node - * - c_i_0 - * - positive and negative parts of c_i_n (if parametric) - * - positive and negative parts of c_i_x - * - * The c_i_x are not represented directly, but through the columns of - * node->cmap. That is, the computed values are for variable t_i_x - * such that c_i_x = Q t_i_x with Q equal to node->cmap. - * - * The constraints are those from the edges plus two or three equalities - * to express the sums. - * - * If force_zero is set, then we add equalities to ensure that - * the sum of the m_n coefficients and m_0 are both zero. - */ -static int setup_lp(isl_ctx *ctx, struct isl_sched_graph *graph, - int force_zero) -{ - int i, j; - int k; - unsigned nparam; - unsigned total; - isl_space *dim; - int parametric; - int param_pos; - int n_eq, n_ineq; - int max_constant_term; - int max_coefficient; - - max_constant_term = ctx->opt->schedule_max_constant_term; - max_coefficient = ctx->opt->schedule_max_coefficient; - - parametric = ctx->opt->schedule_parametric; - nparam = isl_space_dim(graph->node[0].dim, isl_dim_param); - param_pos = 4; - total = param_pos + 2 * nparam; - for (i = 0; i < graph->n; ++i) { - struct isl_sched_node *node = &graph->node[graph->sorted[i]]; - if (node_update_cmap(node) < 0) - return -1; - node->start = total; - total += 1 + 2 * (node->nparam + node->nvar); - } - - if (count_constraints(graph, &n_eq, &n_ineq) < 0) - return -1; - - dim = isl_space_set_alloc(ctx, 0, total); - isl_basic_set_free(graph->lp); - n_eq += 2 + parametric + force_zero; - if (max_constant_term != -1) - n_ineq += graph->n; - if (max_coefficient != -1) - for (i = 0; i < graph->n; ++i) - n_ineq += 2 * graph->node[i].nparam + - 2 * graph->node[i].nvar; - - graph->lp = isl_basic_set_alloc_space(dim, 0, n_eq, n_ineq); - - k = isl_basic_set_alloc_equality(graph->lp); - if (k < 0) - return -1; - isl_seq_clr(graph->lp->eq[k], 1 + total); - if (!force_zero) - isl_int_set_si(graph->lp->eq[k][1], -1); - for (i = 0; i < 2 * nparam; ++i) - isl_int_set_si(graph->lp->eq[k][1 + param_pos + i], 1); - - if (force_zero) { - k = isl_basic_set_alloc_equality(graph->lp); - if (k < 0) - return -1; - isl_seq_clr(graph->lp->eq[k], 1 + total); - isl_int_set_si(graph->lp->eq[k][2], -1); - } - - if (parametric) { - k = isl_basic_set_alloc_equality(graph->lp); - if (k < 0) - return -1; - isl_seq_clr(graph->lp->eq[k], 1 + total); - isl_int_set_si(graph->lp->eq[k][3], -1); - for (i = 0; i < graph->n; ++i) { - int pos = 1 + graph->node[i].start + 1; - - for (j = 0; j < 2 * graph->node[i].nparam; ++j) - isl_int_set_si(graph->lp->eq[k][pos + j], 1); - } - } - - k = isl_basic_set_alloc_equality(graph->lp); - if (k < 0) - return -1; - isl_seq_clr(graph->lp->eq[k], 1 + total); - isl_int_set_si(graph->lp->eq[k][4], -1); - for (i = 0; i < graph->n; ++i) { - struct isl_sched_node *node = &graph->node[i]; - int pos = 1 + node->start + 1 + 2 * node->nparam; - - for (j = 0; j < 2 * node->nvar; ++j) - isl_int_set_si(graph->lp->eq[k][pos + j], 1); - } - - if (max_constant_term != -1) - for (i = 0; i < graph->n; ++i) { - struct isl_sched_node *node = &graph->node[i]; - k = isl_basic_set_alloc_inequality(graph->lp); - if (k < 0) - return -1; - isl_seq_clr(graph->lp->ineq[k], 1 + total); - isl_int_set_si(graph->lp->ineq[k][1 + node->start], -1); - isl_int_set_si(graph->lp->ineq[k][0], max_constant_term); - } - - if (add_bound_coefficient_constraints(ctx, graph) < 0) - return -1; - if (add_all_validity_constraints(graph) < 0) - return -1; - if (add_all_proximity_constraints(graph) < 0) - return -1; - - return 0; -} - -/* Analyze the conflicting constraint found by - * isl_tab_basic_set_non_trivial_lexmin. If it corresponds to the validity - * constraint of one of the edges between distinct nodes, living, moreover - * in distinct SCCs, then record the source and sink SCC as this may - * be a good place to cut between SCCs. - */ -static int check_conflict(int con, void *user) -{ - int i; - struct isl_sched_graph *graph = user; - - if (graph->src_scc >= 0) - return 0; - - con -= graph->lp->n_eq; - - if (con >= graph->lp->n_ineq) - return 0; - - for (i = 0; i < graph->n_edge; ++i) { - if (!graph->edge[i].validity) - continue; - if (graph->edge[i].src == graph->edge[i].dst) - continue; - if (graph->edge[i].src->scc == graph->edge[i].dst->scc) - continue; - if (graph->edge[i].start > con) - continue; - if (graph->edge[i].end <= con) - continue; - graph->src_scc = graph->edge[i].src->scc; - graph->dst_scc = graph->edge[i].dst->scc; - } - - return 0; -} - -/* Check whether the next schedule row of the given node needs to be - * non-trivial. Lower-dimensional domains may have some trivial rows, - * but as soon as the number of remaining required non-trivial rows - * is as large as the number or remaining rows to be computed, - * all remaining rows need to be non-trivial. - */ -static int needs_row(struct isl_sched_graph *graph, struct isl_sched_node *node) -{ - return node->nvar - node->rank >= graph->maxvar - graph->n_row; -} - -/* Solve the ILP problem constructed in setup_lp. - * For each node such that all the remaining rows of its schedule - * need to be non-trivial, we construct a non-triviality region. - * This region imposes that the next row is independent of previous rows. - * In particular the coefficients c_i_x are represented by t_i_x - * variables with c_i_x = Q t_i_x and Q a unimodular matrix such that - * its first columns span the rows of the previously computed part - * of the schedule. The non-triviality region enforces that at least - * one of the remaining components of t_i_x is non-zero, i.e., - * that the new schedule row depends on at least one of the remaining - * columns of Q. - */ -static __isl_give isl_vec *solve_lp(struct isl_sched_graph *graph) -{ - int i; - isl_vec *sol; - isl_basic_set *lp; - - for (i = 0; i < graph->n; ++i) { - struct isl_sched_node *node = &graph->node[i]; - int skip = node->rank; - graph->region[i].pos = node->start + 1 + 2*(node->nparam+skip); - if (needs_row(graph, node)) - graph->region[i].len = 2 * (node->nvar - skip); - else - graph->region[i].len = 0; - } - lp = isl_basic_set_copy(graph->lp); - sol = isl_tab_basic_set_non_trivial_lexmin(lp, 2, graph->n, - graph->region, &check_conflict, graph); - return sol; -} - -/* Update the schedules of all nodes based on the given solution - * of the LP problem. - * The new row is added to the current band. - * All possibly negative coefficients are encoded as a difference - * of two non-negative variables, so we need to perform the subtraction - * here. Moreover, if use_cmap is set, then the solution does - * not refer to the actual coefficients c_i_x, but instead to variables - * t_i_x such that c_i_x = Q t_i_x and Q is equal to node->cmap. - * In this case, we then also need to perform this multiplication - * to obtain the values of c_i_x. - * - * If check_zero is set, then the first two coordinates of sol are - * assumed to correspond to the dependence distance. If these two - * coordinates are zero, then the corresponding scheduling dimension - * is marked as being zero distance. - */ -static int update_schedule(struct isl_sched_graph *graph, - __isl_take isl_vec *sol, int use_cmap, int check_zero) -{ - int i, j; - int zero = 0; - isl_vec *csol = NULL; - - if (!sol) - goto error; - if (sol->size == 0) - isl_die(sol->ctx, isl_error_internal, - "no solution found", goto error); - if (graph->n_total_row >= graph->max_row) - isl_die(sol->ctx, isl_error_internal, - "too many schedule rows", goto error); - - if (check_zero) - zero = isl_int_is_zero(sol->el[1]) && - isl_int_is_zero(sol->el[2]); - - for (i = 0; i < graph->n; ++i) { - struct isl_sched_node *node = &graph->node[i]; - int pos = node->start; - int row = isl_mat_rows(node->sched); - - isl_vec_free(csol); - csol = isl_vec_alloc(sol->ctx, node->nvar); - if (!csol) - goto error; - - isl_map_free(node->sched_map); - node->sched_map = NULL; - node->sched = isl_mat_add_rows(node->sched, 1); - if (!node->sched) - goto error; - node->sched = isl_mat_set_element(node->sched, row, 0, - sol->el[1 + pos]); - for (j = 0; j < node->nparam + node->nvar; ++j) - isl_int_sub(sol->el[1 + pos + 1 + 2 * j + 1], - sol->el[1 + pos + 1 + 2 * j + 1], - sol->el[1 + pos + 1 + 2 * j]); - for (j = 0; j < node->nparam; ++j) - node->sched = isl_mat_set_element(node->sched, - row, 1 + j, sol->el[1+pos+1+2*j+1]); - for (j = 0; j < node->nvar; ++j) - isl_int_set(csol->el[j], - sol->el[1+pos+1+2*(node->nparam+j)+1]); - if (use_cmap) - csol = isl_mat_vec_product(isl_mat_copy(node->cmap), - csol); - if (!csol) - goto error; - for (j = 0; j < node->nvar; ++j) - node->sched = isl_mat_set_element(node->sched, - row, 1 + node->nparam + j, csol->el[j]); - node->band[graph->n_total_row] = graph->n_band; - node->zero[graph->n_total_row] = zero; - } - isl_vec_free(sol); - isl_vec_free(csol); - - graph->n_row++; - graph->n_total_row++; - - return 0; -error: - isl_vec_free(sol); - isl_vec_free(csol); - return -1; -} - -/* Convert node->sched into a multi_aff and return this multi_aff. - */ -static __isl_give isl_multi_aff *node_extract_schedule_multi_aff( - struct isl_sched_node *node) -{ - int i, j; + enum isl_schedule_node_type type; isl_space *space; - isl_local_space *ls; - isl_aff *aff; - isl_multi_aff *ma; - int nrow, ncol; - isl_int v; - - nrow = isl_mat_rows(node->sched); - ncol = isl_mat_cols(node->sched) - 1; - space = isl_space_from_domain(isl_space_copy(node->dim)); - space = isl_space_add_dims(space, isl_dim_out, nrow); - ma = isl_multi_aff_zero(space); - ls = isl_local_space_from_space(isl_space_copy(node->dim)); - - isl_int_init(v); - - for (i = 0; i < nrow; ++i) { - aff = isl_aff_zero_on_domain(isl_local_space_copy(ls)); - isl_mat_get_element(node->sched, i, 0, &v); - aff = isl_aff_set_constant(aff, v); - for (j = 0; j < node->nparam; ++j) { - isl_mat_get_element(node->sched, i, 1 + j, &v); - aff = isl_aff_set_coefficient(aff, isl_dim_param, j, v); - } - for (j = 0; j < node->nvar; ++j) { - isl_mat_get_element(node->sched, - i, 1 + node->nparam + j, &v); - aff = isl_aff_set_coefficient(aff, isl_dim_in, j, v); - } - ma = isl_multi_aff_set_aff(ma, i, aff); - } - - isl_int_clear(v); - - isl_local_space_free(ls); - - return ma; -} - -/* Convert node->sched into a map and return this map. - * - * The result is cached in node->sched_map, which needs to be released - * whenever node->sched is updated. - */ -static __isl_give isl_map *node_extract_schedule(struct isl_sched_node *node) -{ - if (!node->sched_map) { - isl_multi_aff *ma; - - ma = node_extract_schedule_multi_aff(node); - node->sched_map = isl_map_from_multi_aff(ma); - } - - return isl_map_copy(node->sched_map); -} - -/* Update the given dependence relation based on the current schedule. - * That is, intersect the dependence relation with a map expressing - * that source and sink are executed within the same iteration of - * the current schedule. - * This is not the most efficient way, but this shouldn't be a critical - * operation. - */ -static __isl_give isl_map *specialize(__isl_take isl_map *map, - struct isl_sched_node *src, struct isl_sched_node *dst) -{ - isl_map *src_sched, *dst_sched, *id; - - src_sched = node_extract_schedule(src); - dst_sched = node_extract_schedule(dst); - id = isl_map_apply_range(src_sched, isl_map_reverse(dst_sched)); - return isl_map_intersect(map, id); -} - -/* Update the dependence relations of all edges based on the current schedule. - * If a dependence is carried completely by the current schedule, then - * it is removed from the edge_tables. It is kept in the list of edges - * as otherwise all edge_tables would have to be recomputed. - */ -static int update_edges(isl_ctx *ctx, struct isl_sched_graph *graph) -{ - int i; - - for (i = graph->n_edge - 1; i >= 0; --i) { - struct isl_sched_edge *edge = &graph->edge[i]; - edge->map = specialize(edge->map, edge->src, edge->dst); - if (!edge->map) - return -1; - - if (isl_map_plain_is_empty(edge->map)) - graph_remove_edge(graph, edge); - } - - return 0; -} - -static void next_band(struct isl_sched_graph *graph) -{ - graph->band_start = graph->n_total_row; - graph->n_band++; -} - -/* Topologically sort statements mapped to the same schedule iteration - * and add a row to the schedule corresponding to this order. - */ -static int sort_statements(isl_ctx *ctx, struct isl_sched_graph *graph) -{ - int i, j; - - if (graph->n <= 1) - return 0; - - if (update_edges(ctx, graph) < 0) - return -1; - - if (graph->n_edge == 0) - return 0; - - if (detect_sccs(ctx, graph) < 0) - return -1; - - if (graph->n_total_row >= graph->max_row) - isl_die(ctx, isl_error_internal, - "too many schedule rows", return -1); - - for (i = 0; i < graph->n; ++i) { - struct isl_sched_node *node = &graph->node[i]; - int row = isl_mat_rows(node->sched); - int cols = isl_mat_cols(node->sched); - - isl_map_free(node->sched_map); - node->sched_map = NULL; - node->sched = isl_mat_add_rows(node->sched, 1); - if (!node->sched) - return -1; - node->sched = isl_mat_set_element_si(node->sched, row, 0, - node->scc); - for (j = 1; j < cols; ++j) - node->sched = isl_mat_set_element_si(node->sched, - row, j, 0); - node->band[graph->n_total_row] = graph->n_band; - } - - graph->n_total_row++; - next_band(graph); - - return 0; -} - -/* Construct an isl_schedule based on the computed schedule stored - * in graph and with parameters specified by dim. - */ -static __isl_give isl_schedule *extract_schedule(struct isl_sched_graph *graph, - __isl_take isl_space *dim) -{ - int i; - isl_ctx *ctx; - isl_schedule *sched = NULL; - - if (!dim) - return NULL; - - ctx = isl_space_get_ctx(dim); - sched = isl_calloc(ctx, struct isl_schedule, - sizeof(struct isl_schedule) + - (graph->n - 1) * sizeof(struct isl_schedule_node)); - if (!sched) - goto error; - - sched->ref = 1; - sched->n = graph->n; - sched->n_band = graph->n_band; - sched->n_total_row = graph->n_total_row; - - for (i = 0; i < sched->n; ++i) { - int r, b; - int *band_end, *band_id, *zero; - - sched->node[i].sched = - node_extract_schedule_multi_aff(&graph->node[i]); - if (!sched->node[i].sched) - goto error; - - sched->node[i].n_band = graph->n_band; - if (graph->n_band == 0) - continue; - - band_end = isl_alloc_array(ctx, int, graph->n_band); - band_id = isl_alloc_array(ctx, int, graph->n_band); - zero = isl_alloc_array(ctx, int, graph->n_total_row); - sched->node[i].band_end = band_end; - sched->node[i].band_id = band_id; - sched->node[i].zero = zero; - if (!band_end || !band_id || !zero) - goto error; - - for (r = 0; r < graph->n_total_row; ++r) - zero[r] = graph->node[i].zero[r]; - for (r = b = 0; r < graph->n_total_row; ++r) { - if (graph->node[i].band[r] == b) - continue; - band_end[b++] = r; - if (graph->node[i].band[r] == -1) - break; - } - if (r == graph->n_total_row) - band_end[b++] = r; - sched->node[i].n_band = b; - for (--b; b >= 0; --b) - band_id[b] = graph->node[i].band_id[b]; - } - - sched->dim = dim; - - return sched; -error: - isl_space_free(dim); - isl_schedule_free(sched); - return NULL; -} - -/* Copy nodes that satisfy node_pred from the src dependence graph - * to the dst dependence graph. - */ -static int copy_nodes(struct isl_sched_graph *dst, struct isl_sched_graph *src, - int (*node_pred)(struct isl_sched_node *node, int data), int data) -{ - int i; - - dst->n = 0; - for (i = 0; i < src->n; ++i) { - if (!node_pred(&src->node[i], data)) - continue; - dst->node[dst->n].dim = isl_space_copy(src->node[i].dim); - dst->node[dst->n].nvar = src->node[i].nvar; - dst->node[dst->n].nparam = src->node[i].nparam; - dst->node[dst->n].sched = isl_mat_copy(src->node[i].sched); - dst->node[dst->n].sched_map = - isl_map_copy(src->node[i].sched_map); - dst->node[dst->n].band = src->node[i].band; - dst->node[dst->n].band_id = src->node[i].band_id; - dst->node[dst->n].zero = src->node[i].zero; - dst->n++; - } - - return 0; -} - -/* Copy non-empty edges that satisfy edge_pred from the src dependence graph - * to the dst dependence graph. - * If the source or destination node of the edge is not in the destination - * graph, then it must be a backward proximity edge and it should simply - * be ignored. - */ -static int copy_edges(isl_ctx *ctx, struct isl_sched_graph *dst, - struct isl_sched_graph *src, - int (*edge_pred)(struct isl_sched_edge *edge, int data), int data) -{ - int i; - enum isl_edge_type t; - - dst->n_edge = 0; - for (i = 0; i < src->n_edge; ++i) { - struct isl_sched_edge *edge = &src->edge[i]; - isl_map *map; - struct isl_sched_node *dst_src, *dst_dst; - - if (!edge_pred(edge, data)) - continue; - - if (isl_map_plain_is_empty(edge->map)) - continue; - - dst_src = graph_find_node(ctx, dst, edge->src->dim); - dst_dst = graph_find_node(ctx, dst, edge->dst->dim); - if (!dst_src || !dst_dst) { - if (edge->validity) - isl_die(ctx, isl_error_internal, - "backward validity edge", return -1); - continue; - } - - map = isl_map_copy(edge->map); - - dst->edge[dst->n_edge].src = dst_src; - dst->edge[dst->n_edge].dst = dst_dst; - dst->edge[dst->n_edge].map = map; - dst->edge[dst->n_edge].validity = edge->validity; - dst->edge[dst->n_edge].proximity = edge->proximity; - dst->n_edge++; - - for (t = isl_edge_first; t <= isl_edge_last; ++t) { - if (edge != - graph_find_edge(src, t, edge->src, edge->dst)) - continue; - if (graph_edge_table_add(ctx, dst, t, - &dst->edge[dst->n_edge - 1]) < 0) - return -1; - } - } - - return 0; -} - -/* Given a "src" dependence graph that contains the nodes from "dst" - * that satisfy node_pred, copy the schedule computed in "src" - * for those nodes back to "dst". - */ -static int copy_schedule(struct isl_sched_graph *dst, - struct isl_sched_graph *src, - int (*node_pred)(struct isl_sched_node *node, int data), int data) -{ - int i; - - src->n = 0; - for (i = 0; i < dst->n; ++i) { - if (!node_pred(&dst->node[i], data)) - continue; - isl_mat_free(dst->node[i].sched); - isl_map_free(dst->node[i].sched_map); - dst->node[i].sched = isl_mat_copy(src->node[src->n].sched); - dst->node[i].sched_map = - isl_map_copy(src->node[src->n].sched_map); - src->n++; - } - - dst->max_row = src->max_row; - dst->n_total_row = src->n_total_row; - dst->n_band = src->n_band; - - return 0; -} - -/* Compute the maximal number of variables over all nodes. - * This is the maximal number of linearly independent schedule - * rows that we need to compute. - * Just in case we end up in a part of the dependence graph - * with only lower-dimensional domains, we make sure we will - * compute the required amount of extra linearly independent rows. - */ -static int compute_maxvar(struct isl_sched_graph *graph) -{ - int i; - - graph->maxvar = 0; - for (i = 0; i < graph->n; ++i) { - struct isl_sched_node *node = &graph->node[i]; - int nvar; - - if (node_update_cmap(node) < 0) - return -1; - nvar = node->nvar + graph->n_row - node->rank; - if (nvar > graph->maxvar) - graph->maxvar = nvar; - } - - return 0; -} - -static int compute_schedule(isl_ctx *ctx, struct isl_sched_graph *graph); -static int compute_schedule_wcc(isl_ctx *ctx, struct isl_sched_graph *graph); - -/* Compute a schedule for a subgraph of "graph". In particular, for - * the graph composed of nodes that satisfy node_pred and edges that - * that satisfy edge_pred. The caller should precompute the number - * of nodes and edges that satisfy these predicates and pass them along - * as "n" and "n_edge". - * If the subgraph is known to consist of a single component, then wcc should - * be set and then we call compute_schedule_wcc on the constructed subgraph. - * Otherwise, we call compute_schedule, which will check whether the subgraph - * is connected. - */ -static int compute_sub_schedule(isl_ctx *ctx, - struct isl_sched_graph *graph, int n, int n_edge, - int (*node_pred)(struct isl_sched_node *node, int data), - int (*edge_pred)(struct isl_sched_edge *edge, int data), - int data, int wcc) -{ - struct isl_sched_graph split = { 0 }; - int t; - - if (graph_alloc(ctx, &split, n, n_edge) < 0) - goto error; - if (copy_nodes(&split, graph, node_pred, data) < 0) - goto error; - if (graph_init_table(ctx, &split) < 0) - goto error; - for (t = 0; t <= isl_edge_last; ++t) - split.max_edge[t] = graph->max_edge[t]; - if (graph_init_edge_tables(ctx, &split) < 0) - goto error; - if (copy_edges(ctx, &split, graph, edge_pred, data) < 0) - goto error; - split.n_row = graph->n_row; - split.max_row = graph->max_row; - split.n_total_row = graph->n_total_row; - split.n_band = graph->n_band; - split.band_start = graph->band_start; - - if (wcc && compute_schedule_wcc(ctx, &split) < 0) - goto error; - if (!wcc && compute_schedule(ctx, &split) < 0) - goto error; - - copy_schedule(graph, &split, node_pred, data); - - graph_free(ctx, &split); - return 0; -error: - graph_free(ctx, &split); - return -1; -} - -static int node_scc_exactly(struct isl_sched_node *node, int scc) -{ - return node->scc == scc; -} - -static int node_scc_at_most(struct isl_sched_node *node, int scc) -{ - return node->scc <= scc; -} - -static int node_scc_at_least(struct isl_sched_node *node, int scc) -{ - return node->scc >= scc; -} - -static int edge_scc_exactly(struct isl_sched_edge *edge, int scc) -{ - return edge->src->scc == scc && edge->dst->scc == scc; -} - -static int edge_dst_scc_at_most(struct isl_sched_edge *edge, int scc) -{ - return edge->dst->scc <= scc; -} - -static int edge_src_scc_at_least(struct isl_sched_edge *edge, int scc) -{ - return edge->src->scc >= scc; -} - -/* Pad the schedules of all nodes with zero rows such that in the end - * they all have graph->n_total_row rows. - * The extra rows don't belong to any band, so they get assigned band number -1. - */ -static int pad_schedule(struct isl_sched_graph *graph) -{ - int i, j; - - for (i = 0; i < graph->n; ++i) { - struct isl_sched_node *node = &graph->node[i]; - int row = isl_mat_rows(node->sched); - if (graph->n_total_row > row) { - isl_map_free(node->sched_map); - node->sched_map = NULL; - } - node->sched = isl_mat_add_zero_rows(node->sched, - graph->n_total_row - row); - if (!node->sched) - return -1; - for (j = row; j < graph->n_total_row; ++j) - node->band[j] = -1; - } - - return 0; -} - -/* Split the current graph into two parts and compute a schedule for each - * part individually. In particular, one part consists of all SCCs up - * to and including graph->src_scc, while the other part contains the other - * SCCS. - * - * The split is enforced in the schedule by constant rows with two different - * values (0 and 1). These constant rows replace the previously computed rows - * in the current band. - * It would be possible to reuse them as the first rows in the next - * band, but recomputing them may result in better rows as we are looking - * at a smaller part of the dependence graph. - * compute_split_schedule is only called when no zero-distance schedule row - * could be found on the entire graph, so we wark the splitting row as - * non zero-distance. - * - * The band_id of the second group is set to n, where n is the number - * of nodes in the first group. This ensures that the band_ids over - * the two groups remain disjoint, even if either or both of the two - * groups contain independent components. - */ -static int compute_split_schedule(isl_ctx *ctx, struct isl_sched_graph *graph) -{ - int i, j, n, e1, e2; - int n_total_row, orig_total_row; - int n_band, orig_band; - int drop; - - if (graph->n_total_row >= graph->max_row) - isl_die(ctx, isl_error_internal, - "too many schedule rows", return -1); - - drop = graph->n_total_row - graph->band_start; - graph->n_total_row -= drop; - graph->n_row -= drop; - - n = 0; - for (i = 0; i < graph->n; ++i) { - struct isl_sched_node *node = &graph->node[i]; - int row = isl_mat_rows(node->sched) - drop; - int cols = isl_mat_cols(node->sched); - int before = node->scc <= graph->src_scc; - - if (before) - n++; - - isl_map_free(node->sched_map); - node->sched_map = NULL; - node->sched = isl_mat_drop_rows(node->sched, - graph->band_start, drop); - node->sched = isl_mat_add_rows(node->sched, 1); - if (!node->sched) - return -1; - node->sched = isl_mat_set_element_si(node->sched, row, 0, - !before); - for (j = 1; j < cols; ++j) - node->sched = isl_mat_set_element_si(node->sched, - row, j, 0); - node->band[graph->n_total_row] = graph->n_band; - node->zero[graph->n_total_row] = 0; - } - - e1 = e2 = 0; - for (i = 0; i < graph->n_edge; ++i) { - if (graph->edge[i].dst->scc <= graph->src_scc) - e1++; - if (graph->edge[i].src->scc > graph->src_scc) - e2++; - } - - graph->n_total_row++; - next_band(graph); - - for (i = 0; i < graph->n; ++i) { - struct isl_sched_node *node = &graph->node[i]; - if (node->scc > graph->src_scc) - node->band_id[graph->n_band] = n; - } - - orig_total_row = graph->n_total_row; - orig_band = graph->n_band; - if (compute_sub_schedule(ctx, graph, n, e1, - &node_scc_at_most, &edge_dst_scc_at_most, - graph->src_scc, 0) < 0) - return -1; - n_total_row = graph->n_total_row; - graph->n_total_row = orig_total_row; - n_band = graph->n_band; - graph->n_band = orig_band; - if (compute_sub_schedule(ctx, graph, graph->n - n, e2, - &node_scc_at_least, &edge_src_scc_at_least, - graph->src_scc + 1, 0) < 0) - return -1; - if (n_total_row > graph->n_total_row) - graph->n_total_row = n_total_row; - if (n_band > graph->n_band) - graph->n_band = n_band; - - return pad_schedule(graph); -} - -/* Compute the next band of the schedule after updating the dependence - * relations based on the the current schedule. - */ -static int compute_next_band(isl_ctx *ctx, struct isl_sched_graph *graph) -{ - if (update_edges(ctx, graph) < 0) - return -1; - next_band(graph); - - return compute_schedule(ctx, graph); -} - -/* Add constraints to graph->lp that force the dependence "map" (which - * is part of the dependence relation of "edge") - * to be respected and attempt to carry it, where the edge is one from - * a node j to itself. "pos" is the sequence number of the given map. - * That is, add constraints that enforce - * - * (c_j_0 + c_j_n n + c_j_x y) - (c_j_0 + c_j_n n + c_j_x x) - * = c_j_x (y - x) >= e_i - * - * for each (x,y) in R. - * We obtain general constraints on coefficients (c_0, c_n, c_x) - * of valid constraints for (y - x) and then plug in (-e_i, 0, c_j_x), - * with each coefficient in c_j_x represented as a pair of non-negative - * coefficients. - */ -static int add_intra_constraints(struct isl_sched_graph *graph, - struct isl_sched_edge *edge, __isl_take isl_map *map, int pos) -{ - unsigned total; - isl_ctx *ctx = isl_map_get_ctx(map); - isl_space *dim; - isl_dim_map *dim_map; - isl_basic_set *coef; - struct isl_sched_node *node = edge->src; - - coef = intra_coefficients(graph, map); - if (!coef) - return -1; - - dim = isl_space_domain(isl_space_unwrap(isl_basic_set_get_space(coef))); - - total = isl_basic_set_total_dim(graph->lp); - dim_map = isl_dim_map_alloc(ctx, total); - isl_dim_map_range(dim_map, 3 + pos, 0, 0, 0, 1, -1); - isl_dim_map_range(dim_map, node->start + 2 * node->nparam + 1, 2, - isl_space_dim(dim, isl_dim_set), 1, - node->nvar, -1); - isl_dim_map_range(dim_map, node->start + 2 * node->nparam + 2, 2, - isl_space_dim(dim, isl_dim_set), 1, - node->nvar, 1); - graph->lp = isl_basic_set_extend_constraints(graph->lp, - coef->n_eq, coef->n_ineq); - graph->lp = isl_basic_set_add_constraints_dim_map(graph->lp, - coef, dim_map); - isl_space_free(dim); - - return 0; -} - -/* Add constraints to graph->lp that force the dependence "map" (which - * is part of the dependence relation of "edge") - * to be respected and attempt to carry it, where the edge is one from - * node j to node k. "pos" is the sequence number of the given map. - * That is, add constraints that enforce - * - * (c_k_0 + c_k_n n + c_k_x y) - (c_j_0 + c_j_n n + c_j_x x) >= e_i - * - * for each (x,y) in R. - * We obtain general constraints on coefficients (c_0, c_n, c_x) - * of valid constraints for R and then plug in - * (-e_i + c_k_0 - c_j_0, c_k_n - c_j_n, c_k_x - c_j_x) - * with each coefficient (except e_i, c_k_0 and c_j_0) - * represented as a pair of non-negative coefficients. - */ -static int add_inter_constraints(struct isl_sched_graph *graph, - struct isl_sched_edge *edge, __isl_take isl_map *map, int pos) -{ - unsigned total; - isl_ctx *ctx = isl_map_get_ctx(map); - isl_space *dim; - isl_dim_map *dim_map; - isl_basic_set *coef; - struct isl_sched_node *src = edge->src; - struct isl_sched_node *dst = edge->dst; - - coef = inter_coefficients(graph, map); - if (!coef) - return -1; - - dim = isl_space_domain(isl_space_unwrap(isl_basic_set_get_space(coef))); - - total = isl_basic_set_total_dim(graph->lp); - dim_map = isl_dim_map_alloc(ctx, total); - - isl_dim_map_range(dim_map, 3 + pos, 0, 0, 0, 1, -1); - - isl_dim_map_range(dim_map, dst->start, 0, 0, 0, 1, 1); - isl_dim_map_range(dim_map, dst->start + 1, 2, 1, 1, dst->nparam, -1); - isl_dim_map_range(dim_map, dst->start + 2, 2, 1, 1, dst->nparam, 1); - isl_dim_map_range(dim_map, dst->start + 2 * dst->nparam + 1, 2, - isl_space_dim(dim, isl_dim_set) + src->nvar, 1, - dst->nvar, -1); - isl_dim_map_range(dim_map, dst->start + 2 * dst->nparam + 2, 2, - isl_space_dim(dim, isl_dim_set) + src->nvar, 1, - dst->nvar, 1); - - isl_dim_map_range(dim_map, src->start, 0, 0, 0, 1, -1); - isl_dim_map_range(dim_map, src->start + 1, 2, 1, 1, src->nparam, 1); - isl_dim_map_range(dim_map, src->start + 2, 2, 1, 1, src->nparam, -1); - isl_dim_map_range(dim_map, src->start + 2 * src->nparam + 1, 2, - isl_space_dim(dim, isl_dim_set), 1, - src->nvar, 1); - isl_dim_map_range(dim_map, src->start + 2 * src->nparam + 2, 2, - isl_space_dim(dim, isl_dim_set), 1, - src->nvar, -1); - - graph->lp = isl_basic_set_extend_constraints(graph->lp, - coef->n_eq, coef->n_ineq); - graph->lp = isl_basic_set_add_constraints_dim_map(graph->lp, - coef, dim_map); - isl_space_free(dim); - - return 0; -} - -/* Add constraints to graph->lp that force all validity dependences - * to be respected and attempt to carry them. - */ -static int add_all_constraints(struct isl_sched_graph *graph) -{ - int i, j; - int pos; - - pos = 0; - for (i = 0; i < graph->n_edge; ++i) { - struct isl_sched_edge *edge= &graph->edge[i]; - - if (!edge->validity) - continue; - - for (j = 0; j < edge->map->n; ++j) { - isl_basic_map *bmap; - isl_map *map; - - bmap = isl_basic_map_copy(edge->map->p[j]); - map = isl_map_from_basic_map(bmap); - - if (edge->src == edge->dst && - add_intra_constraints(graph, edge, map, pos) < 0) - return -1; - if (edge->src != edge->dst && - add_inter_constraints(graph, edge, map, pos) < 0) - return -1; - ++pos; - } - } - - return 0; -} - -/* Count the number of equality and inequality constraints - * that will be added to the carry_lp problem. - * We count each edge exactly once. - */ -static int count_all_constraints(struct isl_sched_graph *graph, - int *n_eq, int *n_ineq) -{ - int i, j; - - *n_eq = *n_ineq = 0; - for (i = 0; i < graph->n_edge; ++i) { - struct isl_sched_edge *edge= &graph->edge[i]; - for (j = 0; j < edge->map->n; ++j) { - isl_basic_map *bmap; - isl_map *map; - - bmap = isl_basic_map_copy(edge->map->p[j]); - map = isl_map_from_basic_map(bmap); - - if (count_map_constraints(graph, edge, map, - n_eq, n_ineq, 1) < 0) - return -1; - } - } - - return 0; -} - -/* Construct an LP problem for finding schedule coefficients - * such that the schedule carries as many dependences as possible. - * In particular, for each dependence i, we bound the dependence distance - * from below by e_i, with 0 <= e_i <= 1 and then maximize the sum - * of all e_i's. Dependence with e_i = 0 in the solution are simply - * respected, while those with e_i > 0 (in practice e_i = 1) are carried. - * Note that if the dependence relation is a union of basic maps, - * then we have to consider each basic map individually as it may only - * be possible to carry the dependences expressed by some of those - * basic maps and not all off them. - * Below, we consider each of those basic maps as a separate "edge". - * - * All variables of the LP are non-negative. The actual coefficients - * may be negative, so each coefficient is represented as the difference - * of two non-negative variables. The negative part always appears - * immediately before the positive part. - * Other than that, the variables have the following order - * - * - sum of (1 - e_i) over all edges - * - sum of positive and negative parts of all c_n coefficients - * (unconstrained when computing non-parametric schedules) - * - sum of positive and negative parts of all c_x coefficients - * - for each edge - * - e_i - * - for each node - * - c_i_0 - * - positive and negative parts of c_i_n (if parametric) - * - positive and negative parts of c_i_x - * - * The constraints are those from the (validity) edges plus three equalities - * to express the sums and n_edge inequalities to express e_i <= 1. - */ -static int setup_carry_lp(isl_ctx *ctx, struct isl_sched_graph *graph) -{ - int i, j; - int k; - isl_space *dim; - unsigned total; - int n_eq, n_ineq; - int n_edge; - - n_edge = 0; - for (i = 0; i < graph->n_edge; ++i) - n_edge += graph->edge[i].map->n; - - total = 3 + n_edge; - for (i = 0; i < graph->n; ++i) { - struct isl_sched_node *node = &graph->node[graph->sorted[i]]; - node->start = total; - total += 1 + 2 * (node->nparam + node->nvar); - } - - if (count_all_constraints(graph, &n_eq, &n_ineq) < 0) - return -1; - - dim = isl_space_set_alloc(ctx, 0, total); - isl_basic_set_free(graph->lp); - n_eq += 3; - n_ineq += n_edge; - graph->lp = isl_basic_set_alloc_space(dim, 0, n_eq, n_ineq); - graph->lp = isl_basic_set_set_rational(graph->lp); - - k = isl_basic_set_alloc_equality(graph->lp); - if (k < 0) - return -1; - isl_seq_clr(graph->lp->eq[k], 1 + total); - isl_int_set_si(graph->lp->eq[k][0], -n_edge); - isl_int_set_si(graph->lp->eq[k][1], 1); - for (i = 0; i < n_edge; ++i) - isl_int_set_si(graph->lp->eq[k][4 + i], 1); - - k = isl_basic_set_alloc_equality(graph->lp); - if (k < 0) - return -1; - isl_seq_clr(graph->lp->eq[k], 1 + total); - isl_int_set_si(graph->lp->eq[k][2], -1); - for (i = 0; i < graph->n; ++i) { - int pos = 1 + graph->node[i].start + 1; - - for (j = 0; j < 2 * graph->node[i].nparam; ++j) - isl_int_set_si(graph->lp->eq[k][pos + j], 1); - } - - k = isl_basic_set_alloc_equality(graph->lp); - if (k < 0) - return -1; - isl_seq_clr(graph->lp->eq[k], 1 + total); - isl_int_set_si(graph->lp->eq[k][3], -1); - for (i = 0; i < graph->n; ++i) { - struct isl_sched_node *node = &graph->node[i]; - int pos = 1 + node->start + 1 + 2 * node->nparam; - - for (j = 0; j < 2 * node->nvar; ++j) - isl_int_set_si(graph->lp->eq[k][pos + j], 1); - } - - for (i = 0; i < n_edge; ++i) { - k = isl_basic_set_alloc_inequality(graph->lp); - if (k < 0) - return -1; - isl_seq_clr(graph->lp->ineq[k], 1 + total); - isl_int_set_si(graph->lp->ineq[k][4 + i], -1); - isl_int_set_si(graph->lp->ineq[k][0], 1); - } - - if (add_all_constraints(graph) < 0) - return -1; - - return 0; -} - -/* If the schedule_split_scaled option is set and if the linear - * parts of the scheduling rows for all nodes in the graphs have - * non-trivial common divisor, then split off the constant term - * from the linear part. - * The constant term is then placed in a separate band and - * the linear part is reduced. - */ -static int split_scaled(isl_ctx *ctx, struct isl_sched_graph *graph) -{ - int i; - int row; - isl_int gcd, gcd_i; - - if (!ctx->opt->schedule_split_scaled) - return 0; - if (graph->n <= 1) - return 0; - - if (graph->n_total_row >= graph->max_row) - isl_die(ctx, isl_error_internal, - "too many schedule rows", return -1); - - isl_int_init(gcd); - isl_int_init(gcd_i); - - isl_int_set_si(gcd, 0); - - row = isl_mat_rows(graph->node[0].sched) - 1; - - for (i = 0; i < graph->n; ++i) { - struct isl_sched_node *node = &graph->node[i]; - int cols = isl_mat_cols(node->sched); - - isl_seq_gcd(node->sched->row[row] + 1, cols - 1, &gcd_i); - isl_int_gcd(gcd, gcd, gcd_i); - } - - isl_int_clear(gcd_i); - - if (isl_int_cmp_si(gcd, 1) <= 0) { - isl_int_clear(gcd); - return 0; - } - - next_band(graph); - - for (i = 0; i < graph->n; ++i) { - struct isl_sched_node *node = &graph->node[i]; - - isl_map_free(node->sched_map); - node->sched_map = NULL; - node->sched = isl_mat_add_zero_rows(node->sched, 1); - if (!node->sched) - goto error; - isl_int_fdiv_r(node->sched->row[row + 1][0], - node->sched->row[row][0], gcd); - isl_int_fdiv_q(node->sched->row[row][0], - node->sched->row[row][0], gcd); - isl_int_mul(node->sched->row[row][0], - node->sched->row[row][0], gcd); - node->sched = isl_mat_scale_down_row(node->sched, row, gcd); - if (!node->sched) - goto error; - node->band[graph->n_total_row] = graph->n_band; - } - - graph->n_total_row++; - - isl_int_clear(gcd); - return 0; -error: - isl_int_clear(gcd); - return -1; -} - -static int compute_component_schedule(isl_ctx *ctx, - struct isl_sched_graph *graph); - -/* Is the schedule row "sol" trivial on node "node"? - * That is, is the solution zero on the dimensions orthogonal to - * the previously found solutions? - * Each coefficient is represented as the difference between - * two non-negative values in "sol". The coefficient is then - * zero if those two values are equal to each other. - */ -static int is_trivial(struct isl_sched_node *node, __isl_keep isl_vec *sol) -{ - int i; - int pos; - int len; - - pos = 1 + node->start + 1 + 2 * (node->nparam + node->rank); - len = 2 * (node->nvar - node->rank); - - if (len == 0) - return 0; - - for (i = 0; i < len; i += 2) - if (isl_int_ne(sol->el[pos + i], sol->el[pos + i + 1])) - return 0; - - return 1; -} - -/* Is the schedule row "sol" trivial on any node where it should - * not be trivial? - */ -static int is_any_trivial(struct isl_sched_graph *graph, - __isl_keep isl_vec *sol) -{ - int i; - - for (i = 0; i < graph->n; ++i) { - struct isl_sched_node *node = &graph->node[i]; - - if (!needs_row(graph, node)) - continue; - if (is_trivial(node, sol)) - return 1; - } - - return 0; -} - -/* Construct a schedule row for each node such that as many dependences - * as possible are carried and then continue with the next band. - * - * If the computed schedule row turns out to be trivial on one or - * more nodes where it should not be trivial, then we throw it away - * and try again on each component separately. - */ -static int carry_dependences(isl_ctx *ctx, struct isl_sched_graph *graph) -{ - int i; - int n_edge; - isl_vec *sol; - isl_basic_set *lp; - - n_edge = 0; - for (i = 0; i < graph->n_edge; ++i) - n_edge += graph->edge[i].map->n; - - if (setup_carry_lp(ctx, graph) < 0) - return -1; - - lp = isl_basic_set_copy(graph->lp); - sol = isl_tab_basic_set_non_neg_lexmin(lp); - if (!sol) - return -1; - - if (sol->size == 0) { - isl_vec_free(sol); - isl_die(ctx, isl_error_internal, - "error in schedule construction", return -1); - } - - isl_int_divexact(sol->el[1], sol->el[1], sol->el[0]); - if (isl_int_cmp_si(sol->el[1], n_edge) >= 0) { - isl_vec_free(sol); - isl_die(ctx, isl_error_unknown, - "unable to carry dependences", return -1); - } - - if (is_any_trivial(graph, sol)) { - isl_vec_free(sol); - if (graph->scc > 1) - return compute_component_schedule(ctx, graph); - isl_die(ctx, isl_error_unknown, - "unable to construct non-trivial solution", return -1); - } - - if (update_schedule(graph, sol, 0, 0) < 0) - return -1; - - if (split_scaled(ctx, graph) < 0) - return -1; - - return compute_next_band(ctx, graph); -} - -/* Are there any (non-empty) validity edges in the graph? - */ -static int has_validity_edges(struct isl_sched_graph *graph) -{ - int i; - - for (i = 0; i < graph->n_edge; ++i) { - int empty; - - empty = isl_map_plain_is_empty(graph->edge[i].map); - if (empty < 0) - return -1; - if (empty) - continue; - if (graph->edge[i].validity) - return 1; - } - - return 0; -} - -/* Should we apply a Feautrier step? - * That is, did the user request the Feautrier algorithm and are - * there any validity dependences (left)? - */ -static int need_feautrier_step(isl_ctx *ctx, struct isl_sched_graph *graph) -{ - if (ctx->opt->schedule_algorithm != ISL_SCHEDULE_ALGORITHM_FEAUTRIER) - return 0; - - return has_validity_edges(graph); -} - -/* Compute a schedule for a connected dependence graph using Feautrier's - * multi-dimensional scheduling algorithm. - * The original algorithm is described in [1]. - * The main idea is to minimize the number of scheduling dimensions, by - * trying to satisfy as many dependences as possible per scheduling dimension. - * - * [1] P. Feautrier, Some Efficient Solutions to the Affine Scheduling - * Problem, Part II: Multi-Dimensional Time. - * In Intl. Journal of Parallel Programming, 1992. - */ -static int compute_schedule_wcc_feautrier(isl_ctx *ctx, - struct isl_sched_graph *graph) -{ - return carry_dependences(ctx, graph); -} - -/* Compute a schedule for a connected dependence graph. - * We try to find a sequence of as many schedule rows as possible that result - * in non-negative dependence distances (independent of the previous rows - * in the sequence, i.e., such that the sequence is tilable). - * If we can't find any more rows we either - * - split between SCCs and start over (assuming we found an interesting - * pair of SCCs between which to split) - * - continue with the next band (assuming the current band has at least - * one row) - * - try to carry as many dependences as possible and continue with the next - * band - * - * If Feautrier's algorithm is selected, we first recursively try to satisfy - * as many validity dependences as possible. When all validity dependences - * are satisfied we extend the schedule to a full-dimensional schedule. - * - * If we manage to complete the schedule, we finish off by topologically - * sorting the statements based on the remaining dependences. - * - * If ctx->opt->schedule_outer_zero_distance is set, then we force the - * outermost dimension in the current band to be zero distance. If this - * turns out to be impossible, we fall back on the general scheme above - * and try to carry as many dependences as possible. - */ -static int compute_schedule_wcc(isl_ctx *ctx, struct isl_sched_graph *graph) -{ - int force_zero = 0; - - if (detect_sccs(ctx, graph) < 0) - return -1; - if (sort_sccs(graph) < 0) - return -1; - - if (compute_maxvar(graph) < 0) - return -1; - - if (need_feautrier_step(ctx, graph)) - return compute_schedule_wcc_feautrier(ctx, graph); - - if (ctx->opt->schedule_outer_zero_distance) - force_zero = 1; - - while (graph->n_row < graph->maxvar) { - isl_vec *sol; - - graph->src_scc = -1; - graph->dst_scc = -1; - - if (setup_lp(ctx, graph, force_zero) < 0) - return -1; - sol = solve_lp(graph); - if (!sol) - return -1; - if (sol->size == 0) { - isl_vec_free(sol); - if (!ctx->opt->schedule_maximize_band_depth && - graph->n_total_row > graph->band_start) - return compute_next_band(ctx, graph); - if (graph->src_scc >= 0) - return compute_split_schedule(ctx, graph); - if (graph->n_total_row > graph->band_start) - return compute_next_band(ctx, graph); - return carry_dependences(ctx, graph); - } - if (update_schedule(graph, sol, 1, 1) < 0) - return -1; - force_zero = 0; - } - - if (graph->n_total_row > graph->band_start) - next_band(graph); - return sort_statements(ctx, graph); -} - -/* Add a row to the schedules that separates the SCCs and move - * to the next band. - */ -static int split_on_scc(isl_ctx *ctx, struct isl_sched_graph *graph) -{ - int i; - - if (graph->n_total_row >= graph->max_row) - isl_die(ctx, isl_error_internal, - "too many schedule rows", return -1); - - for (i = 0; i < graph->n; ++i) { - struct isl_sched_node *node = &graph->node[i]; - int row = isl_mat_rows(node->sched); - - isl_map_free(node->sched_map); - node->sched_map = NULL; - node->sched = isl_mat_add_zero_rows(node->sched, 1); - node->sched = isl_mat_set_element_si(node->sched, row, 0, - node->scc); - if (!node->sched) - return -1; - node->band[graph->n_total_row] = graph->n_band; - } - - graph->n_total_row++; - next_band(graph); - - return 0; -} - -/* Compute a schedule for each component (identified by node->scc) - * of the dependence graph separately and then combine the results. - * Depending on the setting of schedule_fuse, a component may be - * either weakly or strongly connected. - * - * The band_id is adjusted such that each component has a separate id. - * Note that the band_id may have already been set to a value different - * from zero by compute_split_schedule. - */ -static int compute_component_schedule(isl_ctx *ctx, - struct isl_sched_graph *graph) -{ - int wcc, i; - int n, n_edge; - int n_total_row, orig_total_row; - int n_band, orig_band; - - if (ctx->opt->schedule_fuse == ISL_SCHEDULE_FUSE_MIN || - ctx->opt->schedule_separate_components) - if (split_on_scc(ctx, graph) < 0) - return -1; - - n_total_row = 0; - orig_total_row = graph->n_total_row; - n_band = 0; - orig_band = graph->n_band; - for (i = 0; i < graph->n; ++i) - graph->node[i].band_id[graph->n_band] += graph->node[i].scc; - for (wcc = 0; wcc < graph->scc; ++wcc) { - n = 0; - for (i = 0; i < graph->n; ++i) - if (graph->node[i].scc == wcc) - n++; - n_edge = 0; - for (i = 0; i < graph->n_edge; ++i) - if (graph->edge[i].src->scc == wcc && - graph->edge[i].dst->scc == wcc) - n_edge++; - - if (compute_sub_schedule(ctx, graph, n, n_edge, - &node_scc_exactly, - &edge_scc_exactly, wcc, 1) < 0) - return -1; - if (graph->n_total_row > n_total_row) - n_total_row = graph->n_total_row; - graph->n_total_row = orig_total_row; - if (graph->n_band > n_band) - n_band = graph->n_band; - graph->n_band = orig_band; - } - - graph->n_total_row = n_total_row; - graph->n_band = n_band; - - return pad_schedule(graph); -} - -/* Compute a schedule for the given dependence graph. - * We first check if the graph is connected (through validity dependences) - * and, if not, compute a schedule for each component separately. - * If schedule_fuse is set to minimal fusion, then we check for strongly - * connected components instead and compute a separate schedule for - * each such strongly connected component. - */ -static int compute_schedule(isl_ctx *ctx, struct isl_sched_graph *graph) -{ - if (ctx->opt->schedule_fuse == ISL_SCHEDULE_FUSE_MIN) { - if (detect_sccs(ctx, graph) < 0) - return -1; - } else { - if (detect_wccs(ctx, graph) < 0) - return -1; - } - - if (graph->scc > 1) - return compute_component_schedule(ctx, graph); - - return compute_schedule_wcc(ctx, graph); -} - -/* Compute a schedule for the given union of domains that respects - * all the validity dependences. - * If the default isl scheduling algorithm is used, it tries to minimize - * the dependence distances over the proximity dependences. - * If Feautrier's scheduling algorithm is used, the proximity dependence - * distances are only minimized during the extension to a full-dimensional - * schedule. - */ -__isl_give isl_schedule *isl_union_set_compute_schedule( - __isl_take isl_union_set *domain, - __isl_take isl_union_map *validity, - __isl_take isl_union_map *proximity) -{ - isl_ctx *ctx = isl_union_set_get_ctx(domain); - isl_space *dim; - struct isl_sched_graph graph = { 0 }; - isl_schedule *sched; - struct isl_extract_edge_data data; - - domain = isl_union_set_align_params(domain, - isl_union_map_get_space(validity)); - domain = isl_union_set_align_params(domain, - isl_union_map_get_space(proximity)); - dim = isl_union_set_get_space(domain); - validity = isl_union_map_align_params(validity, isl_space_copy(dim)); - proximity = isl_union_map_align_params(proximity, dim); - - if (!domain) - goto error; - - graph.n = isl_union_set_n_set(domain); - if (graph.n == 0) - goto empty; - if (graph_alloc(ctx, &graph, graph.n, - isl_union_map_n_map(validity) + isl_union_map_n_map(proximity)) < 0) - goto error; - if (compute_max_row(&graph, domain) < 0) - goto error; - graph.root = 1; - graph.n = 0; - if (isl_union_set_foreach_set(domain, &extract_node, &graph) < 0) - goto error; - if (graph_init_table(ctx, &graph) < 0) - goto error; - graph.max_edge[isl_edge_validity] = isl_union_map_n_map(validity); - graph.max_edge[isl_edge_proximity] = isl_union_map_n_map(proximity); - if (graph_init_edge_tables(ctx, &graph) < 0) - goto error; - graph.n_edge = 0; - data.graph = &graph; - data.type = isl_edge_validity; - if (isl_union_map_foreach_map(validity, &extract_edge, &data) < 0) - goto error; - data.type = isl_edge_proximity; - if (isl_union_map_foreach_map(proximity, &extract_edge, &data) < 0) - goto error; - - if (compute_schedule(ctx, &graph) < 0) - goto error; + isl_union_set *domain; -empty: - sched = extract_schedule(&graph, isl_union_set_get_space(domain)); + if (!schedule) + return NULL; + if (!schedule->root) + isl_die(isl_schedule_get_ctx(schedule), isl_error_invalid, + "schedule tree representation not available", + return NULL); + type = isl_schedule_tree_get_type(schedule->root); + if (type != isl_schedule_node_domain) + isl_die(isl_schedule_get_ctx(schedule), isl_error_internal, + "root node not a domain node", return NULL); - graph_free(ctx, &graph); + domain = isl_schedule_tree_domain_get_domain(schedule->root); + space = isl_union_set_get_space(domain); isl_union_set_free(domain); - isl_union_map_free(validity); - isl_union_map_free(proximity); - return sched; -error: - graph_free(ctx, &graph); - isl_union_set_free(domain); - isl_union_map_free(validity); - isl_union_map_free(proximity); - return NULL; + return space; } -void *isl_schedule_free(__isl_take isl_schedule *sched) +/* Return a pointer to the root of "schedule". + */ +__isl_give isl_schedule_node *isl_schedule_get_root( + __isl_keep isl_schedule *schedule) { - int i; - if (!sched) - return NULL; + isl_ctx *ctx; + isl_schedule_tree *tree; + isl_schedule_tree_list *ancestors; - if (--sched->ref > 0) + if (!schedule) return NULL; - for (i = 0; i < sched->n; ++i) { - isl_multi_aff_free(sched->node[i].sched); - free(sched->node[i].band_end); - free(sched->node[i].band_id); - free(sched->node[i].zero); - } - isl_space_free(sched->dim); - isl_band_list_free(sched->band_forest); - free(sched); - return NULL; -} - -isl_ctx *isl_schedule_get_ctx(__isl_keep isl_schedule *schedule) -{ - return schedule ? isl_space_get_ctx(schedule->dim) : NULL; + if (!schedule->root) + isl_die(isl_schedule_get_ctx(schedule), isl_error_invalid, + "schedule tree representation not available", + return NULL); + + ctx = isl_schedule_get_ctx(schedule); + tree = isl_schedule_tree_copy(schedule->root); + schedule = isl_schedule_copy(schedule); + ancestors = isl_schedule_tree_list_alloc(ctx, 0); + return isl_schedule_node_alloc(schedule, tree, ancestors, NULL); } /* Set max_out to the maximal number of output dimensions over * all maps. */ -static int update_max_out(__isl_take isl_map *map, void *user) +static isl_stat update_max_out(__isl_take isl_map *map, void *user) { int *max_out = user; int n_out = isl_map_dim(map, isl_dim_out); @@ -2984,7 +257,7 @@ *max_out = n_out; isl_map_free(map); - return 0; + return isl_stat_ok; } /* Internal data structure for map_pad_range. @@ -3000,7 +273,7 @@ /* Pad the range of the given map with zeros to data->max_out and * then add the result to data->res. */ -static int map_pad_range(__isl_take isl_map *map, void *user) +static isl_stat map_pad_range(__isl_take isl_map *map, void *user) { struct isl_pad_schedule_map_data *data = user; int i; @@ -3012,9 +285,9 @@ data->res = isl_union_map_add_map(data->res, map); if (!data->res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Pad the ranges of the maps in the union map with zeros such they all have @@ -3042,473 +315,498 @@ return data.res; } -/* Return an isl_union_map of the schedule. If we have already constructed - * a band forest, then this band forest may have been modified so we need - * to extract the isl_union_map from the forest rather than from - * the originally computed schedule. This reconstructed schedule map - * then needs to be padded with zeros to unify the schedule space - * since the result of isl_band_list_get_suffix_schedule may not have - * a unified schedule space. +/* Return the domain of the root domain node of "schedule". */ -__isl_give isl_union_map *isl_schedule_get_map(__isl_keep isl_schedule *sched) +__isl_give isl_union_set *isl_schedule_get_domain( + __isl_keep isl_schedule *schedule) { - int i; - isl_union_map *umap; - - if (!sched) + if (!schedule) return NULL; + if (!schedule->root) + isl_die(isl_schedule_get_ctx(schedule), isl_error_invalid, + "schedule tree representation not available", + return NULL); + return isl_schedule_tree_domain_get_domain(schedule->root); +} - if (sched->band_forest) { - umap = isl_band_list_get_suffix_schedule(sched->band_forest); - return pad_schedule_map(umap); - } +/* Traverse all nodes of "sched" in depth first preorder. + * + * If "fn" returns -1 on any of the nodes, then the traversal is aborted. + * If "fn" returns 0 on any of the nodes, then the subtree rooted + * at that node is skipped. + * + * Return 0 on success and -1 on failure. + */ +isl_stat isl_schedule_foreach_schedule_node_top_down( + __isl_keep isl_schedule *sched, + isl_bool (*fn)(__isl_keep isl_schedule_node *node, void *user), + void *user) +{ + isl_schedule_node *node; + isl_stat r; - umap = isl_union_map_empty(isl_space_copy(sched->dim)); - for (i = 0; i < sched->n; ++i) { - isl_multi_aff *ma; + if (!sched) + return isl_stat_error; - ma = isl_multi_aff_copy(sched->node[i].sched); - umap = isl_union_map_add_map(umap, isl_map_from_multi_aff(ma)); - } + node = isl_schedule_get_root(sched); + r = isl_schedule_node_foreach_descendant_top_down(node, fn, user); + isl_schedule_node_free(node); - return umap; + return r; } -static __isl_give isl_band_list *construct_band_list( - __isl_keep isl_schedule *schedule, __isl_keep isl_band *parent, - int band_nr, int *parent_active, int n_active); - -/* Construct an isl_band structure for the band in the given schedule - * with sequence number band_nr for the n_active nodes marked by active. - * If the nodes don't have a band with the given sequence number, - * then a band without members is created. - * - * Because of the way the schedule is constructed, we know that - * the position of the band inside the schedule of a node is the same - * for all active nodes. - * - * The partial schedule for the band is created before the children - * are created to that construct_band_list can refer to the partial - * schedule of the parent. - */ -static __isl_give isl_band *construct_band(__isl_keep isl_schedule *schedule, - __isl_keep isl_band *parent, - int band_nr, int *active, int n_active) +/* Traverse the node of "sched" in depth first postorder, + * allowing the user to modify the visited node. + * The traversal continues from the node returned by the callback function. + * It is the responsibility of the user to ensure that this does not + * lead to an infinite loop. It is safest to always return a pointer + * to the same position (same ancestors and child positions) as the input node. + */ +__isl_give isl_schedule *isl_schedule_map_schedule_node_bottom_up( + __isl_take isl_schedule *schedule, + __isl_give isl_schedule_node *(*fn)( + __isl_take isl_schedule_node *node, void *user), void *user) { - int i, j; - isl_ctx *ctx = isl_schedule_get_ctx(schedule); - isl_band *band; - unsigned start, end; + isl_schedule_node *node; - band = isl_band_alloc(ctx); - if (!band) - return NULL; + node = isl_schedule_get_root(schedule); + isl_schedule_free(schedule); - band->schedule = schedule; - band->parent = parent; + node = isl_schedule_node_map_descendant_bottom_up(node, fn, user); + schedule = isl_schedule_node_get_schedule(node); + isl_schedule_node_free(node); - for (i = 0; i < schedule->n; ++i) - if (active[i]) - break; + return schedule; +} - if (i >= schedule->n) - isl_die(ctx, isl_error_internal, - "band without active statements", goto error); +/* Wrapper around isl_schedule_node_reset_user for use as + * an isl_schedule_map_schedule_node_bottom_up callback. + */ +static __isl_give isl_schedule_node *reset_user( + __isl_take isl_schedule_node *node, void *user) +{ + return isl_schedule_node_reset_user(node); +} - start = band_nr ? schedule->node[i].band_end[band_nr - 1] : 0; - end = band_nr < schedule->node[i].n_band ? - schedule->node[i].band_end[band_nr] : start; - band->n = end - start; +/* Reset the user pointer on all identifiers of parameters and tuples + * in the schedule "schedule". + */ +__isl_give isl_schedule *isl_schedule_reset_user( + __isl_take isl_schedule *schedule) +{ + return isl_schedule_map_schedule_node_bottom_up(schedule, &reset_user, + NULL); +} - band->zero = isl_alloc_array(ctx, int, band->n); - if (band->n && !band->zero) - goto error; +/* Wrapper around isl_schedule_node_align_params for use as + * an isl_schedule_map_schedule_node_bottom_up callback. + */ +static __isl_give isl_schedule_node *align_params( + __isl_take isl_schedule_node *node, void *user) +{ + isl_space *space = user; - for (j = 0; j < band->n; ++j) - band->zero[j] = schedule->node[i].zero[start + j]; + return isl_schedule_node_align_params(node, isl_space_copy(space)); +} - band->pma = isl_union_pw_multi_aff_empty(isl_space_copy(schedule->dim)); - for (i = 0; i < schedule->n; ++i) { - isl_multi_aff *ma; - isl_pw_multi_aff *pma; - unsigned n_out; - - if (!active[i]) - continue; - - ma = isl_multi_aff_copy(schedule->node[i].sched); - n_out = isl_multi_aff_dim(ma, isl_dim_out); - ma = isl_multi_aff_drop_dims(ma, isl_dim_out, end, n_out - end); - ma = isl_multi_aff_drop_dims(ma, isl_dim_out, 0, start); - pma = isl_pw_multi_aff_from_multi_aff(ma); - band->pma = isl_union_pw_multi_aff_add_pw_multi_aff(band->pma, - pma); - } - if (!band->pma) - goto error; +/* Align the parameters of all nodes in schedule "schedule" + * to those of "space". + */ +__isl_give isl_schedule *isl_schedule_align_params( + __isl_take isl_schedule *schedule, __isl_take isl_space *space) +{ + schedule = isl_schedule_map_schedule_node_bottom_up(schedule, + &align_params, space); + isl_space_free(space); + return schedule; +} - for (i = 0; i < schedule->n; ++i) - if (active[i] && schedule->node[i].n_band > band_nr + 1) - break; - - if (i < schedule->n) { - band->children = construct_band_list(schedule, band, - band_nr + 1, active, n_active); - if (!band->children) - goto error; - } +/* Wrapper around isl_schedule_node_pullback_union_pw_multi_aff for use as + * an isl_schedule_map_schedule_node_bottom_up callback. + */ +static __isl_give isl_schedule_node *pullback_upma( + __isl_take isl_schedule_node *node, void *user) +{ + isl_union_pw_multi_aff *upma = user; - return band; -error: - isl_band_free(band); - return NULL; + return isl_schedule_node_pullback_union_pw_multi_aff(node, + isl_union_pw_multi_aff_copy(upma)); } -/* Internal data structure used inside cmp_band and pw_multi_aff_extract_int. - * - * r is set to a negative value if anything goes wrong. +/* Compute the pullback of "schedule" by the function represented by "upma". + * In other words, plug in "upma" in the iteration domains of "schedule". * - * c1 stores the result of extract_int. - * c2 is a temporary value used inside cmp_band_in_ancestor. - * t is a temporary value used inside extract_int. - * - * first and equal are used inside extract_int. - * first is set if we are looking at the first isl_multi_aff inside - * the isl_union_pw_multi_aff. - * equal is set if all the isl_multi_affs have been equal so far. + * The schedule tree is not allowed to contain any expansion nodes. */ -struct isl_cmp_band_data { - int r; +__isl_give isl_schedule *isl_schedule_pullback_union_pw_multi_aff( + __isl_take isl_schedule *schedule, + __isl_take isl_union_pw_multi_aff *upma) +{ + schedule = isl_schedule_map_schedule_node_bottom_up(schedule, + &pullback_upma, upma); + isl_union_pw_multi_aff_free(upma); + return schedule; +} - int first; - int equal; +/* Intersect the domain of the schedule "schedule" with "domain". + * The root of "schedule" is required to be a domain node. + */ +__isl_give isl_schedule *isl_schedule_intersect_domain( + __isl_take isl_schedule *schedule, __isl_take isl_union_set *domain) +{ + enum isl_schedule_node_type root_type; + isl_schedule_node *node; - isl_int t; - isl_int c1; - isl_int c2; -}; + if (!schedule || !domain) + goto error; -/* Check if "ma" assigns a constant value. - * Note that this function is only called on isl_multi_affs - * with a single output dimension. - * - * If "ma" assigns a constant value then we compare it to data->c1 - * or assign it to data->c1 if this is the first isl_multi_aff we consider. - * If "ma" does not assign a constant value or if it assigns a value - * that is different from data->c1, then we set data->equal to zero - * and terminate the check. - */ -static int multi_aff_extract_int(__isl_take isl_set *set, - __isl_take isl_multi_aff *ma, void *user) -{ - isl_aff *aff; - struct isl_cmp_band_data *data = user; - - aff = isl_multi_aff_get_aff(ma, 0); - data->r = isl_aff_is_cst(aff); - if (data->r >= 0 && data->r) { - isl_aff_get_constant(aff, &data->t); - if (data->first) { - isl_int_set(data->c1, data->t); - data->first = 0; - } else if (!isl_int_eq(data->c1, data->t)) - data->equal = 0; - } else if (data->r >= 0 && !data->r) - data->equal = 0; - - isl_aff_free(aff); - isl_set_free(set); - isl_multi_aff_free(ma); + root_type = isl_schedule_tree_get_type(schedule->root); + if (root_type != isl_schedule_node_domain) + isl_die(isl_schedule_get_ctx(schedule), isl_error_invalid, + "root node must be a domain node", goto error); - if (data->r < 0) - return -1; - if (!data->equal) - return -1; - return 0; + node = isl_schedule_get_root(schedule); + isl_schedule_free(schedule); + node = isl_schedule_node_domain_intersect_domain(node, domain); + schedule = isl_schedule_node_get_schedule(node); + isl_schedule_node_free(node); + + return schedule; +error: + isl_schedule_free(schedule); + isl_union_set_free(domain); + return NULL; } -/* This function is called for each isl_pw_multi_aff in - * the isl_union_pw_multi_aff checked by extract_int. - * Check all the isl_multi_affs inside "pma". +/* Return an isl_union_map representation of the schedule. + * If we still have access to the schedule tree, then we return + * an isl_union_map corresponding to the subtree schedule of the child + * of the root domain node. That is, we do not intersect the domain + * of the returned isl_union_map with the domain constraints. + * Otherwise, we must have removed it because we created a band forest. + * If so, we extract the isl_union_map from the forest. + * This reconstructed schedule map + * then needs to be padded with zeros to unify the schedule space + * since the result of isl_band_list_get_suffix_schedule may not have + * a unified schedule space. */ -static int pw_multi_aff_extract_int(__isl_take isl_pw_multi_aff *pma, - void *user) +__isl_give isl_union_map *isl_schedule_get_map(__isl_keep isl_schedule *sched) { - int r; + enum isl_schedule_node_type type; + isl_schedule_node *node; + isl_union_map *umap; - r = isl_pw_multi_aff_foreach_piece(pma, &multi_aff_extract_int, user); - isl_pw_multi_aff_free(pma); + if (!sched) + return NULL; - return r; -} + if (sched->root) { + type = isl_schedule_tree_get_type(sched->root); + if (type != isl_schedule_node_domain) + isl_die(isl_schedule_get_ctx(sched), isl_error_internal, + "root node not a domain node", return NULL); + + node = isl_schedule_get_root(sched); + node = isl_schedule_node_child(node, 0); + umap = isl_schedule_node_get_subtree_schedule_union_map(node); + isl_schedule_node_free(node); -/* Check if "upma" assigns a single constant value to its domain. - * If so, return 1 and store the result in data->c1. - * If not, return 0. - * - * A negative return value from isl_union_pw_multi_aff_foreach_pw_multi_aff - * means that either an error occurred or that we have broken off the check - * because we already know the result is going to be negative. - * In the latter case, data->equal is set to zero. - */ -static int extract_int(__isl_keep isl_union_pw_multi_aff *upma, - struct isl_cmp_band_data *data) -{ - data->first = 1; - data->equal = 1; - - if (isl_union_pw_multi_aff_foreach_pw_multi_aff(upma, - &pw_multi_aff_extract_int, data) < 0) { - if (!data->equal) - return 0; - return -1; + return umap; } - return !data->first && data->equal; + umap = isl_band_list_get_suffix_schedule(sched->band_forest); + return pad_schedule_map(umap); } -/* Compare "b1" and "b2" based on the parent schedule of their ancestor - * "ancestor". - * - * If the parent of "ancestor" also has a single member, then we - * first try to compare the two band based on the partial schedule - * of this parent. - * - * Otherwise, or if the result is inconclusive, we look at the partial schedule - * of "ancestor" itself. - * In particular, we specialize the parent schedule based - * on the domains of the child schedules, check if both assign - * a single constant value and, if so, compare the two constant values. - * If the specialized parent schedules do not assign a constant value, - * then they cannot be used to order the two bands and so in this case - * we return 0. - */ -static int cmp_band_in_ancestor(__isl_keep isl_band *b1, - __isl_keep isl_band *b2, struct isl_cmp_band_data *data, - __isl_keep isl_band *ancestor) -{ - isl_union_pw_multi_aff *upma; - isl_union_set *domain; - int r; +static __isl_give isl_band_list *construct_band_list( + __isl_take isl_schedule_node *node, __isl_take isl_union_set *domain, + __isl_keep isl_band *parent); - if (data->r < 0) - return 0; +/* Construct an isl_band structure from the given schedule tree node, + * which may be either a band node or a leaf node. + * In the latter case, construct a zero-dimensional band. + * "domain" is the universe set of the domain elements that reach "node". + * "parent" is the parent isl_band of the isl_band constructed + * by this function. + * + * In case of a band node, we copy the properties (except tilability, + * which is implicit in an isl_band) to the isl_band. + * We assume that the band node is not zero-dimensional. + * If the child of the band node is not a leaf node, + * then we extract the children of the isl_band from this child. + */ +static __isl_give isl_band *construct_band(__isl_take isl_schedule_node *node, + __isl_take isl_union_set *domain, __isl_keep isl_band *parent) +{ + int i; + isl_ctx *ctx; + isl_band *band = NULL; + isl_multi_union_pw_aff *mupa; - if (ancestor->parent && ancestor->parent->n == 1) { - r = cmp_band_in_ancestor(b1, b2, data, ancestor->parent); - if (data->r < 0) - return 0; - if (r) - return r; - } + if (!node || !domain) + goto error; - upma = isl_union_pw_multi_aff_copy(b1->pma); - domain = isl_union_pw_multi_aff_domain(upma); - upma = isl_union_pw_multi_aff_copy(ancestor->pma); - upma = isl_union_pw_multi_aff_intersect_domain(upma, domain); - r = extract_int(upma, data); - isl_union_pw_multi_aff_free(upma); + ctx = isl_schedule_node_get_ctx(node); + band = isl_band_alloc(ctx); + if (!band) + goto error; - if (r < 0) - data->r = -1; - if (r < 0 || !r) - return 0; - - isl_int_set(data->c2, data->c1); - - upma = isl_union_pw_multi_aff_copy(b2->pma); - domain = isl_union_pw_multi_aff_domain(upma); - upma = isl_union_pw_multi_aff_copy(ancestor->pma); - upma = isl_union_pw_multi_aff_intersect_domain(upma, domain); - r = extract_int(upma, data); - isl_union_pw_multi_aff_free(upma); + band->schedule = node->schedule; + band->parent = parent; - if (r < 0) - data->r = -1; - if (r < 0 || !r) - return 0; + if (isl_schedule_node_get_type(node) == isl_schedule_node_leaf) { + band->n = 0; + band->pma = isl_union_pw_multi_aff_from_domain(domain); + isl_schedule_node_free(node); + return band; + } + + band->n = isl_schedule_node_band_n_member(node); + if (band->n == 0) + isl_die(ctx, isl_error_unsupported, + "zero-dimensional band nodes not supported", + goto error); + band->coincident = isl_alloc_array(ctx, int, band->n); + if (band->n && !band->coincident) + goto error; + for (i = 0; i < band->n; ++i) + band->coincident[i] = + isl_schedule_node_band_member_get_coincident(node, i); + mupa = isl_schedule_node_band_get_partial_schedule(node); + band->pma = isl_union_pw_multi_aff_from_multi_union_pw_aff(mupa); + if (!band->pma) + goto error; - return isl_int_cmp(data->c2, data->c1); -} + node = isl_schedule_node_child(node, 0); + if (isl_schedule_node_get_type(node) == isl_schedule_node_leaf) { + isl_schedule_node_free(node); + isl_union_set_free(domain); + return band; + } -/* Compare "a" and "b" based on the parent schedule of their parent. - */ -static int cmp_band(const void *a, const void *b, void *user) -{ - isl_band *b1 = *(isl_band * const *) a; - isl_band *b2 = *(isl_band * const *) b; - struct isl_cmp_band_data *data = user; + band->children = construct_band_list(node, domain, band); + if (!band->children) + return isl_band_free(band); - return cmp_band_in_ancestor(b1, b2, data, b1->parent); + return band; +error: + isl_union_set_free(domain); + isl_schedule_node_free(node); + isl_band_free(band); + return NULL; } -/* Sort the elements in "list" based on the partial schedules of its parent - * (and ancestors). In particular if the parent assigns constant values - * to the domains of the bands in "list", then the elements are sorted - * according to that order. - * This order should be a more "natural" order for the user, but otherwise - * shouldn't have any effect. - * If we would be constructing an isl_band forest directly in - * isl_union_set_compute_schedule then there wouldn't be any need - * for a reordering, since the children would be added to the list - * in their natural order automatically. - * - * If there is only one element in the list, then there is no need to sort - * anything. - * If the partial schedule of the parent has more than one member - * (or if there is no parent), then it's - * defnitely not assigning constant values to the different children in - * the list and so we wouldn't be able to use it to sort the list. +/* Construct a list of isl_band structures from the children of "node". + * "node" itself is a sequence or set node, so that each of the child nodes + * is a filter node and the list returned by node_construct_band_list + * consists of a single element. + * "domain" is the universe set of the domain elements that reach "node". + * "parent" is the parent isl_band of the isl_band structures constructed + * by this function. */ -static __isl_give isl_band_list *sort_band_list(__isl_take isl_band_list *list, +static __isl_give isl_band_list *construct_band_list_from_children( + __isl_take isl_schedule_node *node, __isl_take isl_union_set *domain, __isl_keep isl_band *parent) { - struct isl_cmp_band_data data; + int i, n; + isl_ctx *ctx; + isl_band_list *list; - if (!list) - return NULL; - if (list->n <= 1) - return list; - if (!parent || parent->n != 1) - return list; - - data.r = 0; - isl_int_init(data.c1); - isl_int_init(data.c2); - isl_int_init(data.t); - isl_sort(list->p, list->n, sizeof(list->p[0]), &cmp_band, &data); - if (data.r < 0) - list = isl_band_list_free(list); - isl_int_clear(data.c1); - isl_int_clear(data.c2); - isl_int_clear(data.t); + n = isl_schedule_node_n_children(node); + + ctx = isl_schedule_node_get_ctx(node); + list = isl_band_list_alloc(ctx, 0); + for (i = 0; i < n; ++i) { + isl_schedule_node *child; + isl_band_list *list_i; + + child = isl_schedule_node_get_child(node, i); + list_i = construct_band_list(child, isl_union_set_copy(domain), + parent); + list = isl_band_list_concat(list, list_i); + } + + isl_union_set_free(domain); + isl_schedule_node_free(node); return list; } -/* Construct a list of bands that start at the same position (with - * sequence number band_nr) in the schedules of the nodes that - * were active in the parent band. - * - * A separate isl_band structure is created for each band_id - * and for each node that does not have a band with sequence - * number band_nr. In the latter case, a band without members - * is created. - * This ensures that if a band has any children, then each node - * that was active in the band is active in exactly one of the children. +/* Construct an isl_band structure from the given sequence node + * (or set node that is treated as a sequence node). + * A single-dimensional band is created with as schedule for each of + * filters of the children, the corresponding child position. + * "domain" is the universe set of the domain elements that reach "node". + * "parent" is the parent isl_band of the isl_band constructed + * by this function. */ -static __isl_give isl_band_list *construct_band_list( - __isl_keep isl_schedule *schedule, __isl_keep isl_band *parent, - int band_nr, int *parent_active, int n_active) +static __isl_give isl_band_list *construct_band_list_sequence( + __isl_take isl_schedule_node *node, __isl_take isl_union_set *domain, + __isl_keep isl_band *parent) { - int i, j; - isl_ctx *ctx = isl_schedule_get_ctx(schedule); - int *active; - int n_band; - isl_band_list *list; - - n_band = 0; - for (i = 0; i < n_active; ++i) { - for (j = 0; j < schedule->n; ++j) { - if (!parent_active[j]) - continue; - if (schedule->node[j].n_band <= band_nr) - continue; - if (schedule->node[j].band_id[band_nr] == i) { - n_band++; - break; - } - } - } - for (j = 0; j < schedule->n; ++j) - if (schedule->node[j].n_band <= band_nr) - n_band++; - - if (n_band == 1) { - isl_band *band; - list = isl_band_list_alloc(ctx, n_band); - band = construct_band(schedule, parent, band_nr, - parent_active, n_active); - return isl_band_list_add(list, band); - } + int i, n; + isl_ctx *ctx; + isl_band *band = NULL; + isl_space *space; + isl_union_pw_multi_aff *upma; - active = isl_alloc_array(ctx, int, schedule->n); - if (schedule->n && !active) - return NULL; + if (!node || !domain) + goto error; - list = isl_band_list_alloc(ctx, n_band); + ctx = isl_schedule_node_get_ctx(node); + band = isl_band_alloc(ctx); + if (!band) + goto error; - for (i = 0; i < n_active; ++i) { - int n = 0; - isl_band *band; + band->schedule = node->schedule; + band->parent = parent; + band->n = 1; + band->coincident = isl_calloc_array(ctx, int, band->n); + if (!band->coincident) + goto error; - for (j = 0; j < schedule->n; ++j) { - active[j] = parent_active[j] && - schedule->node[j].n_band > band_nr && - schedule->node[j].band_id[band_nr] == i; - if (active[j]) - n++; - } - if (n == 0) - continue; + n = isl_schedule_node_n_children(node); + space = isl_union_set_get_space(domain); + upma = isl_union_pw_multi_aff_empty(isl_space_copy(space)); - band = construct_band(schedule, parent, band_nr, active, n); + space = isl_space_set_from_params(space); + space = isl_space_add_dims(space, isl_dim_set, 1); - list = isl_band_list_add(list, band); - } - for (i = 0; i < schedule->n; ++i) { - isl_band *band; - if (!parent_active[i]) - continue; - if (schedule->node[i].n_band > band_nr) - continue; - for (j = 0; j < schedule->n; ++j) - active[j] = j == i; - band = construct_band(schedule, parent, band_nr, active, 1); - list = isl_band_list_add(list, band); + for (i = 0; i < n; ++i) { + isl_schedule_node *child; + isl_union_set *filter; + isl_val *v; + isl_val_list *vl; + isl_multi_val *mv; + isl_union_pw_multi_aff *upma_i; + + child = isl_schedule_node_get_child(node, i); + filter = isl_schedule_node_filter_get_filter(child); + isl_schedule_node_free(child); + filter = isl_union_set_intersect(filter, + isl_union_set_copy(domain)); + v = isl_val_int_from_si(ctx, i); + vl = isl_val_list_from_val(v); + mv = isl_multi_val_from_val_list(isl_space_copy(space), vl); + upma_i = isl_union_pw_multi_aff_multi_val_on_domain(filter, mv); + upma = isl_union_pw_multi_aff_union_add(upma, upma_i); } - free(active); + isl_space_free(space); - list = sort_band_list(list, parent); + band->pma = upma; + if (!band->pma) + goto error; - return list; + band->children = construct_band_list_from_children(node, domain, band); + if (!band->children) + band = isl_band_free(band); + return isl_band_list_from_band(band); +error: + isl_union_set_free(domain); + isl_schedule_node_free(node); + isl_band_free(band); + return NULL; } -/* Construct a band forest representation of the schedule and - * return the list of roots. +/* Construct a list of isl_band structures from "node" depending + * on the type of "node". + * "domain" is the universe set of the domain elements that reach "node". + * "parent" is the parent isl_band of the isl_band structures constructed + * by this function. + * + * If schedule_separate_components is set then set nodes are treated + * as sequence nodes. Otherwise, we directly extract an (implicitly + * parallel) list of isl_band structures. + * + * If "node" is a filter, then "domain" is updated by the filter. */ -static __isl_give isl_band_list *construct_forest( - __isl_keep isl_schedule *schedule) +static __isl_give isl_band_list *construct_band_list( + __isl_take isl_schedule_node *node, __isl_take isl_union_set *domain, + __isl_keep isl_band *parent) { - int i; - isl_ctx *ctx = isl_schedule_get_ctx(schedule); - isl_band_list *forest; - int *active; - - active = isl_alloc_array(ctx, int, schedule->n); - if (schedule->n && !active) - return NULL; - - for (i = 0; i < schedule->n; ++i) - active[i] = 1; + enum isl_schedule_node_type type; + isl_ctx *ctx; + isl_band *band; + isl_band_list *list; + isl_union_set *filter; - forest = construct_band_list(schedule, NULL, 0, active, schedule->n); + if (!node || !domain) + goto error; - free(active); + type = isl_schedule_node_get_type(node); + switch (type) { + case isl_schedule_node_error: + goto error; + case isl_schedule_node_context: + isl_die(isl_schedule_node_get_ctx(node), isl_error_unsupported, + "context nodes not supported", goto error); + case isl_schedule_node_domain: + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "internal domain nodes not allowed", goto error); + case isl_schedule_node_expansion: + isl_die(isl_schedule_node_get_ctx(node), isl_error_unsupported, + "expansion nodes not supported", goto error); + case isl_schedule_node_extension: + isl_die(isl_schedule_node_get_ctx(node), isl_error_unsupported, + "extension nodes not supported", goto error); + case isl_schedule_node_filter: + filter = isl_schedule_node_filter_get_filter(node); + domain = isl_union_set_intersect(domain, filter); + node = isl_schedule_node_child(node, 0); + return construct_band_list(node, domain, parent); + case isl_schedule_node_guard: + isl_die(isl_schedule_node_get_ctx(node), isl_error_unsupported, + "guard nodes not supported", goto error); + case isl_schedule_node_mark: + isl_die(isl_schedule_node_get_ctx(node), isl_error_unsupported, + "mark nodes not supported", goto error); + case isl_schedule_node_set: + ctx = isl_schedule_node_get_ctx(node); + if (isl_options_get_schedule_separate_components(ctx)) + return construct_band_list_sequence(node, domain, + parent); + else + return construct_band_list_from_children(node, domain, + parent); + case isl_schedule_node_sequence: + return construct_band_list_sequence(node, domain, parent); + case isl_schedule_node_leaf: + case isl_schedule_node_band: + band = construct_band(node, domain, parent); + list = isl_band_list_from_band(band); + break; + } - return forest; + return list; +error: + isl_union_set_free(domain); + isl_schedule_node_free(node); + return NULL; } /* Return the roots of a band forest representation of the schedule. + * The band forest is constructed from the schedule tree, + * but once such a band forest is + * constructed, we forget about the original schedule tree since + * the user may modify the schedule through the band forest. */ __isl_give isl_band_list *isl_schedule_get_band_forest( __isl_keep isl_schedule *schedule) { + isl_schedule_node *node; + isl_union_set *domain; + if (!schedule) return NULL; - if (!schedule->band_forest) - schedule->band_forest = construct_forest(schedule); + if (schedule->root) { + node = isl_schedule_get_root(schedule); + domain = isl_schedule_node_domain_get_domain(node); + domain = isl_union_set_universe(domain); + node = isl_schedule_node_child(node, 0); + + schedule->band_forest = construct_band_list(node, domain, NULL); + schedule->root = isl_schedule_tree_free(schedule->root); + } return isl_band_list_dup(schedule->band_forest); } @@ -3572,11 +870,216 @@ return p; } +/* Insert a band node with partial schedule "partial" between the domain + * root node of "schedule" and its single child. + * Return a pointer to the updated schedule. + * + * If any of the nodes in the tree depend on the set of outer band nodes + * then we refuse to insert the band node. + */ +__isl_give isl_schedule *isl_schedule_insert_partial_schedule( + __isl_take isl_schedule *schedule, + __isl_take isl_multi_union_pw_aff *partial) +{ + isl_schedule_node *node; + int anchored; + + node = isl_schedule_get_root(schedule); + isl_schedule_free(schedule); + if (!node) + goto error; + if (isl_schedule_node_get_type(node) != isl_schedule_node_domain) + isl_die(isl_schedule_node_get_ctx(node), isl_error_internal, + "root node not a domain node", goto error); + + node = isl_schedule_node_child(node, 0); + anchored = isl_schedule_node_is_subtree_anchored(node); + if (anchored < 0) + goto error; + if (anchored) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot insert band node in anchored subtree", + goto error); + node = isl_schedule_node_insert_partial_schedule(node, partial); + + schedule = isl_schedule_node_get_schedule(node); + isl_schedule_node_free(node); + + return schedule; +error: + isl_schedule_node_free(node); + isl_multi_union_pw_aff_free(partial); + return NULL; +} + +/* Insert a context node with constraints "context" between the domain + * root node of "schedule" and its single child. + * Return a pointer to the updated schedule. + */ +__isl_give isl_schedule *isl_schedule_insert_context( + __isl_take isl_schedule *schedule, __isl_take isl_set *context) +{ + isl_schedule_node *node; + + node = isl_schedule_get_root(schedule); + isl_schedule_free(schedule); + node = isl_schedule_node_child(node, 0); + node = isl_schedule_node_insert_context(node, context); + schedule = isl_schedule_node_get_schedule(node); + isl_schedule_node_free(node); + + return schedule; +} + +/* Insert a guard node with constraints "guard" between the domain + * root node of "schedule" and its single child. + * Return a pointer to the updated schedule. + */ +__isl_give isl_schedule *isl_schedule_insert_guard( + __isl_take isl_schedule *schedule, __isl_take isl_set *guard) +{ + isl_schedule_node *node; + + node = isl_schedule_get_root(schedule); + isl_schedule_free(schedule); + node = isl_schedule_node_child(node, 0); + node = isl_schedule_node_insert_guard(node, guard); + schedule = isl_schedule_node_get_schedule(node); + isl_schedule_node_free(node); + + return schedule; +} + +/* Return a tree with as top-level node a filter corresponding to "filter" and + * as child, the (single) child of "tree". + * However, if this single child is of type "type", then the filter is inserted + * in the children of this single child instead. + */ +static __isl_give isl_schedule_tree *insert_filter_in_child_of_type( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *filter, + enum isl_schedule_node_type type) +{ + if (!isl_schedule_tree_has_children(tree)) { + isl_schedule_tree_free(tree); + return isl_schedule_tree_from_filter(filter); + } else { + tree = isl_schedule_tree_child(tree, 0); + } + + if (isl_schedule_tree_get_type(tree) == type) + tree = isl_schedule_tree_children_insert_filter(tree, filter); + else + tree = isl_schedule_tree_insert_filter(tree, filter); + + return tree; +} + +/* Construct a schedule that combines the schedules "schedule1" and "schedule2" + * with a top-level node (underneath the domain node) of type "type", + * either isl_schedule_node_sequence or isl_schedule_node_set. + * The domains of the two schedules are assumed to be disjoint. + * + * The new schedule has as domain the union of the domains of the two + * schedules. The child of the domain node is a node of type "type" + * with two filters corresponding to the domains of the input schedules. + * If one (or both) of the top-level nodes of the two schedules is itself + * of type "type", then the filter is pushed into the children of that + * node and the sequence of set is flattened. + */ +__isl_give isl_schedule *isl_schedule_pair(enum isl_schedule_node_type type, + __isl_take isl_schedule *schedule1, __isl_take isl_schedule *schedule2) +{ + int disjoint; + isl_ctx *ctx; + enum isl_schedule_node_type root_type; + isl_schedule_tree *tree1, *tree2; + isl_union_set *filter1, *filter2, *domain; + + if (!schedule1 || !schedule2) + goto error; + + root_type = isl_schedule_tree_get_type(schedule1->root); + if (root_type != isl_schedule_node_domain) + isl_die(isl_schedule_get_ctx(schedule1), isl_error_internal, + "root node not a domain node", goto error); + root_type = isl_schedule_tree_get_type(schedule2->root); + if (root_type != isl_schedule_node_domain) + isl_die(isl_schedule_get_ctx(schedule1), isl_error_internal, + "root node not a domain node", goto error); + + ctx = isl_schedule_get_ctx(schedule1); + tree1 = isl_schedule_tree_copy(schedule1->root); + filter1 = isl_schedule_tree_domain_get_domain(tree1); + tree2 = isl_schedule_tree_copy(schedule2->root); + filter2 = isl_schedule_tree_domain_get_domain(tree2); + + isl_schedule_free(schedule1); + isl_schedule_free(schedule2); + + disjoint = isl_union_set_is_disjoint(filter1, filter2); + if (disjoint < 0) + filter1 = isl_union_set_free(filter1); + if (!disjoint) + isl_die(ctx, isl_error_invalid, + "schedule domains not disjoint", + filter1 = isl_union_set_free(filter1)); + + domain = isl_union_set_union(isl_union_set_copy(filter1), + isl_union_set_copy(filter2)); + filter1 = isl_union_set_gist(filter1, isl_union_set_copy(domain)); + filter2 = isl_union_set_gist(filter2, isl_union_set_copy(domain)); + + tree1 = insert_filter_in_child_of_type(tree1, filter1, type); + tree2 = insert_filter_in_child_of_type(tree2, filter2, type); + + tree1 = isl_schedule_tree_from_pair(type, tree1, tree2); + tree1 = isl_schedule_tree_insert_domain(tree1, domain); + + return isl_schedule_from_schedule_tree(ctx, tree1); +error: + isl_schedule_free(schedule1); + isl_schedule_free(schedule2); + return NULL; +} + +/* Construct a schedule that combines the schedules "schedule1" and "schedule2" + * through a sequence node. + * The domains of the input schedules are assumed to be disjoint. + */ +__isl_give isl_schedule *isl_schedule_sequence( + __isl_take isl_schedule *schedule1, __isl_take isl_schedule *schedule2) +{ + return isl_schedule_pair(isl_schedule_node_sequence, + schedule1, schedule2); +} + +/* Construct a schedule that combines the schedules "schedule1" and "schedule2" + * through a set node. + * The domains of the input schedules are assumed to be disjoint. + */ +__isl_give isl_schedule *isl_schedule_set( + __isl_take isl_schedule *schedule1, __isl_take isl_schedule *schedule2) +{ + return isl_schedule_pair(isl_schedule_node_set, schedule1, schedule2); +} + +/* Print "schedule" to "p". + * + * If "schedule" was created from a schedule tree, then we print + * the schedule tree representation. Otherwise, we print + * the band forest representation. + */ __isl_give isl_printer *isl_printer_print_schedule(__isl_take isl_printer *p, __isl_keep isl_schedule *schedule) { isl_band_list *forest; + if (!schedule) + return isl_printer_free(p); + + if (schedule->root) + return isl_printer_print_schedule_tree(p, schedule->root); + forest = isl_schedule_get_band_forest(schedule); p = print_band_list(p, forest); @@ -3594,6 +1097,7 @@ return; printer = isl_printer_to_file(isl_schedule_get_ctx(schedule), stderr); + printer = isl_printer_set_yaml_style(printer, ISL_YAML_STYLE_BLOCK); printer = isl_printer_print_schedule(printer, schedule); isl_printer_free(printer); diff -Nru cloog-0.18.2/isl/isl_schedule_node.c cloog-0.18.4/isl/isl_schedule_node.c --- cloog-0.18.2/isl/isl_schedule_node.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_schedule_node.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,4320 @@ +/* + * Copyright 2013-2014 Ecole Normale Superieure + * Copyright 2014 INRIA Rocquencourt + * + * Use of this software is governed by the MIT license + * + * Written by Sven Verdoolaege, + * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France + * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, + * B.P. 105 - 78153 Le Chesnay, France + */ + +#include +#include +#include +#include + +/* Create a new schedule node in the given schedule, point at the given + * tree with given ancestors and child positions. + * "child_pos" may be NULL if there are no ancestors. + */ +__isl_give isl_schedule_node *isl_schedule_node_alloc( + __isl_take isl_schedule *schedule, __isl_take isl_schedule_tree *tree, + __isl_take isl_schedule_tree_list *ancestors, int *child_pos) +{ + isl_ctx *ctx; + isl_schedule_node *node; + int i, n; + + if (!schedule || !tree || !ancestors) + goto error; + n = isl_schedule_tree_list_n_schedule_tree(ancestors); + if (n > 0 && !child_pos) + goto error; + ctx = isl_schedule_get_ctx(schedule); + node = isl_calloc_type(ctx, isl_schedule_node); + if (!node) + goto error; + node->ref = 1; + node->schedule = schedule; + node->tree = tree; + node->ancestors = ancestors; + node->child_pos = isl_alloc_array(ctx, int, n); + if (n && !node->child_pos) + return isl_schedule_node_free(node); + for (i = 0; i < n; ++i) + node->child_pos[i] = child_pos[i]; + + return node; +error: + isl_schedule_free(schedule); + isl_schedule_tree_free(tree); + isl_schedule_tree_list_free(ancestors); + return NULL; +} + +/* Return a pointer to the root of a schedule tree with as single + * node a domain node with the given domain. + */ +__isl_give isl_schedule_node *isl_schedule_node_from_domain( + __isl_take isl_union_set *domain) +{ + isl_schedule *schedule; + isl_schedule_node *node; + + schedule = isl_schedule_from_domain(domain); + node = isl_schedule_get_root(schedule); + isl_schedule_free(schedule); + + return node; +} + +/* Return a pointer to the root of a schedule tree with as single + * node a extension node with the given extension. + */ +__isl_give isl_schedule_node *isl_schedule_node_from_extension( + __isl_take isl_union_map *extension) +{ + isl_ctx *ctx; + isl_schedule *schedule; + isl_schedule_tree *tree; + isl_schedule_node *node; + + if (!extension) + return NULL; + + ctx = isl_union_map_get_ctx(extension); + tree = isl_schedule_tree_from_extension(extension); + schedule = isl_schedule_from_schedule_tree(ctx, tree); + node = isl_schedule_get_root(schedule); + isl_schedule_free(schedule); + + return node; +} + +/* Return the isl_ctx to which "node" belongs. + */ +isl_ctx *isl_schedule_node_get_ctx(__isl_keep isl_schedule_node *node) +{ + return node ? isl_schedule_get_ctx(node->schedule) : NULL; +} + +/* Return a pointer to the leaf of the schedule into which "node" points. + * + * Even though these leaves are not reference counted, we still + * indicate that this function does not return a copy. + */ +__isl_keep isl_schedule_tree *isl_schedule_node_peek_leaf( + __isl_keep isl_schedule_node *node) +{ + return node ? isl_schedule_peek_leaf(node->schedule) : NULL; +} + +/* Return a pointer to the leaf of the schedule into which "node" points. + * + * Even though these leaves are not reference counted, we still + * return a "copy" of the leaf here such that it can still be "freed" + * by the user. + */ +__isl_give isl_schedule_tree *isl_schedule_node_get_leaf( + __isl_keep isl_schedule_node *node) +{ + return isl_schedule_tree_copy(isl_schedule_node_peek_leaf(node)); +} + +/* Return the type of the node or isl_schedule_node_error on error. + */ +enum isl_schedule_node_type isl_schedule_node_get_type( + __isl_keep isl_schedule_node *node) +{ + return node ? isl_schedule_tree_get_type(node->tree) + : isl_schedule_node_error; +} + +/* Return the type of the parent of "node" or isl_schedule_node_error on error. + */ +enum isl_schedule_node_type isl_schedule_node_get_parent_type( + __isl_keep isl_schedule_node *node) +{ + int pos; + int has_parent; + isl_schedule_tree *parent; + enum isl_schedule_node_type type; + + if (!node) + return isl_schedule_node_error; + has_parent = isl_schedule_node_has_parent(node); + if (has_parent < 0) + return isl_schedule_node_error; + if (!has_parent) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "node has no parent", return isl_schedule_node_error); + + pos = isl_schedule_tree_list_n_schedule_tree(node->ancestors) - 1; + parent = isl_schedule_tree_list_get_schedule_tree(node->ancestors, pos); + type = isl_schedule_tree_get_type(parent); + isl_schedule_tree_free(parent); + + return type; +} + +/* Return a copy of the subtree that this node points to. + */ +__isl_give isl_schedule_tree *isl_schedule_node_get_tree( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + + return isl_schedule_tree_copy(node->tree); +} + +/* Return a copy of the schedule into which "node" points. + */ +__isl_give isl_schedule *isl_schedule_node_get_schedule( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + return isl_schedule_copy(node->schedule); +} + +/* Return a fresh copy of "node". + */ +__isl_take isl_schedule_node *isl_schedule_node_dup( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + + return isl_schedule_node_alloc(isl_schedule_copy(node->schedule), + isl_schedule_tree_copy(node->tree), + isl_schedule_tree_list_copy(node->ancestors), + node->child_pos); +} + +/* Return an isl_schedule_node that is equal to "node" and that has only + * a single reference. + */ +__isl_give isl_schedule_node *isl_schedule_node_cow( + __isl_take isl_schedule_node *node) +{ + if (!node) + return NULL; + + if (node->ref == 1) + return node; + node->ref--; + return isl_schedule_node_dup(node); +} + +/* Return a new reference to "node". + */ +__isl_give isl_schedule_node *isl_schedule_node_copy( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + + node->ref++; + return node; +} + +/* Free "node" and return NULL. + * + * Since the node may point to a leaf of its schedule, which + * point to a field inside the schedule, we need to make sure + * we free the tree before freeing the schedule. + */ +__isl_null isl_schedule_node *isl_schedule_node_free( + __isl_take isl_schedule_node *node) +{ + if (!node) + return NULL; + if (--node->ref > 0) + return NULL; + + isl_schedule_tree_list_free(node->ancestors); + free(node->child_pos); + isl_schedule_tree_free(node->tree); + isl_schedule_free(node->schedule); + free(node); + + return NULL; +} + +/* Do "node1" and "node2" point to the same position in the same + * schedule? + */ +isl_bool isl_schedule_node_is_equal(__isl_keep isl_schedule_node *node1, + __isl_keep isl_schedule_node *node2) +{ + int i, n1, n2; + + if (!node1 || !node2) + return isl_bool_error; + if (node1 == node2) + return isl_bool_true; + if (node1->schedule != node2->schedule) + return isl_bool_false; + + n1 = isl_schedule_node_get_tree_depth(node1); + n2 = isl_schedule_node_get_tree_depth(node2); + if (n1 != n2) + return isl_bool_false; + for (i = 0; i < n1; ++i) + if (node1->child_pos[i] != node2->child_pos[i]) + return isl_bool_false; + + return isl_bool_true; +} + +/* Return the number of outer schedule dimensions of "node" + * in its schedule tree. + * + * Return -1 on error. + */ +int isl_schedule_node_get_schedule_depth(__isl_keep isl_schedule_node *node) +{ + int i, n; + int depth = 0; + + if (!node) + return -1; + + n = isl_schedule_tree_list_n_schedule_tree(node->ancestors); + for (i = n - 1; i >= 0; --i) { + isl_schedule_tree *tree; + + tree = isl_schedule_tree_list_get_schedule_tree( + node->ancestors, i); + if (!tree) + return -1; + if (tree->type == isl_schedule_node_band) + depth += isl_schedule_tree_band_n_member(tree); + isl_schedule_tree_free(tree); + } + + return depth; +} + +/* Internal data structure for + * isl_schedule_node_get_prefix_schedule_union_pw_multi_aff + * + * "initialized" is set if the filter field has been initialized. + * If "universe_domain" is not set, then the collected filter is intersected + * with the the domain of the root domain node. + * "universe_filter" is set if we are only collecting the universes of filters + * "collect_prefix" is set if we are collecting prefixes. + * "filter" collects all outer filters and is NULL until "initialized" is set. + * "prefix" collects all outer band partial schedules (if "collect_prefix" + * is set). If it is used, then it is initialized by the caller + * of collect_filter_prefix to a zero-dimensional function. + */ +struct isl_schedule_node_get_filter_prefix_data { + int initialized; + int universe_domain; + int universe_filter; + int collect_prefix; + isl_union_set *filter; + isl_multi_union_pw_aff *prefix; +}; + +static int collect_filter_prefix(__isl_keep isl_schedule_tree_list *list, + int n, struct isl_schedule_node_get_filter_prefix_data *data); + +/* Update the filter and prefix information in "data" based on the first "n" + * elements in "list" and the expansion tree root "tree". + * + * We first collect the information from the elements in "list", + * initializing the filter based on the domain of the expansion. + * Then we map the results to the expanded space and combined them + * with the results already in "data". + */ +static int collect_filter_prefix_expansion(__isl_take isl_schedule_tree *tree, + __isl_keep isl_schedule_tree_list *list, int n, + struct isl_schedule_node_get_filter_prefix_data *data) +{ + struct isl_schedule_node_get_filter_prefix_data contracted; + isl_union_pw_multi_aff *c; + isl_union_map *exp, *universe; + isl_union_set *filter; + + c = isl_schedule_tree_expansion_get_contraction(tree); + exp = isl_schedule_tree_expansion_get_expansion(tree); + + contracted.initialized = 1; + contracted.universe_domain = data->universe_domain; + contracted.universe_filter = data->universe_filter; + contracted.collect_prefix = data->collect_prefix; + universe = isl_union_map_universe(isl_union_map_copy(exp)); + filter = isl_union_map_domain(universe); + if (data->collect_prefix) { + isl_space *space = isl_union_set_get_space(filter); + space = isl_space_set_from_params(space); + contracted.prefix = isl_multi_union_pw_aff_zero(space); + } + contracted.filter = filter; + + if (collect_filter_prefix(list, n, &contracted) < 0) + contracted.filter = isl_union_set_free(contracted.filter); + if (data->collect_prefix) { + isl_multi_union_pw_aff *prefix; + + prefix = contracted.prefix; + prefix = + isl_multi_union_pw_aff_pullback_union_pw_multi_aff(prefix, + isl_union_pw_multi_aff_copy(c)); + data->prefix = isl_multi_union_pw_aff_flat_range_product( + prefix, data->prefix); + } + filter = contracted.filter; + if (data->universe_domain) + filter = isl_union_set_preimage_union_pw_multi_aff(filter, + isl_union_pw_multi_aff_copy(c)); + else + filter = isl_union_set_apply(filter, isl_union_map_copy(exp)); + if (!data->initialized) + data->filter = filter; + else + data->filter = isl_union_set_intersect(filter, data->filter); + data->initialized = 1; + + isl_union_pw_multi_aff_free(c); + isl_union_map_free(exp); + isl_schedule_tree_free(tree); + + return 0; +} + +/* Update the filter information in "data" based on the first "n" + * elements in "list" and the extension tree root "tree", in case + * data->universe_domain is set and data->collect_prefix is not. + * + * We collect the universe domain of the elements in "list" and + * add it to the universe range of the extension (intersected + * with the already collected filter, if any). + */ +static int collect_universe_domain_extension(__isl_take isl_schedule_tree *tree, + __isl_keep isl_schedule_tree_list *list, int n, + struct isl_schedule_node_get_filter_prefix_data *data) +{ + struct isl_schedule_node_get_filter_prefix_data data_outer; + isl_union_map *extension; + isl_union_set *filter; + + data_outer.initialized = 0; + data_outer.universe_domain = 1; + data_outer.universe_filter = data->universe_filter; + data_outer.collect_prefix = 0; + data_outer.filter = NULL; + data_outer.prefix = NULL; + + if (collect_filter_prefix(list, n, &data_outer) < 0) + data_outer.filter = isl_union_set_free(data_outer.filter); + + extension = isl_schedule_tree_extension_get_extension(tree); + extension = isl_union_map_universe(extension); + filter = isl_union_map_range(extension); + if (data_outer.initialized) + filter = isl_union_set_union(filter, data_outer.filter); + if (data->initialized) + filter = isl_union_set_intersect(filter, data->filter); + + data->filter = filter; + + isl_schedule_tree_free(tree); + + return 0; +} + +/* Update "data" based on the tree node "tree" in case "data" has + * not been initialized yet. + * + * Return 0 on success and -1 on error. + * + * If "tree" is a filter, then we set data->filter to this filter + * (or its universe). + * If "tree" is a domain, then this means we have reached the root + * of the schedule tree without being able to extract any information. + * We therefore initialize data->filter to the universe of the domain, + * or the domain itself if data->universe_domain is not set. + * If "tree" is a band with at least one member, then we set data->filter + * to the universe of the schedule domain and replace the zero-dimensional + * data->prefix by the band schedule (if data->collect_prefix is set). + */ +static int collect_filter_prefix_init(__isl_keep isl_schedule_tree *tree, + struct isl_schedule_node_get_filter_prefix_data *data) +{ + enum isl_schedule_node_type type; + isl_multi_union_pw_aff *mupa; + isl_union_set *filter; + + type = isl_schedule_tree_get_type(tree); + switch (type) { + case isl_schedule_node_error: + return -1; + case isl_schedule_node_expansion: + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "should be handled by caller", return -1); + case isl_schedule_node_extension: + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "cannot handle extension nodes", return -1); + case isl_schedule_node_context: + case isl_schedule_node_leaf: + case isl_schedule_node_guard: + case isl_schedule_node_mark: + case isl_schedule_node_sequence: + case isl_schedule_node_set: + return 0; + case isl_schedule_node_domain: + filter = isl_schedule_tree_domain_get_domain(tree); + if (data->universe_domain) + filter = isl_union_set_universe(filter); + data->filter = filter; + break; + case isl_schedule_node_band: + if (isl_schedule_tree_band_n_member(tree) == 0) + return 0; + mupa = isl_schedule_tree_band_get_partial_schedule(tree); + if (data->collect_prefix) { + isl_multi_union_pw_aff_free(data->prefix); + mupa = isl_multi_union_pw_aff_reset_tuple_id(mupa, + isl_dim_set); + data->prefix = isl_multi_union_pw_aff_copy(mupa); + } + filter = isl_multi_union_pw_aff_domain(mupa); + filter = isl_union_set_universe(filter); + data->filter = filter; + break; + case isl_schedule_node_filter: + filter = isl_schedule_tree_filter_get_filter(tree); + if (data->universe_filter) + filter = isl_union_set_universe(filter); + data->filter = filter; + break; + } + + if ((data->collect_prefix && !data->prefix) || !data->filter) + return -1; + + data->initialized = 1; + + return 0; +} + +/* Update "data" based on the tree node "tree" in case "data" has + * already been initialized. + * + * Return 0 on success and -1 on error. + * + * If "tree" is a domain and data->universe_domain is not set, then + * intersect data->filter with the domain. + * If "tree" is a filter, then we intersect data->filter with this filter + * (or its universe). + * If "tree" is a band with at least one member and data->collect_prefix + * is set, then we extend data->prefix with the band schedule. + * If "tree" is an extension, then we make sure that we are not collecting + * information on any extended domain elements. + */ +static int collect_filter_prefix_update(__isl_keep isl_schedule_tree *tree, + struct isl_schedule_node_get_filter_prefix_data *data) +{ + enum isl_schedule_node_type type; + isl_multi_union_pw_aff *mupa; + isl_union_set *filter; + isl_union_map *extension; + int empty; + + type = isl_schedule_tree_get_type(tree); + switch (type) { + case isl_schedule_node_error: + return -1; + case isl_schedule_node_expansion: + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "should be handled by caller", return -1); + case isl_schedule_node_extension: + extension = isl_schedule_tree_extension_get_extension(tree); + extension = isl_union_map_intersect_range(extension, + isl_union_set_copy(data->filter)); + empty = isl_union_map_is_empty(extension); + isl_union_map_free(extension); + if (empty < 0) + return -1; + if (empty) + break; + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "cannot handle extension nodes", return -1); + case isl_schedule_node_context: + case isl_schedule_node_leaf: + case isl_schedule_node_guard: + case isl_schedule_node_mark: + case isl_schedule_node_sequence: + case isl_schedule_node_set: + break; + case isl_schedule_node_domain: + if (data->universe_domain) + break; + filter = isl_schedule_tree_domain_get_domain(tree); + data->filter = isl_union_set_intersect(data->filter, filter); + break; + case isl_schedule_node_band: + if (isl_schedule_tree_band_n_member(tree) == 0) + break; + if (!data->collect_prefix) + break; + mupa = isl_schedule_tree_band_get_partial_schedule(tree); + data->prefix = isl_multi_union_pw_aff_flat_range_product(mupa, + data->prefix); + if (!data->prefix) + return -1; + break; + case isl_schedule_node_filter: + filter = isl_schedule_tree_filter_get_filter(tree); + if (data->universe_filter) + filter = isl_union_set_universe(filter); + data->filter = isl_union_set_intersect(data->filter, filter); + if (!data->filter) + return -1; + break; + } + + return 0; +} + +/* Collect filter and/or prefix information from the first "n" + * elements in "list" (which represent the ancestors of a node). + * Store the results in "data". + * + * Extension nodes are only supported if they do not affect the outcome, + * i.e., if we are collecting information on non-extended domain elements, + * or if we are collecting the universe domain (without prefix). + * + * Return 0 on success and -1 on error. + * + * We traverse the list from innermost ancestor (last element) + * to outermost ancestor (first element), calling collect_filter_prefix_init + * on each node as long as we have not been able to extract any information + * yet and collect_filter_prefix_update afterwards. + * If we come across an expansion node, then we interrupt the traversal + * and call collect_filter_prefix_expansion to restart the traversal + * over the remaining ancestors and to combine the results with those + * that have already been collected. + * If we come across an extension node and we are only computing + * the universe domain, then we interrupt the traversal and call + * collect_universe_domain_extension to restart the traversal + * over the remaining ancestors and to combine the results with those + * that have already been collected. + * On successful return, data->initialized will be set since the outermost + * ancestor is a domain node, which always results in an initialization. + */ +static int collect_filter_prefix(__isl_keep isl_schedule_tree_list *list, + int n, struct isl_schedule_node_get_filter_prefix_data *data) +{ + int i; + + if (!list) + return -1; + + for (i = n - 1; i >= 0; --i) { + isl_schedule_tree *tree; + enum isl_schedule_node_type type; + int r; + + tree = isl_schedule_tree_list_get_schedule_tree(list, i); + if (!tree) + return -1; + type = isl_schedule_tree_get_type(tree); + if (type == isl_schedule_node_expansion) + return collect_filter_prefix_expansion(tree, list, i, + data); + if (type == isl_schedule_node_extension && + data->universe_domain && !data->collect_prefix) + return collect_universe_domain_extension(tree, list, i, + data); + if (!data->initialized) + r = collect_filter_prefix_init(tree, data); + else + r = collect_filter_prefix_update(tree, data); + isl_schedule_tree_free(tree); + if (r < 0) + return -1; + } + + return 0; +} + +/* Return the concatenation of the partial schedules of all outer band + * nodes of "node" interesected with all outer filters + * as an isl_multi_union_pw_aff. + * None of the ancestors of "node" may be an extension node, unless + * there is also a filter ancestor that filters out all the extended + * domain elements. + * + * If "node" is pointing at the root of the schedule tree, then + * there are no domain elements reaching the current node, so + * we return an empty result. + * + * We collect all the filters and partial schedules in collect_filter_prefix + * and intersect the domain of the combined schedule with the combined filter. + */ +__isl_give isl_multi_union_pw_aff * +isl_schedule_node_get_prefix_schedule_multi_union_pw_aff( + __isl_keep isl_schedule_node *node) +{ + int n; + isl_space *space; + struct isl_schedule_node_get_filter_prefix_data data; + + if (!node) + return NULL; + + space = isl_schedule_get_space(node->schedule); + space = isl_space_set_from_params(space); + if (node->tree == node->schedule->root) + return isl_multi_union_pw_aff_zero(space); + + data.initialized = 0; + data.universe_domain = 1; + data.universe_filter = 0; + data.collect_prefix = 1; + data.filter = NULL; + data.prefix = isl_multi_union_pw_aff_zero(space); + + n = isl_schedule_tree_list_n_schedule_tree(node->ancestors); + if (collect_filter_prefix(node->ancestors, n, &data) < 0) + data.prefix = isl_multi_union_pw_aff_free(data.prefix); + + data.prefix = isl_multi_union_pw_aff_intersect_domain(data.prefix, + data.filter); + + return data.prefix; +} + +/* Return the concatenation of the partial schedules of all outer band + * nodes of "node" interesected with all outer filters + * as an isl_union_pw_multi_aff. + * None of the ancestors of "node" may be an extension node, unless + * there is also a filter ancestor that filters out all the extended + * domain elements. + * + * If "node" is pointing at the root of the schedule tree, then + * there are no domain elements reaching the current node, so + * we return an empty result. + * + * We collect all the filters and partial schedules in collect_filter_prefix. + * The partial schedules are collected as an isl_multi_union_pw_aff. + * If this isl_multi_union_pw_aff is zero-dimensional, then it does not + * contain any domain information, so we construct the isl_union_pw_multi_aff + * result as a zero-dimensional function on the collected filter. + * Otherwise, we convert the isl_multi_union_pw_aff to + * an isl_multi_union_pw_aff and intersect the domain with the filter. + */ +__isl_give isl_union_pw_multi_aff * +isl_schedule_node_get_prefix_schedule_union_pw_multi_aff( + __isl_keep isl_schedule_node *node) +{ + int n; + isl_space *space; + isl_union_pw_multi_aff *prefix; + struct isl_schedule_node_get_filter_prefix_data data; + + if (!node) + return NULL; + + space = isl_schedule_get_space(node->schedule); + if (node->tree == node->schedule->root) + return isl_union_pw_multi_aff_empty(space); + + space = isl_space_set_from_params(space); + data.initialized = 0; + data.universe_domain = 1; + data.universe_filter = 0; + data.collect_prefix = 1; + data.filter = NULL; + data.prefix = isl_multi_union_pw_aff_zero(space); + + n = isl_schedule_tree_list_n_schedule_tree(node->ancestors); + if (collect_filter_prefix(node->ancestors, n, &data) < 0) + data.prefix = isl_multi_union_pw_aff_free(data.prefix); + + if (data.prefix && + isl_multi_union_pw_aff_dim(data.prefix, isl_dim_set) == 0) { + isl_multi_union_pw_aff_free(data.prefix); + prefix = isl_union_pw_multi_aff_from_domain(data.filter); + } else { + prefix = + isl_union_pw_multi_aff_from_multi_union_pw_aff(data.prefix); + prefix = isl_union_pw_multi_aff_intersect_domain(prefix, + data.filter); + } + + return prefix; +} + +/* Return the concatenation of the partial schedules of all outer band + * nodes of "node" interesected with all outer filters + * as an isl_union_map. + */ +__isl_give isl_union_map *isl_schedule_node_get_prefix_schedule_union_map( + __isl_keep isl_schedule_node *node) +{ + isl_union_pw_multi_aff *upma; + + upma = isl_schedule_node_get_prefix_schedule_union_pw_multi_aff(node); + return isl_union_map_from_union_pw_multi_aff(upma); +} + +/* Return the concatenation of the partial schedules of all outer band + * nodes of "node" intersected with all outer domain constraints. + * None of the ancestors of "node" may be an extension node, unless + * there is also a filter ancestor that filters out all the extended + * domain elements. + * + * Essentially, this functions intersected the domain of the output + * of isl_schedule_node_get_prefix_schedule_union_map with the output + * of isl_schedule_node_get_domain, except that it only traverses + * the ancestors of "node" once. + */ +__isl_give isl_union_map *isl_schedule_node_get_prefix_schedule_relation( + __isl_keep isl_schedule_node *node) +{ + int n; + isl_space *space; + isl_union_map *prefix; + struct isl_schedule_node_get_filter_prefix_data data; + + if (!node) + return NULL; + + space = isl_schedule_get_space(node->schedule); + if (node->tree == node->schedule->root) + return isl_union_map_empty(space); + + space = isl_space_set_from_params(space); + data.initialized = 0; + data.universe_domain = 0; + data.universe_filter = 0; + data.collect_prefix = 1; + data.filter = NULL; + data.prefix = isl_multi_union_pw_aff_zero(space); + + n = isl_schedule_tree_list_n_schedule_tree(node->ancestors); + if (collect_filter_prefix(node->ancestors, n, &data) < 0) + data.prefix = isl_multi_union_pw_aff_free(data.prefix); + + if (data.prefix && + isl_multi_union_pw_aff_dim(data.prefix, isl_dim_set) == 0) { + isl_multi_union_pw_aff_free(data.prefix); + prefix = isl_union_map_from_domain(data.filter); + } else { + prefix = isl_union_map_from_multi_union_pw_aff(data.prefix); + prefix = isl_union_map_intersect_domain(prefix, data.filter); + } + + return prefix; +} + +/* Return the domain elements that reach "node". + * + * If "node" is pointing at the root of the schedule tree, then + * there are no domain elements reaching the current node, so + * we return an empty result. + * None of the ancestors of "node" may be an extension node, unless + * there is also a filter ancestor that filters out all the extended + * domain elements. + * + * Otherwise, we collect all filters reaching the node, + * intersected with the root domain in collect_filter_prefix. + */ +__isl_give isl_union_set *isl_schedule_node_get_domain( + __isl_keep isl_schedule_node *node) +{ + int n; + struct isl_schedule_node_get_filter_prefix_data data; + + if (!node) + return NULL; + + if (node->tree == node->schedule->root) { + isl_space *space; + + space = isl_schedule_get_space(node->schedule); + return isl_union_set_empty(space); + } + + data.initialized = 0; + data.universe_domain = 0; + data.universe_filter = 0; + data.collect_prefix = 0; + data.filter = NULL; + data.prefix = NULL; + + n = isl_schedule_tree_list_n_schedule_tree(node->ancestors); + if (collect_filter_prefix(node->ancestors, n, &data) < 0) + data.filter = isl_union_set_free(data.filter); + + return data.filter; +} + +/* Return the union of universe sets of the domain elements that reach "node". + * + * If "node" is pointing at the root of the schedule tree, then + * there are no domain elements reaching the current node, so + * we return an empty result. + * + * Otherwise, we collect the universes of all filters reaching the node + * in collect_filter_prefix. + */ +__isl_give isl_union_set *isl_schedule_node_get_universe_domain( + __isl_keep isl_schedule_node *node) +{ + int n; + struct isl_schedule_node_get_filter_prefix_data data; + + if (!node) + return NULL; + + if (node->tree == node->schedule->root) { + isl_space *space; + + space = isl_schedule_get_space(node->schedule); + return isl_union_set_empty(space); + } + + data.initialized = 0; + data.universe_domain = 1; + data.universe_filter = 1; + data.collect_prefix = 0; + data.filter = NULL; + data.prefix = NULL; + + n = isl_schedule_tree_list_n_schedule_tree(node->ancestors); + if (collect_filter_prefix(node->ancestors, n, &data) < 0) + data.filter = isl_union_set_free(data.filter); + + return data.filter; +} + +/* Return the subtree schedule of "node". + * + * Since isl_schedule_tree_get_subtree_schedule_union_map does not handle + * trees that do not contain any schedule information, we first + * move down to the first relevant descendant and handle leaves ourselves. + * + * If the subtree rooted at "node" contains any expansion nodes, then + * the returned subtree schedule is formulated in terms of the expanded + * domains. + * The subtree is not allowed to contain any extension nodes. + */ +__isl_give isl_union_map *isl_schedule_node_get_subtree_schedule_union_map( + __isl_keep isl_schedule_node *node) +{ + isl_schedule_tree *tree, *leaf; + isl_union_map *umap; + + tree = isl_schedule_node_get_tree(node); + leaf = isl_schedule_node_peek_leaf(node); + tree = isl_schedule_tree_first_schedule_descendant(tree, leaf); + if (!tree) + return NULL; + if (tree == leaf) { + isl_union_set *domain; + domain = isl_schedule_node_get_universe_domain(node); + isl_schedule_tree_free(tree); + return isl_union_map_from_domain(domain); + } + + umap = isl_schedule_tree_get_subtree_schedule_union_map(tree); + isl_schedule_tree_free(tree); + return umap; +} + +/* Return the number of ancestors of "node" in its schedule tree. + */ +int isl_schedule_node_get_tree_depth(__isl_keep isl_schedule_node *node) +{ + if (!node) + return -1; + return isl_schedule_tree_list_n_schedule_tree(node->ancestors); +} + +/* Does "node" have a parent? + * + * That is, does it point to any node of the schedule other than the root? + */ +isl_bool isl_schedule_node_has_parent(__isl_keep isl_schedule_node *node) +{ + if (!node) + return isl_bool_error; + if (!node->ancestors) + return isl_bool_error; + + return isl_schedule_tree_list_n_schedule_tree(node->ancestors) != 0; +} + +/* Return the position of "node" among the children of its parent. + */ +int isl_schedule_node_get_child_position(__isl_keep isl_schedule_node *node) +{ + int n; + int has_parent; + + if (!node) + return -1; + has_parent = isl_schedule_node_has_parent(node); + if (has_parent < 0) + return -1; + if (!has_parent) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "node has no parent", return -1); + + n = isl_schedule_tree_list_n_schedule_tree(node->ancestors); + return node->child_pos[n - 1]; +} + +/* Does the parent (if any) of "node" have any children with a smaller child + * position than this one? + */ +isl_bool isl_schedule_node_has_previous_sibling( + __isl_keep isl_schedule_node *node) +{ + int n; + isl_bool has_parent; + + if (!node) + return isl_bool_error; + has_parent = isl_schedule_node_has_parent(node); + if (has_parent < 0 || !has_parent) + return has_parent; + + n = isl_schedule_tree_list_n_schedule_tree(node->ancestors); + + return node->child_pos[n - 1] > 0; +} + +/* Does the parent (if any) of "node" have any children with a greater child + * position than this one? + */ +isl_bool isl_schedule_node_has_next_sibling(__isl_keep isl_schedule_node *node) +{ + int n, n_child; + isl_bool has_parent; + isl_schedule_tree *tree; + + if (!node) + return isl_bool_error; + has_parent = isl_schedule_node_has_parent(node); + if (has_parent < 0 || !has_parent) + return has_parent; + + n = isl_schedule_tree_list_n_schedule_tree(node->ancestors); + tree = isl_schedule_tree_list_get_schedule_tree(node->ancestors, n - 1); + if (!tree) + return isl_bool_error; + n_child = isl_schedule_tree_list_n_schedule_tree(tree->children); + isl_schedule_tree_free(tree); + + return node->child_pos[n - 1] + 1 < n_child; +} + +/* Does "node" have any children? + * + * Any node other than the leaf nodes is considered to have at least + * one child, even if the corresponding isl_schedule_tree does not + * have any children. + */ +isl_bool isl_schedule_node_has_children(__isl_keep isl_schedule_node *node) +{ + if (!node) + return isl_bool_error; + return !isl_schedule_tree_is_leaf(node->tree); +} + +/* Return the number of children of "node"? + * + * Any node other than the leaf nodes is considered to have at least + * one child, even if the corresponding isl_schedule_tree does not + * have any children. That is, the number of children of "node" is + * only zero if its tree is the explicit empty tree. Otherwise, + * if the isl_schedule_tree has any children, then it is equal + * to the number of children of "node". If it has zero children, + * then "node" still has a leaf node as child. + */ +int isl_schedule_node_n_children(__isl_keep isl_schedule_node *node) +{ + int n; + + if (!node) + return -1; + + if (isl_schedule_tree_is_leaf(node->tree)) + return 0; + + n = isl_schedule_tree_n_children(node->tree); + if (n == 0) + return 1; + + return n; +} + +/* Move the "node" pointer to the ancestor of the given generation + * of the node it currently points to, where generation 0 is the node + * itself and generation 1 is its parent. + */ +__isl_give isl_schedule_node *isl_schedule_node_ancestor( + __isl_take isl_schedule_node *node, int generation) +{ + int n; + isl_schedule_tree *tree; + + if (!node) + return NULL; + if (generation == 0) + return node; + n = isl_schedule_node_get_tree_depth(node); + if (n < 0) + return isl_schedule_node_free(node); + if (generation < 0 || generation > n) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "generation out of bounds", + return isl_schedule_node_free(node)); + node = isl_schedule_node_cow(node); + if (!node) + return NULL; + + tree = isl_schedule_tree_list_get_schedule_tree(node->ancestors, + n - generation); + isl_schedule_tree_free(node->tree); + node->tree = tree; + node->ancestors = isl_schedule_tree_list_drop(node->ancestors, + n - generation, generation); + if (!node->ancestors || !node->tree) + return isl_schedule_node_free(node); + + return node; +} + +/* Move the "node" pointer to the parent of the node it currently points to. + */ +__isl_give isl_schedule_node *isl_schedule_node_parent( + __isl_take isl_schedule_node *node) +{ + if (!node) + return NULL; + if (!isl_schedule_node_has_parent(node)) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "node has no parent", + return isl_schedule_node_free(node)); + return isl_schedule_node_ancestor(node, 1); +} + +/* Move the "node" pointer to the root of its schedule tree. + */ +__isl_give isl_schedule_node *isl_schedule_node_root( + __isl_take isl_schedule_node *node) +{ + int n; + + if (!node) + return NULL; + n = isl_schedule_node_get_tree_depth(node); + if (n < 0) + return isl_schedule_node_free(node); + return isl_schedule_node_ancestor(node, n); +} + +/* Move the "node" pointer to the child at position "pos" of the node + * it currently points to. + */ +__isl_give isl_schedule_node *isl_schedule_node_child( + __isl_take isl_schedule_node *node, int pos) +{ + int n; + isl_ctx *ctx; + isl_schedule_tree *tree; + int *child_pos; + + node = isl_schedule_node_cow(node); + if (!node) + return NULL; + if (!isl_schedule_node_has_children(node)) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "node has no children", + return isl_schedule_node_free(node)); + + ctx = isl_schedule_node_get_ctx(node); + n = isl_schedule_tree_list_n_schedule_tree(node->ancestors); + child_pos = isl_realloc_array(ctx, node->child_pos, int, n + 1); + if (!child_pos) + return isl_schedule_node_free(node); + node->child_pos = child_pos; + node->child_pos[n] = pos; + + node->ancestors = isl_schedule_tree_list_add(node->ancestors, + isl_schedule_tree_copy(node->tree)); + tree = node->tree; + if (isl_schedule_tree_has_children(tree)) + tree = isl_schedule_tree_get_child(tree, pos); + else + tree = isl_schedule_node_get_leaf(node); + isl_schedule_tree_free(node->tree); + node->tree = tree; + + if (!node->tree || !node->ancestors) + return isl_schedule_node_free(node); + + return node; +} + +/* Move the "node" pointer to the first child of the node + * it currently points to. + */ +__isl_give isl_schedule_node *isl_schedule_node_first_child( + __isl_take isl_schedule_node *node) +{ + return isl_schedule_node_child(node, 0); +} + +/* Move the "node" pointer to the child of this node's parent in + * the previous child position. + */ +__isl_give isl_schedule_node *isl_schedule_node_previous_sibling( + __isl_take isl_schedule_node *node) +{ + int n; + isl_schedule_tree *parent, *tree; + + node = isl_schedule_node_cow(node); + if (!node) + return NULL; + if (!isl_schedule_node_has_previous_sibling(node)) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "node has no previous sibling", + return isl_schedule_node_free(node)); + + n = isl_schedule_tree_list_n_schedule_tree(node->ancestors); + parent = isl_schedule_tree_list_get_schedule_tree(node->ancestors, + n - 1); + if (!parent) + return isl_schedule_node_free(node); + node->child_pos[n - 1]--; + tree = isl_schedule_tree_list_get_schedule_tree(parent->children, + node->child_pos[n - 1]); + isl_schedule_tree_free(parent); + if (!tree) + return isl_schedule_node_free(node); + isl_schedule_tree_free(node->tree); + node->tree = tree; + + return node; +} + +/* Move the "node" pointer to the child of this node's parent in + * the next child position. + */ +__isl_give isl_schedule_node *isl_schedule_node_next_sibling( + __isl_take isl_schedule_node *node) +{ + int n; + isl_schedule_tree *parent, *tree; + + node = isl_schedule_node_cow(node); + if (!node) + return NULL; + if (!isl_schedule_node_has_next_sibling(node)) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "node has no next sibling", + return isl_schedule_node_free(node)); + + n = isl_schedule_tree_list_n_schedule_tree(node->ancestors); + parent = isl_schedule_tree_list_get_schedule_tree(node->ancestors, + n - 1); + if (!parent) + return isl_schedule_node_free(node); + node->child_pos[n - 1]++; + tree = isl_schedule_tree_list_get_schedule_tree(parent->children, + node->child_pos[n - 1]); + isl_schedule_tree_free(parent); + if (!tree) + return isl_schedule_node_free(node); + isl_schedule_tree_free(node->tree); + node->tree = tree; + + return node; +} + +/* Return a copy to the child at position "pos" of "node". + */ +__isl_give isl_schedule_node *isl_schedule_node_get_child( + __isl_keep isl_schedule_node *node, int pos) +{ + return isl_schedule_node_child(isl_schedule_node_copy(node), pos); +} + +/* Traverse the descendant of "node" in depth-first order, including + * "node" itself. Call "enter" whenever a node is entered and "leave" + * whenever a node is left. The callback "enter" is responsible + * for moving to the deepest initial subtree of its argument that + * should be traversed. + */ +static __isl_give isl_schedule_node *traverse( + __isl_take isl_schedule_node *node, + __isl_give isl_schedule_node *(*enter)( + __isl_take isl_schedule_node *node, void *user), + __isl_give isl_schedule_node *(*leave)( + __isl_take isl_schedule_node *node, void *user), + void *user) +{ + int depth; + + if (!node) + return NULL; + + depth = isl_schedule_node_get_tree_depth(node); + do { + node = enter(node, user); + node = leave(node, user); + while (node && isl_schedule_node_get_tree_depth(node) > depth && + !isl_schedule_node_has_next_sibling(node)) { + node = isl_schedule_node_parent(node); + node = leave(node, user); + } + if (node && isl_schedule_node_get_tree_depth(node) > depth) + node = isl_schedule_node_next_sibling(node); + } while (node && isl_schedule_node_get_tree_depth(node) > depth); + + return node; +} + +/* Internal data structure for isl_schedule_node_foreach_descendant_top_down. + * + * "fn" is the user-specified callback function. + * "user" is the user-specified argument for the callback. + */ +struct isl_schedule_node_preorder_data { + isl_bool (*fn)(__isl_keep isl_schedule_node *node, void *user); + void *user; +}; + +/* Callback for "traverse" to enter a node and to move + * to the deepest initial subtree that should be traversed + * for use in a preorder visit. + * + * If the user callback returns a negative value, then we abort + * the traversal. If this callback returns zero, then we skip + * the subtree rooted at the current node. Otherwise, we move + * down to the first child and repeat the process until a leaf + * is reached. + */ +static __isl_give isl_schedule_node *preorder_enter( + __isl_take isl_schedule_node *node, void *user) +{ + struct isl_schedule_node_preorder_data *data = user; + + if (!node) + return NULL; + + do { + isl_bool r; + + r = data->fn(node, data->user); + if (r < 0) + return isl_schedule_node_free(node); + if (r == isl_bool_false) + return node; + } while (isl_schedule_node_has_children(node) && + (node = isl_schedule_node_first_child(node)) != NULL); + + return node; +} + +/* Callback for "traverse" to leave a node + * for use in a preorder visit. + * Since we already visited the node when we entered it, + * we do not need to do anything here. + */ +static __isl_give isl_schedule_node *preorder_leave( + __isl_take isl_schedule_node *node, void *user) +{ + return node; +} + +/* Traverse the descendants of "node" (including the node itself) + * in depth first preorder. + * + * If "fn" returns -1 on any of the nodes, then the traversal is aborted. + * If "fn" returns 0 on any of the nodes, then the subtree rooted + * at that node is skipped. + * + * Return 0 on success and -1 on failure. + */ +isl_stat isl_schedule_node_foreach_descendant_top_down( + __isl_keep isl_schedule_node *node, + isl_bool (*fn)(__isl_keep isl_schedule_node *node, void *user), + void *user) +{ + struct isl_schedule_node_preorder_data data = { fn, user }; + + node = isl_schedule_node_copy(node); + node = traverse(node, &preorder_enter, &preorder_leave, &data); + isl_schedule_node_free(node); + + return node ? isl_stat_ok : isl_stat_error; +} + +/* Internal data structure for isl_schedule_node_map_descendant_bottom_up. + * + * "fn" is the user-specified callback function. + * "user" is the user-specified argument for the callback. + */ +struct isl_schedule_node_postorder_data { + __isl_give isl_schedule_node *(*fn)(__isl_take isl_schedule_node *node, + void *user); + void *user; +}; + +/* Callback for "traverse" to enter a node and to move + * to the deepest initial subtree that should be traversed + * for use in a postorder visit. + * + * Since we are performing a postorder visit, we only need + * to move to the deepest initial leaf here. + */ +static __isl_give isl_schedule_node *postorder_enter( + __isl_take isl_schedule_node *node, void *user) +{ + while (node && isl_schedule_node_has_children(node)) + node = isl_schedule_node_first_child(node); + + return node; +} + +/* Callback for "traverse" to leave a node + * for use in a postorder visit. + * + * Since we are performing a postorder visit, we need + * to call the user callback here. + */ +static __isl_give isl_schedule_node *postorder_leave( + __isl_take isl_schedule_node *node, void *user) +{ + struct isl_schedule_node_postorder_data *data = user; + + return data->fn(node, data->user); +} + +/* Traverse the descendants of "node" (including the node itself) + * in depth first postorder, allowing the user to modify the visited node. + * The traversal continues from the node returned by the callback function. + * It is the responsibility of the user to ensure that this does not + * lead to an infinite loop. It is safest to always return a pointer + * to the same position (same ancestors and child positions) as the input node. + */ +__isl_give isl_schedule_node *isl_schedule_node_map_descendant_bottom_up( + __isl_take isl_schedule_node *node, + __isl_give isl_schedule_node *(*fn)(__isl_take isl_schedule_node *node, + void *user), void *user) +{ + struct isl_schedule_node_postorder_data data = { fn, user }; + + return traverse(node, &postorder_enter, &postorder_leave, &data); +} + +/* Traverse the ancestors of "node" from the root down to and including + * the parent of "node", calling "fn" on each of them. + * + * If "fn" returns -1 on any of the nodes, then the traversal is aborted. + * + * Return 0 on success and -1 on failure. + */ +isl_stat isl_schedule_node_foreach_ancestor_top_down( + __isl_keep isl_schedule_node *node, + isl_stat (*fn)(__isl_keep isl_schedule_node *node, void *user), + void *user) +{ + int i, n; + + if (!node) + return isl_stat_error; + + n = isl_schedule_node_get_tree_depth(node); + for (i = 0; i < n; ++i) { + isl_schedule_node *ancestor; + isl_stat r; + + ancestor = isl_schedule_node_copy(node); + ancestor = isl_schedule_node_ancestor(ancestor, n - i); + r = fn(ancestor, user); + isl_schedule_node_free(ancestor); + if (r < 0) + return isl_stat_error; + } + + return isl_stat_ok; +} + +/* Is any node in the subtree rooted at "node" anchored? + * That is, do any of these nodes reference the outer band nodes? + */ +isl_bool isl_schedule_node_is_subtree_anchored( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return isl_bool_error; + return isl_schedule_tree_is_subtree_anchored(node->tree); +} + +/* Return the number of members in the given band node. + */ +unsigned isl_schedule_node_band_n_member(__isl_keep isl_schedule_node *node) +{ + return node ? isl_schedule_tree_band_n_member(node->tree) : 0; +} + +/* Is the band member at position "pos" of the band node "node" + * marked coincident? + */ +isl_bool isl_schedule_node_band_member_get_coincident( + __isl_keep isl_schedule_node *node, int pos) +{ + if (!node) + return isl_bool_error; + return isl_schedule_tree_band_member_get_coincident(node->tree, pos); +} + +/* Mark the band member at position "pos" the band node "node" + * as being coincident or not according to "coincident". + */ +__isl_give isl_schedule_node *isl_schedule_node_band_member_set_coincident( + __isl_take isl_schedule_node *node, int pos, int coincident) +{ + int c; + isl_schedule_tree *tree; + + if (!node) + return NULL; + c = isl_schedule_node_band_member_get_coincident(node, pos); + if (c == coincident) + return node; + + tree = isl_schedule_tree_copy(node->tree); + tree = isl_schedule_tree_band_member_set_coincident(tree, pos, + coincident); + node = isl_schedule_node_graft_tree(node, tree); + + return node; +} + +/* Is the band node "node" marked permutable? + */ +isl_bool isl_schedule_node_band_get_permutable( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return isl_bool_error; + + return isl_schedule_tree_band_get_permutable(node->tree); +} + +/* Mark the band node "node" permutable or not according to "permutable"? + */ +__isl_give isl_schedule_node *isl_schedule_node_band_set_permutable( + __isl_take isl_schedule_node *node, int permutable) +{ + isl_schedule_tree *tree; + + if (!node) + return NULL; + if (isl_schedule_node_band_get_permutable(node) == permutable) + return node; + + tree = isl_schedule_tree_copy(node->tree); + tree = isl_schedule_tree_band_set_permutable(tree, permutable); + node = isl_schedule_node_graft_tree(node, tree); + + return node; +} + +/* Return the schedule space of the band node. + */ +__isl_give isl_space *isl_schedule_node_band_get_space( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + + return isl_schedule_tree_band_get_space(node->tree); +} + +/* Return the schedule of the band node in isolation. + */ +__isl_give isl_multi_union_pw_aff *isl_schedule_node_band_get_partial_schedule( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + + return isl_schedule_tree_band_get_partial_schedule(node->tree); +} + +/* Return the schedule of the band node in isolation in the form of + * an isl_union_map. + * + * If the band does not have any members, then we construct a universe map + * with the universe of the domain elements reaching the node as domain. + * Otherwise, we extract an isl_multi_union_pw_aff representation and + * convert that to an isl_union_map. + */ +__isl_give isl_union_map *isl_schedule_node_band_get_partial_schedule_union_map( + __isl_keep isl_schedule_node *node) +{ + isl_multi_union_pw_aff *mupa; + + if (!node) + return NULL; + + if (isl_schedule_node_get_type(node) != isl_schedule_node_band) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "not a band node", return NULL); + if (isl_schedule_node_band_n_member(node) == 0) { + isl_union_set *domain; + + domain = isl_schedule_node_get_universe_domain(node); + return isl_union_map_from_domain(domain); + } + + mupa = isl_schedule_node_band_get_partial_schedule(node); + return isl_union_map_from_multi_union_pw_aff(mupa); +} + +/* Return the loop AST generation type for the band member of band node "node" + * at position "pos". + */ +enum isl_ast_loop_type isl_schedule_node_band_member_get_ast_loop_type( + __isl_keep isl_schedule_node *node, int pos) +{ + if (!node) + return isl_ast_loop_error; + + return isl_schedule_tree_band_member_get_ast_loop_type(node->tree, pos); +} + +/* Set the loop AST generation type for the band member of band node "node" + * at position "pos" to "type". + */ +__isl_give isl_schedule_node *isl_schedule_node_band_member_set_ast_loop_type( + __isl_take isl_schedule_node *node, int pos, + enum isl_ast_loop_type type) +{ + isl_schedule_tree *tree; + + if (!node) + return NULL; + + tree = isl_schedule_tree_copy(node->tree); + tree = isl_schedule_tree_band_member_set_ast_loop_type(tree, pos, type); + return isl_schedule_node_graft_tree(node, tree); +} + +/* Return the loop AST generation type for the band member of band node "node" + * at position "pos" for the isolated part. + */ +enum isl_ast_loop_type isl_schedule_node_band_member_get_isolate_ast_loop_type( + __isl_keep isl_schedule_node *node, int pos) +{ + if (!node) + return isl_ast_loop_error; + + return isl_schedule_tree_band_member_get_isolate_ast_loop_type( + node->tree, pos); +} + +/* Set the loop AST generation type for the band member of band node "node" + * at position "pos" for the isolated part to "type". + */ +__isl_give isl_schedule_node * +isl_schedule_node_band_member_set_isolate_ast_loop_type( + __isl_take isl_schedule_node *node, int pos, + enum isl_ast_loop_type type) +{ + isl_schedule_tree *tree; + + if (!node) + return NULL; + + tree = isl_schedule_tree_copy(node->tree); + tree = isl_schedule_tree_band_member_set_isolate_ast_loop_type(tree, + pos, type); + return isl_schedule_node_graft_tree(node, tree); +} + +/* Return the AST build options associated to band node "node". + */ +__isl_give isl_union_set *isl_schedule_node_band_get_ast_build_options( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + + return isl_schedule_tree_band_get_ast_build_options(node->tree); +} + +/* Replace the AST build options associated to band node "node" by "options". + */ +__isl_give isl_schedule_node *isl_schedule_node_band_set_ast_build_options( + __isl_take isl_schedule_node *node, __isl_take isl_union_set *options) +{ + isl_schedule_tree *tree; + + if (!node || !options) + goto error; + + tree = isl_schedule_tree_copy(node->tree); + tree = isl_schedule_tree_band_set_ast_build_options(tree, options); + return isl_schedule_node_graft_tree(node, tree); +error: + isl_schedule_node_free(node); + isl_union_set_free(options); + return NULL; +} + +/* Make sure that that spaces of "node" and "mv" are the same. + * Return -1 on error, reporting the error to the user. + */ +static int check_space_multi_val(__isl_keep isl_schedule_node *node, + __isl_keep isl_multi_val *mv) +{ + isl_space *node_space, *mv_space; + int equal; + + node_space = isl_schedule_node_band_get_space(node); + mv_space = isl_multi_val_get_space(mv); + equal = isl_space_tuple_is_equal(node_space, isl_dim_set, + mv_space, isl_dim_set); + isl_space_free(mv_space); + isl_space_free(node_space); + if (equal < 0) + return -1; + if (!equal) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "spaces don't match", return -1); + + return 0; +} + +/* Multiply the partial schedule of the band node "node" + * with the factors in "mv". + */ +__isl_give isl_schedule_node *isl_schedule_node_band_scale( + __isl_take isl_schedule_node *node, __isl_take isl_multi_val *mv) +{ + isl_schedule_tree *tree; + int anchored; + + if (!node || !mv) + goto error; + if (check_space_multi_val(node, mv) < 0) + goto error; + anchored = isl_schedule_node_is_subtree_anchored(node); + if (anchored < 0) + goto error; + if (anchored) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot scale band node with anchored subtree", + goto error); + + tree = isl_schedule_node_get_tree(node); + tree = isl_schedule_tree_band_scale(tree, mv); + return isl_schedule_node_graft_tree(node, tree); +error: + isl_multi_val_free(mv); + isl_schedule_node_free(node); + return NULL; +} + +/* Divide the partial schedule of the band node "node" + * by the factors in "mv". + */ +__isl_give isl_schedule_node *isl_schedule_node_band_scale_down( + __isl_take isl_schedule_node *node, __isl_take isl_multi_val *mv) +{ + isl_schedule_tree *tree; + int anchored; + + if (!node || !mv) + goto error; + if (check_space_multi_val(node, mv) < 0) + goto error; + anchored = isl_schedule_node_is_subtree_anchored(node); + if (anchored < 0) + goto error; + if (anchored) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot scale down band node with anchored subtree", + goto error); + + tree = isl_schedule_node_get_tree(node); + tree = isl_schedule_tree_band_scale_down(tree, mv); + return isl_schedule_node_graft_tree(node, tree); +error: + isl_multi_val_free(mv); + isl_schedule_node_free(node); + return NULL; +} + +/* Tile "node" with tile sizes "sizes". + * + * The current node is replaced by two nested nodes corresponding + * to the tile dimensions and the point dimensions. + * + * Return a pointer to the outer (tile) node. + * + * If any of the descendants of "node" depend on the set of outer band nodes, + * then we refuse to tile the node. + * + * If the scale tile loops option is set, then the tile loops + * are scaled by the tile sizes. If the shift point loops option is set, + * then the point loops are shifted to start at zero. + * In particular, these options affect the tile and point loop schedules + * as follows + * + * scale shift original tile point + * + * 0 0 i floor(i/s) i + * 1 0 i s * floor(i/s) i + * 0 1 i floor(i/s) i - s * floor(i/s) + * 1 1 i s * floor(i/s) i - s * floor(i/s) + */ +__isl_give isl_schedule_node *isl_schedule_node_band_tile( + __isl_take isl_schedule_node *node, __isl_take isl_multi_val *sizes) +{ + isl_schedule_tree *tree; + int anchored; + + if (!node || !sizes) + goto error; + anchored = isl_schedule_node_is_subtree_anchored(node); + if (anchored < 0) + goto error; + if (anchored) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot tile band node with anchored subtree", + goto error); + + if (check_space_multi_val(node, sizes) < 0) + goto error; + + tree = isl_schedule_node_get_tree(node); + tree = isl_schedule_tree_band_tile(tree, sizes); + return isl_schedule_node_graft_tree(node, tree); +error: + isl_multi_val_free(sizes); + isl_schedule_node_free(node); + return NULL; +} + +/* Move the band node "node" down to all the leaves in the subtree + * rooted at "node". + * Return a pointer to the node in the resulting tree that is in the same + * position as the node pointed to by "node" in the original tree. + * + * If the node only has a leaf child, then nothing needs to be done. + * Otherwise, the child of the node is removed and the result is + * appended to all the leaves in the subtree rooted at the original child. + * The original node is then replaced by the result of this operation. + * + * If any of the nodes in the subtree rooted at "node" depend on + * the set of outer band nodes then we refuse to sink the band node. + */ +__isl_give isl_schedule_node *isl_schedule_node_band_sink( + __isl_take isl_schedule_node *node) +{ + enum isl_schedule_node_type type; + isl_schedule_tree *tree, *child; + int anchored; + + if (!node) + return NULL; + + type = isl_schedule_node_get_type(node); + if (type != isl_schedule_node_band) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "not a band node", isl_schedule_node_free(node)); + anchored = isl_schedule_node_is_subtree_anchored(node); + if (anchored < 0) + return isl_schedule_node_free(node); + if (anchored) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot sink band node in anchored subtree", + isl_schedule_node_free(node)); + if (isl_schedule_tree_n_children(node->tree) == 0) + return node; + + tree = isl_schedule_node_get_tree(node); + child = isl_schedule_tree_get_child(tree, 0); + tree = isl_schedule_tree_reset_children(tree); + tree = isl_schedule_tree_append_to_leaves(child, tree); + + return isl_schedule_node_graft_tree(node, tree); +} + +/* Split "node" into two nested band nodes, one with the first "pos" + * dimensions and one with the remaining dimensions. + * The schedules of the two band nodes live in anonymous spaces. + */ +__isl_give isl_schedule_node *isl_schedule_node_band_split( + __isl_take isl_schedule_node *node, int pos) +{ + isl_schedule_tree *tree; + + tree = isl_schedule_node_get_tree(node); + tree = isl_schedule_tree_band_split(tree, pos); + return isl_schedule_node_graft_tree(node, tree); +} + +/* Return the context of the context node "node". + */ +__isl_give isl_set *isl_schedule_node_context_get_context( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + + return isl_schedule_tree_context_get_context(node->tree); +} + +/* Return the domain of the domain node "node". + */ +__isl_give isl_union_set *isl_schedule_node_domain_get_domain( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + + return isl_schedule_tree_domain_get_domain(node->tree); +} + +/* Return the expansion map of expansion node "node". + */ +__isl_give isl_union_map *isl_schedule_node_expansion_get_expansion( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + + return isl_schedule_tree_expansion_get_expansion(node->tree); +} + +/* Return the contraction of expansion node "node". + */ +__isl_give isl_union_pw_multi_aff *isl_schedule_node_expansion_get_contraction( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + + return isl_schedule_tree_expansion_get_contraction(node->tree); +} + +/* Replace the contraction and the expansion of the expansion node "node" + * by "contraction" and "expansion". + */ +__isl_give isl_schedule_node * +isl_schedule_node_expansion_set_contraction_and_expansion( + __isl_take isl_schedule_node *node, + __isl_take isl_union_pw_multi_aff *contraction, + __isl_take isl_union_map *expansion) +{ + isl_schedule_tree *tree; + + if (!node || !contraction || !expansion) + goto error; + + tree = isl_schedule_tree_copy(node->tree); + tree = isl_schedule_tree_expansion_set_contraction_and_expansion(tree, + contraction, expansion); + return isl_schedule_node_graft_tree(node, tree); +error: + isl_schedule_node_free(node); + isl_union_pw_multi_aff_free(contraction); + isl_union_map_free(expansion); + return NULL; +} + +/* Return the extension of the extension node "node". + */ +__isl_give isl_union_map *isl_schedule_node_extension_get_extension( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + + return isl_schedule_tree_extension_get_extension(node->tree); +} + +/* Replace the extension of extension node "node" by "extension". + */ +__isl_give isl_schedule_node *isl_schedule_node_extension_set_extension( + __isl_take isl_schedule_node *node, __isl_take isl_union_map *extension) +{ + isl_schedule_tree *tree; + + if (!node || !extension) + goto error; + + tree = isl_schedule_tree_copy(node->tree); + tree = isl_schedule_tree_extension_set_extension(tree, extension); + return isl_schedule_node_graft_tree(node, tree); +error: + isl_schedule_node_free(node); + isl_union_map_free(extension); + return NULL; +} + +/* Return the filter of the filter node "node". + */ +__isl_give isl_union_set *isl_schedule_node_filter_get_filter( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + + return isl_schedule_tree_filter_get_filter(node->tree); +} + +/* Replace the filter of filter node "node" by "filter". + */ +__isl_give isl_schedule_node *isl_schedule_node_filter_set_filter( + __isl_take isl_schedule_node *node, __isl_take isl_union_set *filter) +{ + isl_schedule_tree *tree; + + if (!node || !filter) + goto error; + + tree = isl_schedule_tree_copy(node->tree); + tree = isl_schedule_tree_filter_set_filter(tree, filter); + return isl_schedule_node_graft_tree(node, tree); +error: + isl_schedule_node_free(node); + isl_union_set_free(filter); + return NULL; +} + +/* Return the guard of the guard node "node". + */ +__isl_give isl_set *isl_schedule_node_guard_get_guard( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + + return isl_schedule_tree_guard_get_guard(node->tree); +} + +/* Return the mark identifier of the mark node "node". + */ +__isl_give isl_id *isl_schedule_node_mark_get_id( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + + return isl_schedule_tree_mark_get_id(node->tree); +} + +/* Replace the child at position "pos" of the sequence node "node" + * by the children of sequence root node of "tree". + */ +__isl_give isl_schedule_node *isl_schedule_node_sequence_splice( + __isl_take isl_schedule_node *node, int pos, + __isl_take isl_schedule_tree *tree) +{ + isl_schedule_tree *node_tree; + + if (!node || !tree) + goto error; + if (isl_schedule_node_get_type(node) != isl_schedule_node_sequence) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "not a sequence node", goto error); + if (isl_schedule_tree_get_type(tree) != isl_schedule_node_sequence) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "not a sequence node", goto error); + node_tree = isl_schedule_node_get_tree(node); + node_tree = isl_schedule_tree_sequence_splice(node_tree, pos, tree); + node = isl_schedule_node_graft_tree(node, node_tree); + + return node; +error: + isl_schedule_node_free(node); + isl_schedule_tree_free(tree); + return NULL; +} + +/* Update the ancestors of "node" to point to the tree that "node" + * now points to. + * That is, replace the child in the original parent that corresponds + * to the current tree position by node->tree and continue updating + * the ancestors in the same way until the root is reached. + * + * If "fn" is not NULL, then it is called on each ancestor as we move up + * the tree so that it can modify the ancestor before it is added + * to the list of ancestors of the modified node. + * The additional "pos" argument records the position + * of the "tree" argument in the original schedule tree. + * + * If "node" originally points to a leaf of the schedule tree, then make sure + * that in the end it points to a leaf in the updated schedule tree. + */ +static __isl_give isl_schedule_node *update_ancestors( + __isl_take isl_schedule_node *node, + __isl_give isl_schedule_tree *(*fn)(__isl_take isl_schedule_tree *tree, + __isl_keep isl_schedule_node *pos, void *user), void *user) +{ + int i, n; + int is_leaf; + isl_ctx *ctx; + isl_schedule_tree *tree; + isl_schedule_node *pos = NULL; + + if (fn) + pos = isl_schedule_node_copy(node); + + node = isl_schedule_node_cow(node); + if (!node) + return isl_schedule_node_free(pos); + + ctx = isl_schedule_node_get_ctx(node); + n = isl_schedule_tree_list_n_schedule_tree(node->ancestors); + tree = isl_schedule_tree_copy(node->tree); + + for (i = n - 1; i >= 0; --i) { + isl_schedule_tree *parent; + + parent = isl_schedule_tree_list_get_schedule_tree( + node->ancestors, i); + parent = isl_schedule_tree_replace_child(parent, + node->child_pos[i], tree); + if (fn) { + pos = isl_schedule_node_parent(pos); + parent = fn(parent, pos, user); + } + node->ancestors = isl_schedule_tree_list_set_schedule_tree( + node->ancestors, i, isl_schedule_tree_copy(parent)); + + tree = parent; + } + + if (fn) + isl_schedule_node_free(pos); + + is_leaf = isl_schedule_tree_is_leaf(node->tree); + node->schedule = isl_schedule_set_root(node->schedule, tree); + if (is_leaf) { + isl_schedule_tree_free(node->tree); + node->tree = isl_schedule_node_get_leaf(node); + } + + if (!node->schedule || !node->ancestors) + return isl_schedule_node_free(node); + + return node; +} + +/* Replace the subtree that "pos" points to by "tree", updating + * the ancestors to maintain a consistent state. + */ +__isl_give isl_schedule_node *isl_schedule_node_graft_tree( + __isl_take isl_schedule_node *pos, __isl_take isl_schedule_tree *tree) +{ + if (!tree || !pos) + goto error; + if (pos->tree == tree) { + isl_schedule_tree_free(tree); + return pos; + } + + pos = isl_schedule_node_cow(pos); + if (!pos) + goto error; + + isl_schedule_tree_free(pos->tree); + pos->tree = tree; + + return update_ancestors(pos, NULL, NULL); +error: + isl_schedule_node_free(pos); + isl_schedule_tree_free(tree); + return NULL; +} + +/* Make sure we can insert a node between "node" and its parent. + * Return -1 on error, reporting the reason why we cannot insert a node. + */ +static int check_insert(__isl_keep isl_schedule_node *node) +{ + int has_parent; + enum isl_schedule_node_type type; + + has_parent = isl_schedule_node_has_parent(node); + if (has_parent < 0) + return -1; + if (!has_parent) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot insert node outside of root", return -1); + + type = isl_schedule_node_get_parent_type(node); + if (type == isl_schedule_node_error) + return -1; + if (type == isl_schedule_node_set || type == isl_schedule_node_sequence) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot insert node between set or sequence node " + "and its filter children", return -1); + + return 0; +} + +/* Insert a band node with partial schedule "mupa" between "node" and + * its parent. + * Return a pointer to the new band node. + * + * If any of the nodes in the subtree rooted at "node" depend on + * the set of outer band nodes then we refuse to insert the band node. + */ +__isl_give isl_schedule_node *isl_schedule_node_insert_partial_schedule( + __isl_take isl_schedule_node *node, + __isl_take isl_multi_union_pw_aff *mupa) +{ + int anchored; + isl_schedule_band *band; + isl_schedule_tree *tree; + + if (check_insert(node) < 0) + node = isl_schedule_node_free(node); + anchored = isl_schedule_node_is_subtree_anchored(node); + if (anchored < 0) + goto error; + if (anchored) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot insert band node in anchored subtree", + goto error); + + tree = isl_schedule_node_get_tree(node); + band = isl_schedule_band_from_multi_union_pw_aff(mupa); + tree = isl_schedule_tree_insert_band(tree, band); + node = isl_schedule_node_graft_tree(node, tree); + + return node; +error: + isl_schedule_node_free(node); + isl_multi_union_pw_aff_free(mupa); + return NULL; +} + +/* Insert a context node with context "context" between "node" and its parent. + * Return a pointer to the new context node. + */ +__isl_give isl_schedule_node *isl_schedule_node_insert_context( + __isl_take isl_schedule_node *node, __isl_take isl_set *context) +{ + isl_schedule_tree *tree; + + if (check_insert(node) < 0) + node = isl_schedule_node_free(node); + + tree = isl_schedule_node_get_tree(node); + tree = isl_schedule_tree_insert_context(tree, context); + node = isl_schedule_node_graft_tree(node, tree); + + return node; +} + +/* Insert an expansion node with the given "contraction" and "expansion" + * between "node" and its parent. + * Return a pointer to the new expansion node. + * + * Typically the domain and range spaces of the expansion are different. + * This means that only one of them can refer to the current domain space + * in a consistent tree. It is up to the caller to ensure that the tree + * returns to a consistent state. + */ +__isl_give isl_schedule_node *isl_schedule_node_insert_expansion( + __isl_take isl_schedule_node *node, + __isl_take isl_union_pw_multi_aff *contraction, + __isl_take isl_union_map *expansion) +{ + isl_schedule_tree *tree; + + if (check_insert(node) < 0) + node = isl_schedule_node_free(node); + + tree = isl_schedule_node_get_tree(node); + tree = isl_schedule_tree_insert_expansion(tree, contraction, expansion); + node = isl_schedule_node_graft_tree(node, tree); + + return node; +} + +/* Insert an extension node with extension "extension" between "node" and + * its parent. + * Return a pointer to the new extension node. + */ +__isl_give isl_schedule_node *isl_schedule_node_insert_extension( + __isl_take isl_schedule_node *node, + __isl_take isl_union_map *extension) +{ + isl_schedule_tree *tree; + + tree = isl_schedule_node_get_tree(node); + tree = isl_schedule_tree_insert_extension(tree, extension); + node = isl_schedule_node_graft_tree(node, tree); + + return node; +} + +/* Insert a filter node with filter "filter" between "node" and its parent. + * Return a pointer to the new filter node. + */ +__isl_give isl_schedule_node *isl_schedule_node_insert_filter( + __isl_take isl_schedule_node *node, __isl_take isl_union_set *filter) +{ + isl_schedule_tree *tree; + + if (check_insert(node) < 0) + node = isl_schedule_node_free(node); + + tree = isl_schedule_node_get_tree(node); + tree = isl_schedule_tree_insert_filter(tree, filter); + node = isl_schedule_node_graft_tree(node, tree); + + return node; +} + +/* Insert a guard node with guard "guard" between "node" and its parent. + * Return a pointer to the new guard node. + */ +__isl_give isl_schedule_node *isl_schedule_node_insert_guard( + __isl_take isl_schedule_node *node, __isl_take isl_set *guard) +{ + isl_schedule_tree *tree; + + if (check_insert(node) < 0) + node = isl_schedule_node_free(node); + + tree = isl_schedule_node_get_tree(node); + tree = isl_schedule_tree_insert_guard(tree, guard); + node = isl_schedule_node_graft_tree(node, tree); + + return node; +} + +/* Insert a mark node with mark identifier "mark" between "node" and + * its parent. + * Return a pointer to the new mark node. + */ +__isl_give isl_schedule_node *isl_schedule_node_insert_mark( + __isl_take isl_schedule_node *node, __isl_take isl_id *mark) +{ + isl_schedule_tree *tree; + + if (check_insert(node) < 0) + node = isl_schedule_node_free(node); + + tree = isl_schedule_node_get_tree(node); + tree = isl_schedule_tree_insert_mark(tree, mark); + node = isl_schedule_node_graft_tree(node, tree); + + return node; +} + +/* Attach the current subtree of "node" to a sequence of filter tree nodes + * with filters described by "filters", attach this sequence + * of filter tree nodes as children to a new tree of type "type" and + * replace the original subtree of "node" by this new tree. + */ +static __isl_give isl_schedule_node *isl_schedule_node_insert_children( + __isl_take isl_schedule_node *node, + enum isl_schedule_node_type type, + __isl_take isl_union_set_list *filters) +{ + int i, n; + isl_ctx *ctx; + isl_schedule_tree *tree; + isl_schedule_tree_list *list; + + if (check_insert(node) < 0) + node = isl_schedule_node_free(node); + + if (!node || !filters) + goto error; + + ctx = isl_schedule_node_get_ctx(node); + n = isl_union_set_list_n_union_set(filters); + list = isl_schedule_tree_list_alloc(ctx, n); + for (i = 0; i < n; ++i) { + isl_schedule_tree *tree; + isl_union_set *filter; + + tree = isl_schedule_node_get_tree(node); + filter = isl_union_set_list_get_union_set(filters, i); + tree = isl_schedule_tree_insert_filter(tree, filter); + list = isl_schedule_tree_list_add(list, tree); + } + tree = isl_schedule_tree_from_children(type, list); + node = isl_schedule_node_graft_tree(node, tree); + + isl_union_set_list_free(filters); + return node; +error: + isl_union_set_list_free(filters); + isl_schedule_node_free(node); + return NULL; +} + +/* Insert a sequence node with child filters "filters" between "node" and + * its parent. That is, the tree that "node" points to is attached + * to each of the child nodes of the filter nodes. + * Return a pointer to the new sequence node. + */ +__isl_give isl_schedule_node *isl_schedule_node_insert_sequence( + __isl_take isl_schedule_node *node, + __isl_take isl_union_set_list *filters) +{ + return isl_schedule_node_insert_children(node, + isl_schedule_node_sequence, filters); +} + +/* Insert a set node with child filters "filters" between "node" and + * its parent. That is, the tree that "node" points to is attached + * to each of the child nodes of the filter nodes. + * Return a pointer to the new set node. + */ +__isl_give isl_schedule_node *isl_schedule_node_insert_set( + __isl_take isl_schedule_node *node, + __isl_take isl_union_set_list *filters) +{ + return isl_schedule_node_insert_children(node, + isl_schedule_node_set, filters); +} + +/* Remove "node" from its schedule tree and return a pointer + * to the leaf at the same position in the updated schedule tree. + * + * It is not allowed to remove the root of a schedule tree or + * a child of a set or sequence node. + */ +__isl_give isl_schedule_node *isl_schedule_node_cut( + __isl_take isl_schedule_node *node) +{ + isl_schedule_tree *leaf; + enum isl_schedule_node_type parent_type; + + if (!node) + return NULL; + if (!isl_schedule_node_has_parent(node)) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot cut root", return isl_schedule_node_free(node)); + + parent_type = isl_schedule_node_get_parent_type(node); + if (parent_type == isl_schedule_node_set || + parent_type == isl_schedule_node_sequence) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot cut child of set or sequence", + return isl_schedule_node_free(node)); + + leaf = isl_schedule_node_get_leaf(node); + return isl_schedule_node_graft_tree(node, leaf); +} + +/* Remove a single node from the schedule tree, attaching the child + * of "node" directly to its parent. + * Return a pointer to this former child or to the leaf the position + * of the original node if there was no child. + * It is not allowed to remove the root of a schedule tree, + * a set or sequence node, a child of a set or sequence node or + * a band node with an anchored subtree. + */ +__isl_give isl_schedule_node *isl_schedule_node_delete( + __isl_take isl_schedule_node *node) +{ + int n; + isl_schedule_tree *tree; + enum isl_schedule_node_type type; + + if (!node) + return NULL; + + if (isl_schedule_node_get_tree_depth(node) == 0) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot delete root node", + return isl_schedule_node_free(node)); + n = isl_schedule_node_n_children(node); + if (n != 1) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "can only delete node with a single child", + return isl_schedule_node_free(node)); + type = isl_schedule_node_get_parent_type(node); + if (type == isl_schedule_node_sequence || type == isl_schedule_node_set) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot delete child of set or sequence", + return isl_schedule_node_free(node)); + if (isl_schedule_node_get_type(node) == isl_schedule_node_band) { + int anchored; + + anchored = isl_schedule_node_is_subtree_anchored(node); + if (anchored < 0) + return isl_schedule_node_free(node); + if (anchored) + isl_die(isl_schedule_node_get_ctx(node), + isl_error_invalid, + "cannot delete band node with anchored subtree", + return isl_schedule_node_free(node)); + } + + tree = isl_schedule_node_get_tree(node); + if (!tree || isl_schedule_tree_has_children(tree)) { + tree = isl_schedule_tree_child(tree, 0); + } else { + isl_schedule_tree_free(tree); + tree = isl_schedule_node_get_leaf(node); + } + node = isl_schedule_node_graft_tree(node, tree); + + return node; +} + +/* Internal data structure for the group_ancestor callback. + * + * If "finished" is set, then we no longer need to modify + * any further ancestors. + * + * "contraction" and "expansion" represent the expansion + * that reflects the grouping. + * + * "domain" contains the domain elements that reach the position + * where the grouping is performed. That is, it is the range + * of the resulting expansion. + * "domain_universe" is the universe of "domain". + * "group" is the set of group elements, i.e., the domain + * of the resulting expansion. + * "group_universe" is the universe of "group". + * + * "sched" is the schedule for the group elements, in pratice + * an identity mapping on "group_universe". + * "dim" is the dimension of "sched". + */ +struct isl_schedule_group_data { + int finished; + + isl_union_map *expansion; + isl_union_pw_multi_aff *contraction; + + isl_union_set *domain; + isl_union_set *domain_universe; + isl_union_set *group; + isl_union_set *group_universe; + + int dim; + isl_multi_aff *sched; +}; + +/* Is domain covered by data->domain within data->domain_universe? + */ +static int locally_covered_by_domain(__isl_keep isl_union_set *domain, + struct isl_schedule_group_data *data) +{ + int is_subset; + isl_union_set *test; + + test = isl_union_set_copy(domain); + test = isl_union_set_intersect(test, + isl_union_set_copy(data->domain_universe)); + is_subset = isl_union_set_is_subset(test, data->domain); + isl_union_set_free(test); + + return is_subset; +} + +/* Update the band tree root "tree" to refer to the group instances + * in data->group rather than the original domain elements in data->domain. + * "pos" is the position in the original schedule tree where the modified + * "tree" will be attached. + * + * Add the part of the identity schedule on the group instances data->sched + * that corresponds to this band node to the band schedule. + * If the domain elements that reach the node and that are part + * of data->domain_universe are all elements of data->domain (and therefore + * replaced by the group instances) then this data->domain_universe + * is removed from the domain of the band schedule. + */ +static __isl_give isl_schedule_tree *group_band( + __isl_take isl_schedule_tree *tree, __isl_keep isl_schedule_node *pos, + struct isl_schedule_group_data *data) +{ + isl_union_set *domain; + isl_multi_aff *ma; + isl_multi_union_pw_aff *mupa, *partial; + int is_covered; + int depth, n, has_id; + + domain = isl_schedule_node_get_domain(pos); + is_covered = locally_covered_by_domain(domain, data); + if (is_covered >= 0 && is_covered) { + domain = isl_union_set_universe(domain); + domain = isl_union_set_subtract(domain, + isl_union_set_copy(data->domain_universe)); + tree = isl_schedule_tree_band_intersect_domain(tree, domain); + } else + isl_union_set_free(domain); + if (is_covered < 0) + return isl_schedule_tree_free(tree); + depth = isl_schedule_node_get_schedule_depth(pos); + n = isl_schedule_tree_band_n_member(tree); + ma = isl_multi_aff_copy(data->sched); + ma = isl_multi_aff_drop_dims(ma, isl_dim_out, 0, depth); + ma = isl_multi_aff_drop_dims(ma, isl_dim_out, n, data->dim - depth - n); + mupa = isl_multi_union_pw_aff_from_multi_aff(ma); + partial = isl_schedule_tree_band_get_partial_schedule(tree); + has_id = isl_multi_union_pw_aff_has_tuple_id(partial, isl_dim_set); + if (has_id < 0) { + partial = isl_multi_union_pw_aff_free(partial); + } else if (has_id) { + isl_id *id; + id = isl_multi_union_pw_aff_get_tuple_id(partial, isl_dim_set); + mupa = isl_multi_union_pw_aff_set_tuple_id(mupa, + isl_dim_set, id); + } + partial = isl_multi_union_pw_aff_union_add(partial, mupa); + tree = isl_schedule_tree_band_set_partial_schedule(tree, partial); + + return tree; +} + +/* Drop the parameters in "uset" that are not also in "space". + * "n" is the number of parameters in "space". + */ +static __isl_give isl_union_set *union_set_drop_extra_params( + __isl_take isl_union_set *uset, __isl_keep isl_space *space, int n) +{ + int n2; + + uset = isl_union_set_align_params(uset, isl_space_copy(space)); + n2 = isl_union_set_dim(uset, isl_dim_param); + uset = isl_union_set_project_out(uset, isl_dim_param, n, n2 - n); + + return uset; +} + +/* Update the context tree root "tree" to refer to the group instances + * in data->group rather than the original domain elements in data->domain. + * "pos" is the position in the original schedule tree where the modified + * "tree" will be attached. + * + * We do not actually need to update "tree" since a context node only + * refers to the schedule space. However, we may need to update "data" + * to not refer to any parameters introduced by the context node. + */ +static __isl_give isl_schedule_tree *group_context( + __isl_take isl_schedule_tree *tree, __isl_keep isl_schedule_node *pos, + struct isl_schedule_group_data *data) +{ + isl_space *space; + isl_union_set *domain; + int n1, n2; + int involves; + + if (isl_schedule_node_get_tree_depth(pos) == 1) + return tree; + + domain = isl_schedule_node_get_universe_domain(pos); + space = isl_union_set_get_space(domain); + isl_union_set_free(domain); + + n1 = isl_space_dim(space, isl_dim_param); + data->expansion = isl_union_map_align_params(data->expansion, space); + n2 = isl_union_map_dim(data->expansion, isl_dim_param); + + if (!data->expansion) + return isl_schedule_tree_free(tree); + if (n1 == n2) + return tree; + + involves = isl_union_map_involves_dims(data->expansion, + isl_dim_param, n1, n2 - n1); + if (involves < 0) + return isl_schedule_tree_free(tree); + if (involves) + isl_die(isl_schedule_node_get_ctx(pos), isl_error_invalid, + "grouping cannot only refer to global parameters", + return isl_schedule_tree_free(tree)); + + data->expansion = isl_union_map_project_out(data->expansion, + isl_dim_param, n1, n2 - n1); + space = isl_union_map_get_space(data->expansion); + + data->contraction = isl_union_pw_multi_aff_align_params( + data->contraction, isl_space_copy(space)); + n2 = isl_union_pw_multi_aff_dim(data->contraction, isl_dim_param); + data->contraction = isl_union_pw_multi_aff_drop_dims(data->contraction, + isl_dim_param, n1, n2 - n1); + + data->domain = union_set_drop_extra_params(data->domain, space, n1); + data->domain_universe = + union_set_drop_extra_params(data->domain_universe, space, n1); + data->group = union_set_drop_extra_params(data->group, space, n1); + data->group_universe = + union_set_drop_extra_params(data->group_universe, space, n1); + + data->sched = isl_multi_aff_align_params(data->sched, + isl_space_copy(space)); + n2 = isl_multi_aff_dim(data->sched, isl_dim_param); + data->sched = isl_multi_aff_drop_dims(data->sched, + isl_dim_param, n1, n2 - n1); + + isl_space_free(space); + + return tree; +} + +/* Update the domain tree root "tree" to refer to the group instances + * in data->group rather than the original domain elements in data->domain. + * "pos" is the position in the original schedule tree where the modified + * "tree" will be attached. + * + * We first double-check that all grouped domain elements are actually + * part of the root domain and then replace those elements by the group + * instances. + */ +static __isl_give isl_schedule_tree *group_domain( + __isl_take isl_schedule_tree *tree, __isl_keep isl_schedule_node *pos, + struct isl_schedule_group_data *data) +{ + isl_union_set *domain; + int is_subset; + + domain = isl_schedule_tree_domain_get_domain(tree); + is_subset = isl_union_set_is_subset(data->domain, domain); + isl_union_set_free(domain); + if (is_subset < 0) + return isl_schedule_tree_free(tree); + if (!is_subset) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "grouped domain should be part of outer domain", + return isl_schedule_tree_free(tree)); + domain = isl_schedule_tree_domain_get_domain(tree); + domain = isl_union_set_subtract(domain, + isl_union_set_copy(data->domain)); + domain = isl_union_set_union(domain, isl_union_set_copy(data->group)); + tree = isl_schedule_tree_domain_set_domain(tree, domain); + + return tree; +} + +/* Update the expansion tree root "tree" to refer to the group instances + * in data->group rather than the original domain elements in data->domain. + * "pos" is the position in the original schedule tree where the modified + * "tree" will be attached. + * + * Let G_1 -> D_1 be the expansion of "tree" and G_2 -> D_2 the newly + * introduced expansion in a descendant of "tree". + * We first double-check that D_2 is a subset of D_1. + * Then we remove D_2 from the range of G_1 -> D_1 and add the mapping + * G_1 -> D_1 . D_2 -> G_2. + * Simmilarly, we restrict the domain of the contraction to the universe + * of the range of the updated expansion and add G_2 -> D_2 . D_1 -> G_1, + * attempting to remove the domain constraints of this additional part. + */ +static __isl_give isl_schedule_tree *group_expansion( + __isl_take isl_schedule_tree *tree, __isl_keep isl_schedule_node *pos, + struct isl_schedule_group_data *data) +{ + isl_union_set *domain; + isl_union_map *expansion, *umap; + isl_union_pw_multi_aff *contraction, *upma; + int is_subset; + + expansion = isl_schedule_tree_expansion_get_expansion(tree); + domain = isl_union_map_range(expansion); + is_subset = isl_union_set_is_subset(data->domain, domain); + isl_union_set_free(domain); + if (is_subset < 0) + return isl_schedule_tree_free(tree); + if (!is_subset) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "grouped domain should be part " + "of outer expansion domain", + return isl_schedule_tree_free(tree)); + expansion = isl_schedule_tree_expansion_get_expansion(tree); + umap = isl_union_map_from_union_pw_multi_aff( + isl_union_pw_multi_aff_copy(data->contraction)); + umap = isl_union_map_apply_range(expansion, umap); + expansion = isl_schedule_tree_expansion_get_expansion(tree); + expansion = isl_union_map_subtract_range(expansion, + isl_union_set_copy(data->domain)); + expansion = isl_union_map_union(expansion, umap); + umap = isl_union_map_universe(isl_union_map_copy(expansion)); + domain = isl_union_map_range(umap); + contraction = isl_schedule_tree_expansion_get_contraction(tree); + umap = isl_union_map_from_union_pw_multi_aff(contraction); + umap = isl_union_map_apply_range(isl_union_map_copy(data->expansion), + umap); + upma = isl_union_pw_multi_aff_from_union_map(umap); + contraction = isl_schedule_tree_expansion_get_contraction(tree); + contraction = isl_union_pw_multi_aff_intersect_domain(contraction, + domain); + domain = isl_union_pw_multi_aff_domain( + isl_union_pw_multi_aff_copy(upma)); + upma = isl_union_pw_multi_aff_gist(upma, domain); + contraction = isl_union_pw_multi_aff_union_add(contraction, upma); + tree = isl_schedule_tree_expansion_set_contraction_and_expansion(tree, + contraction, expansion); + + return tree; +} + +/* Update the tree root "tree" to refer to the group instances + * in data->group rather than the original domain elements in data->domain. + * "pos" is the position in the original schedule tree where the modified + * "tree" will be attached. + * + * If we have come across a domain or expansion node before (data->finished + * is set), then we no longer need perform any modifications. + * + * If "tree" is a filter, then we add data->group_universe to the filter. + * We also remove data->domain_universe from the filter if all the domain + * elements in this universe that reach the filter node are part of + * the elements that are being grouped by data->expansion. + * If "tree" is a band, domain or expansion, then it is handled + * in a separate function. + */ +static __isl_give isl_schedule_tree *group_ancestor( + __isl_take isl_schedule_tree *tree, __isl_keep isl_schedule_node *pos, + void *user) +{ + struct isl_schedule_group_data *data = user; + isl_union_set *domain; + int is_covered; + + if (!tree || !pos) + return isl_schedule_tree_free(tree); + + if (data->finished) + return tree; + + switch (isl_schedule_tree_get_type(tree)) { + case isl_schedule_node_error: + return isl_schedule_tree_free(tree); + case isl_schedule_node_extension: + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_unsupported, + "grouping not allowed in extended tree", + return isl_schedule_tree_free(tree)); + case isl_schedule_node_band: + tree = group_band(tree, pos, data); + break; + case isl_schedule_node_context: + tree = group_context(tree, pos, data); + break; + case isl_schedule_node_domain: + tree = group_domain(tree, pos, data); + data->finished = 1; + break; + case isl_schedule_node_filter: + domain = isl_schedule_node_get_domain(pos); + is_covered = locally_covered_by_domain(domain, data); + isl_union_set_free(domain); + if (is_covered < 0) + return isl_schedule_tree_free(tree); + domain = isl_schedule_tree_filter_get_filter(tree); + if (is_covered) + domain = isl_union_set_subtract(domain, + isl_union_set_copy(data->domain_universe)); + domain = isl_union_set_union(domain, + isl_union_set_copy(data->group_universe)); + tree = isl_schedule_tree_filter_set_filter(tree, domain); + break; + case isl_schedule_node_expansion: + tree = group_expansion(tree, pos, data); + data->finished = 1; + break; + case isl_schedule_node_leaf: + case isl_schedule_node_guard: + case isl_schedule_node_mark: + case isl_schedule_node_sequence: + case isl_schedule_node_set: + break; + } + + return tree; +} + +/* Group the domain elements that reach "node" into instances + * of a single statement with identifier "group_id". + * In particular, group the domain elements according to their + * prefix schedule. + * + * That is, introduce an expansion node with as contraction + * the prefix schedule (with the target space replaced by "group_id") + * and as expansion the inverse of this contraction (with its range + * intersected with the domain elements that reach "node"). + * The outer nodes are then modified to refer to the group instances + * instead of the original domain elements. + * + * No instance of "group_id" is allowed to reach "node" prior + * to the grouping. + * No ancestor of "node" is allowed to be an extension node. + * + * Return a pointer to original node in tree, i.e., the child + * of the newly introduced expansion node. + */ +__isl_give isl_schedule_node *isl_schedule_node_group( + __isl_take isl_schedule_node *node, __isl_take isl_id *group_id) +{ + struct isl_schedule_group_data data = { 0 }; + isl_space *space; + isl_union_set *domain; + isl_union_pw_multi_aff *contraction; + isl_union_map *expansion; + int disjoint; + + if (!node || !group_id) + goto error; + if (check_insert(node) < 0) + goto error; + + domain = isl_schedule_node_get_domain(node); + data.domain = isl_union_set_copy(domain); + data.domain_universe = isl_union_set_copy(domain); + data.domain_universe = isl_union_set_universe(data.domain_universe); + + data.dim = isl_schedule_node_get_schedule_depth(node); + if (data.dim == 0) { + isl_ctx *ctx; + isl_set *set; + isl_union_set *group; + isl_union_map *univ; + + ctx = isl_schedule_node_get_ctx(node); + space = isl_space_set_alloc(ctx, 0, 0); + space = isl_space_set_tuple_id(space, isl_dim_set, group_id); + set = isl_set_universe(isl_space_copy(space)); + group = isl_union_set_from_set(set); + expansion = isl_union_map_from_domain_and_range(domain, group); + univ = isl_union_map_universe(isl_union_map_copy(expansion)); + contraction = isl_union_pw_multi_aff_from_union_map(univ); + expansion = isl_union_map_reverse(expansion); + } else { + isl_multi_union_pw_aff *prefix; + isl_union_set *univ; + + prefix = + isl_schedule_node_get_prefix_schedule_multi_union_pw_aff(node); + prefix = isl_multi_union_pw_aff_set_tuple_id(prefix, + isl_dim_set, group_id); + space = isl_multi_union_pw_aff_get_space(prefix); + contraction = isl_union_pw_multi_aff_from_multi_union_pw_aff( + prefix); + univ = isl_union_set_universe(isl_union_set_copy(domain)); + contraction = + isl_union_pw_multi_aff_intersect_domain(contraction, univ); + expansion = isl_union_map_from_union_pw_multi_aff( + isl_union_pw_multi_aff_copy(contraction)); + expansion = isl_union_map_reverse(expansion); + expansion = isl_union_map_intersect_range(expansion, domain); + } + space = isl_space_map_from_set(space); + data.sched = isl_multi_aff_identity(space); + data.group = isl_union_map_domain(isl_union_map_copy(expansion)); + data.group = isl_union_set_coalesce(data.group); + data.group_universe = isl_union_set_copy(data.group); + data.group_universe = isl_union_set_universe(data.group_universe); + data.expansion = isl_union_map_copy(expansion); + data.contraction = isl_union_pw_multi_aff_copy(contraction); + node = isl_schedule_node_insert_expansion(node, contraction, expansion); + + disjoint = isl_union_set_is_disjoint(data.domain_universe, + data.group_universe); + + node = update_ancestors(node, &group_ancestor, &data); + + isl_union_set_free(data.domain); + isl_union_set_free(data.domain_universe); + isl_union_set_free(data.group); + isl_union_set_free(data.group_universe); + isl_multi_aff_free(data.sched); + isl_union_map_free(data.expansion); + isl_union_pw_multi_aff_free(data.contraction); + + node = isl_schedule_node_child(node, 0); + + if (!node || disjoint < 0) + return isl_schedule_node_free(node); + if (!disjoint) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "group instances already reach node", + isl_schedule_node_free(node)); + + return node; +error: + isl_schedule_node_free(node); + isl_id_free(group_id); + return NULL; +} + +/* Compute the gist of the given band node with respect to "context". + */ +__isl_give isl_schedule_node *isl_schedule_node_band_gist( + __isl_take isl_schedule_node *node, __isl_take isl_union_set *context) +{ + isl_schedule_tree *tree; + + tree = isl_schedule_node_get_tree(node); + tree = isl_schedule_tree_band_gist(tree, context); + return isl_schedule_node_graft_tree(node, tree); +} + +/* Internal data structure for isl_schedule_node_gist. + * "n_expansion" is the number of outer expansion nodes + * with respect to the current position + * "filters" contains an element for each outer filter, expansion or + * extension node with respect to the current position, each representing + * the intersection of the previous element and the filter on the filter node + * or the expansion/extension of the previous element. + * The first element in the original context passed to isl_schedule_node_gist. + */ +struct isl_node_gist_data { + int n_expansion; + isl_union_set_list *filters; +}; + +/* Enter the expansion node "node" during a isl_schedule_node_gist traversal. + * + * In particular, add an extra element to data->filters containing + * the expansion of the previous element and replace the expansion + * and contraction on "node" by the gist with respect to these filters. + * Also keep track of the fact that we have entered another expansion. + */ +static __isl_give isl_schedule_node *gist_enter_expansion( + __isl_take isl_schedule_node *node, struct isl_node_gist_data *data) +{ + int n; + isl_union_set *inner; + isl_union_map *expansion; + isl_union_pw_multi_aff *contraction; + + data->n_expansion++; + + n = isl_union_set_list_n_union_set(data->filters); + inner = isl_union_set_list_get_union_set(data->filters, n - 1); + expansion = isl_schedule_node_expansion_get_expansion(node); + inner = isl_union_set_apply(inner, expansion); + + contraction = isl_schedule_node_expansion_get_contraction(node); + contraction = isl_union_pw_multi_aff_gist(contraction, + isl_union_set_copy(inner)); + + data->filters = isl_union_set_list_add(data->filters, inner); + + inner = isl_union_set_list_get_union_set(data->filters, n - 1); + expansion = isl_schedule_node_expansion_get_expansion(node); + expansion = isl_union_map_gist_domain(expansion, inner); + node = isl_schedule_node_expansion_set_contraction_and_expansion(node, + contraction, expansion); + + return node; +} + +/* Enter the extension node "node" during a isl_schedule_node_gist traversal. + * + * In particular, add an extra element to data->filters containing + * the union of the previous element with the additional domain elements + * introduced by the extension. + */ +static __isl_give isl_schedule_node *gist_enter_extension( + __isl_take isl_schedule_node *node, struct isl_node_gist_data *data) +{ + int n; + isl_union_set *inner, *extra; + isl_union_map *extension; + + n = isl_union_set_list_n_union_set(data->filters); + inner = isl_union_set_list_get_union_set(data->filters, n - 1); + extension = isl_schedule_node_extension_get_extension(node); + extra = isl_union_map_range(extension); + inner = isl_union_set_union(inner, extra); + + data->filters = isl_union_set_list_add(data->filters, inner); + + return node; +} + +/* Can we finish gisting at this node? + * That is, is the filter on the current filter node a subset of + * the original context passed to isl_schedule_node_gist? + * If we have gone through any expansions, then we cannot perform + * this test since the current domain elements are incomparable + * to the domain elements in the original context. + */ +static int gist_done(__isl_keep isl_schedule_node *node, + struct isl_node_gist_data *data) +{ + isl_union_set *filter, *outer; + int subset; + + if (data->n_expansion != 0) + return 0; + + filter = isl_schedule_node_filter_get_filter(node); + outer = isl_union_set_list_get_union_set(data->filters, 0); + subset = isl_union_set_is_subset(filter, outer); + isl_union_set_free(outer); + isl_union_set_free(filter); + + return subset; +} + +/* Callback for "traverse" to enter a node and to move + * to the deepest initial subtree that should be traversed + * by isl_schedule_node_gist. + * + * The "filters" list is extended by one element each time + * we come across a filter node by the result of intersecting + * the last element in the list with the filter on the filter node. + * + * If the filter on the current filter node is a subset of + * the original context passed to isl_schedule_node_gist, + * then there is no need to go into its subtree since it cannot + * be further simplified by the context. The "filters" list is + * still extended for consistency, but the actual value of the + * added element is immaterial since it will not be used. + * + * Otherwise, the filter on the current filter node is replaced by + * the gist of the original filter with respect to the intersection + * of the original context with the intermediate filters. + * + * If the new element in the "filters" list is empty, then no elements + * can reach the descendants of the current filter node. The subtree + * underneath the filter node is therefore removed. + * + * Each expansion node we come across is handled by + * gist_enter_expansion. + * + * Each extension node we come across is handled by + * gist_enter_extension. + */ +static __isl_give isl_schedule_node *gist_enter( + __isl_take isl_schedule_node *node, void *user) +{ + struct isl_node_gist_data *data = user; + + do { + isl_union_set *filter, *inner; + int done, empty; + int n; + + switch (isl_schedule_node_get_type(node)) { + case isl_schedule_node_error: + return isl_schedule_node_free(node); + case isl_schedule_node_expansion: + node = gist_enter_expansion(node, data); + continue; + case isl_schedule_node_extension: + node = gist_enter_extension(node, data); + continue; + case isl_schedule_node_band: + case isl_schedule_node_context: + case isl_schedule_node_domain: + case isl_schedule_node_guard: + case isl_schedule_node_leaf: + case isl_schedule_node_mark: + case isl_schedule_node_sequence: + case isl_schedule_node_set: + continue; + case isl_schedule_node_filter: + break; + } + done = gist_done(node, data); + filter = isl_schedule_node_filter_get_filter(node); + if (done < 0 || done) { + data->filters = isl_union_set_list_add(data->filters, + filter); + if (done < 0) + return isl_schedule_node_free(node); + return node; + } + n = isl_union_set_list_n_union_set(data->filters); + inner = isl_union_set_list_get_union_set(data->filters, n - 1); + filter = isl_union_set_gist(filter, isl_union_set_copy(inner)); + node = isl_schedule_node_filter_set_filter(node, + isl_union_set_copy(filter)); + filter = isl_union_set_intersect(filter, inner); + empty = isl_union_set_is_empty(filter); + data->filters = isl_union_set_list_add(data->filters, filter); + if (empty < 0) + return isl_schedule_node_free(node); + if (!empty) + continue; + node = isl_schedule_node_child(node, 0); + node = isl_schedule_node_cut(node); + node = isl_schedule_node_parent(node); + return node; + } while (isl_schedule_node_has_children(node) && + (node = isl_schedule_node_first_child(node)) != NULL); + + return node; +} + +/* Callback for "traverse" to leave a node for isl_schedule_node_gist. + * + * In particular, if the current node is a filter node, then we remove + * the element on the "filters" list that was added when we entered + * the node. There is no need to compute any gist here, since we + * already did that when we entered the node. + * + * If the current node is an expansion, then we decrement + * the number of outer expansions and remove the element + * in data->filters that was added by gist_enter_expansion. + * + * If the current node is an extension, then remove the element + * in data->filters that was added by gist_enter_extension. + * + * If the current node is a band node, then we compute the gist of + * the band node with respect to the intersection of the original context + * and the intermediate filters. + * + * If the current node is a sequence or set node, then some of + * the filter children may have become empty and so they are removed. + * If only one child is left, then the set or sequence node along with + * the single remaining child filter is removed. The filter can be + * removed because the filters on a sequence or set node are supposed + * to partition the incoming domain instances. + * In principle, it should then be impossible for there to be zero + * remaining children, but should this happen, we replace the entire + * subtree with an empty filter. + */ +static __isl_give isl_schedule_node *gist_leave( + __isl_take isl_schedule_node *node, void *user) +{ + struct isl_node_gist_data *data = user; + isl_schedule_tree *tree; + int i, n; + isl_union_set *filter; + + switch (isl_schedule_node_get_type(node)) { + case isl_schedule_node_error: + return isl_schedule_node_free(node); + case isl_schedule_node_expansion: + data->n_expansion--; + case isl_schedule_node_extension: + case isl_schedule_node_filter: + n = isl_union_set_list_n_union_set(data->filters); + data->filters = isl_union_set_list_drop(data->filters, + n - 1, 1); + break; + case isl_schedule_node_band: + n = isl_union_set_list_n_union_set(data->filters); + filter = isl_union_set_list_get_union_set(data->filters, n - 1); + node = isl_schedule_node_band_gist(node, filter); + break; + case isl_schedule_node_set: + case isl_schedule_node_sequence: + tree = isl_schedule_node_get_tree(node); + n = isl_schedule_tree_n_children(tree); + for (i = n - 1; i >= 0; --i) { + isl_schedule_tree *child; + isl_union_set *filter; + int empty; + + child = isl_schedule_tree_get_child(tree, i); + filter = isl_schedule_tree_filter_get_filter(child); + empty = isl_union_set_is_empty(filter); + isl_union_set_free(filter); + isl_schedule_tree_free(child); + if (empty < 0) + tree = isl_schedule_tree_free(tree); + else if (empty) + tree = isl_schedule_tree_drop_child(tree, i); + } + n = isl_schedule_tree_n_children(tree); + node = isl_schedule_node_graft_tree(node, tree); + if (n == 1) { + node = isl_schedule_node_delete(node); + node = isl_schedule_node_delete(node); + } else if (n == 0) { + isl_space *space; + + filter = + isl_union_set_list_get_union_set(data->filters, 0); + space = isl_union_set_get_space(filter); + isl_union_set_free(filter); + filter = isl_union_set_empty(space); + node = isl_schedule_node_cut(node); + node = isl_schedule_node_insert_filter(node, filter); + } + break; + case isl_schedule_node_context: + case isl_schedule_node_domain: + case isl_schedule_node_guard: + case isl_schedule_node_leaf: + case isl_schedule_node_mark: + break; + } + + return node; +} + +/* Compute the gist of the subtree at "node" with respect to + * the reaching domain elements in "context". + * In particular, compute the gist of all band and filter nodes + * in the subtree with respect to "context". Children of set or sequence + * nodes that end up with an empty filter are removed completely. + * + * We keep track of the intersection of "context" with all outer filters + * of the current node within the subtree in the final element of "filters". + * Initially, this list contains the single element "context" and it is + * extended or shortened each time we enter or leave a filter node. + */ +__isl_give isl_schedule_node *isl_schedule_node_gist( + __isl_take isl_schedule_node *node, __isl_take isl_union_set *context) +{ + struct isl_node_gist_data data; + + data.n_expansion = 0; + data.filters = isl_union_set_list_from_union_set(context); + node = traverse(node, &gist_enter, &gist_leave, &data); + isl_union_set_list_free(data.filters); + return node; +} + +/* Intersect the domain of domain node "node" with "domain". + * + * If the domain of "node" is already a subset of "domain", + * then nothing needs to be changed. + * + * Otherwise, we replace the domain of the domain node by the intersection + * and simplify the subtree rooted at "node" with respect to this intersection. + */ +__isl_give isl_schedule_node *isl_schedule_node_domain_intersect_domain( + __isl_take isl_schedule_node *node, __isl_take isl_union_set *domain) +{ + isl_schedule_tree *tree; + isl_union_set *uset; + int is_subset; + + if (!node || !domain) + goto error; + + uset = isl_schedule_tree_domain_get_domain(node->tree); + is_subset = isl_union_set_is_subset(uset, domain); + isl_union_set_free(uset); + if (is_subset < 0) + goto error; + if (is_subset) { + isl_union_set_free(domain); + return node; + } + + tree = isl_schedule_tree_copy(node->tree); + uset = isl_schedule_tree_domain_get_domain(tree); + uset = isl_union_set_intersect(uset, domain); + tree = isl_schedule_tree_domain_set_domain(tree, + isl_union_set_copy(uset)); + node = isl_schedule_node_graft_tree(node, tree); + + node = isl_schedule_node_child(node, 0); + node = isl_schedule_node_gist(node, uset); + node = isl_schedule_node_parent(node); + + return node; +error: + isl_schedule_node_free(node); + isl_union_set_free(domain); + return NULL; +} + +/* Internal data structure for isl_schedule_node_get_subtree_expansion. + * "expansions" contains a list of accumulated expansions + * for each outer expansion, set or sequence node. The first element + * in the list is an identity mapping on the reaching domain elements. + * "res" collects the results. + */ +struct isl_subtree_expansion_data { + isl_union_map_list *expansions; + isl_union_map *res; +}; + +/* Callback for "traverse" to enter a node and to move + * to the deepest initial subtree that should be traversed + * by isl_schedule_node_get_subtree_expansion. + * + * Whenever we come across an expansion node, the last element + * of data->expansions is combined with the expansion + * on the expansion node. + * + * Whenever we come across a filter node that is the child + * of a set or sequence node, data->expansions is extended + * with a new element that restricts the previous element + * to the elements selected by the filter. + * The previous element can then be reused while backtracking. + */ +static __isl_give isl_schedule_node *subtree_expansion_enter( + __isl_take isl_schedule_node *node, void *user) +{ + struct isl_subtree_expansion_data *data = user; + + do { + enum isl_schedule_node_type type; + isl_union_set *filter; + isl_union_map *inner, *expansion; + int n; + + switch (isl_schedule_node_get_type(node)) { + case isl_schedule_node_error: + return isl_schedule_node_free(node); + case isl_schedule_node_filter: + type = isl_schedule_node_get_parent_type(node); + if (type != isl_schedule_node_set && + type != isl_schedule_node_sequence) + break; + filter = isl_schedule_node_filter_get_filter(node); + n = isl_union_map_list_n_union_map(data->expansions); + inner = + isl_union_map_list_get_union_map(data->expansions, + n - 1); + inner = isl_union_map_intersect_range(inner, filter); + data->expansions = + isl_union_map_list_add(data->expansions, inner); + break; + case isl_schedule_node_expansion: + n = isl_union_map_list_n_union_map(data->expansions); + expansion = + isl_schedule_node_expansion_get_expansion(node); + inner = + isl_union_map_list_get_union_map(data->expansions, + n - 1); + inner = isl_union_map_apply_range(inner, expansion); + data->expansions = + isl_union_map_list_set_union_map(data->expansions, + n - 1, inner); + break; + case isl_schedule_node_band: + case isl_schedule_node_context: + case isl_schedule_node_domain: + case isl_schedule_node_extension: + case isl_schedule_node_guard: + case isl_schedule_node_leaf: + case isl_schedule_node_mark: + case isl_schedule_node_sequence: + case isl_schedule_node_set: + break; + } + } while (isl_schedule_node_has_children(node) && + (node = isl_schedule_node_first_child(node)) != NULL); + + return node; +} + +/* Callback for "traverse" to leave a node for + * isl_schedule_node_get_subtree_expansion. + * + * If we come across a filter node that is the child + * of a set or sequence node, then we remove the element + * of data->expansions that was added in subtree_expansion_enter. + * + * If we reach a leaf node, then the accumulated expansion is + * added to data->res. + */ +static __isl_give isl_schedule_node *subtree_expansion_leave( + __isl_take isl_schedule_node *node, void *user) +{ + struct isl_subtree_expansion_data *data = user; + int n; + isl_union_map *inner; + enum isl_schedule_node_type type; + + switch (isl_schedule_node_get_type(node)) { + case isl_schedule_node_error: + return isl_schedule_node_free(node); + case isl_schedule_node_filter: + type = isl_schedule_node_get_parent_type(node); + if (type != isl_schedule_node_set && + type != isl_schedule_node_sequence) + break; + n = isl_union_map_list_n_union_map(data->expansions); + data->expansions = isl_union_map_list_drop(data->expansions, + n - 1, 1); + break; + case isl_schedule_node_leaf: + n = isl_union_map_list_n_union_map(data->expansions); + inner = isl_union_map_list_get_union_map(data->expansions, + n - 1); + data->res = isl_union_map_union(data->res, inner); + break; + case isl_schedule_node_band: + case isl_schedule_node_context: + case isl_schedule_node_domain: + case isl_schedule_node_expansion: + case isl_schedule_node_extension: + case isl_schedule_node_guard: + case isl_schedule_node_mark: + case isl_schedule_node_sequence: + case isl_schedule_node_set: + break; + } + + return node; +} + +/* Return a mapping from the domain elements that reach "node" + * to the corresponding domain elements in the leaves of the subtree + * rooted at "node" obtained by composing the intermediate expansions. + * + * We start out with an identity mapping between the domain elements + * that reach "node" and compose it with all the expansions + * on a path from "node" to a leaf while traversing the subtree. + * Within the children of an a sequence or set node, the + * accumulated expansion is restricted to the elements selected + * by the filter child. + */ +__isl_give isl_union_map *isl_schedule_node_get_subtree_expansion( + __isl_keep isl_schedule_node *node) +{ + struct isl_subtree_expansion_data data; + isl_space *space; + isl_union_set *domain; + isl_union_map *expansion; + + if (!node) + return NULL; + + domain = isl_schedule_node_get_universe_domain(node); + space = isl_union_set_get_space(domain); + expansion = isl_union_set_identity(domain); + data.res = isl_union_map_empty(space); + data.expansions = isl_union_map_list_from_union_map(expansion); + + node = isl_schedule_node_copy(node); + node = traverse(node, &subtree_expansion_enter, + &subtree_expansion_leave, &data); + if (!node) + data.res = isl_union_map_free(data.res); + isl_schedule_node_free(node); + + isl_union_map_list_free(data.expansions); + + return data.res; +} + +/* Internal data structure for isl_schedule_node_get_subtree_contraction. + * "contractions" contains a list of accumulated contractions + * for each outer expansion, set or sequence node. The first element + * in the list is an identity mapping on the reaching domain elements. + * "res" collects the results. + */ +struct isl_subtree_contraction_data { + isl_union_pw_multi_aff_list *contractions; + isl_union_pw_multi_aff *res; +}; + +/* Callback for "traverse" to enter a node and to move + * to the deepest initial subtree that should be traversed + * by isl_schedule_node_get_subtree_contraction. + * + * Whenever we come across an expansion node, the last element + * of data->contractions is combined with the contraction + * on the expansion node. + * + * Whenever we come across a filter node that is the child + * of a set or sequence node, data->contractions is extended + * with a new element that restricts the previous element + * to the elements selected by the filter. + * The previous element can then be reused while backtracking. + */ +static __isl_give isl_schedule_node *subtree_contraction_enter( + __isl_take isl_schedule_node *node, void *user) +{ + struct isl_subtree_contraction_data *data = user; + + do { + enum isl_schedule_node_type type; + isl_union_set *filter; + isl_union_pw_multi_aff *inner, *contraction; + int n; + + switch (isl_schedule_node_get_type(node)) { + case isl_schedule_node_error: + return isl_schedule_node_free(node); + case isl_schedule_node_filter: + type = isl_schedule_node_get_parent_type(node); + if (type != isl_schedule_node_set && + type != isl_schedule_node_sequence) + break; + filter = isl_schedule_node_filter_get_filter(node); + n = isl_union_pw_multi_aff_list_n_union_pw_multi_aff( + data->contractions); + inner = + isl_union_pw_multi_aff_list_get_union_pw_multi_aff( + data->contractions, n - 1); + inner = isl_union_pw_multi_aff_intersect_domain(inner, + filter); + data->contractions = + isl_union_pw_multi_aff_list_add(data->contractions, + inner); + break; + case isl_schedule_node_expansion: + n = isl_union_pw_multi_aff_list_n_union_pw_multi_aff( + data->contractions); + contraction = + isl_schedule_node_expansion_get_contraction(node); + inner = + isl_union_pw_multi_aff_list_get_union_pw_multi_aff( + data->contractions, n - 1); + inner = + isl_union_pw_multi_aff_pullback_union_pw_multi_aff( + inner, contraction); + data->contractions = + isl_union_pw_multi_aff_list_set_union_pw_multi_aff( + data->contractions, n - 1, inner); + break; + case isl_schedule_node_band: + case isl_schedule_node_context: + case isl_schedule_node_domain: + case isl_schedule_node_extension: + case isl_schedule_node_guard: + case isl_schedule_node_leaf: + case isl_schedule_node_mark: + case isl_schedule_node_sequence: + case isl_schedule_node_set: + break; + } + } while (isl_schedule_node_has_children(node) && + (node = isl_schedule_node_first_child(node)) != NULL); + + return node; +} + +/* Callback for "traverse" to leave a node for + * isl_schedule_node_get_subtree_contraction. + * + * If we come across a filter node that is the child + * of a set or sequence node, then we remove the element + * of data->contractions that was added in subtree_contraction_enter. + * + * If we reach a leaf node, then the accumulated contraction is + * added to data->res. + */ +static __isl_give isl_schedule_node *subtree_contraction_leave( + __isl_take isl_schedule_node *node, void *user) +{ + struct isl_subtree_contraction_data *data = user; + int n; + isl_union_pw_multi_aff *inner; + enum isl_schedule_node_type type; + + switch (isl_schedule_node_get_type(node)) { + case isl_schedule_node_error: + return isl_schedule_node_free(node); + case isl_schedule_node_filter: + type = isl_schedule_node_get_parent_type(node); + if (type != isl_schedule_node_set && + type != isl_schedule_node_sequence) + break; + n = isl_union_pw_multi_aff_list_n_union_pw_multi_aff( + data->contractions); + data->contractions = + isl_union_pw_multi_aff_list_drop(data->contractions, + n - 1, 1); + break; + case isl_schedule_node_leaf: + n = isl_union_pw_multi_aff_list_n_union_pw_multi_aff( + data->contractions); + inner = isl_union_pw_multi_aff_list_get_union_pw_multi_aff( + data->contractions, n - 1); + data->res = isl_union_pw_multi_aff_union_add(data->res, inner); + break; + case isl_schedule_node_band: + case isl_schedule_node_context: + case isl_schedule_node_domain: + case isl_schedule_node_expansion: + case isl_schedule_node_extension: + case isl_schedule_node_guard: + case isl_schedule_node_mark: + case isl_schedule_node_sequence: + case isl_schedule_node_set: + break; + } + + return node; +} + +/* Return a mapping from the domain elements in the leaves of the subtree + * rooted at "node" to the corresponding domain elements that reach "node" + * obtained by composing the intermediate contractions. + * + * We start out with an identity mapping between the domain elements + * that reach "node" and compose it with all the contractions + * on a path from "node" to a leaf while traversing the subtree. + * Within the children of an a sequence or set node, the + * accumulated contraction is restricted to the elements selected + * by the filter child. + */ +__isl_give isl_union_pw_multi_aff *isl_schedule_node_get_subtree_contraction( + __isl_keep isl_schedule_node *node) +{ + struct isl_subtree_contraction_data data; + isl_space *space; + isl_union_set *domain; + isl_union_pw_multi_aff *contraction; + + if (!node) + return NULL; + + domain = isl_schedule_node_get_universe_domain(node); + space = isl_union_set_get_space(domain); + contraction = isl_union_set_identity_union_pw_multi_aff(domain); + data.res = isl_union_pw_multi_aff_empty(space); + data.contractions = + isl_union_pw_multi_aff_list_from_union_pw_multi_aff(contraction); + + node = isl_schedule_node_copy(node); + node = traverse(node, &subtree_contraction_enter, + &subtree_contraction_leave, &data); + if (!node) + data.res = isl_union_pw_multi_aff_free(data.res); + isl_schedule_node_free(node); + + isl_union_pw_multi_aff_list_free(data.contractions); + + return data.res; +} + +/* Do the nearest "n" ancestors of "node" have the types given in "types" + * (starting at the parent of "node")? + */ +static int has_ancestors(__isl_keep isl_schedule_node *node, + int n, enum isl_schedule_node_type *types) +{ + int i, n_ancestor; + + if (!node) + return -1; + + n_ancestor = isl_schedule_tree_list_n_schedule_tree(node->ancestors); + if (n_ancestor < n) + return 0; + + for (i = 0; i < n; ++i) { + isl_schedule_tree *tree; + int correct_type; + + tree = isl_schedule_tree_list_get_schedule_tree(node->ancestors, + n_ancestor - 1 - i); + if (!tree) + return -1; + correct_type = isl_schedule_tree_get_type(tree) == types[i]; + isl_schedule_tree_free(tree); + if (!correct_type) + return 0; + } + + return 1; +} + +/* Given a node "node" that appears in an extension (i.e., it is the child + * of a filter in a sequence inside an extension node), are the spaces + * of the extension specified by "extension" disjoint from those + * of both the original extension and the domain elements that reach + * that original extension? + */ +static int is_disjoint_extension(__isl_keep isl_schedule_node *node, + __isl_keep isl_union_map *extension) +{ + isl_union_map *old; + isl_union_set *domain; + int empty; + + node = isl_schedule_node_copy(node); + node = isl_schedule_node_parent(node); + node = isl_schedule_node_parent(node); + node = isl_schedule_node_parent(node); + old = isl_schedule_node_extension_get_extension(node); + domain = isl_schedule_node_get_universe_domain(node); + isl_schedule_node_free(node); + old = isl_union_map_universe(old); + domain = isl_union_set_union(domain, isl_union_map_range(old)); + extension = isl_union_map_copy(extension); + extension = isl_union_map_intersect_range(extension, domain); + empty = isl_union_map_is_empty(extension); + isl_union_map_free(extension); + + return empty; +} + +/* Given a node "node" that is governed by an extension node, extend + * that extension node with "extension". + * + * In particular, "node" is the child of a filter in a sequence that + * is in turn a child of an extension node. Extend that extension node + * with "extension". + * + * Return a pointer to the parent of the original node (i.e., a filter). + */ +static __isl_give isl_schedule_node *extend_extension( + __isl_take isl_schedule_node *node, __isl_take isl_union_map *extension) +{ + int pos; + int disjoint; + isl_union_map *node_extension; + + node = isl_schedule_node_parent(node); + pos = isl_schedule_node_get_child_position(node); + node = isl_schedule_node_parent(node); + node = isl_schedule_node_parent(node); + node_extension = isl_schedule_node_extension_get_extension(node); + disjoint = isl_union_map_is_disjoint(extension, node_extension); + extension = isl_union_map_union(extension, node_extension); + node = isl_schedule_node_extension_set_extension(node, extension); + node = isl_schedule_node_child(node, 0); + node = isl_schedule_node_child(node, pos); + + if (disjoint < 0) + return isl_schedule_node_free(node); + if (!node) + return NULL; + if (!disjoint) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "extension domain should be disjoint from earlier " + "extensions", return isl_schedule_node_free(node)); + + return node; +} + +/* Return the universe of "uset" if this universe is disjoint from "ref". + * Otherwise, return "uset". + * + * Also check if "uset" itself is disjoint from "ref", reporting + * an error if it is not. + */ +static __isl_give isl_union_set *replace_by_universe_if_disjoint( + __isl_take isl_union_set *uset, __isl_keep isl_union_set *ref) +{ + int disjoint; + isl_union_set *universe; + + disjoint = isl_union_set_is_disjoint(uset, ref); + if (disjoint < 0) + return isl_union_set_free(uset); + if (!disjoint) + isl_die(isl_union_set_get_ctx(uset), isl_error_invalid, + "extension domain should be disjoint from " + "current domain", return isl_union_set_free(uset)); + + universe = isl_union_set_universe(isl_union_set_copy(uset)); + disjoint = isl_union_set_is_disjoint(universe, ref); + if (disjoint >= 0 && disjoint) { + isl_union_set_free(uset); + return universe; + } + isl_union_set_free(universe); + + if (disjoint < 0) + return isl_union_set_free(uset); + return uset; +} + +/* Insert an extension node on top of "node" with extension "extension". + * In addition, insert a filter that separates node from the extension + * between the extension node and "node". + * Return a pointer to the inserted filter node. + * + * If "node" already appears in an extension (i.e., if it is the child + * of a filter in a sequence inside an extension node), then extend that + * extension with "extension" instead. + * In this case, a pointer to the original filter node is returned. + * Note that if some of the elements in the new extension live in the + * same space as those of the original extension or the domain elements + * reaching the original extension, then we insert a new extension anyway. + * Otherwise, we would have to adjust the filters in the sequence child + * of the extension to ensure that the elements in the new extension + * are filtered out. + */ +static __isl_give isl_schedule_node *insert_extension( + __isl_take isl_schedule_node *node, __isl_take isl_union_map *extension) +{ + enum isl_schedule_node_type ancestors[] = + { isl_schedule_node_filter, isl_schedule_node_sequence, + isl_schedule_node_extension }; + isl_union_set *domain; + isl_union_set *filter; + int in_ext; + + in_ext = has_ancestors(node, 3, ancestors); + if (in_ext < 0) + goto error; + if (in_ext) { + int disjoint; + + disjoint = is_disjoint_extension(node, extension); + if (disjoint < 0) + goto error; + if (disjoint) + return extend_extension(node, extension); + } + + filter = isl_schedule_node_get_domain(node); + domain = isl_union_map_range(isl_union_map_copy(extension)); + filter = replace_by_universe_if_disjoint(filter, domain); + isl_union_set_free(domain); + + node = isl_schedule_node_insert_filter(node, filter); + node = isl_schedule_node_insert_extension(node, extension); + node = isl_schedule_node_child(node, 0); + return node; +error: + isl_schedule_node_free(node); + isl_union_map_free(extension); + return NULL; +} + +/* Replace the subtree that "node" points to by "tree" (which has + * a sequence root with two children), except if the parent of "node" + * is a sequence as well, in which case "tree" is spliced at the position + * of "node" in its parent. + * Return a pointer to the child of the "tree_pos" (filter) child of "tree" + * in the updated schedule tree. + */ +static __isl_give isl_schedule_node *graft_or_splice( + __isl_take isl_schedule_node *node, __isl_take isl_schedule_tree *tree, + int tree_pos) +{ + int pos; + + if (isl_schedule_node_get_parent_type(node) == + isl_schedule_node_sequence) { + pos = isl_schedule_node_get_child_position(node); + node = isl_schedule_node_parent(node); + node = isl_schedule_node_sequence_splice(node, pos, tree); + } else { + pos = 0; + node = isl_schedule_node_graft_tree(node, tree); + } + node = isl_schedule_node_child(node, pos + tree_pos); + node = isl_schedule_node_child(node, 0); + + return node; +} + +/* Insert a node "graft" into the schedule tree of "node" such that it + * is executed before (if "before" is set) or after (if "before" is not set) + * the node that "node" points to. + * The root of "graft" is an extension node. + * Return a pointer to the node that "node" pointed to. + * + * We first insert an extension node on top of "node" (or extend + * the extension node if there already is one), with a filter on "node" + * separating it from the extension. + * We then insert a filter in the graft to separate it from the original + * domain elements and combine the original and new tree in a sequence. + * If we have extended an extension node, then the children of this + * sequence are spliced in the sequence of the extended extension + * at the position where "node" appears in the original extension. + * Otherwise, the sequence pair is attached to the new extension node. + */ +static __isl_give isl_schedule_node *graft_extension( + __isl_take isl_schedule_node *node, __isl_take isl_schedule_node *graft, + int before) +{ + isl_union_map *extension; + isl_union_set *graft_domain; + isl_union_set *node_domain; + isl_schedule_tree *tree, *tree_graft; + + extension = isl_schedule_node_extension_get_extension(graft); + graft_domain = isl_union_map_range(isl_union_map_copy(extension)); + node_domain = isl_schedule_node_get_universe_domain(node); + node = insert_extension(node, extension); + + graft_domain = replace_by_universe_if_disjoint(graft_domain, + node_domain); + isl_union_set_free(node_domain); + + tree = isl_schedule_node_get_tree(node); + if (!isl_schedule_node_has_children(graft)) { + tree_graft = isl_schedule_tree_from_filter(graft_domain); + } else { + graft = isl_schedule_node_child(graft, 0); + tree_graft = isl_schedule_node_get_tree(graft); + tree_graft = isl_schedule_tree_insert_filter(tree_graft, + graft_domain); + } + if (before) + tree = isl_schedule_tree_sequence_pair(tree_graft, tree); + else + tree = isl_schedule_tree_sequence_pair(tree, tree_graft); + node = graft_or_splice(node, tree, before); + + isl_schedule_node_free(graft); + + return node; +} + +/* Replace the root domain node of "node" by an extension node suitable + * for insertion at "pos". + * That is, create an extension node that maps the outer band nodes + * at "pos" to the domain of the root node of "node" and attach + * the child of this root node to the extension node. + */ +static __isl_give isl_schedule_node *extension_from_domain( + __isl_take isl_schedule_node *node, __isl_keep isl_schedule_node *pos) +{ + isl_union_set *universe; + isl_union_set *domain; + isl_union_map *ext; + int depth; + int anchored; + isl_space *space; + isl_schedule_node *res; + isl_schedule_tree *tree; + + anchored = isl_schedule_node_is_subtree_anchored(node); + if (anchored < 0) + return isl_schedule_node_free(node); + if (anchored) + isl_die(isl_schedule_node_get_ctx(node), isl_error_unsupported, + "cannot graft anchored tree with domain root", + return isl_schedule_node_free(node)); + + depth = isl_schedule_node_get_schedule_depth(pos); + domain = isl_schedule_node_domain_get_domain(node); + space = isl_union_set_get_space(domain); + space = isl_space_set_from_params(space); + space = isl_space_add_dims(space, isl_dim_set, depth); + universe = isl_union_set_from_set(isl_set_universe(space)); + ext = isl_union_map_from_domain_and_range(universe, domain); + res = isl_schedule_node_from_extension(ext); + node = isl_schedule_node_child(node, 0); + if (!node) + return isl_schedule_node_free(res); + if (!isl_schedule_tree_is_leaf(node->tree)) { + tree = isl_schedule_node_get_tree(node); + res = isl_schedule_node_child(res, 0); + res = isl_schedule_node_graft_tree(res, tree); + res = isl_schedule_node_parent(res); + } + isl_schedule_node_free(node); + + return res; +} + +/* Insert a node "graft" into the schedule tree of "node" such that it + * is executed before (if "before" is set) or after (if "before" is not set) + * the node that "node" points to. + * The root of "graft" may be either a domain or an extension node. + * In the latter case, the domain of the extension needs to correspond + * to the outer band nodes of "node". + * The elements of the domain or the range of the extension may not + * intersect with the domain elements that reach "node". + * The schedule tree of "graft" may not be anchored. + * + * The schedule tree of "node" is modified to include an extension node + * corresponding to the root node of "graft" as a child of the original + * parent of "node". The original node that "node" points to and the + * child of the root node of "graft" are attached to this extension node + * through a sequence, with appropriate filters and with the child + * of "graft" appearing before or after the original "node". + * + * If "node" already appears inside a sequence that is the child of + * an extension node and if the spaces of the new domain elements + * do not overlap with those of the original domain elements, + * then that extension node is extended with the new extension + * rather than introducing a new segment of extension and sequence nodes. + * + * Return a pointer to the same node in the modified tree that + * "node" pointed to in the original tree. + */ +static __isl_give isl_schedule_node *isl_schedule_node_graft_before_or_after( + __isl_take isl_schedule_node *node, __isl_take isl_schedule_node *graft, + int before) +{ + if (!node || !graft) + goto error; + if (check_insert(node) < 0) + goto error; + + if (isl_schedule_node_get_type(graft) == isl_schedule_node_domain) + graft = extension_from_domain(graft, node); + + if (isl_schedule_node_get_type(graft) != isl_schedule_node_extension) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "expecting domain or extension as root of graft", + goto error); + + return graft_extension(node, graft, before); +error: + isl_schedule_node_free(node); + isl_schedule_node_free(graft); + return NULL; +} + +/* Insert a node "graft" into the schedule tree of "node" such that it + * is executed before the node that "node" points to. + * The root of "graft" may be either a domain or an extension node. + * In the latter case, the domain of the extension needs to correspond + * to the outer band nodes of "node". + * The elements of the domain or the range of the extension may not + * intersect with the domain elements that reach "node". + * The schedule tree of "graft" may not be anchored. + * + * Return a pointer to the same node in the modified tree that + * "node" pointed to in the original tree. + */ +__isl_give isl_schedule_node *isl_schedule_node_graft_before( + __isl_take isl_schedule_node *node, __isl_take isl_schedule_node *graft) +{ + return isl_schedule_node_graft_before_or_after(node, graft, 1); +} + +/* Insert a node "graft" into the schedule tree of "node" such that it + * is executed after the node that "node" points to. + * The root of "graft" may be either a domain or an extension node. + * In the latter case, the domain of the extension needs to correspond + * to the outer band nodes of "node". + * The elements of the domain or the range of the extension may not + * intersect with the domain elements that reach "node". + * The schedule tree of "graft" may not be anchored. + * + * Return a pointer to the same node in the modified tree that + * "node" pointed to in the original tree. + */ +__isl_give isl_schedule_node *isl_schedule_node_graft_after( + __isl_take isl_schedule_node *node, + __isl_take isl_schedule_node *graft) +{ + return isl_schedule_node_graft_before_or_after(node, graft, 0); +} + +/* Split the domain elements that reach "node" into those that satisfy + * "filter" and those that do not. Arrange for the first subset to be + * executed after the second subset. + * Return a pointer to the tree corresponding to the second subset, + * except when this subset is empty in which case the original pointer + * is returned. + * If both subsets are non-empty, then a sequence node is introduced + * to impose the order. If the grandparent of the original node was + * itself a sequence, then the original child is replaced by two children + * in this sequence instead. + * The children in the sequence are copies of the original subtree, + * simplified with respect to their filters. + */ +__isl_give isl_schedule_node *isl_schedule_node_order_after( + __isl_take isl_schedule_node *node, __isl_take isl_union_set *filter) +{ + enum isl_schedule_node_type ancestors[] = + { isl_schedule_node_filter, isl_schedule_node_sequence }; + isl_union_set *node_domain, *node_filter = NULL; + isl_schedule_node *node2; + isl_schedule_tree *tree1, *tree2; + int empty1, empty2; + int in_seq; + + if (!node || !filter) + goto error; + if (check_insert(node) < 0) + goto error; + + in_seq = has_ancestors(node, 2, ancestors); + if (in_seq < 0) + goto error; + if (in_seq) + node = isl_schedule_node_parent(node); + node_domain = isl_schedule_node_get_domain(node); + filter = isl_union_set_gist(filter, isl_union_set_copy(node_domain)); + node_filter = isl_union_set_copy(node_domain); + node_filter = isl_union_set_subtract(node_filter, + isl_union_set_copy(filter)); + node_filter = isl_union_set_gist(node_filter, node_domain); + empty1 = isl_union_set_is_empty(filter); + empty2 = isl_union_set_is_empty(node_filter); + if (empty1 < 0 || empty2 < 0) + goto error; + if (empty1 || empty2) { + isl_union_set_free(filter); + isl_union_set_free(node_filter); + return node; + } + + node2 = isl_schedule_node_copy(node); + node = isl_schedule_node_gist(node, isl_union_set_copy(node_filter)); + node2 = isl_schedule_node_gist(node2, isl_union_set_copy(filter)); + tree1 = isl_schedule_node_get_tree(node); + tree2 = isl_schedule_node_get_tree(node2); + isl_schedule_node_free(node2); + tree1 = isl_schedule_tree_insert_filter(tree1, node_filter); + tree2 = isl_schedule_tree_insert_filter(tree2, filter); + tree1 = isl_schedule_tree_sequence_pair(tree1, tree2); + + node = graft_or_splice(node, tree1, 0); + + return node; +error: + isl_schedule_node_free(node); + isl_union_set_free(filter); + isl_union_set_free(node_filter); + return NULL; +} + +/* Reset the user pointer on all identifiers of parameters and tuples + * in the schedule node "node". + */ +__isl_give isl_schedule_node *isl_schedule_node_reset_user( + __isl_take isl_schedule_node *node) +{ + isl_schedule_tree *tree; + + tree = isl_schedule_node_get_tree(node); + tree = isl_schedule_tree_reset_user(tree); + node = isl_schedule_node_graft_tree(node, tree); + + return node; +} + +/* Align the parameters of the schedule node "node" to those of "space". + */ +__isl_give isl_schedule_node *isl_schedule_node_align_params( + __isl_take isl_schedule_node *node, __isl_take isl_space *space) +{ + isl_schedule_tree *tree; + + tree = isl_schedule_node_get_tree(node); + tree = isl_schedule_tree_align_params(tree, space); + node = isl_schedule_node_graft_tree(node, tree); + + return node; +} + +/* Compute the pullback of schedule node "node" + * by the function represented by "upma". + * In other words, plug in "upma" in the iteration domains + * of schedule node "node". + * We currently do not handle expansion nodes. + * + * Note that this is only a helper function for + * isl_schedule_pullback_union_pw_multi_aff. In order to maintain consistency, + * this function should not be called on a single node without also + * calling it on all the other nodes. + */ +__isl_give isl_schedule_node *isl_schedule_node_pullback_union_pw_multi_aff( + __isl_take isl_schedule_node *node, + __isl_take isl_union_pw_multi_aff *upma) +{ + isl_schedule_tree *tree; + + tree = isl_schedule_node_get_tree(node); + tree = isl_schedule_tree_pullback_union_pw_multi_aff(tree, upma); + node = isl_schedule_node_graft_tree(node, tree); + + return node; +} + +/* Return the position of the subtree containing "node" among the children + * of "ancestor". "node" is assumed to be a descendant of "ancestor". + * In particular, both nodes should point to the same schedule tree. + * + * Return -1 on error. + */ +int isl_schedule_node_get_ancestor_child_position( + __isl_keep isl_schedule_node *node, + __isl_keep isl_schedule_node *ancestor) +{ + int n1, n2; + isl_schedule_tree *tree; + + if (!node || !ancestor) + return -1; + + if (node->schedule != ancestor->schedule) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "not a descendant", return -1); + + n1 = isl_schedule_node_get_tree_depth(ancestor); + n2 = isl_schedule_node_get_tree_depth(node); + + if (n1 >= n2) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "not a descendant", return -1); + tree = isl_schedule_tree_list_get_schedule_tree(node->ancestors, n1); + isl_schedule_tree_free(tree); + if (tree != ancestor->tree) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "not a descendant", return -1); + + return node->child_pos[n1]; +} + +/* Given two nodes that point to the same schedule tree, return their + * closest shared ancestor. + * + * Since the two nodes point to the same schedule, they share at least + * one ancestor, the root of the schedule. We move down from the root + * to the first ancestor where the respective children have a different + * child position. This is the requested ancestor. + * If there is no ancestor where the children have a different position, + * then one node is an ancestor of the other and then this node is + * the requested ancestor. + */ +__isl_give isl_schedule_node *isl_schedule_node_get_shared_ancestor( + __isl_keep isl_schedule_node *node1, + __isl_keep isl_schedule_node *node2) +{ + int i, n1, n2; + + if (!node1 || !node2) + return NULL; + if (node1->schedule != node2->schedule) + isl_die(isl_schedule_node_get_ctx(node1), isl_error_invalid, + "not part of same schedule", return NULL); + n1 = isl_schedule_node_get_tree_depth(node1); + n2 = isl_schedule_node_get_tree_depth(node2); + if (n2 < n1) + return isl_schedule_node_get_shared_ancestor(node2, node1); + if (n1 == 0) + return isl_schedule_node_copy(node1); + if (isl_schedule_node_is_equal(node1, node2)) + return isl_schedule_node_copy(node1); + + for (i = 0; i < n1; ++i) + if (node1->child_pos[i] != node2->child_pos[i]) + break; + + node1 = isl_schedule_node_copy(node1); + return isl_schedule_node_ancestor(node1, n1 - i); +} + +/* Print "node" to "p". + */ +__isl_give isl_printer *isl_printer_print_schedule_node( + __isl_take isl_printer *p, __isl_keep isl_schedule_node *node) +{ + if (!node) + return isl_printer_free(p); + return isl_printer_print_schedule_tree_mark(p, node->schedule->root, + isl_schedule_tree_list_n_schedule_tree(node->ancestors), + node->child_pos); +} + +void isl_schedule_node_dump(__isl_keep isl_schedule_node *node) +{ + isl_ctx *ctx; + isl_printer *printer; + + if (!node) + return; + + ctx = isl_schedule_node_get_ctx(node); + printer = isl_printer_to_file(ctx, stderr); + printer = isl_printer_set_yaml_style(printer, ISL_YAML_STYLE_BLOCK); + printer = isl_printer_print_schedule_node(printer, node); + + isl_printer_free(printer); +} diff -Nru cloog-0.18.2/isl/isl_schedule_node_private.h cloog-0.18.4/isl/isl_schedule_node_private.h --- cloog-0.18.2/isl/isl_schedule_node_private.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_schedule_node_private.h 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,56 @@ +#ifndef ISL_SCHEDLUE_NODE_PRIVATE_H +#define ISL_SCHEDLUE_NODE_PRIVATE_H + +#include +#include + +/* An isl_schedule_node points to a particular location in a schedule tree. + * + * "schedule" is the schedule that the node is pointing to. + * "ancestors" is a list of the n ancestors of the node + * that is being pointed to. + * The first ancestor is the root of "schedule", while the last ancestor + * is the parent of the specified location. + * "child_pos" is an array of child positions of the same length as "ancestors", + * where ancestor i (i > 0) appears in child_pos[i - 1] of ancestor i - 1 and + * "tree" appears in child_pos[n - 1] of ancestor n - 1. + * "tree" is the subtree at the specified location. + * + * Note that the same isl_schedule_tree object may appear several times + * in a schedule tree and therefore does not uniquely identify a position + * in the schedule tree. + */ +struct isl_schedule_node { + int ref; + + isl_schedule *schedule; + isl_schedule_tree_list *ancestors; + int *child_pos; + isl_schedule_tree *tree; +}; + +__isl_give isl_schedule_node *isl_schedule_node_alloc( + __isl_take isl_schedule *schedule, __isl_take isl_schedule_tree *tree, + __isl_take isl_schedule_tree_list *ancestors, int *child_pos); +__isl_give isl_schedule_node *isl_schedule_node_graft_tree( + __isl_take isl_schedule_node *pos, __isl_take isl_schedule_tree *tree); + +__isl_give isl_schedule_tree *isl_schedule_node_get_tree( + __isl_keep isl_schedule_node *node); + +__isl_give isl_schedule_node *isl_schedule_node_pullback_union_pw_multi_aff( + __isl_take isl_schedule_node *node, + __isl_take isl_union_pw_multi_aff *upma); + +__isl_give isl_schedule_node *isl_schedule_node_domain_intersect_domain( + __isl_take isl_schedule_node *node, __isl_take isl_union_set *domain); + +__isl_give isl_schedule_node *isl_schedule_node_insert_expansion( + __isl_take isl_schedule_node *node, + __isl_take isl_union_pw_multi_aff *contraction, + __isl_take isl_union_map *expansion); +__isl_give isl_schedule_node *isl_schedule_node_insert_extension( + __isl_take isl_schedule_node *node, + __isl_take isl_union_map *extension); + +#endif diff -Nru cloog-0.18.2/isl/isl_schedule_private.h cloog-0.18.4/isl/isl_schedule_private.h --- cloog-0.18.2/isl/isl_schedule_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_schedule_private.h 2015-07-24 12:23:09.000000000 +0000 @@ -3,43 +3,39 @@ #include #include +#include -/* The schedule for an individual domain, plus information about the bands - * and scheduling dimensions. - * In particular, we keep track of the number of bands and for each - * band, the starting position of the next band. The first band starts at - * position 0. - * For each scheduling dimension, we keep track of whether it result - * in zero dependence distances (within its band) with respect - * to the proximity edges. - */ -struct isl_schedule_node { - isl_multi_aff *sched; - int n_band; - int *band_end; - int *band_id; - int *zero; -}; - -/* Information about the computed schedule. - * n is the number of nodes/domains/statements. - * n_band is the maximal number of bands. - * n_total_row is the number of coordinates of the schedule. - * dim contains a description of the parameters. +/* A complete schedule tree. + * * band_forest points to a band forest representation of the schedule * and may be NULL if the forest hasn't been created yet. + * + * "root" is the root of the schedule tree and may be NULL if we + * have created a band forest corresponding to the schedule. + * + * A pointer to "leaf" may be used to represent a leaf of the schedule. + * It should not appear as a child to any other isl_schedule_tree objects, + * but an isl_schedule_node may point to "leaf" if it refers to + * a leaf of this schedule tree. */ struct isl_schedule { int ref; - int n; - int n_band; - int n_total_row; - isl_space *dim; - isl_band_list *band_forest; + isl_schedule_tree *root; - struct isl_schedule_node node[1]; + struct isl_schedule_tree leaf; }; +__isl_give isl_schedule *isl_schedule_from_schedule_tree(isl_ctx *ctx, + __isl_take isl_schedule_tree *tree); +__isl_give isl_schedule *isl_schedule_set_root( + __isl_take isl_schedule *schedule, __isl_take isl_schedule_tree *tree); +__isl_give isl_space *isl_schedule_get_space( + __isl_keep isl_schedule *schedule); +__isl_give isl_union_set *isl_schedule_get_domain( + __isl_keep isl_schedule *schedule); +__isl_keep isl_schedule_tree *isl_schedule_peek_leaf( + __isl_keep isl_schedule *schedule); + #endif diff -Nru cloog-0.18.2/isl/isl_scheduler.c cloog-0.18.4/isl/isl_scheduler.c --- cloog-0.18.2/isl/isl_scheduler.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_scheduler.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,4364 @@ +/* + * Copyright 2011 INRIA Saclay + * Copyright 2012-2014 Ecole Normale Superieure + * Copyright 2015 Sven Verdoolaege + * + * Use of this software is governed by the MIT license + * + * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, + * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, + * 91893 Orsay, France + * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * The scheduling algorithm implemented in this file was inspired by + * Bondhugula et al., "Automatic Transformations for Communication-Minimized + * Parallelization and Locality Optimization in the Polyhedral Model". + */ + +enum isl_edge_type { + isl_edge_validity = 0, + isl_edge_first = isl_edge_validity, + isl_edge_coincidence, + isl_edge_condition, + isl_edge_conditional_validity, + isl_edge_proximity, + isl_edge_last = isl_edge_proximity +}; + +/* The constraints that need to be satisfied by a schedule on "domain". + * + * "context" specifies extra constraints on the parameters. + * + * "validity" constraints map domain elements i to domain elements + * that should be scheduled after i. (Hard constraint) + * "proximity" constraints map domain elements i to domains elements + * that should be scheduled as early as possible after i (or before i). + * (Soft constraint) + * + * "condition" and "conditional_validity" constraints map possibly "tagged" + * domain elements i -> s to "tagged" domain elements j -> t. + * The elements of the "conditional_validity" constraints, but without the + * tags (i.e., the elements i -> j) are treated as validity constraints, + * except that during the construction of a tilable band, + * the elements of the "conditional_validity" constraints may be violated + * provided that all adjacent elements of the "condition" constraints + * are local within the band. + * A dependence is local within a band if domain and range are mapped + * to the same schedule point by the band. + */ +struct isl_schedule_constraints { + isl_union_set *domain; + isl_set *context; + + isl_union_map *constraint[isl_edge_last + 1]; +}; + +__isl_give isl_schedule_constraints *isl_schedule_constraints_copy( + __isl_keep isl_schedule_constraints *sc) +{ + isl_ctx *ctx; + isl_schedule_constraints *sc_copy; + enum isl_edge_type i; + + ctx = isl_union_set_get_ctx(sc->domain); + sc_copy = isl_calloc_type(ctx, struct isl_schedule_constraints); + if (!sc_copy) + return NULL; + + sc_copy->domain = isl_union_set_copy(sc->domain); + sc_copy->context = isl_set_copy(sc->context); + if (!sc_copy->domain || !sc_copy->context) + return isl_schedule_constraints_free(sc_copy); + + for (i = isl_edge_first; i <= isl_edge_last; ++i) { + sc_copy->constraint[i] = isl_union_map_copy(sc->constraint[i]); + if (!sc_copy->constraint[i]) + return isl_schedule_constraints_free(sc_copy); + } + + return sc_copy; +} + + +/* Construct an isl_schedule_constraints object for computing a schedule + * on "domain". The initial object does not impose any constraints. + */ +__isl_give isl_schedule_constraints *isl_schedule_constraints_on_domain( + __isl_take isl_union_set *domain) +{ + isl_ctx *ctx; + isl_space *space; + isl_schedule_constraints *sc; + isl_union_map *empty; + enum isl_edge_type i; + + if (!domain) + return NULL; + + ctx = isl_union_set_get_ctx(domain); + sc = isl_calloc_type(ctx, struct isl_schedule_constraints); + if (!sc) + goto error; + + space = isl_union_set_get_space(domain); + sc->domain = domain; + sc->context = isl_set_universe(isl_space_copy(space)); + empty = isl_union_map_empty(space); + for (i = isl_edge_first; i <= isl_edge_last; ++i) { + sc->constraint[i] = isl_union_map_copy(empty); + if (!sc->constraint[i]) + sc->domain = isl_union_set_free(sc->domain); + } + isl_union_map_free(empty); + + if (!sc->domain || !sc->context) + return isl_schedule_constraints_free(sc); + + return sc; +error: + isl_union_set_free(domain); + return NULL; +} + +/* Replace the context of "sc" by "context". + */ +__isl_give isl_schedule_constraints *isl_schedule_constraints_set_context( + __isl_take isl_schedule_constraints *sc, __isl_take isl_set *context) +{ + if (!sc || !context) + goto error; + + isl_set_free(sc->context); + sc->context = context; + + return sc; +error: + isl_schedule_constraints_free(sc); + isl_set_free(context); + return NULL; +} + +/* Replace the validity constraints of "sc" by "validity". + */ +__isl_give isl_schedule_constraints *isl_schedule_constraints_set_validity( + __isl_take isl_schedule_constraints *sc, + __isl_take isl_union_map *validity) +{ + if (!sc || !validity) + goto error; + + isl_union_map_free(sc->constraint[isl_edge_validity]); + sc->constraint[isl_edge_validity] = validity; + + return sc; +error: + isl_schedule_constraints_free(sc); + isl_union_map_free(validity); + return NULL; +} + +/* Replace the coincidence constraints of "sc" by "coincidence". + */ +__isl_give isl_schedule_constraints *isl_schedule_constraints_set_coincidence( + __isl_take isl_schedule_constraints *sc, + __isl_take isl_union_map *coincidence) +{ + if (!sc || !coincidence) + goto error; + + isl_union_map_free(sc->constraint[isl_edge_coincidence]); + sc->constraint[isl_edge_coincidence] = coincidence; + + return sc; +error: + isl_schedule_constraints_free(sc); + isl_union_map_free(coincidence); + return NULL; +} + +/* Replace the proximity constraints of "sc" by "proximity". + */ +__isl_give isl_schedule_constraints *isl_schedule_constraints_set_proximity( + __isl_take isl_schedule_constraints *sc, + __isl_take isl_union_map *proximity) +{ + if (!sc || !proximity) + goto error; + + isl_union_map_free(sc->constraint[isl_edge_proximity]); + sc->constraint[isl_edge_proximity] = proximity; + + return sc; +error: + isl_schedule_constraints_free(sc); + isl_union_map_free(proximity); + return NULL; +} + +/* Replace the conditional validity constraints of "sc" by "condition" + * and "validity". + */ +__isl_give isl_schedule_constraints * +isl_schedule_constraints_set_conditional_validity( + __isl_take isl_schedule_constraints *sc, + __isl_take isl_union_map *condition, + __isl_take isl_union_map *validity) +{ + if (!sc || !condition || !validity) + goto error; + + isl_union_map_free(sc->constraint[isl_edge_condition]); + sc->constraint[isl_edge_condition] = condition; + isl_union_map_free(sc->constraint[isl_edge_conditional_validity]); + sc->constraint[isl_edge_conditional_validity] = validity; + + return sc; +error: + isl_schedule_constraints_free(sc); + isl_union_map_free(condition); + isl_union_map_free(validity); + return NULL; +} + +__isl_null isl_schedule_constraints *isl_schedule_constraints_free( + __isl_take isl_schedule_constraints *sc) +{ + enum isl_edge_type i; + + if (!sc) + return NULL; + + isl_union_set_free(sc->domain); + isl_set_free(sc->context); + for (i = isl_edge_first; i <= isl_edge_last; ++i) + isl_union_map_free(sc->constraint[i]); + + free(sc); + + return NULL; +} + +isl_ctx *isl_schedule_constraints_get_ctx( + __isl_keep isl_schedule_constraints *sc) +{ + return sc ? isl_union_set_get_ctx(sc->domain) : NULL; +} + +/* Return the validity constraints of "sc". + */ +__isl_give isl_union_map *isl_schedule_constraints_get_validity( + __isl_keep isl_schedule_constraints *sc) +{ + if (!sc) + return NULL; + + return isl_union_map_copy(sc->constraint[isl_edge_validity]); +} + +/* Return the coincidence constraints of "sc". + */ +__isl_give isl_union_map *isl_schedule_constraints_get_coincidence( + __isl_keep isl_schedule_constraints *sc) +{ + if (!sc) + return NULL; + + return isl_union_map_copy(sc->constraint[isl_edge_coincidence]); +} + +/* Return the conditional validity constraints of "sc". + */ +__isl_give isl_union_map *isl_schedule_constraints_get_conditional_validity( + __isl_keep isl_schedule_constraints *sc) +{ + if (!sc) + return NULL; + + return + isl_union_map_copy(sc->constraint[isl_edge_conditional_validity]); +} + +/* Return the conditions for the conditional validity constraints of "sc". + */ +__isl_give isl_union_map * +isl_schedule_constraints_get_conditional_validity_condition( + __isl_keep isl_schedule_constraints *sc) +{ + if (!sc) + return NULL; + + return isl_union_map_copy(sc->constraint[isl_edge_condition]); +} + +void isl_schedule_constraints_dump(__isl_keep isl_schedule_constraints *sc) +{ + if (!sc) + return; + + fprintf(stderr, "domain: "); + isl_union_set_dump(sc->domain); + fprintf(stderr, "context: "); + isl_set_dump(sc->context); + fprintf(stderr, "validity: "); + isl_union_map_dump(sc->constraint[isl_edge_validity]); + fprintf(stderr, "proximity: "); + isl_union_map_dump(sc->constraint[isl_edge_proximity]); + fprintf(stderr, "coincidence: "); + isl_union_map_dump(sc->constraint[isl_edge_coincidence]); + fprintf(stderr, "condition: "); + isl_union_map_dump(sc->constraint[isl_edge_condition]); + fprintf(stderr, "conditional_validity: "); + isl_union_map_dump(sc->constraint[isl_edge_conditional_validity]); +} + +/* Align the parameters of the fields of "sc". + */ +static __isl_give isl_schedule_constraints * +isl_schedule_constraints_align_params(__isl_take isl_schedule_constraints *sc) +{ + isl_space *space; + enum isl_edge_type i; + + if (!sc) + return NULL; + + space = isl_union_set_get_space(sc->domain); + space = isl_space_align_params(space, isl_set_get_space(sc->context)); + for (i = isl_edge_first; i <= isl_edge_last; ++i) + space = isl_space_align_params(space, + isl_union_map_get_space(sc->constraint[i])); + + for (i = isl_edge_first; i <= isl_edge_last; ++i) { + sc->constraint[i] = isl_union_map_align_params( + sc->constraint[i], isl_space_copy(space)); + if (!sc->constraint[i]) + space = isl_space_free(space); + } + sc->context = isl_set_align_params(sc->context, isl_space_copy(space)); + sc->domain = isl_union_set_align_params(sc->domain, space); + if (!sc->context || !sc->domain) + return isl_schedule_constraints_free(sc); + + return sc; +} + +/* Return the total number of isl_maps in the constraints of "sc". + */ +static __isl_give int isl_schedule_constraints_n_map( + __isl_keep isl_schedule_constraints *sc) +{ + enum isl_edge_type i; + int n = 0; + + for (i = isl_edge_first; i <= isl_edge_last; ++i) + n += isl_union_map_n_map(sc->constraint[i]); + + return n; +} + +/* Internal information about a node that is used during the construction + * of a schedule. + * space represents the space in which the domain lives + * sched is a matrix representation of the schedule being constructed + * for this node; if compressed is set, then this schedule is + * defined over the compressed domain space + * sched_map is an isl_map representation of the same (partial) schedule + * sched_map may be NULL; if compressed is set, then this map + * is defined over the uncompressed domain space + * rank is the number of linearly independent rows in the linear part + * of sched + * the columns of cmap represent a change of basis for the schedule + * coefficients; the first rank columns span the linear part of + * the schedule rows + * cinv is the inverse of cmap. + * start is the first variable in the LP problem in the sequences that + * represents the schedule coefficients of this node + * nvar is the dimension of the domain + * nparam is the number of parameters or 0 if we are not constructing + * a parametric schedule + * + * If compressed is set, then hull represents the constraints + * that were used to derive the compression, while compress and + * decompress map the original space to the compressed space and + * vice versa. + * + * scc is the index of SCC (or WCC) this node belongs to + * + * coincident contains a boolean for each of the rows of the schedule, + * indicating whether the corresponding scheduling dimension satisfies + * the coincidence constraints in the sense that the corresponding + * dependence distances are zero. + */ +struct isl_sched_node { + isl_space *space; + int compressed; + isl_set *hull; + isl_multi_aff *compress; + isl_multi_aff *decompress; + isl_mat *sched; + isl_map *sched_map; + int rank; + isl_mat *cmap; + isl_mat *cinv; + int start; + int nvar; + int nparam; + + int scc; + + int *coincident; +}; + +static int node_has_space(const void *entry, const void *val) +{ + struct isl_sched_node *node = (struct isl_sched_node *)entry; + isl_space *dim = (isl_space *)val; + + return isl_space_is_equal(node->space, dim); +} + +static int node_scc_exactly(struct isl_sched_node *node, int scc) +{ + return node->scc == scc; +} + +static int node_scc_at_most(struct isl_sched_node *node, int scc) +{ + return node->scc <= scc; +} + +static int node_scc_at_least(struct isl_sched_node *node, int scc) +{ + return node->scc >= scc; +} + +/* An edge in the dependence graph. An edge may be used to + * ensure validity of the generated schedule, to minimize the dependence + * distance or both + * + * map is the dependence relation, with i -> j in the map if j depends on i + * tagged_condition and tagged_validity contain the union of all tagged + * condition or conditional validity dependence relations that + * specialize the dependence relation "map"; that is, + * if (i -> a) -> (j -> b) is an element of "tagged_condition" + * or "tagged_validity", then i -> j is an element of "map". + * If these fields are NULL, then they represent the empty relation. + * src is the source node + * dst is the sink node + * validity is set if the edge is used to ensure correctness + * coincidence is used to enforce zero dependence distances + * proximity is set if the edge is used to minimize dependence distances + * condition is set if the edge represents a condition + * for a conditional validity schedule constraint + * local can only be set for condition edges and indicates that + * the dependence distance over the edge should be zero + * conditional_validity is set if the edge is used to conditionally + * ensure correctness + * + * For validity edges, start and end mark the sequence of inequality + * constraints in the LP problem that encode the validity constraint + * corresponding to this edge. + */ +struct isl_sched_edge { + isl_map *map; + isl_union_map *tagged_condition; + isl_union_map *tagged_validity; + + struct isl_sched_node *src; + struct isl_sched_node *dst; + + unsigned validity : 1; + unsigned coincidence : 1; + unsigned proximity : 1; + unsigned local : 1; + unsigned condition : 1; + unsigned conditional_validity : 1; + + int start; + int end; +}; + +/* Internal information about the dependence graph used during + * the construction of the schedule. + * + * intra_hmap is a cache, mapping dependence relations to their dual, + * for dependences from a node to itself + * inter_hmap is a cache, mapping dependence relations to their dual, + * for dependences between distinct nodes + * if compression is involved then the key for these maps + * it the original, uncompressed dependence relation, while + * the value is the dual of the compressed dependence relation. + * + * n is the number of nodes + * node is the list of nodes + * maxvar is the maximal number of variables over all nodes + * max_row is the allocated number of rows in the schedule + * n_row is the current (maximal) number of linearly independent + * rows in the node schedules + * n_total_row is the current number of rows in the node schedules + * band_start is the starting row in the node schedules of the current band + * root is set if this graph is the original dependence graph, + * without any splitting + * + * sorted contains a list of node indices sorted according to the + * SCC to which a node belongs + * + * n_edge is the number of edges + * edge is the list of edges + * max_edge contains the maximal number of edges of each type; + * in particular, it contains the number of edges in the inital graph. + * edge_table contains pointers into the edge array, hashed on the source + * and sink spaces; there is one such table for each type; + * a given edge may be referenced from more than one table + * if the corresponding relation appears in more than one of the + * sets of dependences + * + * node_table contains pointers into the node array, hashed on the space + * + * region contains a list of variable sequences that should be non-trivial + * + * lp contains the (I)LP problem used to obtain new schedule rows + * + * src_scc and dst_scc are the source and sink SCCs of an edge with + * conflicting constraints + * + * scc represents the number of components + * weak is set if the components are weakly connected + */ +struct isl_sched_graph { + isl_map_to_basic_set *intra_hmap; + isl_map_to_basic_set *inter_hmap; + + struct isl_sched_node *node; + int n; + int maxvar; + int max_row; + int n_row; + + int *sorted; + + int n_total_row; + int band_start; + + int root; + + struct isl_sched_edge *edge; + int n_edge; + int max_edge[isl_edge_last + 1]; + struct isl_hash_table *edge_table[isl_edge_last + 1]; + + struct isl_hash_table *node_table; + struct isl_region *region; + + isl_basic_set *lp; + + int src_scc; + int dst_scc; + + int scc; + int weak; +}; + +/* Initialize node_table based on the list of nodes. + */ +static int graph_init_table(isl_ctx *ctx, struct isl_sched_graph *graph) +{ + int i; + + graph->node_table = isl_hash_table_alloc(ctx, graph->n); + if (!graph->node_table) + return -1; + + for (i = 0; i < graph->n; ++i) { + struct isl_hash_table_entry *entry; + uint32_t hash; + + hash = isl_space_get_hash(graph->node[i].space); + entry = isl_hash_table_find(ctx, graph->node_table, hash, + &node_has_space, + graph->node[i].space, 1); + if (!entry) + return -1; + entry->data = &graph->node[i]; + } + + return 0; +} + +/* Return a pointer to the node that lives within the given space, + * or NULL if there is no such node. + */ +static struct isl_sched_node *graph_find_node(isl_ctx *ctx, + struct isl_sched_graph *graph, __isl_keep isl_space *dim) +{ + struct isl_hash_table_entry *entry; + uint32_t hash; + + hash = isl_space_get_hash(dim); + entry = isl_hash_table_find(ctx, graph->node_table, hash, + &node_has_space, dim, 0); + + return entry ? entry->data : NULL; +} + +static int edge_has_src_and_dst(const void *entry, const void *val) +{ + const struct isl_sched_edge *edge = entry; + const struct isl_sched_edge *temp = val; + + return edge->src == temp->src && edge->dst == temp->dst; +} + +/* Add the given edge to graph->edge_table[type]. + */ +static isl_stat graph_edge_table_add(isl_ctx *ctx, + struct isl_sched_graph *graph, enum isl_edge_type type, + struct isl_sched_edge *edge) +{ + struct isl_hash_table_entry *entry; + uint32_t hash; + + hash = isl_hash_init(); + hash = isl_hash_builtin(hash, edge->src); + hash = isl_hash_builtin(hash, edge->dst); + entry = isl_hash_table_find(ctx, graph->edge_table[type], hash, + &edge_has_src_and_dst, edge, 1); + if (!entry) + return isl_stat_error; + entry->data = edge; + + return isl_stat_ok; +} + +/* Allocate the edge_tables based on the maximal number of edges of + * each type. + */ +static int graph_init_edge_tables(isl_ctx *ctx, struct isl_sched_graph *graph) +{ + int i; + + for (i = 0; i <= isl_edge_last; ++i) { + graph->edge_table[i] = isl_hash_table_alloc(ctx, + graph->max_edge[i]); + if (!graph->edge_table[i]) + return -1; + } + + return 0; +} + +/* If graph->edge_table[type] contains an edge from the given source + * to the given destination, then return the hash table entry of this edge. + * Otherwise, return NULL. + */ +static struct isl_hash_table_entry *graph_find_edge_entry( + struct isl_sched_graph *graph, + enum isl_edge_type type, + struct isl_sched_node *src, struct isl_sched_node *dst) +{ + isl_ctx *ctx = isl_space_get_ctx(src->space); + uint32_t hash; + struct isl_sched_edge temp = { .src = src, .dst = dst }; + + hash = isl_hash_init(); + hash = isl_hash_builtin(hash, temp.src); + hash = isl_hash_builtin(hash, temp.dst); + return isl_hash_table_find(ctx, graph->edge_table[type], hash, + &edge_has_src_and_dst, &temp, 0); +} + + +/* If graph->edge_table[type] contains an edge from the given source + * to the given destination, then return this edge. + * Otherwise, return NULL. + */ +static struct isl_sched_edge *graph_find_edge(struct isl_sched_graph *graph, + enum isl_edge_type type, + struct isl_sched_node *src, struct isl_sched_node *dst) +{ + struct isl_hash_table_entry *entry; + + entry = graph_find_edge_entry(graph, type, src, dst); + if (!entry) + return NULL; + + return entry->data; +} + +/* Check whether the dependence graph has an edge of the given type + * between the given two nodes. + */ +static isl_bool graph_has_edge(struct isl_sched_graph *graph, + enum isl_edge_type type, + struct isl_sched_node *src, struct isl_sched_node *dst) +{ + struct isl_sched_edge *edge; + isl_bool empty; + + edge = graph_find_edge(graph, type, src, dst); + if (!edge) + return 0; + + empty = isl_map_plain_is_empty(edge->map); + if (empty < 0) + return isl_bool_error; + + return !empty; +} + +/* Look for any edge with the same src, dst and map fields as "model". + * + * Return the matching edge if one can be found. + * Return "model" if no matching edge is found. + * Return NULL on error. + */ +static struct isl_sched_edge *graph_find_matching_edge( + struct isl_sched_graph *graph, struct isl_sched_edge *model) +{ + enum isl_edge_type i; + struct isl_sched_edge *edge; + + for (i = isl_edge_first; i <= isl_edge_last; ++i) { + int is_equal; + + edge = graph_find_edge(graph, i, model->src, model->dst); + if (!edge) + continue; + is_equal = isl_map_plain_is_equal(model->map, edge->map); + if (is_equal < 0) + return NULL; + if (is_equal) + return edge; + } + + return model; +} + +/* Remove the given edge from all the edge_tables that refer to it. + */ +static void graph_remove_edge(struct isl_sched_graph *graph, + struct isl_sched_edge *edge) +{ + isl_ctx *ctx = isl_map_get_ctx(edge->map); + enum isl_edge_type i; + + for (i = isl_edge_first; i <= isl_edge_last; ++i) { + struct isl_hash_table_entry *entry; + + entry = graph_find_edge_entry(graph, i, edge->src, edge->dst); + if (!entry) + continue; + if (entry->data != edge) + continue; + isl_hash_table_remove(ctx, graph->edge_table[i], entry); + } +} + +/* Check whether the dependence graph has any edge + * between the given two nodes. + */ +static isl_bool graph_has_any_edge(struct isl_sched_graph *graph, + struct isl_sched_node *src, struct isl_sched_node *dst) +{ + enum isl_edge_type i; + isl_bool r; + + for (i = isl_edge_first; i <= isl_edge_last; ++i) { + r = graph_has_edge(graph, i, src, dst); + if (r < 0 || r) + return r; + } + + return r; +} + +/* Check whether the dependence graph has a validity edge + * between the given two nodes. + * + * Conditional validity edges are essentially validity edges that + * can be ignored if the corresponding condition edges are iteration private. + * Here, we are only checking for the presence of validity + * edges, so we need to consider the conditional validity edges too. + * In particular, this function is used during the detection + * of strongly connected components and we cannot ignore + * conditional validity edges during this detection. + */ +static isl_bool graph_has_validity_edge(struct isl_sched_graph *graph, + struct isl_sched_node *src, struct isl_sched_node *dst) +{ + isl_bool r; + + r = graph_has_edge(graph, isl_edge_validity, src, dst); + if (r < 0 || r) + return r; + + return graph_has_edge(graph, isl_edge_conditional_validity, src, dst); +} + +static int graph_alloc(isl_ctx *ctx, struct isl_sched_graph *graph, + int n_node, int n_edge) +{ + int i; + + graph->n = n_node; + graph->n_edge = n_edge; + graph->node = isl_calloc_array(ctx, struct isl_sched_node, graph->n); + graph->sorted = isl_calloc_array(ctx, int, graph->n); + graph->region = isl_alloc_array(ctx, struct isl_region, graph->n); + graph->edge = isl_calloc_array(ctx, + struct isl_sched_edge, graph->n_edge); + + graph->intra_hmap = isl_map_to_basic_set_alloc(ctx, 2 * n_edge); + graph->inter_hmap = isl_map_to_basic_set_alloc(ctx, 2 * n_edge); + + if (!graph->node || !graph->region || (graph->n_edge && !graph->edge) || + !graph->sorted) + return -1; + + for(i = 0; i < graph->n; ++i) + graph->sorted[i] = i; + + return 0; +} + +static void graph_free(isl_ctx *ctx, struct isl_sched_graph *graph) +{ + int i; + + isl_map_to_basic_set_free(graph->intra_hmap); + isl_map_to_basic_set_free(graph->inter_hmap); + + if (graph->node) + for (i = 0; i < graph->n; ++i) { + isl_space_free(graph->node[i].space); + isl_set_free(graph->node[i].hull); + isl_multi_aff_free(graph->node[i].compress); + isl_multi_aff_free(graph->node[i].decompress); + isl_mat_free(graph->node[i].sched); + isl_map_free(graph->node[i].sched_map); + isl_mat_free(graph->node[i].cmap); + isl_mat_free(graph->node[i].cinv); + if (graph->root) + free(graph->node[i].coincident); + } + free(graph->node); + free(graph->sorted); + if (graph->edge) + for (i = 0; i < graph->n_edge; ++i) { + isl_map_free(graph->edge[i].map); + isl_union_map_free(graph->edge[i].tagged_condition); + isl_union_map_free(graph->edge[i].tagged_validity); + } + free(graph->edge); + free(graph->region); + for (i = 0; i <= isl_edge_last; ++i) + isl_hash_table_free(ctx, graph->edge_table[i]); + isl_hash_table_free(ctx, graph->node_table); + isl_basic_set_free(graph->lp); +} + +/* For each "set" on which this function is called, increment + * graph->n by one and update graph->maxvar. + */ +static isl_stat init_n_maxvar(__isl_take isl_set *set, void *user) +{ + struct isl_sched_graph *graph = user; + int nvar = isl_set_dim(set, isl_dim_set); + + graph->n++; + if (nvar > graph->maxvar) + graph->maxvar = nvar; + + isl_set_free(set); + + return isl_stat_ok; +} + +/* Add the number of basic maps in "map" to *n. + */ +static isl_stat add_n_basic_map(__isl_take isl_map *map, void *user) +{ + int *n = user; + + *n += isl_map_n_basic_map(map); + isl_map_free(map); + + return isl_stat_ok; +} + +/* Compute the number of rows that should be allocated for the schedule. + * In particular, we need one row for each variable or one row + * for each basic map in the dependences. + * Note that it is practically impossible to exhaust both + * the number of dependences and the number of variables. + */ +static int compute_max_row(struct isl_sched_graph *graph, + __isl_keep isl_schedule_constraints *sc) +{ + enum isl_edge_type i; + int n_edge; + + graph->n = 0; + graph->maxvar = 0; + if (isl_union_set_foreach_set(sc->domain, &init_n_maxvar, graph) < 0) + return -1; + n_edge = 0; + for (i = isl_edge_first; i <= isl_edge_last; ++i) + if (isl_union_map_foreach_map(sc->constraint[i], + &add_n_basic_map, &n_edge) < 0) + return -1; + graph->max_row = n_edge + graph->maxvar; + + return 0; +} + +/* Does "bset" have any defining equalities for its set variables? + */ +static int has_any_defining_equality(__isl_keep isl_basic_set *bset) +{ + int i, n; + + if (!bset) + return -1; + + n = isl_basic_set_dim(bset, isl_dim_set); + for (i = 0; i < n; ++i) { + int has; + + has = isl_basic_set_has_defining_equality(bset, isl_dim_set, i, + NULL); + if (has < 0 || has) + return has; + } + + return 0; +} + +/* Add a new node to the graph representing the given space. + * "nvar" is the (possibly compressed) number of variables and + * may be smaller than then number of set variables in "space" + * if "compressed" is set. + * If "compressed" is set, then "hull" represents the constraints + * that were used to derive the compression, while "compress" and + * "decompress" map the original space to the compressed space and + * vice versa. + * If "compressed" is not set, then "hull", "compress" and "decompress" + * should be NULL. + */ +static isl_stat add_node(struct isl_sched_graph *graph, + __isl_take isl_space *space, int nvar, int compressed, + __isl_take isl_set *hull, __isl_take isl_multi_aff *compress, + __isl_take isl_multi_aff *decompress) +{ + int nparam; + isl_ctx *ctx; + isl_mat *sched; + int *coincident; + + if (!space) + return isl_stat_error; + + ctx = isl_space_get_ctx(space); + nparam = isl_space_dim(space, isl_dim_param); + if (!ctx->opt->schedule_parametric) + nparam = 0; + sched = isl_mat_alloc(ctx, 0, 1 + nparam + nvar); + graph->node[graph->n].space = space; + graph->node[graph->n].nvar = nvar; + graph->node[graph->n].nparam = nparam; + graph->node[graph->n].sched = sched; + graph->node[graph->n].sched_map = NULL; + coincident = isl_calloc_array(ctx, int, graph->max_row); + graph->node[graph->n].coincident = coincident; + graph->node[graph->n].compressed = compressed; + graph->node[graph->n].hull = hull; + graph->node[graph->n].compress = compress; + graph->node[graph->n].decompress = decompress; + graph->n++; + + if (!space || !sched || (graph->max_row && !coincident)) + return isl_stat_error; + if (compressed && (!hull || !compress || !decompress)) + return isl_stat_error; + + return isl_stat_ok; +} + +/* Add a new node to the graph representing the given set. + * + * If any of the set variables is defined by an equality, then + * we perform variable compression such that we can perform + * the scheduling on the compressed domain. + */ +static isl_stat extract_node(__isl_take isl_set *set, void *user) +{ + int nvar; + int has_equality; + isl_space *space; + isl_basic_set *hull; + isl_set *hull_set; + isl_morph *morph; + isl_multi_aff *compress, *decompress; + struct isl_sched_graph *graph = user; + + space = isl_set_get_space(set); + hull = isl_set_affine_hull(set); + hull = isl_basic_set_remove_divs(hull); + nvar = isl_space_dim(space, isl_dim_set); + has_equality = has_any_defining_equality(hull); + + if (has_equality < 0) + goto error; + if (!has_equality) { + isl_basic_set_free(hull); + return add_node(graph, space, nvar, 0, NULL, NULL, NULL); + } + + morph = isl_basic_set_variable_compression(hull, isl_dim_set); + nvar = isl_morph_ran_dim(morph, isl_dim_set); + compress = isl_morph_get_var_multi_aff(morph); + morph = isl_morph_inverse(morph); + decompress = isl_morph_get_var_multi_aff(morph); + isl_morph_free(morph); + + hull_set = isl_set_from_basic_set(hull); + return add_node(graph, space, nvar, 1, hull_set, compress, decompress); +error: + isl_basic_set_free(hull); + isl_space_free(space); + return isl_stat_error; +} + +struct isl_extract_edge_data { + enum isl_edge_type type; + struct isl_sched_graph *graph; +}; + +/* Merge edge2 into edge1, freeing the contents of edge2. + * "type" is the type of the schedule constraint from which edge2 was + * extracted. + * Return 0 on success and -1 on failure. + * + * edge1 and edge2 are assumed to have the same value for the map field. + */ +static int merge_edge(enum isl_edge_type type, struct isl_sched_edge *edge1, + struct isl_sched_edge *edge2) +{ + edge1->validity |= edge2->validity; + edge1->coincidence |= edge2->coincidence; + edge1->proximity |= edge2->proximity; + edge1->condition |= edge2->condition; + edge1->conditional_validity |= edge2->conditional_validity; + isl_map_free(edge2->map); + + if (type == isl_edge_condition) { + if (!edge1->tagged_condition) + edge1->tagged_condition = edge2->tagged_condition; + else + edge1->tagged_condition = + isl_union_map_union(edge1->tagged_condition, + edge2->tagged_condition); + } + + if (type == isl_edge_conditional_validity) { + if (!edge1->tagged_validity) + edge1->tagged_validity = edge2->tagged_validity; + else + edge1->tagged_validity = + isl_union_map_union(edge1->tagged_validity, + edge2->tagged_validity); + } + + if (type == isl_edge_condition && !edge1->tagged_condition) + return -1; + if (type == isl_edge_conditional_validity && !edge1->tagged_validity) + return -1; + + return 0; +} + +/* Insert dummy tags in domain and range of "map". + * + * In particular, if "map" is of the form + * + * A -> B + * + * then return + * + * [A -> dummy_tag] -> [B -> dummy_tag] + * + * where the dummy_tags are identical and equal to any dummy tags + * introduced by any other call to this function. + */ +static __isl_give isl_map *insert_dummy_tags(__isl_take isl_map *map) +{ + static char dummy; + isl_ctx *ctx; + isl_id *id; + isl_space *space; + isl_set *domain, *range; + + ctx = isl_map_get_ctx(map); + + id = isl_id_alloc(ctx, NULL, &dummy); + space = isl_space_params(isl_map_get_space(map)); + space = isl_space_set_from_params(space); + space = isl_space_set_tuple_id(space, isl_dim_set, id); + space = isl_space_map_from_set(space); + + domain = isl_map_wrap(map); + range = isl_map_wrap(isl_map_universe(space)); + map = isl_map_from_domain_and_range(domain, range); + map = isl_map_zip(map); + + return map; +} + +/* Given that at least one of "src" or "dst" is compressed, return + * a map between the spaces of these nodes restricted to the affine + * hull that was used in the compression. + */ +static __isl_give isl_map *extract_hull(struct isl_sched_node *src, + struct isl_sched_node *dst) +{ + isl_set *dom, *ran; + + if (src->compressed) + dom = isl_set_copy(src->hull); + else + dom = isl_set_universe(isl_space_copy(src->space)); + if (dst->compressed) + ran = isl_set_copy(dst->hull); + else + ran = isl_set_universe(isl_space_copy(dst->space)); + + return isl_map_from_domain_and_range(dom, ran); +} + +/* Intersect the domains of the nested relations in domain and range + * of "tagged" with "map". + */ +static __isl_give isl_map *map_intersect_domains(__isl_take isl_map *tagged, + __isl_keep isl_map *map) +{ + isl_set *set; + + tagged = isl_map_zip(tagged); + set = isl_map_wrap(isl_map_copy(map)); + tagged = isl_map_intersect_domain(tagged, set); + tagged = isl_map_zip(tagged); + return tagged; +} + +/* Add a new edge to the graph based on the given map + * and add it to data->graph->edge_table[data->type]. + * If a dependence relation of a given type happens to be identical + * to one of the dependence relations of a type that was added before, + * then we don't create a new edge, but instead mark the original edge + * as also representing a dependence of the current type. + * + * Edges of type isl_edge_condition or isl_edge_conditional_validity + * may be specified as "tagged" dependence relations. That is, "map" + * may contain elements (i -> a) -> (j -> b), where i -> j denotes + * the dependence on iterations and a and b are tags. + * edge->map is set to the relation containing the elements i -> j, + * while edge->tagged_condition and edge->tagged_validity contain + * the union of all the "map" relations + * for which extract_edge is called that result in the same edge->map. + * + * If the source or the destination node is compressed, then + * intersect both "map" and "tagged" with the constraints that + * were used to construct the compression. + * This ensures that there are no schedule constraints defined + * outside of these domains, while the scheduler no longer has + * any control over those outside parts. + */ +static isl_stat extract_edge(__isl_take isl_map *map, void *user) +{ + isl_ctx *ctx = isl_map_get_ctx(map); + struct isl_extract_edge_data *data = user; + struct isl_sched_graph *graph = data->graph; + struct isl_sched_node *src, *dst; + isl_space *dim; + struct isl_sched_edge *edge; + isl_map *tagged = NULL; + + if (data->type == isl_edge_condition || + data->type == isl_edge_conditional_validity) { + if (isl_map_can_zip(map)) { + tagged = isl_map_copy(map); + map = isl_set_unwrap(isl_map_domain(isl_map_zip(map))); + } else { + tagged = insert_dummy_tags(isl_map_copy(map)); + } + } + + dim = isl_space_domain(isl_map_get_space(map)); + src = graph_find_node(ctx, graph, dim); + isl_space_free(dim); + dim = isl_space_range(isl_map_get_space(map)); + dst = graph_find_node(ctx, graph, dim); + isl_space_free(dim); + + if (!src || !dst) { + isl_map_free(map); + isl_map_free(tagged); + return isl_stat_ok; + } + + if (src->compressed || dst->compressed) { + isl_map *hull; + hull = extract_hull(src, dst); + if (tagged) + tagged = map_intersect_domains(tagged, hull); + map = isl_map_intersect(map, hull); + } + + graph->edge[graph->n_edge].src = src; + graph->edge[graph->n_edge].dst = dst; + graph->edge[graph->n_edge].map = map; + graph->edge[graph->n_edge].validity = 0; + graph->edge[graph->n_edge].coincidence = 0; + graph->edge[graph->n_edge].proximity = 0; + graph->edge[graph->n_edge].condition = 0; + graph->edge[graph->n_edge].local = 0; + graph->edge[graph->n_edge].conditional_validity = 0; + graph->edge[graph->n_edge].tagged_condition = NULL; + graph->edge[graph->n_edge].tagged_validity = NULL; + if (data->type == isl_edge_validity) + graph->edge[graph->n_edge].validity = 1; + if (data->type == isl_edge_coincidence) + graph->edge[graph->n_edge].coincidence = 1; + if (data->type == isl_edge_proximity) + graph->edge[graph->n_edge].proximity = 1; + if (data->type == isl_edge_condition) { + graph->edge[graph->n_edge].condition = 1; + graph->edge[graph->n_edge].tagged_condition = + isl_union_map_from_map(tagged); + } + if (data->type == isl_edge_conditional_validity) { + graph->edge[graph->n_edge].conditional_validity = 1; + graph->edge[graph->n_edge].tagged_validity = + isl_union_map_from_map(tagged); + } + + edge = graph_find_matching_edge(graph, &graph->edge[graph->n_edge]); + if (!edge) { + graph->n_edge++; + return isl_stat_error; + } + if (edge == &graph->edge[graph->n_edge]) + return graph_edge_table_add(ctx, graph, data->type, + &graph->edge[graph->n_edge++]); + + if (merge_edge(data->type, edge, &graph->edge[graph->n_edge]) < 0) + return -1; + + return graph_edge_table_add(ctx, graph, data->type, edge); +} + +/* Check whether there is any dependence from node[j] to node[i] + * or from node[i] to node[j]. + */ +static isl_bool node_follows_weak(int i, int j, void *user) +{ + isl_bool f; + struct isl_sched_graph *graph = user; + + f = graph_has_any_edge(graph, &graph->node[j], &graph->node[i]); + if (f < 0 || f) + return f; + return graph_has_any_edge(graph, &graph->node[i], &graph->node[j]); +} + +/* Check whether there is a (conditional) validity dependence from node[j] + * to node[i], forcing node[i] to follow node[j]. + */ +static isl_bool node_follows_strong(int i, int j, void *user) +{ + struct isl_sched_graph *graph = user; + + return graph_has_validity_edge(graph, &graph->node[j], &graph->node[i]); +} + +/* Use Tarjan's algorithm for computing the strongly connected components + * in the dependence graph (only validity edges). + * If weak is set, we consider the graph to be undirected and + * we effectively compute the (weakly) connected components. + * Additionally, we also consider other edges when weak is set. + */ +static int detect_ccs(isl_ctx *ctx, struct isl_sched_graph *graph, int weak) +{ + int i, n; + struct isl_tarjan_graph *g = NULL; + + g = isl_tarjan_graph_init(ctx, graph->n, + weak ? &node_follows_weak : &node_follows_strong, graph); + if (!g) + return -1; + + graph->weak = weak; + graph->scc = 0; + i = 0; + n = graph->n; + while (n) { + while (g->order[i] != -1) { + graph->node[g->order[i]].scc = graph->scc; + --n; + ++i; + } + ++i; + graph->scc++; + } + + isl_tarjan_graph_free(g); + + return 0; +} + +/* Apply Tarjan's algorithm to detect the strongly connected components + * in the dependence graph. + */ +static int detect_sccs(isl_ctx *ctx, struct isl_sched_graph *graph) +{ + return detect_ccs(ctx, graph, 0); +} + +/* Apply Tarjan's algorithm to detect the (weakly) connected components + * in the dependence graph. + */ +static int detect_wccs(isl_ctx *ctx, struct isl_sched_graph *graph) +{ + return detect_ccs(ctx, graph, 1); +} + +static int cmp_scc(const void *a, const void *b, void *data) +{ + struct isl_sched_graph *graph = data; + const int *i1 = a; + const int *i2 = b; + + return graph->node[*i1].scc - graph->node[*i2].scc; +} + +/* Sort the elements of graph->sorted according to the corresponding SCCs. + */ +static int sort_sccs(struct isl_sched_graph *graph) +{ + return isl_sort(graph->sorted, graph->n, sizeof(int), &cmp_scc, graph); +} + +/* Given a dependence relation R from "node" to itself, + * construct the set of coefficients of valid constraints for elements + * in that dependence relation. + * In particular, the result contains tuples of coefficients + * c_0, c_n, c_x such that + * + * c_0 + c_n n + c_x y - c_x x >= 0 for each (x,y) in R + * + * or, equivalently, + * + * c_0 + c_n n + c_x d >= 0 for each d in delta R = { y - x | (x,y) in R } + * + * We choose here to compute the dual of delta R. + * Alternatively, we could have computed the dual of R, resulting + * in a set of tuples c_0, c_n, c_x, c_y, and then + * plugged in (c_0, c_n, c_x, -c_x). + * + * If "node" has been compressed, then the dependence relation + * is also compressed before the set of coefficients is computed. + */ +static __isl_give isl_basic_set *intra_coefficients( + struct isl_sched_graph *graph, struct isl_sched_node *node, + __isl_take isl_map *map) +{ + isl_set *delta; + isl_map *key; + isl_basic_set *coef; + + if (isl_map_to_basic_set_has(graph->intra_hmap, map)) + return isl_map_to_basic_set_get(graph->intra_hmap, map); + + key = isl_map_copy(map); + if (node->compressed) { + map = isl_map_preimage_domain_multi_aff(map, + isl_multi_aff_copy(node->decompress)); + map = isl_map_preimage_range_multi_aff(map, + isl_multi_aff_copy(node->decompress)); + } + delta = isl_set_remove_divs(isl_map_deltas(map)); + coef = isl_set_coefficients(delta); + graph->intra_hmap = isl_map_to_basic_set_set(graph->intra_hmap, key, + isl_basic_set_copy(coef)); + + return coef; +} + +/* Given a dependence relation R, construct the set of coefficients + * of valid constraints for elements in that dependence relation. + * In particular, the result contains tuples of coefficients + * c_0, c_n, c_x, c_y such that + * + * c_0 + c_n n + c_x x + c_y y >= 0 for each (x,y) in R + * + * If the source or destination nodes of "edge" have been compressed, + * then the dependence relation is also compressed before + * the set of coefficients is computed. + */ +static __isl_give isl_basic_set *inter_coefficients( + struct isl_sched_graph *graph, struct isl_sched_edge *edge, + __isl_take isl_map *map) +{ + isl_set *set; + isl_map *key; + isl_basic_set *coef; + + if (isl_map_to_basic_set_has(graph->inter_hmap, map)) + return isl_map_to_basic_set_get(graph->inter_hmap, map); + + key = isl_map_copy(map); + if (edge->src->compressed) + map = isl_map_preimage_domain_multi_aff(map, + isl_multi_aff_copy(edge->src->decompress)); + if (edge->dst->compressed) + map = isl_map_preimage_range_multi_aff(map, + isl_multi_aff_copy(edge->dst->decompress)); + set = isl_map_wrap(isl_map_remove_divs(map)); + coef = isl_set_coefficients(set); + graph->inter_hmap = isl_map_to_basic_set_set(graph->inter_hmap, key, + isl_basic_set_copy(coef)); + + return coef; +} + +/* Add constraints to graph->lp that force validity for the given + * dependence from a node i to itself. + * That is, add constraints that enforce + * + * (c_i_0 + c_i_n n + c_i_x y) - (c_i_0 + c_i_n n + c_i_x x) + * = c_i_x (y - x) >= 0 + * + * for each (x,y) in R. + * We obtain general constraints on coefficients (c_0, c_n, c_x) + * of valid constraints for (y - x) and then plug in (0, 0, c_i_x^+ - c_i_x^-), + * where c_i_x = c_i_x^+ - c_i_x^-, with c_i_x^+ and c_i_x^- non-negative. + * In graph->lp, the c_i_x^- appear before their c_i_x^+ counterpart. + * + * Actually, we do not construct constraints for the c_i_x themselves, + * but for the coefficients of c_i_x written as a linear combination + * of the columns in node->cmap. + */ +static int add_intra_validity_constraints(struct isl_sched_graph *graph, + struct isl_sched_edge *edge) +{ + unsigned total; + isl_map *map = isl_map_copy(edge->map); + isl_ctx *ctx = isl_map_get_ctx(map); + isl_space *dim; + isl_dim_map *dim_map; + isl_basic_set *coef; + struct isl_sched_node *node = edge->src; + + coef = intra_coefficients(graph, node, map); + + dim = isl_space_domain(isl_space_unwrap(isl_basic_set_get_space(coef))); + + coef = isl_basic_set_transform_dims(coef, isl_dim_set, + isl_space_dim(dim, isl_dim_set), isl_mat_copy(node->cmap)); + if (!coef) + goto error; + + total = isl_basic_set_total_dim(graph->lp); + dim_map = isl_dim_map_alloc(ctx, total); + isl_dim_map_range(dim_map, node->start + 2 * node->nparam + 1, 2, + isl_space_dim(dim, isl_dim_set), 1, + node->nvar, -1); + isl_dim_map_range(dim_map, node->start + 2 * node->nparam + 2, 2, + isl_space_dim(dim, isl_dim_set), 1, + node->nvar, 1); + graph->lp = isl_basic_set_extend_constraints(graph->lp, + coef->n_eq, coef->n_ineq); + graph->lp = isl_basic_set_add_constraints_dim_map(graph->lp, + coef, dim_map); + isl_space_free(dim); + + return 0; +error: + isl_space_free(dim); + return -1; +} + +/* Add constraints to graph->lp that force validity for the given + * dependence from node i to node j. + * That is, add constraints that enforce + * + * (c_j_0 + c_j_n n + c_j_x y) - (c_i_0 + c_i_n n + c_i_x x) >= 0 + * + * for each (x,y) in R. + * We obtain general constraints on coefficients (c_0, c_n, c_x, c_y) + * of valid constraints for R and then plug in + * (c_j_0 - c_i_0, c_j_n^+ - c_j_n^- - (c_i_n^+ - c_i_n^-), + * c_j_x^+ - c_j_x^- - (c_i_x^+ - c_i_x^-)), + * where c_* = c_*^+ - c_*^-, with c_*^+ and c_*^- non-negative. + * In graph->lp, the c_*^- appear before their c_*^+ counterpart. + * + * Actually, we do not construct constraints for the c_*_x themselves, + * but for the coefficients of c_*_x written as a linear combination + * of the columns in node->cmap. + */ +static int add_inter_validity_constraints(struct isl_sched_graph *graph, + struct isl_sched_edge *edge) +{ + unsigned total; + isl_map *map = isl_map_copy(edge->map); + isl_ctx *ctx = isl_map_get_ctx(map); + isl_space *dim; + isl_dim_map *dim_map; + isl_basic_set *coef; + struct isl_sched_node *src = edge->src; + struct isl_sched_node *dst = edge->dst; + + coef = inter_coefficients(graph, edge, map); + + dim = isl_space_domain(isl_space_unwrap(isl_basic_set_get_space(coef))); + + coef = isl_basic_set_transform_dims(coef, isl_dim_set, + isl_space_dim(dim, isl_dim_set), isl_mat_copy(src->cmap)); + coef = isl_basic_set_transform_dims(coef, isl_dim_set, + isl_space_dim(dim, isl_dim_set) + src->nvar, + isl_mat_copy(dst->cmap)); + if (!coef) + goto error; + + total = isl_basic_set_total_dim(graph->lp); + dim_map = isl_dim_map_alloc(ctx, total); + + isl_dim_map_range(dim_map, dst->start, 0, 0, 0, 1, 1); + isl_dim_map_range(dim_map, dst->start + 1, 2, 1, 1, dst->nparam, -1); + isl_dim_map_range(dim_map, dst->start + 2, 2, 1, 1, dst->nparam, 1); + isl_dim_map_range(dim_map, dst->start + 2 * dst->nparam + 1, 2, + isl_space_dim(dim, isl_dim_set) + src->nvar, 1, + dst->nvar, -1); + isl_dim_map_range(dim_map, dst->start + 2 * dst->nparam + 2, 2, + isl_space_dim(dim, isl_dim_set) + src->nvar, 1, + dst->nvar, 1); + + isl_dim_map_range(dim_map, src->start, 0, 0, 0, 1, -1); + isl_dim_map_range(dim_map, src->start + 1, 2, 1, 1, src->nparam, 1); + isl_dim_map_range(dim_map, src->start + 2, 2, 1, 1, src->nparam, -1); + isl_dim_map_range(dim_map, src->start + 2 * src->nparam + 1, 2, + isl_space_dim(dim, isl_dim_set), 1, + src->nvar, 1); + isl_dim_map_range(dim_map, src->start + 2 * src->nparam + 2, 2, + isl_space_dim(dim, isl_dim_set), 1, + src->nvar, -1); + + edge->start = graph->lp->n_ineq; + graph->lp = isl_basic_set_extend_constraints(graph->lp, + coef->n_eq, coef->n_ineq); + graph->lp = isl_basic_set_add_constraints_dim_map(graph->lp, + coef, dim_map); + if (!graph->lp) + goto error; + isl_space_free(dim); + edge->end = graph->lp->n_ineq; + + return 0; +error: + isl_space_free(dim); + return -1; +} + +/* Add constraints to graph->lp that bound the dependence distance for the given + * dependence from a node i to itself. + * If s = 1, we add the constraint + * + * c_i_x (y - x) <= m_0 + m_n n + * + * or + * + * -c_i_x (y - x) + m_0 + m_n n >= 0 + * + * for each (x,y) in R. + * If s = -1, we add the constraint + * + * -c_i_x (y - x) <= m_0 + m_n n + * + * or + * + * c_i_x (y - x) + m_0 + m_n n >= 0 + * + * for each (x,y) in R. + * We obtain general constraints on coefficients (c_0, c_n, c_x) + * of valid constraints for (y - x) and then plug in (m_0, m_n, -s * c_i_x), + * with each coefficient (except m_0) represented as a pair of non-negative + * coefficients. + * + * Actually, we do not construct constraints for the c_i_x themselves, + * but for the coefficients of c_i_x written as a linear combination + * of the columns in node->cmap. + * + * + * If "local" is set, then we add constraints + * + * c_i_x (y - x) <= 0 + * + * or + * + * -c_i_x (y - x) <= 0 + * + * instead, forcing the dependence distance to be (less than or) equal to 0. + * That is, we plug in (0, 0, -s * c_i_x), + * Note that dependences marked local are treated as validity constraints + * by add_all_validity_constraints and therefore also have + * their distances bounded by 0 from below. + */ +static int add_intra_proximity_constraints(struct isl_sched_graph *graph, + struct isl_sched_edge *edge, int s, int local) +{ + unsigned total; + unsigned nparam; + isl_map *map = isl_map_copy(edge->map); + isl_ctx *ctx = isl_map_get_ctx(map); + isl_space *dim; + isl_dim_map *dim_map; + isl_basic_set *coef; + struct isl_sched_node *node = edge->src; + + coef = intra_coefficients(graph, node, map); + + dim = isl_space_domain(isl_space_unwrap(isl_basic_set_get_space(coef))); + + coef = isl_basic_set_transform_dims(coef, isl_dim_set, + isl_space_dim(dim, isl_dim_set), isl_mat_copy(node->cmap)); + if (!coef) + goto error; + + nparam = isl_space_dim(node->space, isl_dim_param); + total = isl_basic_set_total_dim(graph->lp); + dim_map = isl_dim_map_alloc(ctx, total); + + if (!local) { + isl_dim_map_range(dim_map, 1, 0, 0, 0, 1, 1); + isl_dim_map_range(dim_map, 4, 2, 1, 1, nparam, -1); + isl_dim_map_range(dim_map, 5, 2, 1, 1, nparam, 1); + } + isl_dim_map_range(dim_map, node->start + 2 * node->nparam + 1, 2, + isl_space_dim(dim, isl_dim_set), 1, + node->nvar, s); + isl_dim_map_range(dim_map, node->start + 2 * node->nparam + 2, 2, + isl_space_dim(dim, isl_dim_set), 1, + node->nvar, -s); + graph->lp = isl_basic_set_extend_constraints(graph->lp, + coef->n_eq, coef->n_ineq); + graph->lp = isl_basic_set_add_constraints_dim_map(graph->lp, + coef, dim_map); + isl_space_free(dim); + + return 0; +error: + isl_space_free(dim); + return -1; +} + +/* Add constraints to graph->lp that bound the dependence distance for the given + * dependence from node i to node j. + * If s = 1, we add the constraint + * + * (c_j_0 + c_j_n n + c_j_x y) - (c_i_0 + c_i_n n + c_i_x x) + * <= m_0 + m_n n + * + * or + * + * -(c_j_0 + c_j_n n + c_j_x y) + (c_i_0 + c_i_n n + c_i_x x) + + * m_0 + m_n n >= 0 + * + * for each (x,y) in R. + * If s = -1, we add the constraint + * + * -((c_j_0 + c_j_n n + c_j_x y) - (c_i_0 + c_i_n n + c_i_x x)) + * <= m_0 + m_n n + * + * or + * + * (c_j_0 + c_j_n n + c_j_x y) - (c_i_0 + c_i_n n + c_i_x x) + + * m_0 + m_n n >= 0 + * + * for each (x,y) in R. + * We obtain general constraints on coefficients (c_0, c_n, c_x, c_y) + * of valid constraints for R and then plug in + * (m_0 - s*c_j_0 + s*c_i_0, m_n - s*c_j_n + s*c_i_n, + * -s*c_j_x+s*c_i_x) + * with each coefficient (except m_0, c_j_0 and c_i_0) + * represented as a pair of non-negative coefficients. + * + * Actually, we do not construct constraints for the c_*_x themselves, + * but for the coefficients of c_*_x written as a linear combination + * of the columns in node->cmap. + * + * + * If "local" is set, then we add constraints + * + * (c_j_0 + c_j_n n + c_j_x y) - (c_i_0 + c_i_n n + c_i_x x) <= 0 + * + * or + * + * -((c_j_0 + c_j_n n + c_j_x y) - (c_i_0 + c_i_n n + c_i_x x)) <= 0 + * + * instead, forcing the dependence distance to be (less than or) equal to 0. + * That is, we plug in + * (-s*c_j_0 + s*c_i_0, -s*c_j_n + s*c_i_n, -s*c_j_x+s*c_i_x). + * Note that dependences marked local are treated as validity constraints + * by add_all_validity_constraints and therefore also have + * their distances bounded by 0 from below. + */ +static int add_inter_proximity_constraints(struct isl_sched_graph *graph, + struct isl_sched_edge *edge, int s, int local) +{ + unsigned total; + unsigned nparam; + isl_map *map = isl_map_copy(edge->map); + isl_ctx *ctx = isl_map_get_ctx(map); + isl_space *dim; + isl_dim_map *dim_map; + isl_basic_set *coef; + struct isl_sched_node *src = edge->src; + struct isl_sched_node *dst = edge->dst; + + coef = inter_coefficients(graph, edge, map); + + dim = isl_space_domain(isl_space_unwrap(isl_basic_set_get_space(coef))); + + coef = isl_basic_set_transform_dims(coef, isl_dim_set, + isl_space_dim(dim, isl_dim_set), isl_mat_copy(src->cmap)); + coef = isl_basic_set_transform_dims(coef, isl_dim_set, + isl_space_dim(dim, isl_dim_set) + src->nvar, + isl_mat_copy(dst->cmap)); + if (!coef) + goto error; + + nparam = isl_space_dim(src->space, isl_dim_param); + total = isl_basic_set_total_dim(graph->lp); + dim_map = isl_dim_map_alloc(ctx, total); + + if (!local) { + isl_dim_map_range(dim_map, 1, 0, 0, 0, 1, 1); + isl_dim_map_range(dim_map, 4, 2, 1, 1, nparam, -1); + isl_dim_map_range(dim_map, 5, 2, 1, 1, nparam, 1); + } + + isl_dim_map_range(dim_map, dst->start, 0, 0, 0, 1, -s); + isl_dim_map_range(dim_map, dst->start + 1, 2, 1, 1, dst->nparam, s); + isl_dim_map_range(dim_map, dst->start + 2, 2, 1, 1, dst->nparam, -s); + isl_dim_map_range(dim_map, dst->start + 2 * dst->nparam + 1, 2, + isl_space_dim(dim, isl_dim_set) + src->nvar, 1, + dst->nvar, s); + isl_dim_map_range(dim_map, dst->start + 2 * dst->nparam + 2, 2, + isl_space_dim(dim, isl_dim_set) + src->nvar, 1, + dst->nvar, -s); + + isl_dim_map_range(dim_map, src->start, 0, 0, 0, 1, s); + isl_dim_map_range(dim_map, src->start + 1, 2, 1, 1, src->nparam, -s); + isl_dim_map_range(dim_map, src->start + 2, 2, 1, 1, src->nparam, s); + isl_dim_map_range(dim_map, src->start + 2 * src->nparam + 1, 2, + isl_space_dim(dim, isl_dim_set), 1, + src->nvar, -s); + isl_dim_map_range(dim_map, src->start + 2 * src->nparam + 2, 2, + isl_space_dim(dim, isl_dim_set), 1, + src->nvar, s); + + graph->lp = isl_basic_set_extend_constraints(graph->lp, + coef->n_eq, coef->n_ineq); + graph->lp = isl_basic_set_add_constraints_dim_map(graph->lp, + coef, dim_map); + isl_space_free(dim); + + return 0; +error: + isl_space_free(dim); + return -1; +} + +/* Add all validity constraints to graph->lp. + * + * An edge that is forced to be local needs to have its dependence + * distances equal to zero. We take care of bounding them by 0 from below + * here. add_all_proximity_constraints takes care of bounding them by 0 + * from above. + * + * If "use_coincidence" is set, then we treat coincidence edges as local edges. + * Otherwise, we ignore them. + */ +static int add_all_validity_constraints(struct isl_sched_graph *graph, + int use_coincidence) +{ + int i; + + for (i = 0; i < graph->n_edge; ++i) { + struct isl_sched_edge *edge= &graph->edge[i]; + int local; + + local = edge->local || (edge->coincidence && use_coincidence); + if (!edge->validity && !local) + continue; + if (edge->src != edge->dst) + continue; + if (add_intra_validity_constraints(graph, edge) < 0) + return -1; + } + + for (i = 0; i < graph->n_edge; ++i) { + struct isl_sched_edge *edge = &graph->edge[i]; + int local; + + local = edge->local || (edge->coincidence && use_coincidence); + if (!edge->validity && !local) + continue; + if (edge->src == edge->dst) + continue; + if (add_inter_validity_constraints(graph, edge) < 0) + return -1; + } + + return 0; +} + +/* Add constraints to graph->lp that bound the dependence distance + * for all dependence relations. + * If a given proximity dependence is identical to a validity + * dependence, then the dependence distance is already bounded + * from below (by zero), so we only need to bound the distance + * from above. (This includes the case of "local" dependences + * which are treated as validity dependence by add_all_validity_constraints.) + * Otherwise, we need to bound the distance both from above and from below. + * + * If "use_coincidence" is set, then we treat coincidence edges as local edges. + * Otherwise, we ignore them. + */ +static int add_all_proximity_constraints(struct isl_sched_graph *graph, + int use_coincidence) +{ + int i; + + for (i = 0; i < graph->n_edge; ++i) { + struct isl_sched_edge *edge= &graph->edge[i]; + int local; + + local = edge->local || (edge->coincidence && use_coincidence); + if (!edge->proximity && !local) + continue; + if (edge->src == edge->dst && + add_intra_proximity_constraints(graph, edge, 1, local) < 0) + return -1; + if (edge->src != edge->dst && + add_inter_proximity_constraints(graph, edge, 1, local) < 0) + return -1; + if (edge->validity || local) + continue; + if (edge->src == edge->dst && + add_intra_proximity_constraints(graph, edge, -1, 0) < 0) + return -1; + if (edge->src != edge->dst && + add_inter_proximity_constraints(graph, edge, -1, 0) < 0) + return -1; + } + + return 0; +} + +/* Compute a basis for the rows in the linear part of the schedule + * and extend this basis to a full basis. The remaining rows + * can then be used to force linear independence from the rows + * in the schedule. + * + * In particular, given the schedule rows S, we compute + * + * S = H Q + * S U = H + * + * with H the Hermite normal form of S. That is, all but the + * first rank columns of H are zero and so each row in S is + * a linear combination of the first rank rows of Q. + * The matrix Q is then transposed because we will write the + * coefficients of the next schedule row as a column vector s + * and express this s as a linear combination s = Q c of the + * computed basis. + * Similarly, the matrix U is transposed such that we can + * compute the coefficients c = U s from a schedule row s. + */ +static int node_update_cmap(struct isl_sched_node *node) +{ + isl_mat *H, *U, *Q; + int n_row = isl_mat_rows(node->sched); + + H = isl_mat_sub_alloc(node->sched, 0, n_row, + 1 + node->nparam, node->nvar); + + H = isl_mat_left_hermite(H, 0, &U, &Q); + isl_mat_free(node->cmap); + isl_mat_free(node->cinv); + node->cmap = isl_mat_transpose(Q); + node->cinv = isl_mat_transpose(U); + node->rank = isl_mat_initial_non_zero_cols(H); + isl_mat_free(H); + + if (!node->cmap || !node->cinv || node->rank < 0) + return -1; + return 0; +} + +/* How many times should we count the constraints in "edge"? + * + * If carry is set, then we are counting the number of + * (validity or conditional validity) constraints that will be added + * in setup_carry_lp and we count each edge exactly once. + * + * Otherwise, we count as follows + * validity -> 1 (>= 0) + * validity+proximity -> 2 (>= 0 and upper bound) + * proximity -> 2 (lower and upper bound) + * local(+any) -> 2 (>= 0 and <= 0) + * + * If an edge is only marked conditional_validity then it counts + * as zero since it is only checked afterwards. + * + * If "use_coincidence" is set, then we treat coincidence edges as local edges. + * Otherwise, we ignore them. + */ +static int edge_multiplicity(struct isl_sched_edge *edge, int carry, + int use_coincidence) +{ + if (carry && !edge->validity && !edge->conditional_validity) + return 0; + if (carry) + return 1; + if (edge->proximity || edge->local) + return 2; + if (use_coincidence && edge->coincidence) + return 2; + if (edge->validity) + return 1; + return 0; +} + +/* Count the number of equality and inequality constraints + * that will be added for the given map. + * + * "use_coincidence" is set if we should take into account coincidence edges. + */ +static int count_map_constraints(struct isl_sched_graph *graph, + struct isl_sched_edge *edge, __isl_take isl_map *map, + int *n_eq, int *n_ineq, int carry, int use_coincidence) +{ + isl_basic_set *coef; + int f = edge_multiplicity(edge, carry, use_coincidence); + + if (f == 0) { + isl_map_free(map); + return 0; + } + + if (edge->src == edge->dst) + coef = intra_coefficients(graph, edge->src, map); + else + coef = inter_coefficients(graph, edge, map); + if (!coef) + return -1; + *n_eq += f * coef->n_eq; + *n_ineq += f * coef->n_ineq; + isl_basic_set_free(coef); + + return 0; +} + +/* Count the number of equality and inequality constraints + * that will be added to the main lp problem. + * We count as follows + * validity -> 1 (>= 0) + * validity+proximity -> 2 (>= 0 and upper bound) + * proximity -> 2 (lower and upper bound) + * local(+any) -> 2 (>= 0 and <= 0) + * + * If "use_coincidence" is set, then we treat coincidence edges as local edges. + * Otherwise, we ignore them. + */ +static int count_constraints(struct isl_sched_graph *graph, + int *n_eq, int *n_ineq, int use_coincidence) +{ + int i; + + *n_eq = *n_ineq = 0; + for (i = 0; i < graph->n_edge; ++i) { + struct isl_sched_edge *edge= &graph->edge[i]; + isl_map *map = isl_map_copy(edge->map); + + if (count_map_constraints(graph, edge, map, n_eq, n_ineq, + 0, use_coincidence) < 0) + return -1; + } + + return 0; +} + +/* Count the number of constraints that will be added by + * add_bound_coefficient_constraints and increment *n_eq and *n_ineq + * accordingly. + * + * In practice, add_bound_coefficient_constraints only adds inequalities. + */ +static int count_bound_coefficient_constraints(isl_ctx *ctx, + struct isl_sched_graph *graph, int *n_eq, int *n_ineq) +{ + int i; + + if (ctx->opt->schedule_max_coefficient == -1) + return 0; + + for (i = 0; i < graph->n; ++i) + *n_ineq += 2 * graph->node[i].nparam + 2 * graph->node[i].nvar; + + return 0; +} + +/* Add constraints that bound the values of the variable and parameter + * coefficients of the schedule. + * + * The maximal value of the coefficients is defined by the option + * 'schedule_max_coefficient'. + */ +static int add_bound_coefficient_constraints(isl_ctx *ctx, + struct isl_sched_graph *graph) +{ + int i, j, k; + int max_coefficient; + int total; + + max_coefficient = ctx->opt->schedule_max_coefficient; + + if (max_coefficient == -1) + return 0; + + total = isl_basic_set_total_dim(graph->lp); + + for (i = 0; i < graph->n; ++i) { + struct isl_sched_node *node = &graph->node[i]; + for (j = 0; j < 2 * node->nparam + 2 * node->nvar; ++j) { + int dim; + k = isl_basic_set_alloc_inequality(graph->lp); + if (k < 0) + return -1; + dim = 1 + node->start + 1 + j; + isl_seq_clr(graph->lp->ineq[k], 1 + total); + isl_int_set_si(graph->lp->ineq[k][dim], -1); + isl_int_set_si(graph->lp->ineq[k][0], max_coefficient); + } + } + + return 0; +} + +/* Construct an ILP problem for finding schedule coefficients + * that result in non-negative, but small dependence distances + * over all dependences. + * In particular, the dependence distances over proximity edges + * are bounded by m_0 + m_n n and we compute schedule coefficients + * with small values (preferably zero) of m_n and m_0. + * + * All variables of the ILP are non-negative. The actual coefficients + * may be negative, so each coefficient is represented as the difference + * of two non-negative variables. The negative part always appears + * immediately before the positive part. + * Other than that, the variables have the following order + * + * - sum of positive and negative parts of m_n coefficients + * - m_0 + * - sum of positive and negative parts of all c_n coefficients + * (unconstrained when computing non-parametric schedules) + * - sum of positive and negative parts of all c_x coefficients + * - positive and negative parts of m_n coefficients + * - for each node + * - c_i_0 + * - positive and negative parts of c_i_n (if parametric) + * - positive and negative parts of c_i_x + * + * The c_i_x are not represented directly, but through the columns of + * node->cmap. That is, the computed values are for variable t_i_x + * such that c_i_x = Q t_i_x with Q equal to node->cmap. + * + * The constraints are those from the edges plus two or three equalities + * to express the sums. + * + * If "use_coincidence" is set, then we treat coincidence edges as local edges. + * Otherwise, we ignore them. + */ +static int setup_lp(isl_ctx *ctx, struct isl_sched_graph *graph, + int use_coincidence) +{ + int i, j; + int k; + unsigned nparam; + unsigned total; + isl_space *dim; + int parametric; + int param_pos; + int n_eq, n_ineq; + int max_constant_term; + + max_constant_term = ctx->opt->schedule_max_constant_term; + + parametric = ctx->opt->schedule_parametric; + nparam = isl_space_dim(graph->node[0].space, isl_dim_param); + param_pos = 4; + total = param_pos + 2 * nparam; + for (i = 0; i < graph->n; ++i) { + struct isl_sched_node *node = &graph->node[graph->sorted[i]]; + if (node_update_cmap(node) < 0) + return -1; + node->start = total; + total += 1 + 2 * (node->nparam + node->nvar); + } + + if (count_constraints(graph, &n_eq, &n_ineq, use_coincidence) < 0) + return -1; + if (count_bound_coefficient_constraints(ctx, graph, &n_eq, &n_ineq) < 0) + return -1; + + dim = isl_space_set_alloc(ctx, 0, total); + isl_basic_set_free(graph->lp); + n_eq += 2 + parametric; + if (max_constant_term != -1) + n_ineq += graph->n; + + graph->lp = isl_basic_set_alloc_space(dim, 0, n_eq, n_ineq); + + k = isl_basic_set_alloc_equality(graph->lp); + if (k < 0) + return -1; + isl_seq_clr(graph->lp->eq[k], 1 + total); + isl_int_set_si(graph->lp->eq[k][1], -1); + for (i = 0; i < 2 * nparam; ++i) + isl_int_set_si(graph->lp->eq[k][1 + param_pos + i], 1); + + if (parametric) { + k = isl_basic_set_alloc_equality(graph->lp); + if (k < 0) + return -1; + isl_seq_clr(graph->lp->eq[k], 1 + total); + isl_int_set_si(graph->lp->eq[k][3], -1); + for (i = 0; i < graph->n; ++i) { + int pos = 1 + graph->node[i].start + 1; + + for (j = 0; j < 2 * graph->node[i].nparam; ++j) + isl_int_set_si(graph->lp->eq[k][pos + j], 1); + } + } + + k = isl_basic_set_alloc_equality(graph->lp); + if (k < 0) + return -1; + isl_seq_clr(graph->lp->eq[k], 1 + total); + isl_int_set_si(graph->lp->eq[k][4], -1); + for (i = 0; i < graph->n; ++i) { + struct isl_sched_node *node = &graph->node[i]; + int pos = 1 + node->start + 1 + 2 * node->nparam; + + for (j = 0; j < 2 * node->nvar; ++j) + isl_int_set_si(graph->lp->eq[k][pos + j], 1); + } + + if (max_constant_term != -1) + for (i = 0; i < graph->n; ++i) { + struct isl_sched_node *node = &graph->node[i]; + k = isl_basic_set_alloc_inequality(graph->lp); + if (k < 0) + return -1; + isl_seq_clr(graph->lp->ineq[k], 1 + total); + isl_int_set_si(graph->lp->ineq[k][1 + node->start], -1); + isl_int_set_si(graph->lp->ineq[k][0], max_constant_term); + } + + if (add_bound_coefficient_constraints(ctx, graph) < 0) + return -1; + if (add_all_validity_constraints(graph, use_coincidence) < 0) + return -1; + if (add_all_proximity_constraints(graph, use_coincidence) < 0) + return -1; + + return 0; +} + +/* Analyze the conflicting constraint found by + * isl_tab_basic_set_non_trivial_lexmin. If it corresponds to the validity + * constraint of one of the edges between distinct nodes, living, moreover + * in distinct SCCs, then record the source and sink SCC as this may + * be a good place to cut between SCCs. + */ +static int check_conflict(int con, void *user) +{ + int i; + struct isl_sched_graph *graph = user; + + if (graph->src_scc >= 0) + return 0; + + con -= graph->lp->n_eq; + + if (con >= graph->lp->n_ineq) + return 0; + + for (i = 0; i < graph->n_edge; ++i) { + if (!graph->edge[i].validity) + continue; + if (graph->edge[i].src == graph->edge[i].dst) + continue; + if (graph->edge[i].src->scc == graph->edge[i].dst->scc) + continue; + if (graph->edge[i].start > con) + continue; + if (graph->edge[i].end <= con) + continue; + graph->src_scc = graph->edge[i].src->scc; + graph->dst_scc = graph->edge[i].dst->scc; + } + + return 0; +} + +/* Check whether the next schedule row of the given node needs to be + * non-trivial. Lower-dimensional domains may have some trivial rows, + * but as soon as the number of remaining required non-trivial rows + * is as large as the number or remaining rows to be computed, + * all remaining rows need to be non-trivial. + */ +static int needs_row(struct isl_sched_graph *graph, struct isl_sched_node *node) +{ + return node->nvar - node->rank >= graph->maxvar - graph->n_row; +} + +/* Solve the ILP problem constructed in setup_lp. + * For each node such that all the remaining rows of its schedule + * need to be non-trivial, we construct a non-triviality region. + * This region imposes that the next row is independent of previous rows. + * In particular the coefficients c_i_x are represented by t_i_x + * variables with c_i_x = Q t_i_x and Q a unimodular matrix such that + * its first columns span the rows of the previously computed part + * of the schedule. The non-triviality region enforces that at least + * one of the remaining components of t_i_x is non-zero, i.e., + * that the new schedule row depends on at least one of the remaining + * columns of Q. + */ +static __isl_give isl_vec *solve_lp(struct isl_sched_graph *graph) +{ + int i; + isl_vec *sol; + isl_basic_set *lp; + + for (i = 0; i < graph->n; ++i) { + struct isl_sched_node *node = &graph->node[i]; + int skip = node->rank; + graph->region[i].pos = node->start + 1 + 2*(node->nparam+skip); + if (needs_row(graph, node)) + graph->region[i].len = 2 * (node->nvar - skip); + else + graph->region[i].len = 0; + } + lp = isl_basic_set_copy(graph->lp); + sol = isl_tab_basic_set_non_trivial_lexmin(lp, 2, graph->n, + graph->region, &check_conflict, graph); + return sol; +} + +/* Update the schedules of all nodes based on the given solution + * of the LP problem. + * The new row is added to the current band. + * All possibly negative coefficients are encoded as a difference + * of two non-negative variables, so we need to perform the subtraction + * here. Moreover, if use_cmap is set, then the solution does + * not refer to the actual coefficients c_i_x, but instead to variables + * t_i_x such that c_i_x = Q t_i_x and Q is equal to node->cmap. + * In this case, we then also need to perform this multiplication + * to obtain the values of c_i_x. + * + * If coincident is set, then the caller guarantees that the new + * row satisfies the coincidence constraints. + */ +static int update_schedule(struct isl_sched_graph *graph, + __isl_take isl_vec *sol, int use_cmap, int coincident) +{ + int i, j; + isl_vec *csol = NULL; + + if (!sol) + goto error; + if (sol->size == 0) + isl_die(sol->ctx, isl_error_internal, + "no solution found", goto error); + if (graph->n_total_row >= graph->max_row) + isl_die(sol->ctx, isl_error_internal, + "too many schedule rows", goto error); + + for (i = 0; i < graph->n; ++i) { + struct isl_sched_node *node = &graph->node[i]; + int pos = node->start; + int row = isl_mat_rows(node->sched); + + isl_vec_free(csol); + csol = isl_vec_alloc(sol->ctx, node->nvar); + if (!csol) + goto error; + + isl_map_free(node->sched_map); + node->sched_map = NULL; + node->sched = isl_mat_add_rows(node->sched, 1); + if (!node->sched) + goto error; + node->sched = isl_mat_set_element(node->sched, row, 0, + sol->el[1 + pos]); + for (j = 0; j < node->nparam + node->nvar; ++j) + isl_int_sub(sol->el[1 + pos + 1 + 2 * j + 1], + sol->el[1 + pos + 1 + 2 * j + 1], + sol->el[1 + pos + 1 + 2 * j]); + for (j = 0; j < node->nparam; ++j) + node->sched = isl_mat_set_element(node->sched, + row, 1 + j, sol->el[1+pos+1+2*j+1]); + for (j = 0; j < node->nvar; ++j) + isl_int_set(csol->el[j], + sol->el[1+pos+1+2*(node->nparam+j)+1]); + if (use_cmap) + csol = isl_mat_vec_product(isl_mat_copy(node->cmap), + csol); + if (!csol) + goto error; + for (j = 0; j < node->nvar; ++j) + node->sched = isl_mat_set_element(node->sched, + row, 1 + node->nparam + j, csol->el[j]); + node->coincident[graph->n_total_row] = coincident; + } + isl_vec_free(sol); + isl_vec_free(csol); + + graph->n_row++; + graph->n_total_row++; + + return 0; +error: + isl_vec_free(sol); + isl_vec_free(csol); + return -1; +} + +/* Convert row "row" of node->sched into an isl_aff living in "ls" + * and return this isl_aff. + */ +static __isl_give isl_aff *extract_schedule_row(__isl_take isl_local_space *ls, + struct isl_sched_node *node, int row) +{ + int j; + isl_int v; + isl_aff *aff; + + isl_int_init(v); + + aff = isl_aff_zero_on_domain(ls); + isl_mat_get_element(node->sched, row, 0, &v); + aff = isl_aff_set_constant(aff, v); + for (j = 0; j < node->nparam; ++j) { + isl_mat_get_element(node->sched, row, 1 + j, &v); + aff = isl_aff_set_coefficient(aff, isl_dim_param, j, v); + } + for (j = 0; j < node->nvar; ++j) { + isl_mat_get_element(node->sched, row, 1 + node->nparam + j, &v); + aff = isl_aff_set_coefficient(aff, isl_dim_in, j, v); + } + + isl_int_clear(v); + + return aff; +} + +/* Convert the "n" rows starting at "first" of node->sched into a multi_aff + * and return this multi_aff. + * + * The result is defined over the uncompressed node domain. + */ +static __isl_give isl_multi_aff *node_extract_partial_schedule_multi_aff( + struct isl_sched_node *node, int first, int n) +{ + int i; + isl_space *space; + isl_local_space *ls; + isl_aff *aff; + isl_multi_aff *ma; + int nrow; + + nrow = isl_mat_rows(node->sched); + if (node->compressed) + space = isl_multi_aff_get_domain_space(node->decompress); + else + space = isl_space_copy(node->space); + ls = isl_local_space_from_space(isl_space_copy(space)); + space = isl_space_from_domain(space); + space = isl_space_add_dims(space, isl_dim_out, n); + ma = isl_multi_aff_zero(space); + + for (i = first; i < first + n; ++i) { + aff = extract_schedule_row(isl_local_space_copy(ls), node, i); + ma = isl_multi_aff_set_aff(ma, i - first, aff); + } + + isl_local_space_free(ls); + + if (node->compressed) + ma = isl_multi_aff_pullback_multi_aff(ma, + isl_multi_aff_copy(node->compress)); + + return ma; +} + +/* Convert node->sched into a multi_aff and return this multi_aff. + * + * The result is defined over the uncompressed node domain. + */ +static __isl_give isl_multi_aff *node_extract_schedule_multi_aff( + struct isl_sched_node *node) +{ + int nrow; + + nrow = isl_mat_rows(node->sched); + return node_extract_partial_schedule_multi_aff(node, 0, nrow); +} + +/* Convert node->sched into a map and return this map. + * + * The result is cached in node->sched_map, which needs to be released + * whenever node->sched is updated. + * It is defined over the uncompressed node domain. + */ +static __isl_give isl_map *node_extract_schedule(struct isl_sched_node *node) +{ + if (!node->sched_map) { + isl_multi_aff *ma; + + ma = node_extract_schedule_multi_aff(node); + node->sched_map = isl_map_from_multi_aff(ma); + } + + return isl_map_copy(node->sched_map); +} + +/* Construct a map that can be used to update a dependence relation + * based on the current schedule. + * That is, construct a map expressing that source and sink + * are executed within the same iteration of the current schedule. + * This map can then be intersected with the dependence relation. + * This is not the most efficient way, but this shouldn't be a critical + * operation. + */ +static __isl_give isl_map *specializer(struct isl_sched_node *src, + struct isl_sched_node *dst) +{ + isl_map *src_sched, *dst_sched; + + src_sched = node_extract_schedule(src); + dst_sched = node_extract_schedule(dst); + return isl_map_apply_range(src_sched, isl_map_reverse(dst_sched)); +} + +/* Intersect the domains of the nested relations in domain and range + * of "umap" with "map". + */ +static __isl_give isl_union_map *intersect_domains( + __isl_take isl_union_map *umap, __isl_keep isl_map *map) +{ + isl_union_set *uset; + + umap = isl_union_map_zip(umap); + uset = isl_union_set_from_set(isl_map_wrap(isl_map_copy(map))); + umap = isl_union_map_intersect_domain(umap, uset); + umap = isl_union_map_zip(umap); + return umap; +} + +/* Update the dependence relation of the given edge based + * on the current schedule. + * If the dependence is carried completely by the current schedule, then + * it is removed from the edge_tables. It is kept in the list of edges + * as otherwise all edge_tables would have to be recomputed. + */ +static int update_edge(struct isl_sched_graph *graph, + struct isl_sched_edge *edge) +{ + int empty; + isl_map *id; + + id = specializer(edge->src, edge->dst); + edge->map = isl_map_intersect(edge->map, isl_map_copy(id)); + if (!edge->map) + goto error; + + if (edge->tagged_condition) { + edge->tagged_condition = + intersect_domains(edge->tagged_condition, id); + if (!edge->tagged_condition) + goto error; + } + if (edge->tagged_validity) { + edge->tagged_validity = + intersect_domains(edge->tagged_validity, id); + if (!edge->tagged_validity) + goto error; + } + + empty = isl_map_plain_is_empty(edge->map); + if (empty < 0) + goto error; + if (empty) + graph_remove_edge(graph, edge); + + isl_map_free(id); + return 0; +error: + isl_map_free(id); + return -1; +} + +/* Does the domain of "umap" intersect "uset"? + */ +static int domain_intersects(__isl_keep isl_union_map *umap, + __isl_keep isl_union_set *uset) +{ + int empty; + + umap = isl_union_map_copy(umap); + umap = isl_union_map_intersect_domain(umap, isl_union_set_copy(uset)); + empty = isl_union_map_is_empty(umap); + isl_union_map_free(umap); + + return empty < 0 ? -1 : !empty; +} + +/* Does the range of "umap" intersect "uset"? + */ +static int range_intersects(__isl_keep isl_union_map *umap, + __isl_keep isl_union_set *uset) +{ + int empty; + + umap = isl_union_map_copy(umap); + umap = isl_union_map_intersect_range(umap, isl_union_set_copy(uset)); + empty = isl_union_map_is_empty(umap); + isl_union_map_free(umap); + + return empty < 0 ? -1 : !empty; +} + +/* Are the condition dependences of "edge" local with respect to + * the current schedule? + * + * That is, are domain and range of the condition dependences mapped + * to the same point? + * + * In other words, is the condition false? + */ +static int is_condition_false(struct isl_sched_edge *edge) +{ + isl_union_map *umap; + isl_map *map, *sched, *test; + int empty, local; + + empty = isl_union_map_is_empty(edge->tagged_condition); + if (empty < 0 || empty) + return empty; + + umap = isl_union_map_copy(edge->tagged_condition); + umap = isl_union_map_zip(umap); + umap = isl_union_set_unwrap(isl_union_map_domain(umap)); + map = isl_map_from_union_map(umap); + + sched = node_extract_schedule(edge->src); + map = isl_map_apply_domain(map, sched); + sched = node_extract_schedule(edge->dst); + map = isl_map_apply_range(map, sched); + + test = isl_map_identity(isl_map_get_space(map)); + local = isl_map_is_subset(map, test); + isl_map_free(map); + isl_map_free(test); + + return local; +} + +/* For each conditional validity constraint that is adjacent + * to a condition with domain in condition_source or range in condition_sink, + * turn it into an unconditional validity constraint. + */ +static int unconditionalize_adjacent_validity(struct isl_sched_graph *graph, + __isl_take isl_union_set *condition_source, + __isl_take isl_union_set *condition_sink) +{ + int i; + + condition_source = isl_union_set_coalesce(condition_source); + condition_sink = isl_union_set_coalesce(condition_sink); + + for (i = 0; i < graph->n_edge; ++i) { + int adjacent; + isl_union_map *validity; + + if (!graph->edge[i].conditional_validity) + continue; + if (graph->edge[i].validity) + continue; + + validity = graph->edge[i].tagged_validity; + adjacent = domain_intersects(validity, condition_sink); + if (adjacent >= 0 && !adjacent) + adjacent = range_intersects(validity, condition_source); + if (adjacent < 0) + goto error; + if (!adjacent) + continue; + + graph->edge[i].validity = 1; + } + + isl_union_set_free(condition_source); + isl_union_set_free(condition_sink); + return 0; +error: + isl_union_set_free(condition_source); + isl_union_set_free(condition_sink); + return -1; +} + +/* Update the dependence relations of all edges based on the current schedule + * and enforce conditional validity constraints that are adjacent + * to satisfied condition constraints. + * + * First check if any of the condition constraints are satisfied + * (i.e., not local to the outer schedule) and keep track of + * their domain and range. + * Then update all dependence relations (which removes the non-local + * constraints). + * Finally, if any condition constraints turned out to be satisfied, + * then turn all adjacent conditional validity constraints into + * unconditional validity constraints. + */ +static int update_edges(isl_ctx *ctx, struct isl_sched_graph *graph) +{ + int i; + int any = 0; + isl_union_set *source, *sink; + + source = isl_union_set_empty(isl_space_params_alloc(ctx, 0)); + sink = isl_union_set_empty(isl_space_params_alloc(ctx, 0)); + for (i = 0; i < graph->n_edge; ++i) { + int local; + isl_union_set *uset; + isl_union_map *umap; + + if (!graph->edge[i].condition) + continue; + if (graph->edge[i].local) + continue; + local = is_condition_false(&graph->edge[i]); + if (local < 0) + goto error; + if (local) + continue; + + any = 1; + + umap = isl_union_map_copy(graph->edge[i].tagged_condition); + uset = isl_union_map_domain(umap); + source = isl_union_set_union(source, uset); + + umap = isl_union_map_copy(graph->edge[i].tagged_condition); + uset = isl_union_map_range(umap); + sink = isl_union_set_union(sink, uset); + } + + for (i = graph->n_edge - 1; i >= 0; --i) { + if (update_edge(graph, &graph->edge[i]) < 0) + goto error; + } + + if (any) + return unconditionalize_adjacent_validity(graph, source, sink); + + isl_union_set_free(source); + isl_union_set_free(sink); + return 0; +error: + isl_union_set_free(source); + isl_union_set_free(sink); + return -1; +} + +static void next_band(struct isl_sched_graph *graph) +{ + graph->band_start = graph->n_total_row; +} + +/* Return the union of the universe domains of the nodes in "graph" + * that satisfy "pred". + */ +static __isl_give isl_union_set *isl_sched_graph_domain(isl_ctx *ctx, + struct isl_sched_graph *graph, + int (*pred)(struct isl_sched_node *node, int data), int data) +{ + int i; + isl_set *set; + isl_union_set *dom; + + for (i = 0; i < graph->n; ++i) + if (pred(&graph->node[i], data)) + break; + + if (i >= graph->n) + isl_die(ctx, isl_error_internal, + "empty component", return NULL); + + set = isl_set_universe(isl_space_copy(graph->node[i].space)); + dom = isl_union_set_from_set(set); + + for (i = i + 1; i < graph->n; ++i) { + if (!pred(&graph->node[i], data)) + continue; + set = isl_set_universe(isl_space_copy(graph->node[i].space)); + dom = isl_union_set_union(dom, isl_union_set_from_set(set)); + } + + return dom; +} + +/* Return a list of unions of universe domains, where each element + * in the list corresponds to an SCC (or WCC) indexed by node->scc. + */ +static __isl_give isl_union_set_list *extract_sccs(isl_ctx *ctx, + struct isl_sched_graph *graph) +{ + int i; + isl_union_set_list *filters; + + filters = isl_union_set_list_alloc(ctx, graph->scc); + for (i = 0; i < graph->scc; ++i) { + isl_union_set *dom; + + dom = isl_sched_graph_domain(ctx, graph, &node_scc_exactly, i); + filters = isl_union_set_list_add(filters, dom); + } + + return filters; +} + +/* Return a list of two unions of universe domains, one for the SCCs up + * to and including graph->src_scc and another for the other SCCS. + */ +static __isl_give isl_union_set_list *extract_split(isl_ctx *ctx, + struct isl_sched_graph *graph) +{ + isl_union_set *dom; + isl_union_set_list *filters; + + filters = isl_union_set_list_alloc(ctx, 2); + dom = isl_sched_graph_domain(ctx, graph, + &node_scc_at_most, graph->src_scc); + filters = isl_union_set_list_add(filters, dom); + dom = isl_sched_graph_domain(ctx, graph, + &node_scc_at_least, graph->src_scc + 1); + filters = isl_union_set_list_add(filters, dom); + + return filters; +} + +/* Copy nodes that satisfy node_pred from the src dependence graph + * to the dst dependence graph. + */ +static int copy_nodes(struct isl_sched_graph *dst, struct isl_sched_graph *src, + int (*node_pred)(struct isl_sched_node *node, int data), int data) +{ + int i; + + dst->n = 0; + for (i = 0; i < src->n; ++i) { + int j; + + if (!node_pred(&src->node[i], data)) + continue; + + j = dst->n; + dst->node[j].space = isl_space_copy(src->node[i].space); + dst->node[j].compressed = src->node[i].compressed; + dst->node[j].hull = isl_set_copy(src->node[i].hull); + dst->node[j].compress = + isl_multi_aff_copy(src->node[i].compress); + dst->node[j].decompress = + isl_multi_aff_copy(src->node[i].decompress); + dst->node[j].nvar = src->node[i].nvar; + dst->node[j].nparam = src->node[i].nparam; + dst->node[j].sched = isl_mat_copy(src->node[i].sched); + dst->node[j].sched_map = isl_map_copy(src->node[i].sched_map); + dst->node[j].coincident = src->node[i].coincident; + dst->n++; + + if (!dst->node[j].space || !dst->node[j].sched) + return -1; + if (dst->node[j].compressed && + (!dst->node[j].hull || !dst->node[j].compress || + !dst->node[j].decompress)) + return -1; + } + + return 0; +} + +/* Copy non-empty edges that satisfy edge_pred from the src dependence graph + * to the dst dependence graph. + * If the source or destination node of the edge is not in the destination + * graph, then it must be a backward proximity edge and it should simply + * be ignored. + */ +static int copy_edges(isl_ctx *ctx, struct isl_sched_graph *dst, + struct isl_sched_graph *src, + int (*edge_pred)(struct isl_sched_edge *edge, int data), int data) +{ + int i; + enum isl_edge_type t; + + dst->n_edge = 0; + for (i = 0; i < src->n_edge; ++i) { + struct isl_sched_edge *edge = &src->edge[i]; + isl_map *map; + isl_union_map *tagged_condition; + isl_union_map *tagged_validity; + struct isl_sched_node *dst_src, *dst_dst; + + if (!edge_pred(edge, data)) + continue; + + if (isl_map_plain_is_empty(edge->map)) + continue; + + dst_src = graph_find_node(ctx, dst, edge->src->space); + dst_dst = graph_find_node(ctx, dst, edge->dst->space); + if (!dst_src || !dst_dst) { + if (edge->validity || edge->conditional_validity) + isl_die(ctx, isl_error_internal, + "backward (conditional) validity edge", + return -1); + continue; + } + + map = isl_map_copy(edge->map); + tagged_condition = isl_union_map_copy(edge->tagged_condition); + tagged_validity = isl_union_map_copy(edge->tagged_validity); + + dst->edge[dst->n_edge].src = dst_src; + dst->edge[dst->n_edge].dst = dst_dst; + dst->edge[dst->n_edge].map = map; + dst->edge[dst->n_edge].tagged_condition = tagged_condition; + dst->edge[dst->n_edge].tagged_validity = tagged_validity; + dst->edge[dst->n_edge].validity = edge->validity; + dst->edge[dst->n_edge].proximity = edge->proximity; + dst->edge[dst->n_edge].coincidence = edge->coincidence; + dst->edge[dst->n_edge].condition = edge->condition; + dst->edge[dst->n_edge].conditional_validity = + edge->conditional_validity; + dst->n_edge++; + + if (edge->tagged_condition && !tagged_condition) + return -1; + if (edge->tagged_validity && !tagged_validity) + return -1; + + for (t = isl_edge_first; t <= isl_edge_last; ++t) { + if (edge != + graph_find_edge(src, t, edge->src, edge->dst)) + continue; + if (graph_edge_table_add(ctx, dst, t, + &dst->edge[dst->n_edge - 1]) < 0) + return -1; + } + } + + return 0; +} + +/* Compute the maximal number of variables over all nodes. + * This is the maximal number of linearly independent schedule + * rows that we need to compute. + * Just in case we end up in a part of the dependence graph + * with only lower-dimensional domains, we make sure we will + * compute the required amount of extra linearly independent rows. + */ +static int compute_maxvar(struct isl_sched_graph *graph) +{ + int i; + + graph->maxvar = 0; + for (i = 0; i < graph->n; ++i) { + struct isl_sched_node *node = &graph->node[i]; + int nvar; + + if (node_update_cmap(node) < 0) + return -1; + nvar = node->nvar + graph->n_row - node->rank; + if (nvar > graph->maxvar) + graph->maxvar = nvar; + } + + return 0; +} + +static __isl_give isl_schedule_node *compute_schedule(isl_schedule_node *node, + struct isl_sched_graph *graph); +static __isl_give isl_schedule_node *compute_schedule_wcc( + isl_schedule_node *node, struct isl_sched_graph *graph); + +/* Compute a schedule for a subgraph of "graph". In particular, for + * the graph composed of nodes that satisfy node_pred and edges that + * that satisfy edge_pred. The caller should precompute the number + * of nodes and edges that satisfy these predicates and pass them along + * as "n" and "n_edge". + * If the subgraph is known to consist of a single component, then wcc should + * be set and then we call compute_schedule_wcc on the constructed subgraph. + * Otherwise, we call compute_schedule, which will check whether the subgraph + * is connected. + * + * The schedule is inserted at "node" and the updated schedule node + * is returned. + */ +static __isl_give isl_schedule_node *compute_sub_schedule( + __isl_take isl_schedule_node *node, isl_ctx *ctx, + struct isl_sched_graph *graph, int n, int n_edge, + int (*node_pred)(struct isl_sched_node *node, int data), + int (*edge_pred)(struct isl_sched_edge *edge, int data), + int data, int wcc) +{ + struct isl_sched_graph split = { 0 }; + int t; + + if (graph_alloc(ctx, &split, n, n_edge) < 0) + goto error; + if (copy_nodes(&split, graph, node_pred, data) < 0) + goto error; + if (graph_init_table(ctx, &split) < 0) + goto error; + for (t = 0; t <= isl_edge_last; ++t) + split.max_edge[t] = graph->max_edge[t]; + if (graph_init_edge_tables(ctx, &split) < 0) + goto error; + if (copy_edges(ctx, &split, graph, edge_pred, data) < 0) + goto error; + split.n_row = graph->n_row; + split.max_row = graph->max_row; + split.n_total_row = graph->n_total_row; + split.band_start = graph->band_start; + + if (wcc) + node = compute_schedule_wcc(node, &split); + else + node = compute_schedule(node, &split); + + graph_free(ctx, &split); + return node; +error: + graph_free(ctx, &split); + return isl_schedule_node_free(node); +} + +static int edge_scc_exactly(struct isl_sched_edge *edge, int scc) +{ + return edge->src->scc == scc && edge->dst->scc == scc; +} + +static int edge_dst_scc_at_most(struct isl_sched_edge *edge, int scc) +{ + return edge->dst->scc <= scc; +} + +static int edge_src_scc_at_least(struct isl_sched_edge *edge, int scc) +{ + return edge->src->scc >= scc; +} + +/* Reset the current band by dropping all its schedule rows. + */ +static int reset_band(struct isl_sched_graph *graph) +{ + int i; + int drop; + + drop = graph->n_total_row - graph->band_start; + graph->n_total_row -= drop; + graph->n_row -= drop; + + for (i = 0; i < graph->n; ++i) { + struct isl_sched_node *node = &graph->node[i]; + + isl_map_free(node->sched_map); + node->sched_map = NULL; + + node->sched = isl_mat_drop_rows(node->sched, + graph->band_start, drop); + + if (!node->sched) + return -1; + } + + return 0; +} + +/* Split the current graph into two parts and compute a schedule for each + * part individually. In particular, one part consists of all SCCs up + * to and including graph->src_scc, while the other part contains the other + * SCCS. The split is enforced by a sequence node inserted at position "node" + * in the schedule tree. Return the updated schedule node. + * + * The current band is reset. It would be possible to reuse + * the previously computed rows as the first rows in the next + * band, but recomputing them may result in better rows as we are looking + * at a smaller part of the dependence graph. + */ +static __isl_give isl_schedule_node *compute_split_schedule( + __isl_take isl_schedule_node *node, struct isl_sched_graph *graph) +{ + int i, n, e1, e2; + isl_ctx *ctx; + isl_union_set_list *filters; + + if (!node) + return NULL; + + if (reset_band(graph) < 0) + return isl_schedule_node_free(node); + + n = 0; + for (i = 0; i < graph->n; ++i) { + struct isl_sched_node *node = &graph->node[i]; + int before = node->scc <= graph->src_scc; + + if (before) + n++; + } + + e1 = e2 = 0; + for (i = 0; i < graph->n_edge; ++i) { + if (graph->edge[i].dst->scc <= graph->src_scc) + e1++; + if (graph->edge[i].src->scc > graph->src_scc) + e2++; + } + + next_band(graph); + + ctx = isl_schedule_node_get_ctx(node); + filters = extract_split(ctx, graph); + node = isl_schedule_node_insert_sequence(node, filters); + node = isl_schedule_node_child(node, 0); + node = isl_schedule_node_child(node, 0); + + node = compute_sub_schedule(node, ctx, graph, n, e1, + &node_scc_at_most, &edge_dst_scc_at_most, + graph->src_scc, 0); + node = isl_schedule_node_parent(node); + node = isl_schedule_node_next_sibling(node); + node = isl_schedule_node_child(node, 0); + node = compute_sub_schedule(node, ctx, graph, graph->n - n, e2, + &node_scc_at_least, &edge_src_scc_at_least, + graph->src_scc + 1, 0); + node = isl_schedule_node_parent(node); + node = isl_schedule_node_parent(node); + + return node; +} + +/* Insert a band node at position "node" in the schedule tree corresponding + * to the current band in "graph". Mark the band node permutable + * if "permutable" is set. + * The partial schedules and the coincidence property are extracted + * from the graph nodes. + * Return the updated schedule node. + */ +static __isl_give isl_schedule_node *insert_current_band( + __isl_take isl_schedule_node *node, struct isl_sched_graph *graph, + int permutable) +{ + int i; + int start, end, n; + isl_multi_aff *ma; + isl_multi_pw_aff *mpa; + isl_multi_union_pw_aff *mupa; + + if (!node) + return NULL; + + if (graph->n < 1) + isl_die(isl_schedule_node_get_ctx(node), isl_error_internal, + "graph should have at least one node", + return isl_schedule_node_free(node)); + + start = graph->band_start; + end = graph->n_total_row; + n = end - start; + + ma = node_extract_partial_schedule_multi_aff(&graph->node[0], start, n); + mpa = isl_multi_pw_aff_from_multi_aff(ma); + mupa = isl_multi_union_pw_aff_from_multi_pw_aff(mpa); + + for (i = 1; i < graph->n; ++i) { + isl_multi_union_pw_aff *mupa_i; + + ma = node_extract_partial_schedule_multi_aff(&graph->node[i], + start, n); + mpa = isl_multi_pw_aff_from_multi_aff(ma); + mupa_i = isl_multi_union_pw_aff_from_multi_pw_aff(mpa); + mupa = isl_multi_union_pw_aff_union_add(mupa, mupa_i); + } + node = isl_schedule_node_insert_partial_schedule(node, mupa); + + for (i = 0; i < n; ++i) + node = isl_schedule_node_band_member_set_coincident(node, i, + graph->node[0].coincident[start + i]); + node = isl_schedule_node_band_set_permutable(node, permutable); + + return node; +} + +/* Update the dependence relations based on the current schedule, + * add the current band to "node" and then continue with the computation + * of the next band. + * Return the updated schedule node. + */ +static __isl_give isl_schedule_node *compute_next_band( + __isl_take isl_schedule_node *node, + struct isl_sched_graph *graph, int permutable) +{ + isl_ctx *ctx; + + if (!node) + return NULL; + + ctx = isl_schedule_node_get_ctx(node); + if (update_edges(ctx, graph) < 0) + return isl_schedule_node_free(node); + node = insert_current_band(node, graph, permutable); + next_band(graph); + + node = isl_schedule_node_child(node, 0); + node = compute_schedule(node, graph); + node = isl_schedule_node_parent(node); + + return node; +} + +/* Add constraints to graph->lp that force the dependence "map" (which + * is part of the dependence relation of "edge") + * to be respected and attempt to carry it, where the edge is one from + * a node j to itself. "pos" is the sequence number of the given map. + * That is, add constraints that enforce + * + * (c_j_0 + c_j_n n + c_j_x y) - (c_j_0 + c_j_n n + c_j_x x) + * = c_j_x (y - x) >= e_i + * + * for each (x,y) in R. + * We obtain general constraints on coefficients (c_0, c_n, c_x) + * of valid constraints for (y - x) and then plug in (-e_i, 0, c_j_x), + * with each coefficient in c_j_x represented as a pair of non-negative + * coefficients. + */ +static int add_intra_constraints(struct isl_sched_graph *graph, + struct isl_sched_edge *edge, __isl_take isl_map *map, int pos) +{ + unsigned total; + isl_ctx *ctx = isl_map_get_ctx(map); + isl_space *dim; + isl_dim_map *dim_map; + isl_basic_set *coef; + struct isl_sched_node *node = edge->src; + + coef = intra_coefficients(graph, node, map); + if (!coef) + return -1; + + dim = isl_space_domain(isl_space_unwrap(isl_basic_set_get_space(coef))); + + total = isl_basic_set_total_dim(graph->lp); + dim_map = isl_dim_map_alloc(ctx, total); + isl_dim_map_range(dim_map, 3 + pos, 0, 0, 0, 1, -1); + isl_dim_map_range(dim_map, node->start + 2 * node->nparam + 1, 2, + isl_space_dim(dim, isl_dim_set), 1, + node->nvar, -1); + isl_dim_map_range(dim_map, node->start + 2 * node->nparam + 2, 2, + isl_space_dim(dim, isl_dim_set), 1, + node->nvar, 1); + graph->lp = isl_basic_set_extend_constraints(graph->lp, + coef->n_eq, coef->n_ineq); + graph->lp = isl_basic_set_add_constraints_dim_map(graph->lp, + coef, dim_map); + isl_space_free(dim); + + return 0; +} + +/* Add constraints to graph->lp that force the dependence "map" (which + * is part of the dependence relation of "edge") + * to be respected and attempt to carry it, where the edge is one from + * node j to node k. "pos" is the sequence number of the given map. + * That is, add constraints that enforce + * + * (c_k_0 + c_k_n n + c_k_x y) - (c_j_0 + c_j_n n + c_j_x x) >= e_i + * + * for each (x,y) in R. + * We obtain general constraints on coefficients (c_0, c_n, c_x) + * of valid constraints for R and then plug in + * (-e_i + c_k_0 - c_j_0, c_k_n - c_j_n, c_k_x - c_j_x) + * with each coefficient (except e_i, c_k_0 and c_j_0) + * represented as a pair of non-negative coefficients. + */ +static int add_inter_constraints(struct isl_sched_graph *graph, + struct isl_sched_edge *edge, __isl_take isl_map *map, int pos) +{ + unsigned total; + isl_ctx *ctx = isl_map_get_ctx(map); + isl_space *dim; + isl_dim_map *dim_map; + isl_basic_set *coef; + struct isl_sched_node *src = edge->src; + struct isl_sched_node *dst = edge->dst; + + coef = inter_coefficients(graph, edge, map); + if (!coef) + return -1; + + dim = isl_space_domain(isl_space_unwrap(isl_basic_set_get_space(coef))); + + total = isl_basic_set_total_dim(graph->lp); + dim_map = isl_dim_map_alloc(ctx, total); + + isl_dim_map_range(dim_map, 3 + pos, 0, 0, 0, 1, -1); + + isl_dim_map_range(dim_map, dst->start, 0, 0, 0, 1, 1); + isl_dim_map_range(dim_map, dst->start + 1, 2, 1, 1, dst->nparam, -1); + isl_dim_map_range(dim_map, dst->start + 2, 2, 1, 1, dst->nparam, 1); + isl_dim_map_range(dim_map, dst->start + 2 * dst->nparam + 1, 2, + isl_space_dim(dim, isl_dim_set) + src->nvar, 1, + dst->nvar, -1); + isl_dim_map_range(dim_map, dst->start + 2 * dst->nparam + 2, 2, + isl_space_dim(dim, isl_dim_set) + src->nvar, 1, + dst->nvar, 1); + + isl_dim_map_range(dim_map, src->start, 0, 0, 0, 1, -1); + isl_dim_map_range(dim_map, src->start + 1, 2, 1, 1, src->nparam, 1); + isl_dim_map_range(dim_map, src->start + 2, 2, 1, 1, src->nparam, -1); + isl_dim_map_range(dim_map, src->start + 2 * src->nparam + 1, 2, + isl_space_dim(dim, isl_dim_set), 1, + src->nvar, 1); + isl_dim_map_range(dim_map, src->start + 2 * src->nparam + 2, 2, + isl_space_dim(dim, isl_dim_set), 1, + src->nvar, -1); + + graph->lp = isl_basic_set_extend_constraints(graph->lp, + coef->n_eq, coef->n_ineq); + graph->lp = isl_basic_set_add_constraints_dim_map(graph->lp, + coef, dim_map); + isl_space_free(dim); + + return 0; +} + +/* Add constraints to graph->lp that force all (conditional) validity + * dependences to be respected and attempt to carry them. + */ +static int add_all_constraints(struct isl_sched_graph *graph) +{ + int i, j; + int pos; + + pos = 0; + for (i = 0; i < graph->n_edge; ++i) { + struct isl_sched_edge *edge= &graph->edge[i]; + + if (!edge->validity && !edge->conditional_validity) + continue; + + for (j = 0; j < edge->map->n; ++j) { + isl_basic_map *bmap; + isl_map *map; + + bmap = isl_basic_map_copy(edge->map->p[j]); + map = isl_map_from_basic_map(bmap); + + if (edge->src == edge->dst && + add_intra_constraints(graph, edge, map, pos) < 0) + return -1; + if (edge->src != edge->dst && + add_inter_constraints(graph, edge, map, pos) < 0) + return -1; + ++pos; + } + } + + return 0; +} + +/* Count the number of equality and inequality constraints + * that will be added to the carry_lp problem. + * We count each edge exactly once. + */ +static int count_all_constraints(struct isl_sched_graph *graph, + int *n_eq, int *n_ineq) +{ + int i, j; + + *n_eq = *n_ineq = 0; + for (i = 0; i < graph->n_edge; ++i) { + struct isl_sched_edge *edge= &graph->edge[i]; + for (j = 0; j < edge->map->n; ++j) { + isl_basic_map *bmap; + isl_map *map; + + bmap = isl_basic_map_copy(edge->map->p[j]); + map = isl_map_from_basic_map(bmap); + + if (count_map_constraints(graph, edge, map, + n_eq, n_ineq, 1, 0) < 0) + return -1; + } + } + + return 0; +} + +/* Construct an LP problem for finding schedule coefficients + * such that the schedule carries as many dependences as possible. + * In particular, for each dependence i, we bound the dependence distance + * from below by e_i, with 0 <= e_i <= 1 and then maximize the sum + * of all e_i's. Dependences with e_i = 0 in the solution are simply + * respected, while those with e_i > 0 (in practice e_i = 1) are carried. + * Note that if the dependence relation is a union of basic maps, + * then we have to consider each basic map individually as it may only + * be possible to carry the dependences expressed by some of those + * basic maps and not all of them. + * Below, we consider each of those basic maps as a separate "edge". + * + * All variables of the LP are non-negative. The actual coefficients + * may be negative, so each coefficient is represented as the difference + * of two non-negative variables. The negative part always appears + * immediately before the positive part. + * Other than that, the variables have the following order + * + * - sum of (1 - e_i) over all edges + * - sum of positive and negative parts of all c_n coefficients + * (unconstrained when computing non-parametric schedules) + * - sum of positive and negative parts of all c_x coefficients + * - for each edge + * - e_i + * - for each node + * - c_i_0 + * - positive and negative parts of c_i_n (if parametric) + * - positive and negative parts of c_i_x + * + * The constraints are those from the (validity) edges plus three equalities + * to express the sums and n_edge inequalities to express e_i <= 1. + */ +static int setup_carry_lp(isl_ctx *ctx, struct isl_sched_graph *graph) +{ + int i, j; + int k; + isl_space *dim; + unsigned total; + int n_eq, n_ineq; + int n_edge; + + n_edge = 0; + for (i = 0; i < graph->n_edge; ++i) + n_edge += graph->edge[i].map->n; + + total = 3 + n_edge; + for (i = 0; i < graph->n; ++i) { + struct isl_sched_node *node = &graph->node[graph->sorted[i]]; + node->start = total; + total += 1 + 2 * (node->nparam + node->nvar); + } + + if (count_all_constraints(graph, &n_eq, &n_ineq) < 0) + return -1; + + dim = isl_space_set_alloc(ctx, 0, total); + isl_basic_set_free(graph->lp); + n_eq += 3; + n_ineq += n_edge; + graph->lp = isl_basic_set_alloc_space(dim, 0, n_eq, n_ineq); + graph->lp = isl_basic_set_set_rational(graph->lp); + + k = isl_basic_set_alloc_equality(graph->lp); + if (k < 0) + return -1; + isl_seq_clr(graph->lp->eq[k], 1 + total); + isl_int_set_si(graph->lp->eq[k][0], -n_edge); + isl_int_set_si(graph->lp->eq[k][1], 1); + for (i = 0; i < n_edge; ++i) + isl_int_set_si(graph->lp->eq[k][4 + i], 1); + + k = isl_basic_set_alloc_equality(graph->lp); + if (k < 0) + return -1; + isl_seq_clr(graph->lp->eq[k], 1 + total); + isl_int_set_si(graph->lp->eq[k][2], -1); + for (i = 0; i < graph->n; ++i) { + int pos = 1 + graph->node[i].start + 1; + + for (j = 0; j < 2 * graph->node[i].nparam; ++j) + isl_int_set_si(graph->lp->eq[k][pos + j], 1); + } + + k = isl_basic_set_alloc_equality(graph->lp); + if (k < 0) + return -1; + isl_seq_clr(graph->lp->eq[k], 1 + total); + isl_int_set_si(graph->lp->eq[k][3], -1); + for (i = 0; i < graph->n; ++i) { + struct isl_sched_node *node = &graph->node[i]; + int pos = 1 + node->start + 1 + 2 * node->nparam; + + for (j = 0; j < 2 * node->nvar; ++j) + isl_int_set_si(graph->lp->eq[k][pos + j], 1); + } + + for (i = 0; i < n_edge; ++i) { + k = isl_basic_set_alloc_inequality(graph->lp); + if (k < 0) + return -1; + isl_seq_clr(graph->lp->ineq[k], 1 + total); + isl_int_set_si(graph->lp->ineq[k][4 + i], -1); + isl_int_set_si(graph->lp->ineq[k][0], 1); + } + + if (add_all_constraints(graph) < 0) + return -1; + + return 0; +} + +static __isl_give isl_schedule_node *compute_component_schedule( + __isl_take isl_schedule_node *node, struct isl_sched_graph *graph, + int wcc); + +/* Comparison function for sorting the statements based on + * the corresponding value in "r". + */ +static int smaller_value(const void *a, const void *b, void *data) +{ + isl_vec *r = data; + const int *i1 = a; + const int *i2 = b; + + return isl_int_cmp(r->el[*i1], r->el[*i2]); +} + +/* If the schedule_split_scaled option is set and if the linear + * parts of the scheduling rows for all nodes in the graphs have + * a non-trivial common divisor, then split off the remainder of the + * constant term modulo this common divisor from the linear part. + * Otherwise, insert a band node directly and continue with + * the construction of the schedule. + * + * If a non-trivial common divisor is found, then + * the linear part is reduced and the remainder is enforced + * by a sequence node with the children placed in the order + * of this remainder. + * In particular, we assign an scc index based on the remainder and + * then rely on compute_component_schedule to insert the sequence and + * to continue the schedule construction on each part. + */ +static __isl_give isl_schedule_node *split_scaled( + __isl_take isl_schedule_node *node, struct isl_sched_graph *graph) +{ + int i; + int row; + int scc; + isl_ctx *ctx; + isl_int gcd, gcd_i; + isl_vec *r; + int *order; + + if (!node) + return NULL; + + ctx = isl_schedule_node_get_ctx(node); + if (!ctx->opt->schedule_split_scaled) + return compute_next_band(node, graph, 0); + if (graph->n <= 1) + return compute_next_band(node, graph, 0); + + isl_int_init(gcd); + isl_int_init(gcd_i); + + isl_int_set_si(gcd, 0); + + row = isl_mat_rows(graph->node[0].sched) - 1; + + for (i = 0; i < graph->n; ++i) { + struct isl_sched_node *node = &graph->node[i]; + int cols = isl_mat_cols(node->sched); + + isl_seq_gcd(node->sched->row[row] + 1, cols - 1, &gcd_i); + isl_int_gcd(gcd, gcd, gcd_i); + } + + isl_int_clear(gcd_i); + + if (isl_int_cmp_si(gcd, 1) <= 0) { + isl_int_clear(gcd); + return compute_next_band(node, graph, 0); + } + + r = isl_vec_alloc(ctx, graph->n); + order = isl_calloc_array(ctx, int, graph->n); + if (!r || !order) + goto error; + + for (i = 0; i < graph->n; ++i) { + struct isl_sched_node *node = &graph->node[i]; + + order[i] = i; + isl_int_fdiv_r(r->el[i], node->sched->row[row][0], gcd); + isl_int_fdiv_q(node->sched->row[row][0], + node->sched->row[row][0], gcd); + isl_int_mul(node->sched->row[row][0], + node->sched->row[row][0], gcd); + node->sched = isl_mat_scale_down_row(node->sched, row, gcd); + if (!node->sched) + goto error; + } + + if (isl_sort(order, graph->n, sizeof(order[0]), &smaller_value, r) < 0) + goto error; + + scc = 0; + for (i = 0; i < graph->n; ++i) { + if (i > 0 && isl_int_ne(r->el[order[i - 1]], r->el[order[i]])) + ++scc; + graph->node[order[i]].scc = scc; + } + graph->scc = ++scc; + graph->weak = 0; + + isl_int_clear(gcd); + isl_vec_free(r); + free(order); + + if (update_edges(ctx, graph) < 0) + return isl_schedule_node_free(node); + node = insert_current_band(node, graph, 0); + next_band(graph); + + node = isl_schedule_node_child(node, 0); + node = compute_component_schedule(node, graph, 0); + node = isl_schedule_node_parent(node); + + return node; +error: + isl_vec_free(r); + free(order); + isl_int_clear(gcd); + return isl_schedule_node_free(node); +} + +/* Is the schedule row "sol" trivial on node "node"? + * That is, is the solution zero on the dimensions orthogonal to + * the previously found solutions? + * Return 1 if the solution is trivial, 0 if it is not and -1 on error. + * + * Each coefficient is represented as the difference between + * two non-negative values in "sol". "sol" has been computed + * in terms of the original iterators (i.e., without use of cmap). + * We construct the schedule row s and write it as a linear + * combination of (linear combinations of) previously computed schedule rows. + * s = Q c or c = U s. + * If the final entries of c are all zero, then the solution is trivial. + */ +static int is_trivial(struct isl_sched_node *node, __isl_keep isl_vec *sol) +{ + int i; + int pos; + int trivial; + isl_ctx *ctx; + isl_vec *node_sol; + + if (!sol) + return -1; + if (node->nvar == node->rank) + return 0; + + ctx = isl_vec_get_ctx(sol); + node_sol = isl_vec_alloc(ctx, node->nvar); + if (!node_sol) + return -1; + + pos = 1 + node->start + 1 + 2 * node->nparam; + + for (i = 0; i < node->nvar; ++i) + isl_int_sub(node_sol->el[i], + sol->el[pos + 2 * i + 1], sol->el[pos + 2 * i]); + + node_sol = isl_mat_vec_product(isl_mat_copy(node->cinv), node_sol); + + if (!node_sol) + return -1; + + trivial = isl_seq_first_non_zero(node_sol->el + node->rank, + node->nvar - node->rank) == -1; + + isl_vec_free(node_sol); + + return trivial; +} + +/* Is the schedule row "sol" trivial on any node where it should + * not be trivial? + * "sol" has been computed in terms of the original iterators + * (i.e., without use of cmap). + * Return 1 if any solution is trivial, 0 if they are not and -1 on error. + */ +static int is_any_trivial(struct isl_sched_graph *graph, + __isl_keep isl_vec *sol) +{ + int i; + + for (i = 0; i < graph->n; ++i) { + struct isl_sched_node *node = &graph->node[i]; + int trivial; + + if (!needs_row(graph, node)) + continue; + trivial = is_trivial(node, sol); + if (trivial < 0 || trivial) + return trivial; + } + + return 0; +} + +/* Construct a schedule row for each node such that as many dependences + * as possible are carried and then continue with the next band. + * + * If the computed schedule row turns out to be trivial on one or + * more nodes where it should not be trivial, then we throw it away + * and try again on each component separately. + * + * If there is only one component, then we accept the schedule row anyway, + * but we do not consider it as a complete row and therefore do not + * increment graph->n_row. Note that the ranks of the nodes that + * do get a non-trivial schedule part will get updated regardless and + * graph->maxvar is computed based on these ranks. The test for + * whether more schedule rows are required in compute_schedule_wcc + * is therefore not affected. + * + * Insert a band corresponding to the schedule row at position "node" + * of the schedule tree and continue with the construction of the schedule. + * This insertion and the continued construction is performed by split_scaled + * after optionally checking for non-trivial common divisors. + */ +static __isl_give isl_schedule_node *carry_dependences( + __isl_take isl_schedule_node *node, struct isl_sched_graph *graph) +{ + int i; + int n_edge; + int trivial; + isl_ctx *ctx; + isl_vec *sol; + isl_basic_set *lp; + + if (!node) + return NULL; + + n_edge = 0; + for (i = 0; i < graph->n_edge; ++i) + n_edge += graph->edge[i].map->n; + + ctx = isl_schedule_node_get_ctx(node); + if (setup_carry_lp(ctx, graph) < 0) + return isl_schedule_node_free(node); + + lp = isl_basic_set_copy(graph->lp); + sol = isl_tab_basic_set_non_neg_lexmin(lp); + if (!sol) + return isl_schedule_node_free(node); + + if (sol->size == 0) { + isl_vec_free(sol); + isl_die(ctx, isl_error_internal, + "error in schedule construction", + return isl_schedule_node_free(node)); + } + + isl_int_divexact(sol->el[1], sol->el[1], sol->el[0]); + if (isl_int_cmp_si(sol->el[1], n_edge) >= 0) { + isl_vec_free(sol); + isl_die(ctx, isl_error_unknown, + "unable to carry dependences", + return isl_schedule_node_free(node)); + } + + trivial = is_any_trivial(graph, sol); + if (trivial < 0) { + sol = isl_vec_free(sol); + } else if (trivial && graph->scc > 1) { + isl_vec_free(sol); + return compute_component_schedule(node, graph, 1); + } + + if (update_schedule(graph, sol, 0, 0) < 0) + return isl_schedule_node_free(node); + if (trivial) + graph->n_row--; + + return split_scaled(node, graph); +} + +/* Topologically sort statements mapped to the same schedule iteration + * and add insert a sequence node in front of "node" + * corresponding to this order. + * + * If it turns out to be impossible to sort the statements apart, + * because different dependences impose different orderings + * on the statements, then we extend the schedule such that + * it carries at least one more dependence. + */ +static __isl_give isl_schedule_node *sort_statements( + __isl_take isl_schedule_node *node, struct isl_sched_graph *graph) +{ + isl_ctx *ctx; + isl_union_set_list *filters; + + if (!node) + return NULL; + + ctx = isl_schedule_node_get_ctx(node); + if (graph->n < 1) + isl_die(ctx, isl_error_internal, + "graph should have at least one node", + return isl_schedule_node_free(node)); + + if (graph->n == 1) + return node; + + if (update_edges(ctx, graph) < 0) + return isl_schedule_node_free(node); + + if (graph->n_edge == 0) + return node; + + if (detect_sccs(ctx, graph) < 0) + return isl_schedule_node_free(node); + + next_band(graph); + if (graph->scc < graph->n) + return carry_dependences(node, graph); + + filters = extract_sccs(ctx, graph); + node = isl_schedule_node_insert_sequence(node, filters); + + return node; +} + +/* Are there any (non-empty) (conditional) validity edges in the graph? + */ +static int has_validity_edges(struct isl_sched_graph *graph) +{ + int i; + + for (i = 0; i < graph->n_edge; ++i) { + int empty; + + empty = isl_map_plain_is_empty(graph->edge[i].map); + if (empty < 0) + return -1; + if (empty) + continue; + if (graph->edge[i].validity || + graph->edge[i].conditional_validity) + return 1; + } + + return 0; +} + +/* Should we apply a Feautrier step? + * That is, did the user request the Feautrier algorithm and are + * there any validity dependences (left)? + */ +static int need_feautrier_step(isl_ctx *ctx, struct isl_sched_graph *graph) +{ + if (ctx->opt->schedule_algorithm != ISL_SCHEDULE_ALGORITHM_FEAUTRIER) + return 0; + + return has_validity_edges(graph); +} + +/* Compute a schedule for a connected dependence graph using Feautrier's + * multi-dimensional scheduling algorithm and return the updated schedule node. + * + * The original algorithm is described in [1]. + * The main idea is to minimize the number of scheduling dimensions, by + * trying to satisfy as many dependences as possible per scheduling dimension. + * + * [1] P. Feautrier, Some Efficient Solutions to the Affine Scheduling + * Problem, Part II: Multi-Dimensional Time. + * In Intl. Journal of Parallel Programming, 1992. + */ +static __isl_give isl_schedule_node *compute_schedule_wcc_feautrier( + isl_schedule_node *node, struct isl_sched_graph *graph) +{ + return carry_dependences(node, graph); +} + +/* Turn off the "local" bit on all (condition) edges. + */ +static void clear_local_edges(struct isl_sched_graph *graph) +{ + int i; + + for (i = 0; i < graph->n_edge; ++i) + if (graph->edge[i].condition) + graph->edge[i].local = 0; +} + +/* Does "graph" have both condition and conditional validity edges? + */ +static int need_condition_check(struct isl_sched_graph *graph) +{ + int i; + int any_condition = 0; + int any_conditional_validity = 0; + + for (i = 0; i < graph->n_edge; ++i) { + if (graph->edge[i].condition) + any_condition = 1; + if (graph->edge[i].conditional_validity) + any_conditional_validity = 1; + } + + return any_condition && any_conditional_validity; +} + +/* Does "graph" contain any coincidence edge? + */ +static int has_any_coincidence(struct isl_sched_graph *graph) +{ + int i; + + for (i = 0; i < graph->n_edge; ++i) + if (graph->edge[i].coincidence) + return 1; + + return 0; +} + +/* Extract the final schedule row as a map with the iteration domain + * of "node" as domain. + */ +static __isl_give isl_map *final_row(struct isl_sched_node *node) +{ + isl_local_space *ls; + isl_aff *aff; + int row; + + row = isl_mat_rows(node->sched) - 1; + ls = isl_local_space_from_space(isl_space_copy(node->space)); + aff = extract_schedule_row(ls, node, row); + return isl_map_from_aff(aff); +} + +/* Is the conditional validity dependence in the edge with index "edge_index" + * violated by the latest (i.e., final) row of the schedule? + * That is, is i scheduled after j + * for any conditional validity dependence i -> j? + */ +static int is_violated(struct isl_sched_graph *graph, int edge_index) +{ + isl_map *src_sched, *dst_sched, *map; + struct isl_sched_edge *edge = &graph->edge[edge_index]; + int empty; + + src_sched = final_row(edge->src); + dst_sched = final_row(edge->dst); + map = isl_map_copy(edge->map); + map = isl_map_apply_domain(map, src_sched); + map = isl_map_apply_range(map, dst_sched); + map = isl_map_order_gt(map, isl_dim_in, 0, isl_dim_out, 0); + empty = isl_map_is_empty(map); + isl_map_free(map); + + if (empty < 0) + return -1; + + return !empty; +} + +/* Does "graph" have any satisfied condition edges that + * are adjacent to the conditional validity constraint with + * domain "conditional_source" and range "conditional_sink"? + * + * A satisfied condition is one that is not local. + * If a condition was forced to be local already (i.e., marked as local) + * then there is no need to check if it is in fact local. + * + * Additionally, mark all adjacent condition edges found as local. + */ +static int has_adjacent_true_conditions(struct isl_sched_graph *graph, + __isl_keep isl_union_set *conditional_source, + __isl_keep isl_union_set *conditional_sink) +{ + int i; + int any = 0; + + for (i = 0; i < graph->n_edge; ++i) { + int adjacent, local; + isl_union_map *condition; + + if (!graph->edge[i].condition) + continue; + if (graph->edge[i].local) + continue; + + condition = graph->edge[i].tagged_condition; + adjacent = domain_intersects(condition, conditional_sink); + if (adjacent >= 0 && !adjacent) + adjacent = range_intersects(condition, + conditional_source); + if (adjacent < 0) + return -1; + if (!adjacent) + continue; + + graph->edge[i].local = 1; + + local = is_condition_false(&graph->edge[i]); + if (local < 0) + return -1; + if (!local) + any = 1; + } + + return any; +} + +/* Are there any violated conditional validity dependences with + * adjacent condition dependences that are not local with respect + * to the current schedule? + * That is, is the conditional validity constraint violated? + * + * Additionally, mark all those adjacent condition dependences as local. + * We also mark those adjacent condition dependences that were not marked + * as local before, but just happened to be local already. This ensures + * that they remain local if the schedule is recomputed. + * + * We first collect domain and range of all violated conditional validity + * dependences and then check if there are any adjacent non-local + * condition dependences. + */ +static int has_violated_conditional_constraint(isl_ctx *ctx, + struct isl_sched_graph *graph) +{ + int i; + int any = 0; + isl_union_set *source, *sink; + + source = isl_union_set_empty(isl_space_params_alloc(ctx, 0)); + sink = isl_union_set_empty(isl_space_params_alloc(ctx, 0)); + for (i = 0; i < graph->n_edge; ++i) { + isl_union_set *uset; + isl_union_map *umap; + int violated; + + if (!graph->edge[i].conditional_validity) + continue; + + violated = is_violated(graph, i); + if (violated < 0) + goto error; + if (!violated) + continue; + + any = 1; + + umap = isl_union_map_copy(graph->edge[i].tagged_validity); + uset = isl_union_map_domain(umap); + source = isl_union_set_union(source, uset); + source = isl_union_set_coalesce(source); + + umap = isl_union_map_copy(graph->edge[i].tagged_validity); + uset = isl_union_map_range(umap); + sink = isl_union_set_union(sink, uset); + sink = isl_union_set_coalesce(sink); + } + + if (any) + any = has_adjacent_true_conditions(graph, source, sink); + + isl_union_set_free(source); + isl_union_set_free(sink); + return any; +error: + isl_union_set_free(source); + isl_union_set_free(sink); + return -1; +} + +/* Compute a schedule for a connected dependence graph and return + * the updated schedule node. + * + * We try to find a sequence of as many schedule rows as possible that result + * in non-negative dependence distances (independent of the previous rows + * in the sequence, i.e., such that the sequence is tilable), with as + * many of the initial rows as possible satisfying the coincidence constraints. + * If we can't find any more rows we either + * - split between SCCs and start over (assuming we found an interesting + * pair of SCCs between which to split) + * - continue with the next band (assuming the current band has at least + * one row) + * - try to carry as many dependences as possible and continue with the next + * band + * In each case, we first insert a band node in the schedule tree + * if any rows have been computed. + * + * If Feautrier's algorithm is selected, we first recursively try to satisfy + * as many validity dependences as possible. When all validity dependences + * are satisfied we extend the schedule to a full-dimensional schedule. + * + * If we manage to complete the schedule, we insert a band node + * (if any schedule rows were computed) and we finish off by topologically + * sorting the statements based on the remaining dependences. + * + * If ctx->opt->schedule_outer_coincidence is set, then we force the + * outermost dimension to satisfy the coincidence constraints. If this + * turns out to be impossible, we fall back on the general scheme above + * and try to carry as many dependences as possible. + * + * If "graph" contains both condition and conditional validity dependences, + * then we need to check that that the conditional schedule constraint + * is satisfied, i.e., there are no violated conditional validity dependences + * that are adjacent to any non-local condition dependences. + * If there are, then we mark all those adjacent condition dependences + * as local and recompute the current band. Those dependences that + * are marked local will then be forced to be local. + * The initial computation is performed with no dependences marked as local. + * If we are lucky, then there will be no violated conditional validity + * dependences adjacent to any non-local condition dependences. + * Otherwise, we mark some additional condition dependences as local and + * recompute. We continue this process until there are no violations left or + * until we are no longer able to compute a schedule. + * Since there are only a finite number of dependences, + * there will only be a finite number of iterations. + */ +static __isl_give isl_schedule_node *compute_schedule_wcc( + __isl_take isl_schedule_node *node, struct isl_sched_graph *graph) +{ + int has_coincidence; + int use_coincidence; + int force_coincidence = 0; + int check_conditional; + int insert; + isl_ctx *ctx; + + if (!node) + return NULL; + + ctx = isl_schedule_node_get_ctx(node); + if (detect_sccs(ctx, graph) < 0) + return isl_schedule_node_free(node); + if (sort_sccs(graph) < 0) + return isl_schedule_node_free(node); + + if (compute_maxvar(graph) < 0) + return isl_schedule_node_free(node); + + if (need_feautrier_step(ctx, graph)) + return compute_schedule_wcc_feautrier(node, graph); + + clear_local_edges(graph); + check_conditional = need_condition_check(graph); + has_coincidence = has_any_coincidence(graph); + + if (ctx->opt->schedule_outer_coincidence) + force_coincidence = 1; + + use_coincidence = has_coincidence; + while (graph->n_row < graph->maxvar) { + isl_vec *sol; + int violated; + int coincident; + + graph->src_scc = -1; + graph->dst_scc = -1; + + if (setup_lp(ctx, graph, use_coincidence) < 0) + return isl_schedule_node_free(node); + sol = solve_lp(graph); + if (!sol) + return isl_schedule_node_free(node); + if (sol->size == 0) { + int empty = graph->n_total_row == graph->band_start; + + isl_vec_free(sol); + if (use_coincidence && (!force_coincidence || !empty)) { + use_coincidence = 0; + continue; + } + if (!ctx->opt->schedule_maximize_band_depth && !empty) + return compute_next_band(node, graph, 1); + if (graph->src_scc >= 0) + return compute_split_schedule(node, graph); + if (!empty) + return compute_next_band(node, graph, 1); + return carry_dependences(node, graph); + } + coincident = !has_coincidence || use_coincidence; + if (update_schedule(graph, sol, 1, coincident) < 0) + return isl_schedule_node_free(node); + + if (!check_conditional) + continue; + violated = has_violated_conditional_constraint(ctx, graph); + if (violated < 0) + return isl_schedule_node_free(node); + if (!violated) + continue; + if (reset_band(graph) < 0) + return isl_schedule_node_free(node); + use_coincidence = has_coincidence; + } + + insert = graph->n_total_row > graph->band_start; + if (insert) { + node = insert_current_band(node, graph, 1); + node = isl_schedule_node_child(node, 0); + } + node = sort_statements(node, graph); + if (insert) + node = isl_schedule_node_parent(node); + + return node; +} + +/* Compute a schedule for each group of nodes identified by node->scc + * separately and then combine them in a sequence node (or as set node + * if graph->weak is set) inserted at position "node" of the schedule tree. + * Return the updated schedule node. + * + * If "wcc" is set then each of the groups belongs to a single + * weakly connected component in the dependence graph so that + * there is no need for compute_sub_schedule to look for weakly + * connected components. + */ +static __isl_give isl_schedule_node *compute_component_schedule( + __isl_take isl_schedule_node *node, struct isl_sched_graph *graph, + int wcc) +{ + int component, i; + int n, n_edge; + isl_ctx *ctx; + isl_union_set_list *filters; + + if (!node) + return NULL; + ctx = isl_schedule_node_get_ctx(node); + + filters = extract_sccs(ctx, graph); + if (graph->weak) + node = isl_schedule_node_insert_set(node, filters); + else + node = isl_schedule_node_insert_sequence(node, filters); + + for (component = 0; component < graph->scc; ++component) { + n = 0; + for (i = 0; i < graph->n; ++i) + if (graph->node[i].scc == component) + n++; + n_edge = 0; + for (i = 0; i < graph->n_edge; ++i) + if (graph->edge[i].src->scc == component && + graph->edge[i].dst->scc == component) + n_edge++; + + node = isl_schedule_node_child(node, component); + node = isl_schedule_node_child(node, 0); + node = compute_sub_schedule(node, ctx, graph, n, n_edge, + &node_scc_exactly, + &edge_scc_exactly, component, wcc); + node = isl_schedule_node_parent(node); + node = isl_schedule_node_parent(node); + } + + return node; +} + +/* Compute a schedule for the given dependence graph and insert it at "node". + * Return the updated schedule node. + * + * We first check if the graph is connected (through validity and conditional + * validity dependences) and, if not, compute a schedule + * for each component separately. + * If the schedule_serialize_sccs option is set, then we check for strongly + * connected components instead and compute a separate schedule for + * each such strongly connected component. + */ +static __isl_give isl_schedule_node *compute_schedule(isl_schedule_node *node, + struct isl_sched_graph *graph) +{ + isl_ctx *ctx; + + if (!node) + return NULL; + + ctx = isl_schedule_node_get_ctx(node); + if (isl_options_get_schedule_serialize_sccs(ctx)) { + if (detect_sccs(ctx, graph) < 0) + return isl_schedule_node_free(node); + } else { + if (detect_wccs(ctx, graph) < 0) + return isl_schedule_node_free(node); + } + + if (graph->scc > 1) + return compute_component_schedule(node, graph, 1); + + return compute_schedule_wcc(node, graph); +} + +/* Compute a schedule on sc->domain that respects the given schedule + * constraints. + * + * In particular, the schedule respects all the validity dependences. + * If the default isl scheduling algorithm is used, it tries to minimize + * the dependence distances over the proximity dependences. + * If Feautrier's scheduling algorithm is used, the proximity dependence + * distances are only minimized during the extension to a full-dimensional + * schedule. + * + * If there are any condition and conditional validity dependences, + * then the conditional validity dependences may be violated inside + * a tilable band, provided they have no adjacent non-local + * condition dependences. + * + * The context is included in the domain before the nodes of + * the graphs are extracted in order to be able to exploit + * any possible additional equalities. + * However, the returned schedule contains the original domain + * (before this intersection). + */ +__isl_give isl_schedule *isl_schedule_constraints_compute_schedule( + __isl_take isl_schedule_constraints *sc) +{ + isl_ctx *ctx = isl_schedule_constraints_get_ctx(sc); + struct isl_sched_graph graph = { 0 }; + isl_schedule *sched; + isl_schedule_node *node; + isl_union_set *domain; + struct isl_extract_edge_data data; + enum isl_edge_type i; + int r; + + sc = isl_schedule_constraints_align_params(sc); + if (!sc) + return NULL; + + graph.n = isl_union_set_n_set(sc->domain); + if (graph.n == 0) { + isl_union_set *domain = isl_union_set_copy(sc->domain); + sched = isl_schedule_from_domain(domain); + goto done; + } + if (graph_alloc(ctx, &graph, graph.n, + isl_schedule_constraints_n_map(sc)) < 0) + goto error; + if (compute_max_row(&graph, sc) < 0) + goto error; + graph.root = 1; + graph.n = 0; + domain = isl_union_set_copy(sc->domain); + domain = isl_union_set_intersect_params(domain, + isl_set_copy(sc->context)); + r = isl_union_set_foreach_set(domain, &extract_node, &graph); + isl_union_set_free(domain); + if (r < 0) + goto error; + if (graph_init_table(ctx, &graph) < 0) + goto error; + for (i = isl_edge_first; i <= isl_edge_last; ++i) + graph.max_edge[i] = isl_union_map_n_map(sc->constraint[i]); + if (graph_init_edge_tables(ctx, &graph) < 0) + goto error; + graph.n_edge = 0; + data.graph = &graph; + for (i = isl_edge_first; i <= isl_edge_last; ++i) { + data.type = i; + if (isl_union_map_foreach_map(sc->constraint[i], + &extract_edge, &data) < 0) + goto error; + } + + node = isl_schedule_node_from_domain(isl_union_set_copy(sc->domain)); + node = isl_schedule_node_child(node, 0); + if (graph.n > 0) + node = compute_schedule(node, &graph); + sched = isl_schedule_node_get_schedule(node); + isl_schedule_node_free(node); + +done: + graph_free(ctx, &graph); + isl_schedule_constraints_free(sc); + + return sched; +error: + graph_free(ctx, &graph); + isl_schedule_constraints_free(sc); + return NULL; +} + +/* Compute a schedule for the given union of domains that respects + * all the validity dependences and minimizes + * the dependence distances over the proximity dependences. + * + * This function is kept for backward compatibility. + */ +__isl_give isl_schedule *isl_union_set_compute_schedule( + __isl_take isl_union_set *domain, + __isl_take isl_union_map *validity, + __isl_take isl_union_map *proximity) +{ + isl_schedule_constraints *sc; + + sc = isl_schedule_constraints_on_domain(domain); + sc = isl_schedule_constraints_set_validity(sc, validity); + sc = isl_schedule_constraints_set_proximity(sc, proximity); + + return isl_schedule_constraints_compute_schedule(sc); +} diff -Nru cloog-0.18.2/isl/isl_schedule_read.c cloog-0.18.4/isl/isl_schedule_read.c --- cloog-0.18.2/isl/isl_schedule_read.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_schedule_read.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,820 @@ +#include + +#include +#include +#include +#include + +/* An enumeration of the various keys that may appear in a YAML mapping + * of a schedule. + */ +enum isl_schedule_key { + isl_schedule_key_error = -1, + isl_schedule_key_child, + isl_schedule_key_coincident, + isl_schedule_key_context, + isl_schedule_key_contraction, + isl_schedule_key_domain, + isl_schedule_key_expansion, + isl_schedule_key_extension, + isl_schedule_key_filter, + isl_schedule_key_guard, + isl_schedule_key_leaf, + isl_schedule_key_mark, + isl_schedule_key_options, + isl_schedule_key_permutable, + isl_schedule_key_schedule, + isl_schedule_key_sequence, + isl_schedule_key_set +}; + +/* Extract a mapping key from the token "tok". + * Return isl_schedule_key_error on error, i.e., if "tok" does not + * correspond to any known key. + */ +static enum isl_schedule_key extract_key(__isl_keep isl_stream *s, + struct isl_token *tok) +{ + int type; + char *name; + enum isl_schedule_key key; + isl_ctx *ctx; + + ctx = isl_stream_get_ctx(s); + type = isl_token_get_type(tok); + if (type != ISL_TOKEN_IDENT && type != ISL_TOKEN_STRING) { + isl_stream_error(s, tok, "expecting key"); + return isl_schedule_key_error; + } + name = isl_token_get_str(ctx, tok); + if (!strcmp(name, "child")) + key = isl_schedule_key_child; + else if (!strcmp(name, "coincident")) + key = isl_schedule_key_coincident; + else if (!strcmp(name, "context")) + key = isl_schedule_key_context; + else if (!strcmp(name, "contraction")) + key = isl_schedule_key_contraction; + else if (!strcmp(name, "domain")) + key = isl_schedule_key_domain; + else if (!strcmp(name, "expansion")) + key = isl_schedule_key_expansion; + else if (!strcmp(name, "extension")) + key = isl_schedule_key_extension; + else if (!strcmp(name, "filter")) + key = isl_schedule_key_filter; + else if (!strcmp(name, "guard")) + key = isl_schedule_key_guard; + else if (!strcmp(name, "leaf")) + key = isl_schedule_key_leaf; + else if (!strcmp(name, "mark")) + key = isl_schedule_key_mark; + else if (!strcmp(name, "options")) + key = isl_schedule_key_options; + else if (!strcmp(name, "schedule")) + key = isl_schedule_key_schedule; + else if (!strcmp(name, "sequence")) + key = isl_schedule_key_sequence; + else if (!strcmp(name, "set")) + key = isl_schedule_key_set; + else if (!strcmp(name, "permutable")) + key = isl_schedule_key_permutable; + else + isl_die(ctx, isl_error_invalid, "unknown key", + key = isl_schedule_key_error); + free(name); + return key; +} + +/* Read a key from "s" and return the corresponding enum. + * Return isl_schedule_key_error on error, i.e., if the first token + * on the stream does not correspond to any known key. + */ +static enum isl_schedule_key get_key(__isl_keep isl_stream *s) +{ + struct isl_token *tok; + enum isl_schedule_key key; + + tok = isl_stream_next_token(s); + key = extract_key(s, tok); + isl_token_free(tok); + + return key; +} + +static __isl_give isl_schedule_tree *isl_stream_read_schedule_tree( + __isl_keep isl_stream *s); + +/* Read a subtree with context root node from "s". + */ +static __isl_give isl_schedule_tree *read_context(__isl_keep isl_stream *s) +{ + isl_set *context = NULL; + isl_schedule_tree *tree; + isl_ctx *ctx; + struct isl_token *tok; + enum isl_schedule_key key; + char *str; + int more; + + ctx = isl_stream_get_ctx(s); + + key = get_key(s); + + if (isl_stream_yaml_next(s) < 0) + return NULL; + + tok = isl_stream_next_token(s); + if (!tok) { + isl_stream_error(s, NULL, "unexpected EOF"); + return NULL; + } + str = isl_token_get_str(ctx, tok); + context = isl_set_read_from_str(ctx, str); + free(str); + isl_token_free(tok); + + more = isl_stream_yaml_next(s); + if (more < 0) + goto error; + if (!more) { + tree = isl_schedule_tree_from_context(context); + } else { + key = get_key(s); + if (key != isl_schedule_key_child) + isl_die(ctx, isl_error_invalid, "expecting child", + goto error); + if (isl_stream_yaml_next(s) < 0) + goto error; + tree = isl_stream_read_schedule_tree(s); + tree = isl_schedule_tree_insert_context(tree, context); + } + + return tree; +error: + isl_set_free(context); + return NULL; +} + +/* Read a subtree with domain root node from "s". + */ +static __isl_give isl_schedule_tree *read_domain(__isl_keep isl_stream *s) +{ + isl_union_set *domain = NULL; + isl_schedule_tree *tree; + isl_ctx *ctx; + struct isl_token *tok; + enum isl_schedule_key key; + char *str; + int more; + + ctx = isl_stream_get_ctx(s); + + key = get_key(s); + + if (isl_stream_yaml_next(s) < 0) + return NULL; + + tok = isl_stream_next_token(s); + if (!tok) { + isl_stream_error(s, NULL, "unexpected EOF"); + return NULL; + } + str = isl_token_get_str(ctx, tok); + domain = isl_union_set_read_from_str(ctx, str); + free(str); + isl_token_free(tok); + + more = isl_stream_yaml_next(s); + if (more < 0) + goto error; + if (!more) { + tree = isl_schedule_tree_from_domain(domain); + } else { + key = get_key(s); + if (key != isl_schedule_key_child) + isl_die(ctx, isl_error_invalid, "expecting child", + goto error); + if (isl_stream_yaml_next(s) < 0) + goto error; + tree = isl_stream_read_schedule_tree(s); + tree = isl_schedule_tree_insert_domain(tree, domain); + } + + return tree; +error: + isl_union_set_free(domain); + return NULL; +} + +/* Read a subtree with expansion root node from "s". + */ +static __isl_give isl_schedule_tree *read_expansion(isl_stream *s) +{ + isl_ctx *ctx; + isl_union_pw_multi_aff *contraction = NULL; + isl_union_map *expansion = NULL; + isl_schedule_tree *tree = NULL; + int more; + + ctx = isl_stream_get_ctx(s); + + do { + struct isl_token *tok; + enum isl_schedule_key key; + char *str; + + key = get_key(s); + if (isl_stream_yaml_next(s) < 0) + goto error; + + switch (key) { + case isl_schedule_key_contraction: + isl_union_pw_multi_aff_free(contraction); + tok = isl_stream_next_token(s); + str = isl_token_get_str(ctx, tok); + contraction = isl_union_pw_multi_aff_read_from_str(ctx, + str); + free(str); + isl_token_free(tok); + if (!contraction) + goto error; + break; + case isl_schedule_key_expansion: + isl_union_map_free(expansion); + tok = isl_stream_next_token(s); + str = isl_token_get_str(ctx, tok); + expansion = isl_union_map_read_from_str(ctx, str); + free(str); + isl_token_free(tok); + if (!expansion) + goto error; + break; + case isl_schedule_key_child: + isl_schedule_tree_free(tree); + tree = isl_stream_read_schedule_tree(s); + if (!tree) + goto error; + break; + default: + isl_die(ctx, isl_error_invalid, "unexpected key", + goto error); + } + } while ((more = isl_stream_yaml_next(s)) > 0); + + if (more < 0) + goto error; + + if (!contraction) + isl_die(ctx, isl_error_invalid, "missing contraction", + goto error); + if (!expansion) + isl_die(ctx, isl_error_invalid, "missing expansion", + goto error); + + if (!tree) + return isl_schedule_tree_from_expansion(contraction, expansion); + return isl_schedule_tree_insert_expansion(tree, contraction, expansion); +error: + isl_schedule_tree_free(tree); + isl_union_pw_multi_aff_free(contraction); + isl_union_map_free(expansion); + return NULL; +} + +/* Read a subtree with extension root node from "s". + */ +static __isl_give isl_schedule_tree *read_extension(isl_stream *s) +{ + isl_union_map *extension = NULL; + isl_schedule_tree *tree; + isl_ctx *ctx; + struct isl_token *tok; + enum isl_schedule_key key; + char *str; + int more; + + ctx = isl_stream_get_ctx(s); + + key = get_key(s); + + if (isl_stream_yaml_next(s) < 0) + return NULL; + + tok = isl_stream_next_token(s); + if (!tok) { + isl_stream_error(s, NULL, "unexpected EOF"); + return NULL; + } + str = isl_token_get_str(ctx, tok); + extension = isl_union_map_read_from_str(ctx, str); + free(str); + isl_token_free(tok); + + more = isl_stream_yaml_next(s); + if (more < 0) + goto error; + if (!more) { + tree = isl_schedule_tree_from_extension(extension); + } else { + key = get_key(s); + if (key != isl_schedule_key_child) + isl_die(ctx, isl_error_invalid, "expecting child", + goto error); + if (isl_stream_yaml_next(s) < 0) + goto error; + tree = isl_stream_read_schedule_tree(s); + tree = isl_schedule_tree_insert_extension(tree, extension); + } + + return tree; +error: + isl_union_map_free(extension); + return NULL; +} + +/* Read a subtree with filter root node from "s". + */ +static __isl_give isl_schedule_tree *read_filter(__isl_keep isl_stream *s) +{ + isl_union_set *filter = NULL; + isl_schedule_tree *tree; + isl_ctx *ctx; + struct isl_token *tok; + enum isl_schedule_key key; + char *str; + int more; + + ctx = isl_stream_get_ctx(s); + + key = get_key(s); + + if (isl_stream_yaml_next(s) < 0) + return NULL; + + tok = isl_stream_next_token(s); + if (!tok) { + isl_stream_error(s, NULL, "unexpected EOF"); + return NULL; + } + str = isl_token_get_str(ctx, tok); + filter = isl_union_set_read_from_str(ctx, str); + free(str); + isl_token_free(tok); + + more = isl_stream_yaml_next(s); + if (more < 0) + goto error; + if (!more) { + tree = isl_schedule_tree_from_filter(filter); + } else { + key = get_key(s); + if (key != isl_schedule_key_child) + isl_die(ctx, isl_error_invalid, "expecting child", + goto error); + if (isl_stream_yaml_next(s) < 0) + goto error; + tree = isl_stream_read_schedule_tree(s); + tree = isl_schedule_tree_insert_filter(tree, filter); + } + + return tree; +error: + isl_union_set_free(filter); + return NULL; +} + +/* Read a subtree with guard root node from "s". + */ +static __isl_give isl_schedule_tree *read_guard(isl_stream *s) +{ + isl_set *guard = NULL; + isl_schedule_tree *tree; + isl_ctx *ctx; + struct isl_token *tok; + enum isl_schedule_key key; + char *str; + int more; + + ctx = isl_stream_get_ctx(s); + + key = get_key(s); + + if (isl_stream_yaml_next(s) < 0) + return NULL; + + tok = isl_stream_next_token(s); + if (!tok) { + isl_stream_error(s, NULL, "unexpected EOF"); + return NULL; + } + str = isl_token_get_str(ctx, tok); + guard = isl_set_read_from_str(ctx, str); + free(str); + isl_token_free(tok); + + more = isl_stream_yaml_next(s); + if (more < 0) + goto error; + if (!more) { + tree = isl_schedule_tree_from_guard(guard); + } else { + key = get_key(s); + if (key != isl_schedule_key_child) + isl_die(ctx, isl_error_invalid, "expecting child", + goto error); + if (isl_stream_yaml_next(s) < 0) + goto error; + tree = isl_stream_read_schedule_tree(s); + tree = isl_schedule_tree_insert_guard(tree, guard); + } + + return tree; +error: + isl_set_free(guard); + return NULL; +} + +/* Read a subtree with mark root node from "s". + */ +static __isl_give isl_schedule_tree *read_mark(isl_stream *s) +{ + isl_id *mark; + isl_schedule_tree *tree; + isl_ctx *ctx; + struct isl_token *tok; + enum isl_schedule_key key; + char *str; + int more; + + ctx = isl_stream_get_ctx(s); + + key = get_key(s); + + if (isl_stream_yaml_next(s) < 0) + return NULL; + + tok = isl_stream_next_token(s); + if (!tok) { + isl_stream_error(s, NULL, "unexpected EOF"); + return NULL; + } + str = isl_token_get_str(ctx, tok); + mark = isl_id_alloc(ctx, str, NULL); + free(str); + isl_token_free(tok); + + more = isl_stream_yaml_next(s); + if (more < 0) + goto error; + if (!more) { + isl_die(ctx, isl_error_invalid, "expecting child", + goto error); + } else { + key = get_key(s); + if (key != isl_schedule_key_child) + isl_die(ctx, isl_error_invalid, "expecting child", + goto error); + if (isl_stream_yaml_next(s) < 0) + goto error; + tree = isl_stream_read_schedule_tree(s); + tree = isl_schedule_tree_insert_mark(tree, mark); + } + + return tree; +error: + isl_id_free(mark); + return NULL; +} + +/* Read a sequence of integers from "s" (representing the coincident + * property of a band node). + */ +static __isl_give isl_val_list *read_coincident(__isl_keep isl_stream *s) +{ + isl_ctx *ctx; + isl_val_list *list; + int more; + + ctx = isl_stream_get_ctx(s); + + if (isl_stream_yaml_read_start_sequence(s) < 0) + return NULL; + + list = isl_val_list_alloc(ctx, 0); + while ((more = isl_stream_yaml_next(s)) > 0) { + isl_val *val; + + val = isl_stream_read_val(s); + list = isl_val_list_add(list, val); + } + + if (more < 0 || isl_stream_yaml_read_end_sequence(s)) + list = isl_val_list_free(list); + + return list; +} + +/* Set the (initial) coincident properties of "band" according to + * the (initial) elements of "coincident". + */ +static __isl_give isl_schedule_band *set_coincident( + __isl_take isl_schedule_band *band, __isl_take isl_val_list *coincident) +{ + int i; + int n, m; + + n = isl_schedule_band_n_member(band); + m = isl_val_list_n_val(coincident); + + for (i = 0; i < n && i < m; ++i) { + isl_val *v; + + v = isl_val_list_get_val(coincident, i); + if (!v) + band = isl_schedule_band_free(band); + band = isl_schedule_band_member_set_coincident(band, i, + !isl_val_is_zero(v)); + isl_val_free(v); + } + isl_val_list_free(coincident); + return band; +} + +/* Read a subtree with band root node from "s". + */ +static __isl_give isl_schedule_tree *read_band(isl_stream *s) +{ + isl_multi_union_pw_aff *schedule = NULL; + isl_schedule_tree *tree = NULL; + isl_val_list *coincident = NULL; + isl_union_set *options = NULL; + isl_ctx *ctx; + isl_schedule_band *band; + int permutable = 0; + int more; + + ctx = isl_stream_get_ctx(s); + + do { + struct isl_token *tok; + enum isl_schedule_key key; + char *str; + isl_val *v; + + key = get_key(s); + if (isl_stream_yaml_next(s) < 0) + goto error; + + switch (key) { + case isl_schedule_key_schedule: + isl_multi_union_pw_aff_free(schedule); + tok = isl_stream_next_token(s); + if (!tok) { + isl_stream_error(s, NULL, "unexpected EOF"); + goto error; + } + str = isl_token_get_str(ctx, tok); + schedule = isl_multi_union_pw_aff_read_from_str(ctx, + str); + free(str); + isl_token_free(tok); + if (!schedule) + goto error; + break; + case isl_schedule_key_coincident: + coincident = read_coincident(s); + if (!coincident) + goto error; + break; + case isl_schedule_key_permutable: + v = isl_stream_read_val(s); + permutable = !isl_val_is_zero(v); + isl_val_free(v); + break; + case isl_schedule_key_options: + isl_union_set_free(options); + tok = isl_stream_next_token(s); + str = isl_token_get_str(ctx, tok); + options = isl_union_set_read_from_str(ctx, str); + free(str); + isl_token_free(tok); + if (!options) + goto error; + break; + case isl_schedule_key_child: + isl_schedule_tree_free(tree); + tree = isl_stream_read_schedule_tree(s); + if (!tree) + goto error; + break; + default: + isl_die(ctx, isl_error_invalid, "unexpected key", + goto error); + } + } while ((more = isl_stream_yaml_next(s)) > 0); + + if (more < 0) + goto error; + + if (!schedule) + isl_die(ctx, isl_error_invalid, "missing schedule", goto error); + + band = isl_schedule_band_from_multi_union_pw_aff(schedule); + band = isl_schedule_band_set_permutable(band, permutable); + if (coincident) + band = set_coincident(band, coincident); + if (options) + band = isl_schedule_band_set_ast_build_options(band, options); + if (tree) + tree = isl_schedule_tree_insert_band(tree, band); + else + tree = isl_schedule_tree_from_band(band); + + return tree; +error: + isl_val_list_free(coincident); + isl_union_set_free(options); + isl_schedule_tree_free(tree); + isl_multi_union_pw_aff_free(schedule); + return NULL; +} + +/* Read a subtree with root node of type "type" from "s". + * The node is represented by a sequence of children. + */ +static __isl_give isl_schedule_tree *read_children(isl_stream *s, + enum isl_schedule_node_type type) +{ + isl_ctx *ctx; + isl_schedule_tree_list *list; + int more; + + ctx = isl_stream_get_ctx(s); + + isl_token_free(isl_stream_next_token(s)); + + if (isl_stream_yaml_next(s) < 0) + return NULL; + + if (isl_stream_yaml_read_start_sequence(s)) + return NULL; + + list = isl_schedule_tree_list_alloc(ctx, 0); + while ((more = isl_stream_yaml_next(s)) > 0) { + isl_schedule_tree *tree; + + tree = isl_stream_read_schedule_tree(s); + list = isl_schedule_tree_list_add(list, tree); + } + + if (more < 0 || isl_stream_yaml_read_end_sequence(s)) + list = isl_schedule_tree_list_free(list); + + return isl_schedule_tree_from_children(type, list); +} + +/* Read a subtree with sequence root node from "s". + */ +static __isl_give isl_schedule_tree *read_sequence(isl_stream *s) +{ + return read_children(s, isl_schedule_node_sequence); +} + +/* Read a subtree with set root node from "s". + */ +static __isl_give isl_schedule_tree *read_set(isl_stream *s) +{ + return read_children(s, isl_schedule_node_set); +} + +/* Read a schedule (sub)tree from "s". + * + * We first determine the type of the root node based on the first + * mapping key and then hand over to a function tailored to reading + * nodes of this type. + */ +static __isl_give isl_schedule_tree *isl_stream_read_schedule_tree( + struct isl_stream *s) +{ + enum isl_schedule_key key; + struct isl_token *tok; + isl_schedule_tree *tree = NULL; + int more; + + if (isl_stream_yaml_read_start_mapping(s)) + return NULL; + more = isl_stream_yaml_next(s); + if (more < 0) + return NULL; + if (!more) { + isl_stream_error(s, NULL, "missing key"); + return NULL; + } + + tok = isl_stream_next_token(s); + key = extract_key(s, tok); + isl_stream_push_token(s, tok); + if (key < 0) + return NULL; + switch (key) { + case isl_schedule_key_context: + tree = read_context(s); + break; + case isl_schedule_key_domain: + tree = read_domain(s); + break; + case isl_schedule_key_contraction: + case isl_schedule_key_expansion: + tree = read_expansion(s); + break; + case isl_schedule_key_extension: + tree = read_extension(s); + break; + case isl_schedule_key_filter: + tree = read_filter(s); + break; + case isl_schedule_key_guard: + tree = read_guard(s); + break; + case isl_schedule_key_leaf: + isl_token_free(isl_stream_next_token(s)); + tree = isl_schedule_tree_leaf(isl_stream_get_ctx(s)); + break; + case isl_schedule_key_mark: + tree = read_mark(s); + break; + case isl_schedule_key_sequence: + tree = read_sequence(s); + break; + case isl_schedule_key_set: + tree = read_set(s); + break; + case isl_schedule_key_schedule: + case isl_schedule_key_coincident: + case isl_schedule_key_options: + case isl_schedule_key_permutable: + tree = read_band(s); + break; + case isl_schedule_key_child: + isl_die(isl_stream_get_ctx(s), isl_error_unsupported, + "cannot identity node type", return NULL); + case isl_schedule_key_error: + return NULL; + } + + if (isl_stream_yaml_read_end_mapping(s) < 0) { + isl_stream_error(s, NULL, "unexpected extra elements"); + return isl_schedule_tree_free(tree); + } + + return tree; +} + +/* Read an isl_schedule from "s". + */ +__isl_give isl_schedule *isl_stream_read_schedule(isl_stream *s) +{ + isl_ctx *ctx; + isl_schedule_tree *tree; + + if (!s) + return NULL; + + ctx = isl_stream_get_ctx(s); + tree = isl_stream_read_schedule_tree(s); + return isl_schedule_from_schedule_tree(ctx, tree); +} + +/* Read an isl_schedule from "input". + */ +__isl_give isl_schedule *isl_schedule_read_from_file(isl_ctx *ctx, FILE *input) +{ + struct isl_stream *s; + isl_schedule *schedule; + + s = isl_stream_new_file(ctx, input); + if (!s) + return NULL; + schedule = isl_stream_read_schedule(s); + isl_stream_free(s); + + return schedule; +} + +/* Read an isl_schedule from "str". + */ +__isl_give isl_schedule *isl_schedule_read_from_str(isl_ctx *ctx, + const char *str) +{ + struct isl_stream *s; + isl_schedule *schedule; + + s = isl_stream_new_str(ctx, str); + if (!s) + return NULL; + schedule = isl_stream_read_schedule(s); + isl_stream_free(s); + + return schedule; +} diff -Nru cloog-0.18.2/isl/isl_schedule_tree.c cloog-0.18.4/isl/isl_schedule_tree.c --- cloog-0.18.2/isl/isl_schedule_tree.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_schedule_tree.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,2699 @@ +/* + * Copyright 2013-2014 Ecole Normale Superieure + * Copyright 2014 INRIA Rocquencourt + * + * Use of this software is governed by the MIT license + * + * Written by Sven Verdoolaege, + * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France + * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, + * B.P. 105 - 78153 Le Chesnay, France + */ + +#include +#include +#include + +#undef EL +#define EL isl_schedule_tree + +#include + +#undef BASE +#define BASE schedule_tree + +#include + +/* Is "tree" the leaf of a schedule tree? + */ +int isl_schedule_tree_is_leaf(__isl_keep isl_schedule_tree *tree) +{ + return isl_schedule_tree_get_type(tree) == isl_schedule_node_leaf; +} + +/* Create a new schedule tree of type "type". + * The caller is responsible for filling in the type specific fields and + * the children. + * + * By default, the single node tree does not have any anchored nodes. + * The caller is responsible for updating the anchored field if needed. + */ +static __isl_give isl_schedule_tree *isl_schedule_tree_alloc(isl_ctx *ctx, + enum isl_schedule_node_type type) +{ + isl_schedule_tree *tree; + + if (type == isl_schedule_node_error) + return NULL; + + tree = isl_calloc_type(ctx, isl_schedule_tree); + if (!tree) + return NULL; + + tree->ref = 1; + tree->ctx = ctx; + isl_ctx_ref(ctx); + tree->type = type; + tree->anchored = 0; + + return tree; +} + +/* Return a fresh copy of "tree". + */ +__isl_take isl_schedule_tree *isl_schedule_tree_dup( + __isl_keep isl_schedule_tree *tree) +{ + isl_ctx *ctx; + isl_schedule_tree *dup; + + if (!tree) + return NULL; + + ctx = isl_schedule_tree_get_ctx(tree); + dup = isl_schedule_tree_alloc(ctx, tree->type); + if (!dup) + return NULL; + + switch (tree->type) { + case isl_schedule_node_error: + isl_die(ctx, isl_error_internal, + "allocation should have failed", + isl_schedule_tree_free(dup)); + case isl_schedule_node_band: + dup->band = isl_schedule_band_copy(tree->band); + if (!dup->band) + return isl_schedule_tree_free(dup); + break; + case isl_schedule_node_context: + dup->context = isl_set_copy(tree->context); + if (!dup->context) + return isl_schedule_tree_free(dup); + break; + case isl_schedule_node_domain: + dup->domain = isl_union_set_copy(tree->domain); + if (!dup->domain) + return isl_schedule_tree_free(dup); + break; + case isl_schedule_node_expansion: + dup->contraction = + isl_union_pw_multi_aff_copy(tree->contraction); + dup->expansion = isl_union_map_copy(tree->expansion); + if (!dup->contraction || !dup->expansion) + return isl_schedule_tree_free(dup); + break; + case isl_schedule_node_extension: + dup->extension = isl_union_map_copy(tree->extension); + if (!dup->extension) + return isl_schedule_tree_free(dup); + break; + case isl_schedule_node_filter: + dup->filter = isl_union_set_copy(tree->filter); + if (!dup->filter) + return isl_schedule_tree_free(dup); + break; + case isl_schedule_node_guard: + dup->guard = isl_set_copy(tree->guard); + if (!dup->guard) + return isl_schedule_tree_free(dup); + break; + case isl_schedule_node_mark: + dup->mark = isl_id_copy(tree->mark); + if (!dup->mark) + return isl_schedule_tree_free(dup); + break; + case isl_schedule_node_leaf: + case isl_schedule_node_sequence: + case isl_schedule_node_set: + break; + } + + if (tree->children) { + dup->children = isl_schedule_tree_list_copy(tree->children); + if (!dup->children) + return isl_schedule_tree_free(dup); + } + dup->anchored = tree->anchored; + + return dup; +} + +/* Return an isl_schedule_tree that is equal to "tree" and that has only + * a single reference. + * + * This function is called before a tree is modified. + * A static tree (with negative reference count) should never be modified, + * so it is not allowed to call this function on a static tree. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_cow( + __isl_take isl_schedule_tree *tree) +{ + if (!tree) + return NULL; + + if (tree->ref < 0) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "static trees cannot be modified", + return isl_schedule_tree_free(tree)); + + if (tree->ref == 1) + return tree; + tree->ref--; + return isl_schedule_tree_dup(tree); +} + +/* Return a new reference to "tree". + * + * A static tree (with negative reference count) does not keep track + * of the number of references and should not be modified. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_copy( + __isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return NULL; + + if (tree->ref < 0) + return tree; + + tree->ref++; + return tree; +} + +/* Free "tree" and return NULL. + */ +__isl_null isl_schedule_tree *isl_schedule_tree_free( + __isl_take isl_schedule_tree *tree) +{ + if (!tree) + return NULL; + if (tree->ref < 0) + return NULL; + if (--tree->ref > 0) + return NULL; + + switch (tree->type) { + case isl_schedule_node_band: + isl_schedule_band_free(tree->band); + break; + case isl_schedule_node_context: + isl_set_free(tree->context); + break; + case isl_schedule_node_domain: + isl_union_set_free(tree->domain); + break; + case isl_schedule_node_expansion: + isl_union_pw_multi_aff_free(tree->contraction); + isl_union_map_free(tree->expansion); + break; + case isl_schedule_node_extension: + isl_union_map_free(tree->extension); + break; + case isl_schedule_node_filter: + isl_union_set_free(tree->filter); + break; + case isl_schedule_node_guard: + isl_set_free(tree->guard); + break; + case isl_schedule_node_mark: + isl_id_free(tree->mark); + break; + case isl_schedule_node_sequence: + case isl_schedule_node_set: + case isl_schedule_node_error: + case isl_schedule_node_leaf: + break; + } + isl_schedule_tree_list_free(tree->children); + isl_ctx_deref(tree->ctx); + free(tree); + + return NULL; +} + +/* Create and return a new leaf schedule tree. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_leaf(isl_ctx *ctx) +{ + return isl_schedule_tree_alloc(ctx, isl_schedule_node_leaf); +} + +/* Create a new band schedule tree referring to "band" + * with no children. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_from_band( + __isl_take isl_schedule_band *band) +{ + isl_ctx *ctx; + isl_schedule_tree *tree; + + if (!band) + return NULL; + + ctx = isl_schedule_band_get_ctx(band); + tree = isl_schedule_tree_alloc(ctx, isl_schedule_node_band); + if (!tree) + goto error; + + tree->band = band; + tree->anchored = isl_schedule_band_is_anchored(band); + + return tree; +error: + isl_schedule_band_free(band); + return NULL; +} + +/* Create a new context schedule tree with the given context and no children. + * Since the context references the outer schedule dimension, + * the tree is anchored. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_from_context( + __isl_take isl_set *context) +{ + isl_ctx *ctx; + isl_schedule_tree *tree; + + if (!context) + return NULL; + + ctx = isl_set_get_ctx(context); + tree = isl_schedule_tree_alloc(ctx, isl_schedule_node_context); + if (!tree) + goto error; + + tree->context = context; + tree->anchored = 1; + + return tree; +error: + isl_set_free(context); + return NULL; +} + +/* Create a new domain schedule tree with the given domain and no children. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_from_domain( + __isl_take isl_union_set *domain) +{ + isl_ctx *ctx; + isl_schedule_tree *tree; + + if (!domain) + return NULL; + + ctx = isl_union_set_get_ctx(domain); + tree = isl_schedule_tree_alloc(ctx, isl_schedule_node_domain); + if (!tree) + goto error; + + tree->domain = domain; + + return tree; +error: + isl_union_set_free(domain); + return NULL; +} + +/* Create a new expansion schedule tree with the given contraction and + * expansion and no children. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_from_expansion( + __isl_take isl_union_pw_multi_aff *contraction, + __isl_take isl_union_map *expansion) +{ + isl_ctx *ctx; + isl_schedule_tree *tree; + + if (!contraction || !expansion) + goto error; + + ctx = isl_union_map_get_ctx(expansion); + tree = isl_schedule_tree_alloc(ctx, isl_schedule_node_expansion); + if (!tree) + goto error; + + tree->contraction = contraction; + tree->expansion = expansion; + + return tree; +error: + isl_union_pw_multi_aff_free(contraction); + isl_union_map_free(expansion); + return NULL; +} + +/* Create a new extension schedule tree with the given extension and + * no children. + * Since the domain of the extension refers to the outer schedule dimension, + * the tree is anchored. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_from_extension( + __isl_take isl_union_map *extension) +{ + isl_ctx *ctx; + isl_schedule_tree *tree; + + if (!extension) + return NULL; + + ctx = isl_union_map_get_ctx(extension); + tree = isl_schedule_tree_alloc(ctx, isl_schedule_node_extension); + if (!tree) + goto error; + + tree->extension = extension; + tree->anchored = 1; + + return tree; +error: + isl_union_map_free(extension); + return NULL; +} + +/* Create a new filter schedule tree with the given filter and no children. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_from_filter( + __isl_take isl_union_set *filter) +{ + isl_ctx *ctx; + isl_schedule_tree *tree; + + if (!filter) + return NULL; + + ctx = isl_union_set_get_ctx(filter); + tree = isl_schedule_tree_alloc(ctx, isl_schedule_node_filter); + if (!tree) + goto error; + + tree->filter = filter; + + return tree; +error: + isl_union_set_free(filter); + return NULL; +} + +/* Create a new guard schedule tree with the given guard and no children. + * Since the guard references the outer schedule dimension, + * the tree is anchored. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_from_guard( + __isl_take isl_set *guard) +{ + isl_ctx *ctx; + isl_schedule_tree *tree; + + if (!guard) + return NULL; + + ctx = isl_set_get_ctx(guard); + tree = isl_schedule_tree_alloc(ctx, isl_schedule_node_guard); + if (!tree) + goto error; + + tree->guard = guard; + tree->anchored = 1; + + return tree; +error: + isl_set_free(guard); + return NULL; +} + +/* Create a new mark schedule tree with the given mark identifier and + * no children. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_from_mark( + __isl_take isl_id *mark) +{ + isl_ctx *ctx; + isl_schedule_tree *tree; + + if (!mark) + return NULL; + + ctx = isl_id_get_ctx(mark); + tree = isl_schedule_tree_alloc(ctx, isl_schedule_node_mark); + if (!tree) + goto error; + + tree->mark = mark; + + return tree; +error: + isl_id_free(mark); + return NULL; +} + +/* Does "tree" have any node that depends on its position + * in the complete schedule tree? + */ +isl_bool isl_schedule_tree_is_subtree_anchored( + __isl_keep isl_schedule_tree *tree) +{ + return tree ? tree->anchored : isl_bool_error; +} + +/* Does the root node of "tree" depend on its position in the complete + * schedule tree? + * Band nodes may be anchored depending on the associated AST build options. + * Context, extension and guard nodes are always anchored. + */ +int isl_schedule_tree_is_anchored(__isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return -1; + + switch (isl_schedule_tree_get_type(tree)) { + case isl_schedule_node_error: + return -1; + case isl_schedule_node_band: + return isl_schedule_band_is_anchored(tree->band); + case isl_schedule_node_context: + case isl_schedule_node_extension: + case isl_schedule_node_guard: + return 1; + case isl_schedule_node_domain: + case isl_schedule_node_expansion: + case isl_schedule_node_filter: + case isl_schedule_node_leaf: + case isl_schedule_node_mark: + case isl_schedule_node_sequence: + case isl_schedule_node_set: + return 0; + } + + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "unhandled case", return -1); +} + +/* Update the anchored field of "tree" based on whether the root node + * itself in anchored and the anchored fields of the children. + * + * This function should be called whenever the children of a tree node + * are changed or the anchoredness of the tree root itself changes. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_update_anchored( + __isl_take isl_schedule_tree *tree) +{ + int i, n; + int anchored; + + if (!tree) + return NULL; + + anchored = isl_schedule_tree_is_anchored(tree); + if (anchored < 0) + return isl_schedule_tree_free(tree); + + n = isl_schedule_tree_list_n_schedule_tree(tree->children); + for (i = 0; !anchored && i < n; ++i) { + isl_schedule_tree *child; + + child = isl_schedule_tree_get_child(tree, i); + if (!child) + return isl_schedule_tree_free(tree); + anchored = child->anchored; + isl_schedule_tree_free(child); + } + + if (anchored == tree->anchored) + return tree; + tree = isl_schedule_tree_cow(tree); + if (!tree) + return NULL; + tree->anchored = anchored; + return tree; +} + +/* Create a new tree of the given type (isl_schedule_node_sequence or + * isl_schedule_node_set) with the given children. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_from_children( + enum isl_schedule_node_type type, + __isl_take isl_schedule_tree_list *list) +{ + isl_ctx *ctx; + isl_schedule_tree *tree; + + if (!list) + return NULL; + + ctx = isl_schedule_tree_list_get_ctx(list); + tree = isl_schedule_tree_alloc(ctx, type); + if (!tree) + goto error; + + tree->children = list; + tree = isl_schedule_tree_update_anchored(tree); + + return tree; +error: + isl_schedule_tree_list_free(list); + return NULL; +} + +/* Construct a tree with a root node of type "type" and as children + * "tree1" and "tree2". + * If the root of one (or both) of the input trees is itself of type "type", + * then the tree is replaced by its children. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_from_pair( + enum isl_schedule_node_type type, __isl_take isl_schedule_tree *tree1, + __isl_take isl_schedule_tree *tree2) +{ + isl_ctx *ctx; + isl_schedule_tree_list *list; + + if (!tree1 || !tree2) + goto error; + + ctx = isl_schedule_tree_get_ctx(tree1); + if (isl_schedule_tree_get_type(tree1) == type) { + list = isl_schedule_tree_list_copy(tree1->children); + isl_schedule_tree_free(tree1); + } else { + list = isl_schedule_tree_list_alloc(ctx, 2); + list = isl_schedule_tree_list_add(list, tree1); + } + if (isl_schedule_tree_get_type(tree2) == type) { + isl_schedule_tree_list *children; + + children = isl_schedule_tree_list_copy(tree2->children); + list = isl_schedule_tree_list_concat(list, children); + isl_schedule_tree_free(tree2); + } else { + list = isl_schedule_tree_list_add(list, tree2); + } + + return isl_schedule_tree_from_children(type, list); +error: + isl_schedule_tree_free(tree1); + isl_schedule_tree_free(tree2); + return NULL; +} + +/* Construct a tree with a sequence root node and as children + * "tree1" and "tree2". + * If the root of one (or both) of the input trees is itself a sequence, + * then the tree is replaced by its children. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_sequence_pair( + __isl_take isl_schedule_tree *tree1, + __isl_take isl_schedule_tree *tree2) +{ + return isl_schedule_tree_from_pair(isl_schedule_node_sequence, + tree1, tree2); +} + +/* Return the isl_ctx to which "tree" belongs. + */ +isl_ctx *isl_schedule_tree_get_ctx(__isl_keep isl_schedule_tree *tree) +{ + return tree ? tree->ctx : NULL; +} + +/* Return the type of the root of the tree or isl_schedule_node_error + * on error. + */ +enum isl_schedule_node_type isl_schedule_tree_get_type( + __isl_keep isl_schedule_tree *tree) +{ + return tree ? tree->type : isl_schedule_node_error; +} + +/* Are "tree1" and "tree2" obviously equal to each other? + */ +isl_bool isl_schedule_tree_plain_is_equal(__isl_keep isl_schedule_tree *tree1, + __isl_keep isl_schedule_tree *tree2) +{ + isl_bool equal; + int i, n; + + if (!tree1 || !tree2) + return isl_bool_error; + if (tree1 == tree2) + return isl_bool_true; + if (tree1->type != tree2->type) + return isl_bool_false; + + switch (tree1->type) { + case isl_schedule_node_band: + equal = isl_schedule_band_plain_is_equal(tree1->band, + tree2->band); + break; + case isl_schedule_node_context: + equal = isl_set_is_equal(tree1->context, tree2->context); + break; + case isl_schedule_node_domain: + equal = isl_union_set_is_equal(tree1->domain, tree2->domain); + break; + case isl_schedule_node_expansion: + equal = isl_union_map_is_equal(tree1->expansion, + tree2->expansion); + if (equal >= 0 && equal) + equal = isl_union_pw_multi_aff_plain_is_equal( + tree1->contraction, tree2->contraction); + break; + case isl_schedule_node_extension: + equal = isl_union_map_is_equal(tree1->extension, + tree2->extension); + break; + case isl_schedule_node_filter: + equal = isl_union_set_is_equal(tree1->filter, tree2->filter); + break; + case isl_schedule_node_guard: + equal = isl_set_is_equal(tree1->guard, tree2->guard); + break; + case isl_schedule_node_mark: + equal = tree1->mark == tree2->mark; + break; + case isl_schedule_node_leaf: + case isl_schedule_node_sequence: + case isl_schedule_node_set: + equal = isl_bool_true; + break; + case isl_schedule_node_error: + equal = isl_bool_error; + break; + } + + if (equal < 0 || !equal) + return equal; + + n = isl_schedule_tree_n_children(tree1); + if (n != isl_schedule_tree_n_children(tree2)) + return isl_bool_false; + for (i = 0; i < n; ++i) { + isl_schedule_tree *child1, *child2; + + child1 = isl_schedule_tree_get_child(tree1, i); + child2 = isl_schedule_tree_get_child(tree2, i); + equal = isl_schedule_tree_plain_is_equal(child1, child2); + isl_schedule_tree_free(child1); + isl_schedule_tree_free(child2); + + if (equal < 0 || !equal) + return equal; + } + + return isl_bool_true; +} + +/* Does "tree" have any children, other than an implicit leaf. + */ +int isl_schedule_tree_has_children(__isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return -1; + + return tree->children != NULL; +} + +/* Return the number of children of "tree", excluding implicit leaves. + */ +int isl_schedule_tree_n_children(__isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return -1; + + return isl_schedule_tree_list_n_schedule_tree(tree->children); +} + +/* Return a copy of the (explicit) child at position "pos" of "tree". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_get_child( + __isl_keep isl_schedule_tree *tree, int pos) +{ + if (!tree) + return NULL; + if (!tree->children) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "schedule tree has no explicit children", return NULL); + return isl_schedule_tree_list_get_schedule_tree(tree->children, pos); +} + +/* Return a copy of the (explicit) child at position "pos" of "tree" and + * free "tree". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_child( + __isl_take isl_schedule_tree *tree, int pos) +{ + isl_schedule_tree *child; + + child = isl_schedule_tree_get_child(tree, pos); + isl_schedule_tree_free(tree); + return child; +} + +/* Remove all (explicit) children from "tree". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_reset_children( + __isl_take isl_schedule_tree *tree) +{ + tree = isl_schedule_tree_cow(tree); + if (!tree) + return NULL; + tree->children = isl_schedule_tree_list_free(tree->children); + return tree; +} + +/* Remove the child at position "pos" from the children of "tree". + * If there was only one child to begin with, then remove all children. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_drop_child( + __isl_take isl_schedule_tree *tree, int pos) +{ + int n; + + tree = isl_schedule_tree_cow(tree); + if (!tree) + return NULL; + + if (!isl_schedule_tree_has_children(tree)) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "tree does not have any explicit children", + return isl_schedule_tree_free(tree)); + n = isl_schedule_tree_list_n_schedule_tree(tree->children); + if (pos < 0 || pos >= n) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "position out of bounds", + return isl_schedule_tree_free(tree)); + if (n == 1) + return isl_schedule_tree_reset_children(tree); + + tree->children = isl_schedule_tree_list_drop(tree->children, pos, 1); + if (!tree->children) + return isl_schedule_tree_free(tree); + + return tree; +} + +/* Replace the child at position "pos" of "tree" by "child". + * + * If the new child is a leaf, then it is not explicitly + * recorded in the list of children. Instead, the list of children + * (which is assumed to have only one element) is removed. + * Note that the children of set and sequence nodes are always + * filters, so they cannot be replaced by empty trees. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_replace_child( + __isl_take isl_schedule_tree *tree, int pos, + __isl_take isl_schedule_tree *child) +{ + tree = isl_schedule_tree_cow(tree); + if (!tree || !child) + goto error; + + if (isl_schedule_tree_is_leaf(child)) { + isl_schedule_tree_free(child); + if (!tree->children && pos == 0) + return tree; + if (isl_schedule_tree_n_children(tree) != 1) + isl_die(isl_schedule_tree_get_ctx(tree), + isl_error_internal, + "can only replace single child by leaf", + goto error); + return isl_schedule_tree_reset_children(tree); + } + + if (!tree->children && pos == 0) + tree->children = + isl_schedule_tree_list_from_schedule_tree(child); + else + tree->children = isl_schedule_tree_list_set_schedule_tree( + tree->children, pos, child); + + if (!tree->children) + return isl_schedule_tree_free(tree); + tree = isl_schedule_tree_update_anchored(tree); + + return tree; +error: + isl_schedule_tree_free(tree); + isl_schedule_tree_free(child); + return NULL; +} + +/* Replace the (explicit) children of "tree" by "children"? + */ +__isl_give isl_schedule_tree *isl_schedule_tree_set_children( + __isl_take isl_schedule_tree *tree, + __isl_take isl_schedule_tree_list *children) +{ + tree = isl_schedule_tree_cow(tree); + if (!tree || !children) + goto error; + isl_schedule_tree_list_free(tree->children); + tree->children = children; + return tree; +error: + isl_schedule_tree_free(tree); + isl_schedule_tree_list_free(children); + return NULL; +} + +/* Create a new band schedule tree referring to "band" + * with "tree" as single child. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_insert_band( + __isl_take isl_schedule_tree *tree, __isl_take isl_schedule_band *band) +{ + isl_schedule_tree *res; + + res = isl_schedule_tree_from_band(band); + return isl_schedule_tree_replace_child(res, 0, tree); +} + +/* Create a new context schedule tree with the given context and + * with "tree" as single child. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_insert_context( + __isl_take isl_schedule_tree *tree, __isl_take isl_set *context) +{ + isl_schedule_tree *res; + + res = isl_schedule_tree_from_context(context); + return isl_schedule_tree_replace_child(res, 0, tree); +} + +/* Create a new domain schedule tree with the given domain and + * with "tree" as single child. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_insert_domain( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *domain) +{ + isl_schedule_tree *res; + + res = isl_schedule_tree_from_domain(domain); + return isl_schedule_tree_replace_child(res, 0, tree); +} + +/* Create a new expansion schedule tree with the given contraction and + * expansion and with "tree" as single child. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_insert_expansion( + __isl_take isl_schedule_tree *tree, + __isl_take isl_union_pw_multi_aff *contraction, + __isl_take isl_union_map *expansion) +{ + isl_schedule_tree *res; + + res = isl_schedule_tree_from_expansion(contraction, expansion); + return isl_schedule_tree_replace_child(res, 0, tree); +} + +/* Create a new extension schedule tree with the given extension and + * with "tree" as single child. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_insert_extension( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_map *extension) +{ + isl_schedule_tree *res; + + res = isl_schedule_tree_from_extension(extension); + return isl_schedule_tree_replace_child(res, 0, tree); +} + +/* Create a new filter schedule tree with the given filter and single child. + * + * If the root of "tree" is itself a filter node, then the two + * filter nodes are merged into one node. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_insert_filter( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *filter) +{ + isl_schedule_tree *res; + + if (isl_schedule_tree_get_type(tree) == isl_schedule_node_filter) { + isl_union_set *tree_filter; + + tree_filter = isl_schedule_tree_filter_get_filter(tree); + tree_filter = isl_union_set_intersect(tree_filter, filter); + tree = isl_schedule_tree_filter_set_filter(tree, tree_filter); + return tree; + } + + res = isl_schedule_tree_from_filter(filter); + return isl_schedule_tree_replace_child(res, 0, tree); +} + +/* Insert a filter node with filter set "filter" + * in each of the children of "tree". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_children_insert_filter( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *filter) +{ + int i, n; + + if (!tree || !filter) + goto error; + + n = isl_schedule_tree_n_children(tree); + for (i = 0; i < n; ++i) { + isl_schedule_tree *child; + + child = isl_schedule_tree_get_child(tree, i); + child = isl_schedule_tree_insert_filter(child, + isl_union_set_copy(filter)); + tree = isl_schedule_tree_replace_child(tree, i, child); + } + + isl_union_set_free(filter); + return tree; +error: + isl_union_set_free(filter); + isl_schedule_tree_free(tree); + return NULL; +} + +/* Create a new guard schedule tree with the given guard and + * with "tree" as single child. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_insert_guard( + __isl_take isl_schedule_tree *tree, __isl_take isl_set *guard) +{ + isl_schedule_tree *res; + + res = isl_schedule_tree_from_guard(guard); + return isl_schedule_tree_replace_child(res, 0, tree); +} + +/* Create a new mark schedule tree with the given mark identifier and + * single child. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_insert_mark( + __isl_take isl_schedule_tree *tree, __isl_take isl_id *mark) +{ + isl_schedule_tree *res; + + res = isl_schedule_tree_from_mark(mark); + return isl_schedule_tree_replace_child(res, 0, tree); +} + +/* Return the number of members in the band tree root. + */ +unsigned isl_schedule_tree_band_n_member(__isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return 0; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return 0); + + return isl_schedule_band_n_member(tree->band); +} + +/* Is the band member at position "pos" of the band tree root + * marked coincident? + */ +isl_bool isl_schedule_tree_band_member_get_coincident( + __isl_keep isl_schedule_tree *tree, int pos) +{ + if (!tree) + return isl_bool_error; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return isl_bool_error); + + return isl_schedule_band_member_get_coincident(tree->band, pos); +} + +/* Mark the given band member as being coincident or not + * according to "coincident". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_band_member_set_coincident( + __isl_take isl_schedule_tree *tree, int pos, int coincident) +{ + if (!tree) + return NULL; + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return isl_schedule_tree_free(tree)); + if (isl_schedule_tree_band_member_get_coincident(tree, pos) == + coincident) + return tree; + tree = isl_schedule_tree_cow(tree); + if (!tree) + return NULL; + + tree->band = isl_schedule_band_member_set_coincident(tree->band, pos, + coincident); + if (!tree->band) + return isl_schedule_tree_free(tree); + return tree; +} + +/* Is the band tree root marked permutable? + */ +isl_bool isl_schedule_tree_band_get_permutable( + __isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return isl_bool_error; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return isl_bool_error); + + return isl_schedule_band_get_permutable(tree->band); +} + +/* Mark the band tree root permutable or not according to "permutable"? + */ +__isl_give isl_schedule_tree *isl_schedule_tree_band_set_permutable( + __isl_take isl_schedule_tree *tree, int permutable) +{ + if (!tree) + return NULL; + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return isl_schedule_tree_free(tree)); + if (isl_schedule_tree_band_get_permutable(tree) == permutable) + return tree; + tree = isl_schedule_tree_cow(tree); + if (!tree) + return NULL; + + tree->band = isl_schedule_band_set_permutable(tree->band, permutable); + if (!tree->band) + return isl_schedule_tree_free(tree); + return tree; +} + +/* Return the schedule space of the band tree root. + */ +__isl_give isl_space *isl_schedule_tree_band_get_space( + __isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return NULL); + + return isl_schedule_band_get_space(tree->band); +} + +/* Intersect the domain of the band schedule of the band tree root + * with "domain". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_band_intersect_domain( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *domain) +{ + if (!tree || !domain) + goto error; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", goto error); + + tree->band = isl_schedule_band_intersect_domain(tree->band, domain); + if (!tree->band) + return isl_schedule_tree_free(tree); + + return tree; +error: + isl_schedule_tree_free(tree); + isl_union_set_free(domain); + return NULL; +} + +/* Return the schedule of the band tree root in isolation. + */ +__isl_give isl_multi_union_pw_aff *isl_schedule_tree_band_get_partial_schedule( + __isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return NULL); + + return isl_schedule_band_get_partial_schedule(tree->band); +} + +/* Replace the schedule of the band tree root by "schedule". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_band_set_partial_schedule( + __isl_take isl_schedule_tree *tree, + __isl_take isl_multi_union_pw_aff *schedule) +{ + tree = isl_schedule_tree_cow(tree); + if (!tree || !schedule) + goto error; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return NULL); + tree->band = isl_schedule_band_set_partial_schedule(tree->band, + schedule); + + return tree; +error: + isl_schedule_tree_free(tree); + isl_multi_union_pw_aff_free(schedule); + return NULL; +} + +/* Return the loop AST generation type for the band member + * of the band tree root at position "pos". + */ +enum isl_ast_loop_type isl_schedule_tree_band_member_get_ast_loop_type( + __isl_keep isl_schedule_tree *tree, int pos) +{ + if (!tree) + return isl_ast_loop_error; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return isl_ast_loop_error); + + return isl_schedule_band_member_get_ast_loop_type(tree->band, pos); +} + +/* Set the loop AST generation type for the band member of the band tree root + * at position "pos" to "type". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_band_member_set_ast_loop_type( + __isl_take isl_schedule_tree *tree, int pos, + enum isl_ast_loop_type type) +{ + tree = isl_schedule_tree_cow(tree); + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return isl_schedule_tree_free(tree)); + + tree->band = isl_schedule_band_member_set_ast_loop_type(tree->band, + pos, type); + if (!tree->band) + return isl_schedule_tree_free(tree); + + return tree; +} + +/* Return the loop AST generation type for the band member + * of the band tree root at position "pos" for the isolated part. + */ +enum isl_ast_loop_type isl_schedule_tree_band_member_get_isolate_ast_loop_type( + __isl_keep isl_schedule_tree *tree, int pos) +{ + if (!tree) + return isl_ast_loop_error; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return isl_ast_loop_error); + + return isl_schedule_band_member_get_isolate_ast_loop_type(tree->band, + pos); +} + +/* Set the loop AST generation type for the band member of the band tree root + * at position "pos" for the isolated part to "type". + */ +__isl_give isl_schedule_tree * +isl_schedule_tree_band_member_set_isolate_ast_loop_type( + __isl_take isl_schedule_tree *tree, int pos, + enum isl_ast_loop_type type) +{ + tree = isl_schedule_tree_cow(tree); + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return isl_schedule_tree_free(tree)); + + tree->band = isl_schedule_band_member_set_isolate_ast_loop_type( + tree->band, pos, type); + if (!tree->band) + return isl_schedule_tree_free(tree); + + return tree; +} + +/* Return the AST build options associated to the band tree root. + */ +__isl_give isl_union_set *isl_schedule_tree_band_get_ast_build_options( + __isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return NULL); + + return isl_schedule_band_get_ast_build_options(tree->band); +} + +/* Replace the AST build options associated to band tree root by "options". + * Updated the anchored field if the anchoredness of the root node itself + * changes. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_band_set_ast_build_options( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *options) +{ + int was_anchored; + + tree = isl_schedule_tree_cow(tree); + if (!tree || !options) + goto error; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", goto error); + + was_anchored = isl_schedule_tree_is_anchored(tree); + tree->band = isl_schedule_band_set_ast_build_options(tree->band, + options); + if (!tree->band) + return isl_schedule_tree_free(tree); + if (isl_schedule_tree_is_anchored(tree) != was_anchored) + tree = isl_schedule_tree_update_anchored(tree); + + return tree; +error: + isl_schedule_tree_free(tree); + isl_union_set_free(options); + return NULL; +} + +/* Return the context of the context tree root. + */ +__isl_give isl_set *isl_schedule_tree_context_get_context( + __isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_context) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a context node", return NULL); + + return isl_set_copy(tree->context); +} + +/* Return the domain of the domain tree root. + */ +__isl_give isl_union_set *isl_schedule_tree_domain_get_domain( + __isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_domain) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a domain node", return NULL); + + return isl_union_set_copy(tree->domain); +} + +/* Replace the domain of domain tree root "tree" by "domain". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_domain_set_domain( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *domain) +{ + tree = isl_schedule_tree_cow(tree); + if (!tree || !domain) + goto error; + + if (tree->type != isl_schedule_node_domain) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a domain node", goto error); + + isl_union_set_free(tree->domain); + tree->domain = domain; + + return tree; +error: + isl_schedule_tree_free(tree); + isl_union_set_free(domain); + return NULL; +} + +/* Return the contraction of the expansion tree root. + */ +__isl_give isl_union_pw_multi_aff *isl_schedule_tree_expansion_get_contraction( + __isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_expansion) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not an expansion node", return NULL); + + return isl_union_pw_multi_aff_copy(tree->contraction); +} + +/* Return the expansion of the expansion tree root. + */ +__isl_give isl_union_map *isl_schedule_tree_expansion_get_expansion( + __isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_expansion) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not an expansion node", return NULL); + + return isl_union_map_copy(tree->expansion); +} + +/* Replace the contraction and the expansion of the expansion tree root "tree" + * by "contraction" and "expansion". + */ +__isl_give isl_schedule_tree * +isl_schedule_tree_expansion_set_contraction_and_expansion( + __isl_take isl_schedule_tree *tree, + __isl_take isl_union_pw_multi_aff *contraction, + __isl_take isl_union_map *expansion) +{ + tree = isl_schedule_tree_cow(tree); + if (!tree || !contraction || !expansion) + goto error; + + if (tree->type != isl_schedule_node_expansion) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not an expansion node", return NULL); + + isl_union_pw_multi_aff_free(tree->contraction); + tree->contraction = contraction; + isl_union_map_free(tree->expansion); + tree->expansion = expansion; + + return tree; +error: + isl_schedule_tree_free(tree); + isl_union_pw_multi_aff_free(contraction); + isl_union_map_free(expansion); + return NULL; +} + +/* Return the extension of the extension tree root. + */ +__isl_give isl_union_map *isl_schedule_tree_extension_get_extension( + __isl_take isl_schedule_tree *tree) +{ + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_extension) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not an extension node", return NULL); + + return isl_union_map_copy(tree->extension); +} + +/* Replace the extension of extension tree root "tree" by "extension". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_extension_set_extension( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_map *extension) +{ + tree = isl_schedule_tree_cow(tree); + if (!tree || !extension) + goto error; + + if (tree->type != isl_schedule_node_extension) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not an extension node", return NULL); + isl_union_map_free(tree->extension); + tree->extension = extension; + + return tree; +error: + isl_schedule_tree_free(tree); + isl_union_map_free(extension); + return NULL; +} + +/* Return the filter of the filter tree root. + */ +__isl_give isl_union_set *isl_schedule_tree_filter_get_filter( + __isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_filter) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a filter node", return NULL); + + return isl_union_set_copy(tree->filter); +} + +/* Replace the filter of the filter tree root by "filter". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_filter_set_filter( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *filter) +{ + tree = isl_schedule_tree_cow(tree); + if (!tree || !filter) + goto error; + + if (tree->type != isl_schedule_node_filter) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a filter node", return NULL); + + isl_union_set_free(tree->filter); + tree->filter = filter; + + return tree; +error: + isl_schedule_tree_free(tree); + isl_union_set_free(filter); + return NULL; +} + +/* Return the guard of the guard tree root. + */ +__isl_give isl_set *isl_schedule_tree_guard_get_guard( + __isl_take isl_schedule_tree *tree) +{ + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_guard) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a guard node", return NULL); + + return isl_set_copy(tree->guard); +} + +/* Return the mark identifier of the mark tree root "tree". + */ +__isl_give isl_id *isl_schedule_tree_mark_get_id( + __isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_mark) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a mark node", return NULL); + + return isl_id_copy(tree->mark); +} + +/* Set dim to the range dimension of "map" and abort the search. + */ +static isl_stat set_range_dim(__isl_take isl_map *map, void *user) +{ + int *dim = user; + + *dim = isl_map_dim(map, isl_dim_out); + isl_map_free(map); + + return isl_stat_error; +} + +/* Return the dimension of the range of "umap". + * "umap" is assumed not to be empty and + * all maps inside "umap" are assumed to have the same range. + * + * We extract the range dimension from the first map in "umap". + */ +static int range_dim(__isl_keep isl_union_map *umap) +{ + int dim = -1; + + if (!umap) + return -1; + if (isl_union_map_n_map(umap) == 0) + isl_die(isl_union_map_get_ctx(umap), isl_error_internal, + "unexpected empty input", return -1); + + isl_union_map_foreach_map(umap, &set_range_dim, &dim); + + return dim; +} + +/* Append an "extra" number of zeros to the range of "umap" and + * return the result. + */ +static __isl_give isl_union_map *append_range(__isl_take isl_union_map *umap, + int extra) +{ + isl_union_set *dom; + isl_space *space; + isl_multi_val *mv; + isl_union_pw_multi_aff *suffix; + isl_union_map *universe; + isl_union_map *suffix_umap; + + universe = isl_union_map_universe(isl_union_map_copy(umap)); + dom = isl_union_map_domain(universe); + space = isl_union_set_get_space(dom); + space = isl_space_set_from_params(space); + space = isl_space_add_dims(space, isl_dim_set, extra); + mv = isl_multi_val_zero(space); + + suffix = isl_union_pw_multi_aff_multi_val_on_domain(dom, mv); + suffix_umap = isl_union_map_from_union_pw_multi_aff(suffix); + umap = isl_union_map_flat_range_product(umap, suffix_umap); + + return umap; +} + +/* Should we skip the root of "tree" while looking for the first + * descendant with schedule information? + * That is, is it impossible to derive any information about + * the iteration domain from this node? + * + * We do not want to skip leaf or error nodes because there is + * no point in looking any deeper from these nodes. + * We can only extract partial iteration domain information + * from an extension node, but extension nodes are not supported + * by the caller and it will error out on them. + */ +static int domain_less(__isl_keep isl_schedule_tree *tree) +{ + enum isl_schedule_node_type type; + + type = isl_schedule_tree_get_type(tree); + switch (type) { + case isl_schedule_node_band: + return isl_schedule_tree_band_n_member(tree) == 0; + case isl_schedule_node_context: + case isl_schedule_node_guard: + case isl_schedule_node_mark: + return 1; + case isl_schedule_node_leaf: + case isl_schedule_node_error: + case isl_schedule_node_domain: + case isl_schedule_node_expansion: + case isl_schedule_node_extension: + case isl_schedule_node_filter: + case isl_schedule_node_set: + case isl_schedule_node_sequence: + return 0; + } + + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "unhandled case", return 0); +} + +/* Move down to the first descendant of "tree" that contains any schedule + * information or return "leaf" if there is no such descendant. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_first_schedule_descendant( + __isl_take isl_schedule_tree *tree, __isl_keep isl_schedule_tree *leaf) +{ + while (domain_less(tree)) { + if (!isl_schedule_tree_has_children(tree)) { + isl_schedule_tree_free(tree); + return isl_schedule_tree_copy(leaf); + } + tree = isl_schedule_tree_child(tree, 0); + } + + return tree; +} + +static __isl_give isl_union_map *subtree_schedule_extend( + __isl_keep isl_schedule_tree *tree, __isl_take isl_union_map *outer); + +/* Extend the schedule map "outer" with the subtree schedule + * of the (single) child of "tree", if any. + * + * If "tree" does not have any descendants (apart from those that + * do not carry any schedule information), then we simply return "outer". + * Otherwise, we extend the schedule map "outer" with the subtree schedule + * of the single child. + */ +static __isl_give isl_union_map *subtree_schedule_extend_child( + __isl_keep isl_schedule_tree *tree, __isl_take isl_union_map *outer) +{ + isl_schedule_tree *child; + isl_union_map *res; + + if (!tree) + return isl_union_map_free(outer); + if (!isl_schedule_tree_has_children(tree)) + return outer; + child = isl_schedule_tree_get_child(tree, 0); + if (!child) + return isl_union_map_free(outer); + res = subtree_schedule_extend(child, outer); + isl_schedule_tree_free(child); + return res; +} + +/* Extract the parameter space from one of the children of "tree", + * which are assumed to be filters. + */ +static __isl_give isl_space *extract_space_from_filter_child( + __isl_keep isl_schedule_tree *tree) +{ + isl_space *space; + isl_union_set *dom; + isl_schedule_tree *child; + + child = isl_schedule_tree_list_get_schedule_tree(tree->children, 0); + dom = isl_schedule_tree_filter_get_filter(child); + space = isl_union_set_get_space(dom); + isl_union_set_free(dom); + isl_schedule_tree_free(child); + + return space; +} + +/* Extend the schedule map "outer" with the subtree schedule + * of a set or sequence node. + * + * The schedule for the set or sequence node itself is composed of + * pieces of the form + * + * filter -> [] + * + * or + * + * filter -> [index] + * + * The first form is used if there is only a single child or + * if the current node is a set node and the schedule_separate_components + * option is not set. + * + * Each of the pieces above is extended with the subtree schedule of + * the child of the corresponding filter, if any, padded with zeros + * to ensure that all pieces have the same range dimension. + */ +static __isl_give isl_union_map *subtree_schedule_extend_from_children( + __isl_keep isl_schedule_tree *tree, __isl_take isl_union_map *outer) +{ + int i, n; + int dim; + int separate; + isl_ctx *ctx; + isl_val *v = NULL; + isl_multi_val *mv; + isl_space *space; + isl_union_map *umap; + + if (!tree) + return NULL; + + ctx = isl_schedule_tree_get_ctx(tree); + if (!tree->children) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "missing children", return NULL); + n = isl_schedule_tree_list_n_schedule_tree(tree->children); + if (n == 0) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "missing children", return NULL); + + separate = n > 1 && (tree->type == isl_schedule_node_sequence || + isl_options_get_schedule_separate_components(ctx)); + + space = extract_space_from_filter_child(tree); + + umap = isl_union_map_empty(isl_space_copy(space)); + space = isl_space_set_from_params(space); + if (separate) { + space = isl_space_add_dims(space, isl_dim_set, 1); + v = isl_val_zero(ctx); + } + mv = isl_multi_val_zero(space); + + dim = isl_multi_val_dim(mv, isl_dim_set); + for (i = 0; i < n; ++i) { + isl_union_pw_multi_aff *upma; + isl_union_map *umap_i; + isl_union_set *dom; + isl_schedule_tree *child; + int dim_i; + int empty; + + child = isl_schedule_tree_list_get_schedule_tree( + tree->children, i); + dom = isl_schedule_tree_filter_get_filter(child); + + if (separate) { + mv = isl_multi_val_set_val(mv, 0, isl_val_copy(v)); + v = isl_val_add_ui(v, 1); + } + upma = isl_union_pw_multi_aff_multi_val_on_domain(dom, + isl_multi_val_copy(mv)); + umap_i = isl_union_map_from_union_pw_multi_aff(upma); + umap_i = isl_union_map_flat_range_product( + isl_union_map_copy(outer), umap_i); + umap_i = subtree_schedule_extend_child(child, umap_i); + isl_schedule_tree_free(child); + + empty = isl_union_map_is_empty(umap_i); + if (empty < 0) + umap_i = isl_union_map_free(umap_i); + else if (empty) { + isl_union_map_free(umap_i); + continue; + } + + dim_i = range_dim(umap_i); + if (dim_i < 0) { + umap = isl_union_map_free(umap); + } else if (dim < dim_i) { + umap = append_range(umap, dim_i - dim); + dim = dim_i; + } else if (dim_i < dim) { + umap_i = append_range(umap_i, dim - dim_i); + } + umap = isl_union_map_union(umap, umap_i); + } + + isl_val_free(v); + isl_multi_val_free(mv); + isl_union_map_free(outer); + + return umap; +} + +/* Extend the schedule map "outer" with the subtree schedule of "tree". + * + * If the root of the tree is a set or a sequence, then we extend + * the schedule map in subtree_schedule_extend_from_children. + * Otherwise, we extend the schedule map with the partial schedule + * corresponding to the root of the tree and then continue with + * the single child of this root. + * In the special case of an expansion, the schedule map is "extended" + * by applying the expansion to the domain of the schedule map. + */ +static __isl_give isl_union_map *subtree_schedule_extend( + __isl_keep isl_schedule_tree *tree, __isl_take isl_union_map *outer) +{ + isl_multi_union_pw_aff *mupa; + isl_union_map *umap; + isl_union_set *domain; + + if (!tree) + return NULL; + + switch (tree->type) { + case isl_schedule_node_error: + return isl_union_map_free(outer); + case isl_schedule_node_extension: + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "cannot construct subtree schedule of tree " + "with extension nodes", + return isl_union_map_free(outer)); + case isl_schedule_node_context: + case isl_schedule_node_guard: + case isl_schedule_node_mark: + return subtree_schedule_extend_child(tree, outer); + case isl_schedule_node_band: + if (isl_schedule_tree_band_n_member(tree) == 0) + return subtree_schedule_extend_child(tree, outer); + mupa = isl_schedule_band_get_partial_schedule(tree->band); + umap = isl_union_map_from_multi_union_pw_aff(mupa); + outer = isl_union_map_flat_range_product(outer, umap); + umap = subtree_schedule_extend_child(tree, outer); + break; + case isl_schedule_node_domain: + domain = isl_schedule_tree_domain_get_domain(tree); + umap = isl_union_map_from_domain(domain); + outer = isl_union_map_flat_range_product(outer, umap); + umap = subtree_schedule_extend_child(tree, outer); + break; + case isl_schedule_node_expansion: + umap = isl_schedule_tree_expansion_get_expansion(tree); + outer = isl_union_map_apply_domain(outer, umap); + umap = subtree_schedule_extend_child(tree, outer); + break; + case isl_schedule_node_filter: + domain = isl_schedule_tree_filter_get_filter(tree); + umap = isl_union_map_from_domain(domain); + outer = isl_union_map_flat_range_product(outer, umap); + umap = subtree_schedule_extend_child(tree, outer); + break; + case isl_schedule_node_leaf: + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "leaf node should be handled by caller", return NULL); + case isl_schedule_node_set: + case isl_schedule_node_sequence: + umap = subtree_schedule_extend_from_children(tree, outer); + break; + } + + return umap; +} + +static __isl_give isl_union_set *initial_domain( + __isl_keep isl_schedule_tree *tree); + +/* Extract a universe domain from the children of the tree root "tree", + * which is a set or sequence, meaning that its children are filters. + * In particular, return the union of the universes of the filters. + */ +static __isl_give isl_union_set *initial_domain_from_children( + __isl_keep isl_schedule_tree *tree) +{ + int i, n; + isl_space *space; + isl_union_set *domain; + + if (!tree->children) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "missing children", return NULL); + n = isl_schedule_tree_list_n_schedule_tree(tree->children); + if (n == 0) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "missing children", return NULL); + + space = extract_space_from_filter_child(tree); + domain = isl_union_set_empty(space); + + for (i = 0; i < n; ++i) { + isl_schedule_tree *child; + isl_union_set *domain_i; + + child = isl_schedule_tree_get_child(tree, i); + domain_i = initial_domain(child); + domain = isl_union_set_union(domain, domain_i); + isl_schedule_tree_free(child); + } + + return domain; +} + +/* Extract a universe domain from the tree root "tree". + * The caller is responsible for making sure that this node + * would not be skipped by isl_schedule_tree_first_schedule_descendant + * and that it is not a leaf node. + */ +static __isl_give isl_union_set *initial_domain( + __isl_keep isl_schedule_tree *tree) +{ + isl_multi_union_pw_aff *mupa; + isl_union_set *domain; + isl_union_map *exp; + + if (!tree) + return NULL; + + switch (tree->type) { + case isl_schedule_node_error: + return NULL; + case isl_schedule_node_context: + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "context node should be handled by caller", + return NULL); + case isl_schedule_node_guard: + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "guard node should be handled by caller", + return NULL); + case isl_schedule_node_mark: + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "mark node should be handled by caller", + return NULL); + case isl_schedule_node_extension: + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "cannot construct subtree schedule of tree " + "with extension nodes", return NULL); + case isl_schedule_node_band: + if (isl_schedule_tree_band_n_member(tree) == 0) + isl_die(isl_schedule_tree_get_ctx(tree), + isl_error_internal, + "0D band should be handled by caller", + return NULL); + mupa = isl_schedule_band_get_partial_schedule(tree->band); + domain = isl_multi_union_pw_aff_domain(mupa); + domain = isl_union_set_universe(domain); + break; + case isl_schedule_node_domain: + domain = isl_schedule_tree_domain_get_domain(tree); + domain = isl_union_set_universe(domain); + break; + case isl_schedule_node_expansion: + exp = isl_schedule_tree_expansion_get_expansion(tree); + exp = isl_union_map_universe(exp); + domain = isl_union_map_domain(exp); + break; + case isl_schedule_node_filter: + domain = isl_schedule_tree_filter_get_filter(tree); + domain = isl_union_set_universe(domain); + break; + case isl_schedule_node_leaf: + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "leaf node should be handled by caller", return NULL); + case isl_schedule_node_set: + case isl_schedule_node_sequence: + domain = initial_domain_from_children(tree); + break; + } + + return domain; +} + +/* Return the subtree schedule of a node that contains some schedule + * information, i.e., a node that would not be skipped by + * isl_schedule_tree_first_schedule_descendant and that is not a leaf. + * + * If the tree contains any expansions, then the returned subtree + * schedule is formulated in terms of the expanded domains. + * The tree is not allowed to contain any extension nodes. + * + * We start with an initial zero-dimensional subtree schedule based + * on the domain information in the root node and then extend it + * based on the schedule information in the root node and its descendants. + */ +__isl_give isl_union_map *isl_schedule_tree_get_subtree_schedule_union_map( + __isl_keep isl_schedule_tree *tree) +{ + isl_union_set *domain; + isl_union_map *umap; + + domain = initial_domain(tree); + umap = isl_union_map_from_domain(domain); + return subtree_schedule_extend(tree, umap); +} + +/* Multiply the partial schedule of the band root node of "tree" + * with the factors in "mv". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_band_scale( + __isl_take isl_schedule_tree *tree, __isl_take isl_multi_val *mv) +{ + if (!tree || !mv) + goto error; + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", goto error); + + tree = isl_schedule_tree_cow(tree); + if (!tree) + goto error; + + tree->band = isl_schedule_band_scale(tree->band, mv); + if (!tree->band) + return isl_schedule_tree_free(tree); + + return tree; +error: + isl_schedule_tree_free(tree); + isl_multi_val_free(mv); + return NULL; +} + +/* Divide the partial schedule of the band root node of "tree" + * by the factors in "mv". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_band_scale_down( + __isl_take isl_schedule_tree *tree, __isl_take isl_multi_val *mv) +{ + if (!tree || !mv) + goto error; + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", goto error); + + tree = isl_schedule_tree_cow(tree); + if (!tree) + goto error; + + tree->band = isl_schedule_band_scale_down(tree->band, mv); + if (!tree->band) + return isl_schedule_tree_free(tree); + + return tree; +error: + isl_schedule_tree_free(tree); + isl_multi_val_free(mv); + return NULL; +} + +/* Given two trees with sequence roots, replace the child at position + * "pos" of "tree" with the children of "child". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_sequence_splice( + __isl_take isl_schedule_tree *tree, int pos, + __isl_take isl_schedule_tree *child) +{ + int n; + isl_schedule_tree_list *list1, *list2; + + tree = isl_schedule_tree_cow(tree); + if (!tree || !child) + goto error; + if (isl_schedule_tree_get_type(tree) != isl_schedule_node_sequence) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a sequence node", goto error); + n = isl_schedule_tree_n_children(tree); + if (pos < 0 || pos >= n) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "position out of bounds", goto error); + if (isl_schedule_tree_get_type(child) != isl_schedule_node_sequence) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a sequence node", goto error); + + list1 = isl_schedule_tree_list_copy(tree->children); + list1 = isl_schedule_tree_list_drop(list1, pos, n - pos); + list2 = isl_schedule_tree_list_copy(tree->children); + list2 = isl_schedule_tree_list_drop(list2, 0, pos + 1); + list1 = isl_schedule_tree_list_concat(list1, + isl_schedule_tree_list_copy(child->children)); + list1 = isl_schedule_tree_list_concat(list1, list2); + + isl_schedule_tree_free(tree); + isl_schedule_tree_free(child); + return isl_schedule_tree_from_children(isl_schedule_node_sequence, + list1); +error: + isl_schedule_tree_free(tree); + isl_schedule_tree_free(child); + return NULL; +} + +/* Tile the band root node of "tree" with tile sizes "sizes". + * + * We duplicate the band node, change the schedule of one of them + * to the tile schedule and the other to the point schedule and then + * attach the point band as a child to the tile band. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_band_tile( + __isl_take isl_schedule_tree *tree, __isl_take isl_multi_val *sizes) +{ + isl_schedule_tree *child = NULL; + + if (!tree || !sizes) + goto error; + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", goto error); + + child = isl_schedule_tree_copy(tree); + tree = isl_schedule_tree_cow(tree); + child = isl_schedule_tree_cow(child); + if (!tree || !child) + goto error; + + tree->band = isl_schedule_band_tile(tree->band, + isl_multi_val_copy(sizes)); + if (!tree->band) + goto error; + child->band = isl_schedule_band_point(child->band, tree->band, sizes); + if (!child->band) + child = isl_schedule_tree_free(child); + + tree = isl_schedule_tree_replace_child(tree, 0, child); + + return tree; +error: + isl_schedule_tree_free(child); + isl_schedule_tree_free(tree); + isl_multi_val_free(sizes); + return NULL; +} + +/* Split the band root node of "tree" into two nested band nodes, + * one with the first "pos" dimensions and + * one with the remaining dimensions. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_band_split( + __isl_take isl_schedule_tree *tree, int pos) +{ + int n; + isl_schedule_tree *child; + + if (!tree) + return NULL; + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return isl_schedule_tree_free(tree)); + + n = isl_schedule_tree_band_n_member(tree); + if (pos < 0 || pos > n) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "position out of bounds", + return isl_schedule_tree_free(tree)); + + child = isl_schedule_tree_copy(tree); + tree = isl_schedule_tree_cow(tree); + child = isl_schedule_tree_cow(child); + if (!tree || !child) + goto error; + + child->band = isl_schedule_band_drop(child->band, 0, pos); + tree->band = isl_schedule_band_drop(tree->band, pos, n - pos); + if (!child->band || !tree->band) + goto error; + + tree = isl_schedule_tree_replace_child(tree, 0, child); + + return tree; +error: + isl_schedule_tree_free(child); + isl_schedule_tree_free(tree); + return NULL; +} + +/* Attach "tree2" at each of the leaves of "tree1". + * + * If "tree1" does not have any explicit children, then make "tree2" + * its single child. Otherwise, attach "tree2" to the leaves of + * each of the children of "tree1". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_append_to_leaves( + __isl_take isl_schedule_tree *tree1, + __isl_take isl_schedule_tree *tree2) +{ + int i, n; + + if (!tree1 || !tree2) + goto error; + n = isl_schedule_tree_n_children(tree1); + if (n == 0) { + isl_schedule_tree_list *list; + list = isl_schedule_tree_list_from_schedule_tree(tree2); + tree1 = isl_schedule_tree_set_children(tree1, list); + return tree1; + } + for (i = 0; i < n; ++i) { + isl_schedule_tree *child; + + child = isl_schedule_tree_get_child(tree1, i); + child = isl_schedule_tree_append_to_leaves(child, + isl_schedule_tree_copy(tree2)); + tree1 = isl_schedule_tree_replace_child(tree1, i, child); + } + + isl_schedule_tree_free(tree2); + return tree1; +error: + isl_schedule_tree_free(tree1); + isl_schedule_tree_free(tree2); + return NULL; +} + +/* Reset the user pointer on all identifiers of parameters and tuples + * in the root of "tree". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_reset_user( + __isl_take isl_schedule_tree *tree) +{ + if (isl_schedule_tree_is_leaf(tree)) + return tree; + + tree = isl_schedule_tree_cow(tree); + if (!tree) + return NULL; + + switch (tree->type) { + case isl_schedule_node_error: + return isl_schedule_tree_free(tree); + case isl_schedule_node_band: + tree->band = isl_schedule_band_reset_user(tree->band); + if (!tree->band) + return isl_schedule_tree_free(tree); + break; + case isl_schedule_node_context: + tree->context = isl_set_reset_user(tree->context); + if (!tree->context) + return isl_schedule_tree_free(tree); + break; + case isl_schedule_node_domain: + tree->domain = isl_union_set_reset_user(tree->domain); + if (!tree->domain) + return isl_schedule_tree_free(tree); + break; + case isl_schedule_node_expansion: + tree->contraction = + isl_union_pw_multi_aff_reset_user(tree->contraction); + tree->expansion = isl_union_map_reset_user(tree->expansion); + if (!tree->contraction || !tree->expansion) + return isl_schedule_tree_free(tree); + break; + case isl_schedule_node_extension: + tree->extension = isl_union_map_reset_user(tree->extension); + if (!tree->extension) + return isl_schedule_tree_free(tree); + break; + case isl_schedule_node_filter: + tree->filter = isl_union_set_reset_user(tree->filter); + if (!tree->filter) + return isl_schedule_tree_free(tree); + break; + case isl_schedule_node_guard: + tree->guard = isl_set_reset_user(tree->guard); + if (!tree->guard) + return isl_schedule_tree_free(tree); + break; + case isl_schedule_node_leaf: + case isl_schedule_node_mark: + case isl_schedule_node_sequence: + case isl_schedule_node_set: + break; + } + + return tree; +} + +/* Align the parameters of the root of "tree" to those of "space". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_align_params( + __isl_take isl_schedule_tree *tree, __isl_take isl_space *space) +{ + if (!space) + goto error; + + if (isl_schedule_tree_is_leaf(tree)) { + isl_space_free(space); + return tree; + } + + tree = isl_schedule_tree_cow(tree); + if (!tree) + goto error; + + switch (tree->type) { + case isl_schedule_node_error: + goto error; + case isl_schedule_node_band: + tree->band = isl_schedule_band_align_params(tree->band, space); + if (!tree->band) + return isl_schedule_tree_free(tree); + break; + case isl_schedule_node_context: + tree->context = isl_set_align_params(tree->context, space); + if (!tree->context) + return isl_schedule_tree_free(tree); + break; + case isl_schedule_node_domain: + tree->domain = isl_union_set_align_params(tree->domain, space); + if (!tree->domain) + return isl_schedule_tree_free(tree); + break; + case isl_schedule_node_expansion: + tree->contraction = + isl_union_pw_multi_aff_align_params(tree->contraction, + isl_space_copy(space)); + tree->expansion = isl_union_map_align_params(tree->expansion, + space); + if (!tree->contraction || !tree->expansion) + return isl_schedule_tree_free(tree); + break; + case isl_schedule_node_extension: + tree->extension = isl_union_map_align_params(tree->extension, + space); + if (!tree->extension) + return isl_schedule_tree_free(tree); + break; + case isl_schedule_node_filter: + tree->filter = isl_union_set_align_params(tree->filter, space); + if (!tree->filter) + return isl_schedule_tree_free(tree); + break; + case isl_schedule_node_guard: + tree->guard = isl_set_align_params(tree->guard, space); + if (!tree->guard) + return isl_schedule_tree_free(tree); + break; + case isl_schedule_node_leaf: + case isl_schedule_node_mark: + case isl_schedule_node_sequence: + case isl_schedule_node_set: + isl_space_free(space); + break; + } + + return tree; +error: + isl_space_free(space); + isl_schedule_tree_free(tree); + return NULL; +} + +/* Does "tree" involve the iteration domain? + * That is, does it need to be modified + * by isl_schedule_tree_pullback_union_pw_multi_aff? + */ +static int involves_iteration_domain(__isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return -1; + + switch (tree->type) { + case isl_schedule_node_error: + return -1; + case isl_schedule_node_band: + case isl_schedule_node_domain: + case isl_schedule_node_expansion: + case isl_schedule_node_extension: + case isl_schedule_node_filter: + return 1; + case isl_schedule_node_context: + case isl_schedule_node_leaf: + case isl_schedule_node_guard: + case isl_schedule_node_mark: + case isl_schedule_node_sequence: + case isl_schedule_node_set: + return 0; + } + + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "unhandled case", return -1); +} + +/* Compute the pullback of the root node of "tree" by the function + * represented by "upma". + * In other words, plug in "upma" in the iteration domains of + * the root node of "tree". + * We currently do not handle expansion nodes. + * + * We first check if the root node involves any iteration domains. + * If so, we handle the specific cases. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_pullback_union_pw_multi_aff( + __isl_take isl_schedule_tree *tree, + __isl_take isl_union_pw_multi_aff *upma) +{ + int involves; + + if (!tree || !upma) + goto error; + + involves = involves_iteration_domain(tree); + if (involves < 0) + goto error; + if (!involves) { + isl_union_pw_multi_aff_free(upma); + return tree; + } + + tree = isl_schedule_tree_cow(tree); + if (!tree) + goto error; + + if (tree->type == isl_schedule_node_band) { + tree->band = isl_schedule_band_pullback_union_pw_multi_aff( + tree->band, upma); + if (!tree->band) + return isl_schedule_tree_free(tree); + } else if (tree->type == isl_schedule_node_domain) { + tree->domain = + isl_union_set_preimage_union_pw_multi_aff(tree->domain, + upma); + if (!tree->domain) + return isl_schedule_tree_free(tree); + } else if (tree->type == isl_schedule_node_expansion) { + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_unsupported, + "cannot pullback expansion node", goto error); + } else if (tree->type == isl_schedule_node_extension) { + tree->extension = + isl_union_map_preimage_range_union_pw_multi_aff( + tree->extension, upma); + if (!tree->extension) + return isl_schedule_tree_free(tree); + } else if (tree->type == isl_schedule_node_filter) { + tree->filter = + isl_union_set_preimage_union_pw_multi_aff(tree->filter, + upma); + if (!tree->filter) + return isl_schedule_tree_free(tree); + } + + return tree; +error: + isl_union_pw_multi_aff_free(upma); + isl_schedule_tree_free(tree); + return NULL; +} + +/* Compute the gist of the band tree root with respect to "context". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_band_gist( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *context) +{ + if (!tree) + return NULL; + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", goto error); + tree = isl_schedule_tree_cow(tree); + if (!tree) + goto error; + + tree->band = isl_schedule_band_gist(tree->band, context); + if (!tree->band) + return isl_schedule_tree_free(tree); + return tree; +error: + isl_union_set_free(context); + isl_schedule_tree_free(tree); + return NULL; +} + +/* Are any members in "band" marked coincident? + */ +static int any_coincident(__isl_keep isl_schedule_band *band) +{ + int i, n; + + n = isl_schedule_band_n_member(band); + for (i = 0; i < n; ++i) + if (isl_schedule_band_member_get_coincident(band, i)) + return 1; + + return 0; +} + +/* Print the band node "band" to "p". + * + * The permutable and coincident properties are only printed if they + * are different from the defaults. + * The coincident property is always printed in YAML flow style. + */ +static __isl_give isl_printer *print_tree_band(__isl_take isl_printer *p, + __isl_keep isl_schedule_band *band) +{ + isl_union_set *options; + int empty; + + p = isl_printer_print_str(p, "schedule"); + p = isl_printer_yaml_next(p); + p = isl_printer_print_str(p, "\""); + p = isl_printer_print_multi_union_pw_aff(p, band->mupa); + p = isl_printer_print_str(p, "\""); + if (isl_schedule_band_get_permutable(band)) { + p = isl_printer_yaml_next(p); + p = isl_printer_print_str(p, "permutable"); + p = isl_printer_yaml_next(p); + p = isl_printer_print_int(p, 1); + } + if (any_coincident(band)) { + int i, n; + int style; + + p = isl_printer_yaml_next(p); + p = isl_printer_print_str(p, "coincident"); + p = isl_printer_yaml_next(p); + style = isl_printer_get_yaml_style(p); + p = isl_printer_set_yaml_style(p, ISL_YAML_STYLE_FLOW); + p = isl_printer_yaml_start_sequence(p); + n = isl_schedule_band_n_member(band); + for (i = 0; i < n; ++i) { + p = isl_printer_print_int(p, + isl_schedule_band_member_get_coincident(band, i)); + p = isl_printer_yaml_next(p); + } + p = isl_printer_yaml_end_sequence(p); + p = isl_printer_set_yaml_style(p, style); + } + options = isl_schedule_band_get_ast_build_options(band); + empty = isl_union_set_is_empty(options); + if (empty < 0) + p = isl_printer_free(p); + if (!empty) { + p = isl_printer_yaml_next(p); + p = isl_printer_print_str(p, "options"); + p = isl_printer_yaml_next(p); + p = isl_printer_print_str(p, "\""); + p = isl_printer_print_union_set(p, options); + p = isl_printer_print_str(p, "\""); + } + isl_union_set_free(options); + + return p; +} + +/* Print "tree" to "p". + * + * If "n_ancestor" is non-negative, then "child_pos" contains the child + * positions of a descendant of the current node that should be marked + * (by the comment "YOU ARE HERE"). In particular, if "n_ancestor" + * is zero, then the current node should be marked. + * The marking is only printed in YAML block format. + * + * Implicit leaf nodes are not printed, except if they correspond + * to the node that should be marked. + */ +__isl_give isl_printer *isl_printer_print_schedule_tree_mark( + __isl_take isl_printer *p, __isl_keep isl_schedule_tree *tree, + int n_ancestor, int *child_pos) +{ + int i, n; + int sequence = 0; + int block; + + block = isl_printer_get_yaml_style(p) == ISL_YAML_STYLE_BLOCK; + + p = isl_printer_yaml_start_mapping(p); + if (n_ancestor == 0 && block) { + p = isl_printer_print_str(p, "# YOU ARE HERE"); + p = isl_printer_end_line(p); + p = isl_printer_start_line(p); + } + switch (tree->type) { + case isl_schedule_node_error: + p = isl_printer_print_str(p, "ERROR"); + break; + case isl_schedule_node_leaf: + p = isl_printer_print_str(p, "leaf"); + break; + case isl_schedule_node_sequence: + p = isl_printer_print_str(p, "sequence"); + sequence = 1; + break; + case isl_schedule_node_set: + p = isl_printer_print_str(p, "set"); + sequence = 1; + break; + case isl_schedule_node_context: + p = isl_printer_print_str(p, "context"); + p = isl_printer_yaml_next(p); + p = isl_printer_print_str(p, "\""); + p = isl_printer_print_set(p, tree->context); + p = isl_printer_print_str(p, "\""); + break; + case isl_schedule_node_domain: + p = isl_printer_print_str(p, "domain"); + p = isl_printer_yaml_next(p); + p = isl_printer_print_str(p, "\""); + p = isl_printer_print_union_set(p, tree->domain); + p = isl_printer_print_str(p, "\""); + break; + case isl_schedule_node_expansion: + p = isl_printer_print_str(p, "contraction"); + p = isl_printer_yaml_next(p); + p = isl_printer_print_str(p, "\""); + p = isl_printer_print_union_pw_multi_aff(p, tree->contraction); + p = isl_printer_print_str(p, "\""); + p = isl_printer_yaml_next(p); + p = isl_printer_print_str(p, "expansion"); + p = isl_printer_yaml_next(p); + p = isl_printer_print_str(p, "\""); + p = isl_printer_print_union_map(p, tree->expansion); + p = isl_printer_print_str(p, "\""); + break; + case isl_schedule_node_extension: + p = isl_printer_print_str(p, "extension"); + p = isl_printer_yaml_next(p); + p = isl_printer_print_str(p, "\""); + p = isl_printer_print_union_map(p, tree->extension); + p = isl_printer_print_str(p, "\""); + break; + case isl_schedule_node_filter: + p = isl_printer_print_str(p, "filter"); + p = isl_printer_yaml_next(p); + p = isl_printer_print_str(p, "\""); + p = isl_printer_print_union_set(p, tree->filter); + p = isl_printer_print_str(p, "\""); + break; + case isl_schedule_node_guard: + p = isl_printer_print_str(p, "guard"); + p = isl_printer_yaml_next(p); + p = isl_printer_print_str(p, "\""); + p = isl_printer_print_set(p, tree->guard); + p = isl_printer_print_str(p, "\""); + break; + case isl_schedule_node_mark: + p = isl_printer_print_str(p, "mark"); + p = isl_printer_yaml_next(p); + p = isl_printer_print_str(p, "\""); + p = isl_printer_print_str(p, isl_id_get_name(tree->mark)); + p = isl_printer_print_str(p, "\""); + break; + case isl_schedule_node_band: + p = print_tree_band(p, tree->band); + break; + } + p = isl_printer_yaml_next(p); + + if (!tree->children) { + if (n_ancestor > 0 && block) { + isl_schedule_tree *leaf; + + p = isl_printer_print_str(p, "child"); + p = isl_printer_yaml_next(p); + leaf = isl_schedule_tree_leaf(isl_printer_get_ctx(p)); + p = isl_printer_print_schedule_tree_mark(p, + leaf, 0, NULL); + isl_schedule_tree_free(leaf); + p = isl_printer_yaml_next(p); + } + return isl_printer_yaml_end_mapping(p); + } + + if (sequence) { + p = isl_printer_yaml_start_sequence(p); + } else { + p = isl_printer_print_str(p, "child"); + p = isl_printer_yaml_next(p); + } + + n = isl_schedule_tree_list_n_schedule_tree(tree->children); + for (i = 0; i < n; ++i) { + isl_schedule_tree *t; + + t = isl_schedule_tree_get_child(tree, i); + if (n_ancestor > 0 && child_pos[0] == i) + p = isl_printer_print_schedule_tree_mark(p, t, + n_ancestor - 1, child_pos + 1); + else + p = isl_printer_print_schedule_tree_mark(p, t, + -1, NULL); + isl_schedule_tree_free(t); + + p = isl_printer_yaml_next(p); + } + + if (sequence) + p = isl_printer_yaml_end_sequence(p); + p = isl_printer_yaml_end_mapping(p); + + return p; +} + +/* Print "tree" to "p". + */ +__isl_give isl_printer *isl_printer_print_schedule_tree( + __isl_take isl_printer *p, __isl_keep isl_schedule_tree *tree) +{ + return isl_printer_print_schedule_tree_mark(p, tree, -1, NULL); +} + +void isl_schedule_tree_dump(__isl_keep isl_schedule_tree *tree) +{ + isl_ctx *ctx; + isl_printer *printer; + + if (!tree) + return; + + ctx = isl_schedule_tree_get_ctx(tree); + printer = isl_printer_to_file(ctx, stderr); + printer = isl_printer_set_yaml_style(printer, ISL_YAML_STYLE_BLOCK); + printer = isl_printer_print_schedule_tree(printer, tree); + + isl_printer_free(printer); +} diff -Nru cloog-0.18.2/isl/isl_schedule_tree.h cloog-0.18.4/isl/isl_schedule_tree.h --- cloog-0.18.2/isl/isl_schedule_tree.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_schedule_tree.h 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,260 @@ +#ifndef ISL_SCHEDLUE_TREE_H +#define ISL_SCHEDLUE_TREE_H + +#include +#include +#include +#include + +struct isl_schedule_tree; +typedef struct isl_schedule_tree isl_schedule_tree; + +ISL_DECLARE_LIST(schedule_tree) + +/* A schedule (sub)tree. + * + * The leaves of a tree are not explicitly represented inside + * the isl_schedule_tree. If a tree consists of only a leaf, + * then it is equal to the static object isl_schedule_tree_empty. + * + * ctx may be NULL if type is isl_schedule_node_leaf. + * In this case, ref has a negative value. + * + * The "band" field is valid when type is isl_schedule_node_band. + * The "context" field is valid when type is isl_schedule_node_context + * and represents constraints on the flat product of the outer band nodes, + * possibly introducing additional parameters. + * The "domain" field is valid when type is isl_schedule_node_domain + * and introduces the statement instances scheduled by the tree. + * + * The "contraction" and "expansion" fields are valid when type + * is isl_schedule_node_expansion. + * "expansion" expands the reaching domain elements to one or more + * domain elements for the subtree. + * "contraction" maps these elements back to the corresponding + * reaching domain element. It does not involve any domain constraints. + * + * The "extension" field is valid when the is isl_schedule_node_extension + * maps outer schedule dimenions (the flat product of the outer band nodes) + * to additional iteration domains. + * + * The "filter" field is valid when type is isl_schedule_node_filter + * and represents the statement instances selected by the node. + * + * The "guard" field is valid when type is isl_schedule_node_guard + * and represents constraints on the flat product of the outer band nodes + * that need to be enforced by the outer nodes in the generated AST. + * + * The "mark" field is valid when type is isl_schedule_node_mark and + * identifies the mark. + * + * The "children" field is valid for all types except + * isl_schedule_node_leaf. This field is NULL if there are + * no children (except for the implicit leaves). + * + * anchored is set if the node or any of its descendants depends + * on its position in the schedule tree. + */ +struct isl_schedule_tree { + int ref; + isl_ctx *ctx; + int anchored; + enum isl_schedule_node_type type; + union { + isl_schedule_band *band; + isl_set *context; + isl_union_set *domain; + struct { + isl_union_pw_multi_aff *contraction; + isl_union_map *expansion; + }; + isl_union_map *extension; + isl_union_set *filter; + isl_set *guard; + isl_id *mark; + }; + isl_schedule_tree_list *children; +}; + +isl_ctx *isl_schedule_tree_get_ctx(__isl_keep isl_schedule_tree *tree); +enum isl_schedule_node_type isl_schedule_tree_get_type( + __isl_keep isl_schedule_tree *tree); + +__isl_give isl_schedule_tree *isl_schedule_tree_leaf(isl_ctx *ctx); +int isl_schedule_tree_is_leaf(__isl_keep isl_schedule_tree *tree); + +isl_bool isl_schedule_tree_plain_is_equal(__isl_keep isl_schedule_tree *tree1, + __isl_keep isl_schedule_tree *tree2); + +__isl_give isl_schedule_tree *isl_schedule_tree_copy( + __isl_keep isl_schedule_tree *tree); +__isl_null isl_schedule_tree *isl_schedule_tree_free( + __isl_take isl_schedule_tree *tree); + +__isl_give isl_schedule_tree *isl_schedule_tree_from_band( + __isl_take isl_schedule_band *band); +__isl_give isl_schedule_tree *isl_schedule_tree_from_context( + __isl_take isl_set *context); +__isl_give isl_schedule_tree *isl_schedule_tree_from_domain( + __isl_take isl_union_set *domain); +__isl_give isl_schedule_tree *isl_schedule_tree_from_expansion( + __isl_take isl_union_pw_multi_aff *contraction, + __isl_take isl_union_map *expansion); +__isl_give isl_schedule_tree *isl_schedule_tree_from_extension( + __isl_take isl_union_map *extension); +__isl_give isl_schedule_tree *isl_schedule_tree_from_filter( + __isl_take isl_union_set *filter); +__isl_give isl_schedule_tree *isl_schedule_tree_from_guard( + __isl_take isl_set *guard); +__isl_give isl_schedule_tree *isl_schedule_tree_from_children( + enum isl_schedule_node_type type, + __isl_take isl_schedule_tree_list *list); +__isl_give isl_schedule_tree *isl_schedule_tree_from_pair( + enum isl_schedule_node_type type, __isl_take isl_schedule_tree *tree1, + __isl_take isl_schedule_tree *tree2); +__isl_give isl_schedule_tree *isl_schedule_tree_sequence_pair( + __isl_take isl_schedule_tree *tree1, + __isl_take isl_schedule_tree *tree2); + +isl_bool isl_schedule_tree_is_subtree_anchored( + __isl_keep isl_schedule_tree *tree); + +__isl_give isl_space *isl_schedule_tree_band_get_space( + __isl_keep isl_schedule_tree *tree); +__isl_give isl_schedule_tree *isl_schedule_tree_band_intersect_domain( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *domain); +__isl_give isl_multi_union_pw_aff *isl_schedule_tree_band_get_partial_schedule( + __isl_keep isl_schedule_tree *tree); +__isl_give isl_schedule_tree *isl_schedule_tree_band_set_partial_schedule( + __isl_take isl_schedule_tree *tree, + __isl_take isl_multi_union_pw_aff *schedule); +enum isl_ast_loop_type isl_schedule_tree_band_member_get_ast_loop_type( + __isl_keep isl_schedule_tree *tree, int pos); +__isl_give isl_schedule_tree *isl_schedule_tree_band_member_set_ast_loop_type( + __isl_take isl_schedule_tree *tree, int pos, + enum isl_ast_loop_type type); +enum isl_ast_loop_type isl_schedule_tree_band_member_get_isolate_ast_loop_type( + __isl_keep isl_schedule_tree *tree, int pos); +__isl_give isl_schedule_tree * +isl_schedule_tree_band_member_set_isolate_ast_loop_type( + __isl_take isl_schedule_tree *tree, int pos, + enum isl_ast_loop_type type); +__isl_give isl_union_set *isl_schedule_tree_band_get_ast_build_options( + __isl_keep isl_schedule_tree *tree); +__isl_give isl_schedule_tree *isl_schedule_tree_band_set_ast_build_options( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *options); +__isl_give isl_set *isl_schedule_tree_context_get_context( + __isl_keep isl_schedule_tree *tree); +__isl_give isl_union_set *isl_schedule_tree_domain_get_domain( + __isl_keep isl_schedule_tree *tree); +__isl_give isl_schedule_tree *isl_schedule_tree_domain_set_domain( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *domain); +__isl_give isl_union_pw_multi_aff *isl_schedule_tree_expansion_get_contraction( + __isl_keep isl_schedule_tree *tree); +__isl_give isl_union_map *isl_schedule_tree_expansion_get_expansion( + __isl_keep isl_schedule_tree *tree); +__isl_give isl_schedule_tree * +isl_schedule_tree_expansion_set_contraction_and_expansion( + __isl_take isl_schedule_tree *tree, + __isl_take isl_union_pw_multi_aff *contraction, + __isl_take isl_union_map *expansion); +__isl_give isl_union_map *isl_schedule_tree_extension_get_extension( + __isl_keep isl_schedule_tree *tree); +__isl_give isl_schedule_tree *isl_schedule_tree_extension_set_extension( + __isl_take isl_schedule_tree *tree, + __isl_take isl_union_map *extension); +__isl_give isl_union_set *isl_schedule_tree_filter_get_filter( + __isl_keep isl_schedule_tree *tree); +__isl_give isl_schedule_tree *isl_schedule_tree_filter_set_filter( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *filter); +__isl_give isl_set *isl_schedule_tree_guard_get_guard( + __isl_keep isl_schedule_tree *tree); +__isl_give isl_id *isl_schedule_tree_mark_get_id( + __isl_keep isl_schedule_tree *tree); + +__isl_give isl_schedule_tree *isl_schedule_tree_first_schedule_descendant( + __isl_take isl_schedule_tree *tree, __isl_keep isl_schedule_tree *leaf); +__isl_give isl_union_map *isl_schedule_tree_get_subtree_schedule_union_map( + __isl_keep isl_schedule_tree *tree); + +unsigned isl_schedule_tree_band_n_member(__isl_keep isl_schedule_tree *tree); + +isl_bool isl_schedule_tree_band_member_get_coincident( + __isl_keep isl_schedule_tree *tree, int pos); +__isl_give isl_schedule_tree *isl_schedule_tree_band_member_set_coincident( + __isl_take isl_schedule_tree *tree, int pos, int coincident); +isl_bool isl_schedule_tree_band_get_permutable( + __isl_keep isl_schedule_tree *tree); +__isl_give isl_schedule_tree *isl_schedule_tree_band_set_permutable( + __isl_take isl_schedule_tree *tree, int permutable); + +int isl_schedule_tree_has_children(__isl_keep isl_schedule_tree *tree); +int isl_schedule_tree_n_children(__isl_keep isl_schedule_tree *tree); +__isl_give isl_schedule_tree *isl_schedule_tree_get_child( + __isl_keep isl_schedule_tree *tree, int pos); + +__isl_give isl_schedule_tree *isl_schedule_tree_insert_band( + __isl_take isl_schedule_tree *tree, __isl_take isl_schedule_band *band); +__isl_give isl_schedule_tree *isl_schedule_tree_insert_context( + __isl_take isl_schedule_tree *tree, __isl_take isl_set *context); +__isl_give isl_schedule_tree *isl_schedule_tree_insert_domain( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *domain); +__isl_give isl_schedule_tree *isl_schedule_tree_insert_expansion( + __isl_take isl_schedule_tree *tree, + __isl_take isl_union_pw_multi_aff *contraction, + __isl_take isl_union_map *expansion); +__isl_give isl_schedule_tree *isl_schedule_tree_insert_extension( + __isl_take isl_schedule_tree *tree, + __isl_take isl_union_map *extension); +__isl_give isl_schedule_tree *isl_schedule_tree_insert_filter( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *filter); +__isl_give isl_schedule_tree *isl_schedule_tree_children_insert_filter( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *filter); +__isl_give isl_schedule_tree *isl_schedule_tree_insert_guard( + __isl_take isl_schedule_tree *tree, __isl_take isl_set *guard); +__isl_give isl_schedule_tree *isl_schedule_tree_insert_mark( + __isl_take isl_schedule_tree *tree, __isl_take isl_id *mark); + +__isl_give isl_schedule_tree *isl_schedule_tree_append_to_leaves( + __isl_take isl_schedule_tree *tree1, + __isl_take isl_schedule_tree *tree2); + +__isl_give isl_schedule_tree *isl_schedule_tree_band_scale( + __isl_take isl_schedule_tree *tree, __isl_take isl_multi_val *mv); +__isl_give isl_schedule_tree *isl_schedule_tree_band_scale_down( + __isl_take isl_schedule_tree *tree, __isl_take isl_multi_val *mv); +__isl_give isl_schedule_tree *isl_schedule_tree_band_tile( + __isl_take isl_schedule_tree *tree, __isl_take isl_multi_val *sizes); +__isl_give isl_schedule_tree *isl_schedule_tree_band_split( + __isl_take isl_schedule_tree *tree, int pos); +__isl_give isl_schedule_tree *isl_schedule_tree_band_gist( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *context); + +__isl_give isl_schedule_tree *isl_schedule_tree_child( + __isl_take isl_schedule_tree *tree, int pos); +__isl_give isl_schedule_tree *isl_schedule_tree_reset_children( + __isl_take isl_schedule_tree *tree); +__isl_give isl_schedule_tree *isl_schedule_tree_drop_child( + __isl_take isl_schedule_tree *tree, int pos); +__isl_give isl_schedule_tree *isl_schedule_tree_replace_child( + __isl_take isl_schedule_tree *tree, int pos, + __isl_take isl_schedule_tree *new_child); +__isl_give isl_schedule_tree *isl_schedule_tree_sequence_splice( + __isl_take isl_schedule_tree *tree, int pos, + __isl_take isl_schedule_tree *child); + +__isl_give isl_schedule_tree *isl_schedule_tree_reset_user( + __isl_take isl_schedule_tree *tree); +__isl_give isl_schedule_tree *isl_schedule_tree_align_params( + __isl_take isl_schedule_tree *tree, __isl_take isl_space *space); +__isl_give isl_schedule_tree *isl_schedule_tree_pullback_union_pw_multi_aff( + __isl_take isl_schedule_tree *tree, + __isl_take isl_union_pw_multi_aff *upma); + +__isl_give isl_printer *isl_printer_print_schedule_tree( + __isl_take isl_printer *p, __isl_keep isl_schedule_tree *tree); +__isl_give isl_printer *isl_printer_print_schedule_tree_mark( + __isl_take isl_printer *p, __isl_keep isl_schedule_tree *tree, + int n_ancestor, int *child_pos); + +#endif diff -Nru cloog-0.18.2/isl/isl_seq.c cloog-0.18.4/isl/isl_seq.c --- cloog-0.18.2/isl/isl_seq.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_seq.c 2015-07-24 12:23:09.000000000 +0000 @@ -8,7 +8,7 @@ */ #include -#include +#include void isl_seq_clr(isl_int *p, unsigned len) { @@ -107,6 +107,14 @@ int i; isl_int tmp; + if (dst == src1 && isl_int_is_one(m1)) { + if (isl_int_is_zero(m2)) + return; + for (i = 0; i < len; ++i) + isl_int_addmul(src1[i], m2, src2[i]); + return; + } + isl_int_init(tmp); for (i = 0; i < len; ++i) { isl_int_mul(tmp, m1, src1[i]); diff -Nru cloog-0.18.2/isl/isl_seq.h cloog-0.18.4/isl/isl_seq.h --- cloog-0.18.2/isl/isl_seq.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_seq.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,60 @@ +/* + * Copyright 2008-2009 Katholieke Universiteit Leuven + * + * Use of this software is governed by the MIT license + * + * Written by Sven Verdoolaege, K.U.Leuven, Departement + * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium + */ + +#ifndef ISL_SEQ_H +#define ISL_SEQ_H + +#include +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +/* Some common operations on sequences of isl_int's */ + +void isl_seq_clr(isl_int *p, unsigned len); +void isl_seq_set(isl_int *p, isl_int v, unsigned len); +void isl_seq_set_si(isl_int *p, int v, unsigned len); +void isl_seq_neg(isl_int *dst, isl_int *src, unsigned len); +void isl_seq_cpy(isl_int *dst, isl_int *src, unsigned len); +void isl_seq_addmul(isl_int *dst, isl_int f, isl_int *src, unsigned len); +void isl_seq_submul(isl_int *dst, isl_int f, isl_int *src, unsigned len); +void isl_seq_swp_or_cpy(isl_int *dst, isl_int *src, unsigned len); +void isl_seq_scale(isl_int *dst, isl_int *src, isl_int f, unsigned len); +void isl_seq_scale_down(isl_int *dst, isl_int *src, isl_int f, unsigned len); +void isl_seq_cdiv_q(isl_int *dst, isl_int *src, isl_int m, unsigned len); +void isl_seq_fdiv_q(isl_int *dst, isl_int *src, isl_int m, unsigned len); +void isl_seq_fdiv_r(isl_int *dst, isl_int *src, isl_int m, unsigned len); +void isl_seq_combine(isl_int *dst, isl_int m1, isl_int *src1, + isl_int m2, isl_int *src2, unsigned len); +void isl_seq_elim(isl_int *dst, isl_int *src, unsigned pos, unsigned len, + isl_int *m); +void isl_seq_abs_max(isl_int *p, unsigned len, isl_int *max); +void isl_seq_gcd(isl_int *p, unsigned len, isl_int *gcd); +void isl_seq_lcm(isl_int *p, unsigned len, isl_int *lcm); +void isl_seq_normalize(struct isl_ctx *ctx, isl_int *p, unsigned len); +void isl_seq_inner_product(isl_int *p1, isl_int *p2, unsigned len, + isl_int *prod); +int isl_seq_first_non_zero(isl_int *p, unsigned len); +int isl_seq_last_non_zero(isl_int *p, unsigned len); +int isl_seq_abs_min_non_zero(isl_int *p, unsigned len); +int isl_seq_eq(isl_int *p1, isl_int *p2, unsigned len); +int isl_seq_cmp(isl_int *p1, isl_int *p2, unsigned len); +int isl_seq_is_neg(isl_int *p1, isl_int *p2, unsigned len); + +uint32_t isl_seq_get_hash(isl_int *p, unsigned len); +uint32_t isl_seq_get_hash_bits(isl_int *p, unsigned len, unsigned bits); + +#if defined(__cplusplus) +} +#endif + +#endif diff -Nru cloog-0.18.2/isl/isl_set_list.c cloog-0.18.4/isl/isl_set_list.c --- cloog-0.18.2/isl/isl_set_list.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_set_list.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,4 +1,5 @@ #include +#include #undef EL #define EL isl_basic_set @@ -10,6 +11,11 @@ #include +#undef EL +#define EL isl_union_set + +#include + #undef BASE #define BASE basic_set @@ -19,3 +25,8 @@ #define BASE set #include + +#undef BASE +#define BASE union_set + +#include diff -Nru cloog-0.18.2/isl/isl_space.c cloog-0.18.4/isl/isl_space.c --- cloog-0.18.2/isl/isl_space.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_space.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,6 +1,7 @@ /* * Copyright 2008-2009 Katholieke Universiteit Leuven * Copyright 2010 INRIA Saclay + * Copyright 2013-2014 Ecole Normale Superieure * * Use of this software is governed by the MIT license * @@ -8,6 +9,7 @@ * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium * and INRIA Saclay - Ile-de-France, Parc Club Orsay Universite, * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France + * and Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France */ #include @@ -63,23 +65,23 @@ /* Is the space that of a set? */ -int isl_space_is_set(__isl_keep isl_space *space) +isl_bool isl_space_is_set(__isl_keep isl_space *space) { if (!space) - return -1; + return isl_bool_error; if (space->n_in != 0 || space->nested[0]) - return 0; + return isl_bool_false; if (space->tuple_id[0] != &isl_id_none) - return 0; - return 1; + return isl_bool_false; + return isl_bool_true; } /* Is the given space that of a map? */ -int isl_space_is_map(__isl_keep isl_space *space) +isl_bool isl_space_is_map(__isl_keep isl_space *space) { if (!space) - return -1; + return isl_bool_error; return space->tuple_id[0] != &isl_id_none && space->tuple_id[1] != &isl_id_none; } @@ -107,18 +109,18 @@ /* Is the space that of a parameter domain? */ -int isl_space_is_params(__isl_keep isl_space *space) +isl_bool isl_space_is_params(__isl_keep isl_space *space) { if (!space) - return -1; + return isl_bool_error; if (space->n_in != 0 || space->nested[0] || space->n_out != 0 || space->nested[1]) - return 0; + return isl_bool_false; if (space->tuple_id[0] != &isl_id_none) - return 0; + return isl_bool_false; if (space->tuple_id[1] != &isl_id_none) - return 0; - return 1; + return isl_bool_false; + return isl_bool_true; } /* Create a space for a parameter domain. @@ -336,28 +338,28 @@ return dim; } -void *isl_space_free(__isl_take isl_space *dim) +__isl_null isl_space *isl_space_free(__isl_take isl_space *space) { int i; - if (!dim) + if (!space) return NULL; - if (--dim->ref > 0) + if (--space->ref > 0) return NULL; - isl_id_free(dim->tuple_id[0]); - isl_id_free(dim->tuple_id[1]); + isl_id_free(space->tuple_id[0]); + isl_id_free(space->tuple_id[1]); - isl_space_free(dim->nested[0]); - isl_space_free(dim->nested[1]); + isl_space_free(space->nested[0]); + isl_space_free(space->nested[1]); - for (i = 0; i < dim->n_id; ++i) - isl_id_free(dim->ids[i]); - free(dim->ids); - isl_ctx_deref(dim->ctx); + for (i = 0; i < space->n_id; ++i) + isl_id_free(space->ids[i]); + free(space->ids); + isl_ctx_deref(space->ctx); - free(dim); + free(space); return NULL; } @@ -403,10 +405,11 @@ /* Does the tuple have an id? */ -int isl_space_has_tuple_id(__isl_keep isl_space *dim, enum isl_dim_type type) +isl_bool isl_space_has_tuple_id(__isl_keep isl_space *dim, + enum isl_dim_type type) { if (!space_can_have_id(dim, type)) - return -1; + return isl_bool_error; return dim->tuple_id[type - isl_dim_in] != NULL; } @@ -534,11 +537,11 @@ return NULL; } -int isl_space_has_dim_id(__isl_keep isl_space *dim, +isl_bool isl_space_has_dim_id(__isl_keep isl_space *dim, enum isl_dim_type type, unsigned pos) { if (!dim) - return -1; + return isl_bool_error; return get_id(dim, type, pos) != NULL; } @@ -576,13 +579,13 @@ /* Does the tuple have a name? */ -int isl_space_has_tuple_name(__isl_keep isl_space *space, +isl_bool isl_space_has_tuple_name(__isl_keep isl_space *space, enum isl_dim_type type) { isl_id *id; if (!space_can_have_id(space, type)) - return -1; + return isl_bool_error; id = space->tuple_id[type - isl_dim_in]; return id && id->name; } @@ -620,13 +623,13 @@ /* Does the given dimension have a name? */ -int isl_space_has_dim_name(__isl_keep isl_space *space, +isl_bool isl_space_has_dim_name(__isl_keep isl_space *space, enum isl_dim_type type, unsigned pos) { isl_id *id; if (!space) - return -1; + return isl_bool_error; id = get_id(space, type, pos); return id && id->name; } @@ -677,6 +680,65 @@ return -1; } +/* Reset the user pointer on all identifiers of parameters and tuples + * of "space". + */ +__isl_give isl_space *isl_space_reset_user(__isl_take isl_space *space) +{ + int i; + isl_ctx *ctx; + isl_id *id; + const char *name; + + if (!space) + return NULL; + + ctx = isl_space_get_ctx(space); + + for (i = 0; i < space->nparam && i < space->n_id; ++i) { + if (!isl_id_get_user(space->ids[i])) + continue; + space = isl_space_cow(space); + if (!space) + return NULL; + name = isl_id_get_name(space->ids[i]); + id = isl_id_alloc(ctx, name, NULL); + isl_id_free(space->ids[i]); + space->ids[i] = id; + if (!id) + return isl_space_free(space); + } + + for (i = 0; i < 2; ++i) { + if (!space->tuple_id[i]) + continue; + if (!isl_id_get_user(space->tuple_id[i])) + continue; + space = isl_space_cow(space); + if (!space) + return NULL; + name = isl_id_get_name(space->tuple_id[i]); + id = isl_id_alloc(ctx, name, NULL); + isl_id_free(space->tuple_id[i]); + space->tuple_id[i] = id; + if (!id) + return isl_space_free(space); + } + + for (i = 0; i < 2; ++i) { + if (!space->nested[i]) + continue; + space = isl_space_cow(space); + if (!space) + return NULL; + space->nested[i] = isl_space_reset_user(space->nested[i]); + if (!space->nested[i]) + return isl_space_free(space); + } + + return space; +} + static __isl_keep isl_id *tuple_id(__isl_keep isl_space *dim, enum isl_dim_type type) { @@ -701,33 +763,70 @@ return NULL; } -int isl_space_tuple_match(__isl_keep isl_space *dim1, enum isl_dim_type dim1_type, - __isl_keep isl_space *dim2, enum isl_dim_type dim2_type) +/* Are the two spaces the same, apart from positions and names of parameters? + */ +static int isl_space_has_equal_tuples(__isl_keep isl_space *space1, + __isl_keep isl_space *space2) +{ + if (!space1 || !space2) + return -1; + if (space1 == space2) + return 1; + return isl_space_tuple_is_equal(space1, isl_dim_in, + space2, isl_dim_in) && + isl_space_tuple_is_equal(space1, isl_dim_out, + space2, isl_dim_out); +} + +/* Check if the tuple of type "type1" of "space1" is the same as + * the tuple of type "type2" of "space2". + * + * That is, check if the tuples have the same identifier, the same dimension + * and the same internal structure. + * The identifiers of the dimensions inside the tuples do not affect the result. + * + * Note that this function only checks the tuples themselves. + * If nested tuples are involved, then we need to be careful not + * to have result affected by possibly differing parameters + * in those nested tuples. + */ +isl_bool isl_space_tuple_is_equal(__isl_keep isl_space *space1, + enum isl_dim_type type1, __isl_keep isl_space *space2, + enum isl_dim_type type2) { isl_id *id1, *id2; isl_space *nested1, *nested2; - if (!dim1 || !dim2) - return -1; + if (!space1 || !space2) + return isl_bool_error; - if (dim1 == dim2 && dim1_type == dim2_type) - return 1; + if (space1 == space2 && type1 == type2) + return isl_bool_true; - if (n(dim1, dim1_type) != n(dim2, dim2_type)) - return 0; - id1 = tuple_id(dim1, dim1_type); - id2 = tuple_id(dim2, dim2_type); + if (n(space1, type1) != n(space2, type2)) + return isl_bool_false; + id1 = tuple_id(space1, type1); + id2 = tuple_id(space2, type2); if (!id1 ^ !id2) - return 0; + return isl_bool_false; if (id1 && id1 != id2) - return 0; - nested1 = nested(dim1, dim1_type); - nested2 = nested(dim2, dim2_type); + return isl_bool_false; + nested1 = nested(space1, type1); + nested2 = nested(space2, type2); if (!nested1 ^ !nested2) - return 0; - if (nested1 && !isl_space_is_equal(nested1, nested2)) - return 0; - return 1; + return isl_bool_false; + if (nested1 && !isl_space_has_equal_tuples(nested1, nested2)) + return isl_bool_false; + return isl_bool_true; +} + +/* This is the old, undocumented, name for isl_space_tuple_is_equal. + * It will be removed at some point. + */ +int isl_space_tuple_match(__isl_keep isl_space *space1, enum isl_dim_type type1, + __isl_keep isl_space *space2, enum isl_dim_type type2) +{ + return isl_space_tuple_is_equal(space1, type1, space2, type2); } static int match(__isl_keep isl_space *dim1, enum isl_dim_type dim1_type, @@ -738,7 +837,7 @@ if (dim1 == dim2 && dim1_type == dim2_type) return 1; - if (!isl_space_tuple_match(dim1, dim1_type, dim2, dim2_type)) + if (!isl_space_tuple_is_equal(dim1, dim1_type, dim2, dim2_type)) return 0; if (!dim1->ids && !dim2->ids) @@ -769,53 +868,60 @@ ids[i] = get_id(dim, type, first + i); } -__isl_give isl_space *isl_space_extend(__isl_take isl_space *dim, +__isl_give isl_space *isl_space_extend(__isl_take isl_space *space, unsigned nparam, unsigned n_in, unsigned n_out) { isl_id **ids = NULL; - if (!dim) + if (!space) return NULL; - if (dim->nparam == nparam && dim->n_in == n_in && dim->n_out == n_out) - return dim; + if (space->nparam == nparam && + space->n_in == n_in && space->n_out == n_out) + return space; - isl_assert(dim->ctx, dim->nparam <= nparam, goto error); - isl_assert(dim->ctx, dim->n_in <= n_in, goto error); - isl_assert(dim->ctx, dim->n_out <= n_out, goto error); + isl_assert(space->ctx, space->nparam <= nparam, goto error); + isl_assert(space->ctx, space->n_in <= n_in, goto error); + isl_assert(space->ctx, space->n_out <= n_out, goto error); - dim = isl_space_cow(dim); - if (!dim) + space = isl_space_cow(space); + if (!space) goto error; - if (dim->ids) { - ids = isl_calloc_array(dim->ctx, isl_id *, - nparam + n_in + n_out); + if (space->ids) { + unsigned n; + n = nparam + n_in + n_out; + if (n < nparam || n < n_in || n < n_out) + isl_die(isl_space_get_ctx(space), isl_error_invalid, + "overflow in total number of dimensions", + goto error); + ids = isl_calloc_array(space->ctx, isl_id *, n); if (!ids) goto error; - get_ids(dim, isl_dim_param, 0, dim->nparam, ids); - get_ids(dim, isl_dim_in, 0, dim->n_in, ids + nparam); - get_ids(dim, isl_dim_out, 0, dim->n_out, ids + nparam + n_in); - free(dim->ids); - dim->ids = ids; - dim->n_id = nparam + n_in + n_out; - } - dim->nparam = nparam; - dim->n_in = n_in; - dim->n_out = n_out; + get_ids(space, isl_dim_param, 0, space->nparam, ids); + get_ids(space, isl_dim_in, 0, space->n_in, ids + nparam); + get_ids(space, isl_dim_out, 0, space->n_out, + ids + nparam + n_in); + free(space->ids); + space->ids = ids; + space->n_id = nparam + n_in + n_out; + } + space->nparam = nparam; + space->n_in = n_in; + space->n_out = n_out; - return dim; + return space; error: free(ids); - isl_space_free(dim); + isl_space_free(space); return NULL; } __isl_give isl_space *isl_space_add_dims(__isl_take isl_space *dim, enum isl_dim_type type, unsigned n) { + dim = isl_space_reset(dim, type); if (!dim) return NULL; - dim = isl_space_reset(dim, type); switch (type) { case isl_dim_param: dim = isl_space_extend(dim, @@ -941,8 +1047,10 @@ if (!dim) return NULL; - if (n == 0) - return dim; + if (n == 0) { + dim = isl_space_reset(dim, src_type); + return isl_space_reset(dim, dst_type); + } isl_assert(dim->ctx, src_pos + n <= isl_space_dim(dim, src_type), goto error); @@ -1040,7 +1148,7 @@ isl_assert(left->ctx, match(left, isl_dim_param, right, isl_dim_param), goto error); isl_assert(left->ctx, - isl_space_tuple_match(left, isl_dim_out, right, isl_dim_in), + isl_space_tuple_is_equal(left, isl_dim_out, right, isl_dim_in), goto error); dim = isl_space_alloc(left->ctx, left->nparam, left->n_in, right->n_out); @@ -1074,14 +1182,27 @@ return NULL; } +/* Given two map spaces { A -> C } and { B -> D }, construct the space + * { [A -> B] -> [C -> D] }. + * Given two set spaces { A } and { B }, construct the space { [A -> B] }. + */ __isl_give isl_space *isl_space_product(__isl_take isl_space *left, __isl_take isl_space *right) { isl_space *dom1, *dom2, *nest1, *nest2; + int is_set; if (!left || !right) goto error; + is_set = isl_space_is_set(left); + if (is_set != isl_space_is_set(right)) + isl_die(isl_space_get_ctx(left), isl_error_invalid, + "expecting either two set spaces or two map spaces", + goto error); + if (is_set) + return isl_space_range_product(left, right); + isl_assert(left->ctx, match(left, isl_dim_param, right, isl_dim_param), goto error); @@ -1114,7 +1235,7 @@ if (!match(left, isl_dim_param, right, isl_dim_param)) isl_die(left->ctx, isl_error_invalid, "parameters need to match", goto error); - if (!isl_space_tuple_match(left, isl_dim_out, right, isl_dim_out)) + if (!isl_space_tuple_is_equal(left, isl_dim_out, right, isl_dim_out)) isl_die(left->ctx, isl_error_invalid, "ranges need to match", goto error); @@ -1141,7 +1262,7 @@ isl_assert(left->ctx, match(left, isl_dim_param, right, isl_dim_param), goto error); - if (!isl_space_tuple_match(left, isl_dim_in, right, isl_dim_in)) + if (!isl_space_tuple_is_equal(left, isl_dim_in, right, isl_dim_in)) isl_die(left->ctx, isl_error_invalid, "domains need to match", goto error); @@ -1158,6 +1279,178 @@ return NULL; } +/* Given a space of the form [A -> B] -> [C -> D], return the space A -> C. + */ +__isl_give isl_space *isl_space_factor_domain(__isl_take isl_space *space) +{ + space = isl_space_domain_factor_domain(space); + space = isl_space_range_factor_domain(space); + return space; +} + +/* Given a space of the form [A -> B] -> [C -> D], return the space B -> D. + */ +__isl_give isl_space *isl_space_factor_range(__isl_take isl_space *space) +{ + space = isl_space_domain_factor_range(space); + space = isl_space_range_factor_range(space); + return space; +} + +/* Given a space of the form [A -> B] -> C, return the space A -> C. + */ +__isl_give isl_space *isl_space_domain_factor_domain( + __isl_take isl_space *space) +{ + isl_space *nested; + isl_space *domain; + + if (!space) + return NULL; + if (!isl_space_domain_is_wrapping(space)) + isl_die(isl_space_get_ctx(space), isl_error_invalid, + "domain not a product", return isl_space_free(space)); + + nested = space->nested[0]; + domain = isl_space_copy(space); + domain = isl_space_drop_dims(domain, isl_dim_in, + nested->n_in, nested->n_out); + if (!domain) + return isl_space_free(space); + if (nested->tuple_id[0]) { + domain->tuple_id[0] = isl_id_copy(nested->tuple_id[0]); + if (!domain->tuple_id[0]) + goto error; + } + if (nested->nested[0]) { + domain->nested[0] = isl_space_copy(nested->nested[0]); + if (!domain->nested[0]) + goto error; + } + + isl_space_free(space); + return domain; +error: + isl_space_free(space); + isl_space_free(domain); + return NULL; +} + +/* Given a space of the form [A -> B] -> C, return the space B -> C. + */ +__isl_give isl_space *isl_space_domain_factor_range( + __isl_take isl_space *space) +{ + isl_space *nested; + isl_space *range; + + if (!space) + return NULL; + if (!isl_space_domain_is_wrapping(space)) + isl_die(isl_space_get_ctx(space), isl_error_invalid, + "domain not a product", return isl_space_free(space)); + + nested = space->nested[0]; + range = isl_space_copy(space); + range = isl_space_drop_dims(range, isl_dim_in, 0, nested->n_in); + if (!range) + return isl_space_free(space); + if (nested->tuple_id[1]) { + range->tuple_id[0] = isl_id_copy(nested->tuple_id[1]); + if (!range->tuple_id[0]) + goto error; + } + if (nested->nested[1]) { + range->nested[0] = isl_space_copy(nested->nested[1]); + if (!range->nested[0]) + goto error; + } + + isl_space_free(space); + return range; +error: + isl_space_free(space); + isl_space_free(range); + return NULL; +} + +/* Given a space of the form A -> [B -> C], return the space A -> B. + */ +__isl_give isl_space *isl_space_range_factor_domain( + __isl_take isl_space *space) +{ + isl_space *nested; + isl_space *domain; + + if (!space) + return NULL; + if (!isl_space_range_is_wrapping(space)) + isl_die(isl_space_get_ctx(space), isl_error_invalid, + "range not a product", return isl_space_free(space)); + + nested = space->nested[1]; + domain = isl_space_copy(space); + domain = isl_space_drop_dims(domain, isl_dim_out, + nested->n_in, nested->n_out); + if (!domain) + return isl_space_free(space); + if (nested->tuple_id[0]) { + domain->tuple_id[1] = isl_id_copy(nested->tuple_id[0]); + if (!domain->tuple_id[1]) + goto error; + } + if (nested->nested[0]) { + domain->nested[1] = isl_space_copy(nested->nested[0]); + if (!domain->nested[1]) + goto error; + } + + isl_space_free(space); + return domain; +error: + isl_space_free(space); + isl_space_free(domain); + return NULL; +} + +/* Given a space of the form A -> [B -> C], return the space A -> C. + */ +__isl_give isl_space *isl_space_range_factor_range( + __isl_take isl_space *space) +{ + isl_space *nested; + isl_space *range; + + if (!space) + return NULL; + if (!isl_space_range_is_wrapping(space)) + isl_die(isl_space_get_ctx(space), isl_error_invalid, + "range not a product", return isl_space_free(space)); + + nested = space->nested[1]; + range = isl_space_copy(space); + range = isl_space_drop_dims(range, isl_dim_out, 0, nested->n_in); + if (!range) + return isl_space_free(space); + if (nested->tuple_id[1]) { + range->tuple_id[1] = isl_id_copy(nested->tuple_id[1]); + if (!range->tuple_id[1]) + goto error; + } + if (nested->nested[1]) { + range->nested[1] = isl_space_copy(nested->nested[1]); + if (!range->nested[1]) + goto error; + } + + isl_space_free(space); + return range; +error: + isl_space_free(space); + isl_space_free(range); + return NULL; +} + __isl_give isl_space *isl_space_map_from_set(__isl_take isl_space *dim) { isl_ctx *ctx; @@ -1291,7 +1584,9 @@ isl_die(dim->ctx, isl_error_invalid, "cannot drop dimensions of specified type", goto error); - isl_assert(dim->ctx, first + num <= n(dim, type), goto error); + if (first + num > n(dim, type) || first + num < first) + isl_die(isl_space_get_ctx(dim), isl_error_invalid, + "index out of bounds", return isl_space_free(dim)); dim = isl_space_cow(dim); if (!dim) goto error; @@ -1401,6 +1696,32 @@ return NULL; } +/* Given a map space A -> B, return the map space [A -> B] -> A. + */ +__isl_give isl_space *isl_space_domain_map(__isl_take isl_space *space) +{ + isl_space *domain; + + domain = isl_space_from_range(isl_space_domain(isl_space_copy(space))); + space = isl_space_from_domain(isl_space_wrap(space)); + space = isl_space_join(space, domain); + + return space; +} + +/* Given a map space A -> B, return the map space [A -> B] -> B. + */ +__isl_give isl_space *isl_space_range_map(__isl_take isl_space *space) +{ + isl_space *range; + + range = isl_space_from_range(isl_space_range(isl_space_copy(space))); + space = isl_space_from_domain(isl_space_wrap(space)); + space = isl_space_join(space, range); + + return space; +} + __isl_give isl_space *isl_space_params(__isl_take isl_space *space) { if (isl_space_is_params(space)) @@ -1468,15 +1789,16 @@ /* Are the two spaces the same, including positions and names of parameters? */ -int isl_space_is_equal(__isl_keep isl_space *dim1, __isl_keep isl_space *dim2) +isl_bool isl_space_is_equal(__isl_keep isl_space *dim1, + __isl_keep isl_space *dim2) { if (!dim1 || !dim2) - return -1; + return isl_bool_error; if (dim1 == dim2) - return 1; + return isl_bool_true; return match(dim1, isl_dim_param, dim2, isl_dim_param) && - isl_space_tuple_match(dim1, isl_dim_in, dim2, isl_dim_in) && - isl_space_tuple_match(dim1, isl_dim_out, dim2, isl_dim_out); + isl_space_tuple_is_equal(dim1, isl_dim_in, dim2, isl_dim_in) && + isl_space_tuple_is_equal(dim1, isl_dim_out, dim2, isl_dim_out); } /* Is space1 equal to the domain of space2? @@ -1484,26 +1806,27 @@ * In the internal version we also allow space2 to be the space of a set, * provided space1 is a parameter space. */ -int isl_space_is_domain_internal(__isl_keep isl_space *space1, +isl_bool isl_space_is_domain_internal(__isl_keep isl_space *space1, __isl_keep isl_space *space2) { if (!space1 || !space2) - return -1; + return isl_bool_error; if (!isl_space_is_set(space1)) - return 0; + return isl_bool_false; return match(space1, isl_dim_param, space2, isl_dim_param) && - isl_space_tuple_match(space1, isl_dim_set, space2, isl_dim_in); + isl_space_tuple_is_equal(space1, isl_dim_set, + space2, isl_dim_in); } /* Is space1 equal to the domain of space2? */ -int isl_space_is_domain(__isl_keep isl_space *space1, +isl_bool isl_space_is_domain(__isl_keep isl_space *space1, __isl_keep isl_space *space2) { if (!space2) - return -1; + return isl_bool_error; if (!isl_space_is_map(space2)) - return 0; + return isl_bool_false; return isl_space_is_domain_internal(space1, space2); } @@ -1512,26 +1835,27 @@ * In the internal version, space2 is allowed to be the space of a set, * in which case it should be equal to space1. */ -int isl_space_is_range_internal(__isl_keep isl_space *space1, +isl_bool isl_space_is_range_internal(__isl_keep isl_space *space1, __isl_keep isl_space *space2) { if (!space1 || !space2) - return -1; + return isl_bool_error; if (!isl_space_is_set(space1)) - return 0; + return isl_bool_false; return match(space1, isl_dim_param, space2, isl_dim_param) && - isl_space_tuple_match(space1, isl_dim_set, space2, isl_dim_out); + isl_space_tuple_is_equal(space1, isl_dim_set, + space2, isl_dim_out); } /* Is space1 equal to the range of space2? */ -int isl_space_is_range(__isl_keep isl_space *space1, +isl_bool isl_space_is_range(__isl_keep isl_space *space1, __isl_keep isl_space *space2) { if (!space2) - return -1; + return isl_bool_error; if (!isl_space_is_map(space2)) - return 0; + return isl_bool_false; return isl_space_is_range_internal(space1, space2); } @@ -1583,17 +1907,43 @@ return hash; } -int isl_space_is_wrapping(__isl_keep isl_space *dim) +isl_bool isl_space_is_wrapping(__isl_keep isl_space *dim) { if (!dim) - return -1; + return isl_bool_error; if (!isl_space_is_set(dim)) - return 0; + return isl_bool_false; return dim->nested[1] != NULL; } +/* Is "space" the space of a map where the domain is a wrapped map space? + */ +isl_bool isl_space_domain_is_wrapping(__isl_keep isl_space *space) +{ + if (!space) + return isl_bool_error; + + if (isl_space_is_set(space)) + return isl_bool_false; + + return space->nested[0] != NULL; +} + +/* Is "space" the space of a map where the range is a wrapped map space? + */ +isl_bool isl_space_range_is_wrapping(__isl_keep isl_space *space) +{ + if (!space) + return isl_bool_error; + + if (isl_space_is_set(space)) + return isl_bool_false; + + return space->nested[1] != NULL; +} + __isl_give isl_space *isl_space_wrap(__isl_take isl_space *dim) { isl_space *wrap; @@ -1774,10 +2124,10 @@ return dim; } -int isl_space_can_zip(__isl_keep isl_space *dim) +isl_bool isl_space_can_zip(__isl_keep isl_space *dim) { if (!dim) - return -1; + return isl_bool_error; return dim->nested[0] && dim->nested[1]; } @@ -1813,10 +2163,10 @@ /* Can we apply isl_space_curry to "space"? * That is, does it have a nested relation in its domain? */ -int isl_space_can_curry(__isl_keep isl_space *space) +isl_bool isl_space_can_curry(__isl_keep isl_space *space) { if (!space) - return -1; + return isl_bool_error; return !!space->nested[0]; } @@ -1852,10 +2202,10 @@ /* Can we apply isl_space_uncurry to "space"? * That is, does it have a nested relation in its range? */ -int isl_space_can_uncurry(__isl_keep isl_space *space) +isl_bool isl_space_can_uncurry(__isl_keep isl_space *space) { if (!space) - return -1; + return isl_bool_error; return !!space->nested[1]; } @@ -1968,3 +2318,71 @@ isl_space_free(space); return NULL; } + +/* Compare the "type" dimensions of two isl_spaces. + * + * The order is fairly arbitrary. + */ +static int isl_space_cmp_type(__isl_keep isl_space *space1, + __isl_keep isl_space *space2, enum isl_dim_type type) +{ + int cmp; + isl_space *nested1, *nested2; + + if (isl_space_dim(space1, type) != isl_space_dim(space2, type)) + return isl_space_dim(space1, type) - + isl_space_dim(space2, type); + + cmp = isl_id_cmp(tuple_id(space1, type), tuple_id(space2, type)); + if (cmp != 0) + return cmp; + + nested1 = nested(space1, type); + nested2 = nested(space2, type); + if (!nested1 != !nested2) + return !nested1 - !nested2; + + if (nested1) + return isl_space_cmp(nested1, nested2); + + return 0; +} + +/* Compare two isl_spaces. + * + * The order is fairly arbitrary. + */ +int isl_space_cmp(__isl_keep isl_space *space1, __isl_keep isl_space *space2) +{ + int i; + int cmp; + + if (space1 == space2) + return 0; + if (!space1) + return -1; + if (!space2) + return 1; + + cmp = isl_space_cmp_type(space1, space2, isl_dim_param); + if (cmp != 0) + return cmp; + cmp = isl_space_cmp_type(space1, space2, isl_dim_in); + if (cmp != 0) + return cmp; + cmp = isl_space_cmp_type(space1, space2, isl_dim_out); + if (cmp != 0) + return cmp; + + if (!space1->ids && !space2->ids) + return 0; + + for (i = 0; i < n(space1, isl_dim_param); ++i) { + cmp = isl_id_cmp(get_id(space1, isl_dim_param, i), + get_id(space2, isl_dim_param, i)); + if (cmp != 0) + return cmp; + } + + return 0; +} diff -Nru cloog-0.18.2/isl/isl_space_private.h cloog-0.18.4/isl/isl_space_private.h --- cloog-0.18.2/isl/isl_space_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_space_private.h 2015-07-24 12:23:09.000000000 +0000 @@ -29,9 +29,9 @@ uint32_t isl_space_get_hash(__isl_keep isl_space *dim); -int isl_space_is_domain_internal(__isl_keep isl_space *space1, +isl_bool isl_space_is_domain_internal(__isl_keep isl_space *space1, __isl_keep isl_space *space2); -int isl_space_is_range_internal(__isl_keep isl_space *space1, +isl_bool isl_space_is_range_internal(__isl_keep isl_space *space1, __isl_keep isl_space *space2); __isl_give isl_space *isl_space_as_set_space(__isl_take isl_space *dim); @@ -55,4 +55,6 @@ __isl_give isl_space *isl_space_extend_domain_with_range( __isl_take isl_space *domain, __isl_take isl_space *model); +int isl_space_cmp(__isl_keep isl_space *space1, __isl_keep isl_space *space2); + #endif diff -Nru cloog-0.18.2/isl/isl_stream.c cloog-0.18.4/isl/isl_stream.c --- cloog-0.18.2/isl/isl_stream.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_stream.c 2015-07-24 12:23:09.000000000 +0000 @@ -28,7 +28,7 @@ return !strcmp(keyword->name, val); } -enum isl_token_type isl_stream_register_keyword(struct isl_stream *s, +enum isl_token_type isl_stream_register_keyword(__isl_keep isl_stream *s, const char *name) { struct isl_hash_table_entry *entry; @@ -101,14 +101,15 @@ return isl_val_int_from_isl_int(ctx, tok->u.v); } -/* Given a token of type ISL_TOKEN_STRING, return the string it represents. +/* Given a token with a string representation, return a copy of this string. */ __isl_give char *isl_token_get_str(isl_ctx *ctx, struct isl_token *tok) { if (!tok) return NULL; - if (tok->type != ISL_TOKEN_STRING) - isl_die(ctx, isl_error_invalid, "not a string token", + if (!tok->u.s) + isl_die(ctx, isl_error_invalid, + "token does not have a string representation", return NULL); return strdup(tok->u.s); @@ -129,7 +130,8 @@ free(tok); } -void isl_stream_error(struct isl_stream *s, struct isl_token *tok, char *msg) +void isl_stream_error(__isl_keep isl_stream *s, struct isl_token *tok, + char *msg) { int line = tok ? tok->line : s->line; int col = tok ? tok->col : s->col; @@ -166,10 +168,10 @@ } } -static struct isl_stream* isl_stream_new(struct isl_ctx *ctx) +static __isl_give isl_stream* isl_stream_new(struct isl_ctx *ctx) { int i; - struct isl_stream *s = isl_alloc_type(ctx, struct isl_stream); + isl_stream *s = isl_calloc_type(ctx, struct isl_stream); if (!s) return NULL; s->ctx = ctx; @@ -178,8 +180,9 @@ s->str = NULL; s->len = 0; s->line = 1; - s->col = 0; + s->col = 1; s->eof = 0; + s->last_line = 0; s->c = -1; s->n_un = 0; for (i = 0; i < 5; ++i) @@ -196,18 +199,18 @@ return NULL; } -struct isl_stream* isl_stream_new_file(struct isl_ctx *ctx, FILE *file) +__isl_give isl_stream* isl_stream_new_file(struct isl_ctx *ctx, FILE *file) { - struct isl_stream *s = isl_stream_new(ctx); + isl_stream *s = isl_stream_new(ctx); if (!s) return NULL; s->file = file; return s; } -struct isl_stream* isl_stream_new_str(struct isl_ctx *ctx, const char *str) +__isl_give isl_stream* isl_stream_new_str(struct isl_ctx *ctx, const char *str) { - struct isl_stream *s; + isl_stream *s; if (!str) return NULL; s = isl_stream_new(ctx); @@ -217,7 +220,10 @@ return s; } -static int stream_getc(struct isl_stream *s) +/* Read a character from the stream and advance s->line and s->col + * to point to the next character. + */ +static int stream_getc(__isl_keep isl_stream *s) { int c; if (s->eof) @@ -233,29 +239,33 @@ } if (c == -1) s->eof = 1; - if (!s->eof) { - if (s->c == '\n') { - s->line++; - s->col = 0; - } else - s->col++; - } + else if (c == '\n') { + s->line++; + s->col = 1; + } else + s->col++; s->c = c; return c; } -static void isl_stream_ungetc(struct isl_stream *s, int c) +static void isl_stream_ungetc(__isl_keep isl_stream *s, int c) { isl_assert(s->ctx, s->n_un < 5, return); s->un[s->n_un++] = c; s->c = -1; } -static int isl_stream_getc(struct isl_stream *s) +/* Read a character from the stream, skipping pairs of '\\' and '\n'. + * Set s->start_line and s->start_col to the line and column + * of the returned character. + */ +static int isl_stream_getc(__isl_keep isl_stream *s) { int c; do { + s->start_line = s->line; + s->start_col = s->col; c = stream_getc(s); if (c != '\\') return c; @@ -267,7 +277,7 @@ return '\\'; } -static int isl_stream_push_char(struct isl_stream *s, int c) +static int isl_stream_push_char(__isl_keep isl_stream *s, int c) { if (s->len >= s->size) { char *buffer; @@ -281,13 +291,13 @@ return 0; } -void isl_stream_push_token(struct isl_stream *s, struct isl_token *tok) +void isl_stream_push_token(__isl_keep isl_stream *s, struct isl_token *tok) { isl_assert(s->ctx, s->n_token < 5, return); s->tokens[s->n_token++] = tok; } -static enum isl_token_type check_keywords(struct isl_stream *s) +static enum isl_token_type check_keywords(__isl_keep isl_stream *s) { struct isl_hash_table_entry *entry; struct isl_keyword *keyword; @@ -344,7 +354,7 @@ return ISL_TOKEN_IDENT; } -int isl_stream_skip_line(struct isl_stream *s) +int isl_stream_skip_line(__isl_keep isl_stream *s) { int c; @@ -355,12 +365,12 @@ return c == -1 ? -1 : 0; } -static struct isl_token *next_token(struct isl_stream *s, int same_line) +static struct isl_token *next_token(__isl_keep isl_stream *s, int same_line) { int c; struct isl_token *tok = NULL; int line, col; - int old_line = s->line; + int old_line = s->last_line; if (s->n_token) { if (same_line && s->tokens[s->n_token - 1]->on_new_line) @@ -385,11 +395,13 @@ break; } - line = s->line; - col = s->col; + line = s->start_line; + col = s->start_col; if (c == -1 || (same_line && c == '\n')) return NULL; + s->last_line = line; + if (c == '(' || c == ')' || c == '+' || @@ -655,17 +667,17 @@ return NULL; } -struct isl_token *isl_stream_next_token(struct isl_stream *s) +struct isl_token *isl_stream_next_token(__isl_keep isl_stream *s) { return next_token(s, 0); } -struct isl_token *isl_stream_next_token_on_same_line(struct isl_stream *s) +struct isl_token *isl_stream_next_token_on_same_line(__isl_keep isl_stream *s) { return next_token(s, 1); } -int isl_stream_eat_if_available(struct isl_stream *s, int type) +int isl_stream_eat_if_available(__isl_keep isl_stream *s, int type) { struct isl_token *tok; @@ -680,7 +692,7 @@ return 0; } -int isl_stream_next_token_is(struct isl_stream *s, int type) +int isl_stream_next_token_is(__isl_keep isl_stream *s, int type) { struct isl_token *tok; int r; @@ -693,7 +705,7 @@ return r; } -char *isl_stream_read_ident_if_available(struct isl_stream *s) +char *isl_stream_read_ident_if_available(__isl_keep isl_stream *s) { struct isl_token *tok; @@ -709,7 +721,7 @@ return NULL; } -int isl_stream_eat(struct isl_stream *s, int type) +int isl_stream_eat(__isl_keep isl_stream *s, int type) { struct isl_token *tok; @@ -725,7 +737,7 @@ return -1; } -int isl_stream_is_empty(struct isl_stream *s) +int isl_stream_is_empty(__isl_keep isl_stream *s) { struct isl_token *tok; @@ -738,17 +750,17 @@ return 0; } -static int free_keyword(void **p, void *user) +static isl_stat free_keyword(void **p, void *user) { struct isl_keyword *keyword = *p; free(keyword->name); free(keyword); - return 0; + return isl_stat_ok; } -void isl_stream_flush_tokens(struct isl_stream *s) +void isl_stream_flush_tokens(__isl_keep isl_stream *s) { int i; @@ -759,7 +771,12 @@ s->n_token = 0; } -void isl_stream_free(struct isl_stream *s) +isl_ctx *isl_stream_get_ctx(__isl_keep isl_stream *s) +{ + return s ? s->ctx : NULL; +} + +void isl_stream_free(__isl_take isl_stream *s) { if (!s) return; @@ -773,6 +790,382 @@ isl_hash_table_foreach(s->ctx, s->keywords, &free_keyword, NULL); isl_hash_table_free(s->ctx, s->keywords); } + free(s->yaml_state); + free(s->yaml_indent); isl_ctx_deref(s->ctx); free(s); } + +/* Push "state" onto the stack of currently active YAML elements. + * The caller is responsible for setting the corresponding indentation. + * Return 0 on success and -1 on failure. + */ +static int push_state(__isl_keep isl_stream *s, enum isl_yaml_state state) +{ + if (s->yaml_size < s->yaml_depth + 1) { + int *indent; + enum isl_yaml_state *state; + + state = isl_realloc_array(s->ctx, s->yaml_state, + enum isl_yaml_state, s->yaml_depth + 1); + if (!state) + return -1; + s->yaml_state = state; + + indent = isl_realloc_array(s->ctx, s->yaml_indent, + int, s->yaml_depth + 1); + if (!indent) + return -1; + s->yaml_indent = indent; + + s->yaml_size = s->yaml_depth + 1; + } + + s->yaml_state[s->yaml_depth] = state; + s->yaml_depth++; + + return 0; +} + +/* Remove the innermost active YAML element from the stack. + * Return 0 on success and -1 on failure. + */ +static int pop_state(__isl_keep isl_stream *s) +{ + if (!s) + return -1; + if (s->yaml_depth < 1) + isl_die(isl_stream_get_ctx(s), isl_error_invalid, + "not in YAML construct", return -1); + + s->yaml_depth--; + + return 0; +} + +/* Set the state of the innermost active YAML element to "state". + * Return 0 on success and -1 on failure. + */ +static int update_state(__isl_keep isl_stream *s, enum isl_yaml_state state) +{ + if (!s) + return -1; + if (s->yaml_depth < 1) + isl_die(isl_stream_get_ctx(s), isl_error_invalid, + "not in YAML construct", return -1); + + s->yaml_state[s->yaml_depth - 1] = state; + + return 0; +} + +/* Return the state of the innermost active YAML element. + * Return isl_yaml_none if we are not inside any YAML element. + */ +static enum isl_yaml_state current_state(__isl_keep isl_stream *s) +{ + if (!s) + return isl_yaml_none; + if (s->yaml_depth < 1) + return isl_yaml_none; + return s->yaml_state[s->yaml_depth - 1]; +} + +/* Set the indentation of the innermost active YAML element to "indent". + * If "indent" is equal to ISL_YAML_INDENT_FLOW, then this means + * that the current elemient is in flow format. + */ +static int set_yaml_indent(__isl_keep isl_stream *s, int indent) +{ + if (s->yaml_depth < 1) + isl_die(s->ctx, isl_error_internal, + "not in YAML element", return -1); + + s->yaml_indent[s->yaml_depth - 1] = indent; + + return 0; +} + +/* Return the indentation of the innermost active YAML element + * of -1 on error. + */ +static int get_yaml_indent(__isl_keep isl_stream *s) +{ + if (s->yaml_depth < 1) + isl_die(s->ctx, isl_error_internal, + "not in YAML element", return -1); + + return s->yaml_indent[s->yaml_depth - 1]; +} + +/* Move to the next state at the innermost level. + * Return 1 if successful. + * Return 0 if we are at the end of the innermost level. + * Return -1 on error. + * + * If we are in state isl_yaml_mapping_key_start, then we have just + * started a mapping and we are expecting a key. If the mapping started + * with a '{', then we check if the next token is a '}'. If so, + * then the mapping is empty and there is no next state at this level. + * Otherwise, we assume that there is at least one key (the one from + * which we derived the indentation in isl_stream_yaml_read_start_mapping. + * + * If we are in state isl_yaml_mapping_key, then the we expect a colon + * followed by a value, so there is always a next state unless + * some error occurs. + * + * If we are in state isl_yaml_mapping_val, then there may or may + * not be a subsequent key in the same mapping. + * In flow format, the next key is preceded by a comma. + * In block format, the next key has the same indentation as the first key. + * If the first token has a smaller indentation, then we have reached + * the end of the current mapping. + * + * If we are in state isl_yaml_sequence_start, then we have just + * started a sequence. If the sequence started with a '[', + * then we check if the next token is a ']'. If so, then the sequence + * is empty and there is no next state at this level. + * Otherwise, we assume that there is at least one element in the sequence + * (the one from which we derived the indentation in + * isl_stream_yaml_read_start_sequence. + * + * If we are in state isl_yaml_sequence, then there may or may + * not be a subsequent element in the same sequence. + * In flow format, the next element is preceded by a comma. + * In block format, the next element is introduced by a dash with + * the same indentation as that of the first element. + * If the first token is not a dash or if it has a smaller indentation, + * then we have reached the end of the current sequence. + */ +int isl_stream_yaml_next(__isl_keep isl_stream *s) +{ + struct isl_token *tok; + enum isl_yaml_state state; + int indent; + + state = current_state(s); + if (state == isl_yaml_none) + isl_die(s->ctx, isl_error_invalid, + "not in YAML element", return -1); + switch (state) { + case isl_yaml_mapping_key_start: + if (get_yaml_indent(s) == ISL_YAML_INDENT_FLOW && + isl_stream_next_token_is(s, '}')) + return 0; + if (update_state(s, isl_yaml_mapping_key) < 0) + return -1; + return 1; + case isl_yaml_mapping_key: + tok = isl_stream_next_token(s); + if (!tok) { + if (s->eof) + isl_stream_error(s, NULL, "unexpected EOF"); + return -1; + } + if (tok->type == ':') { + isl_token_free(tok); + if (update_state(s, isl_yaml_mapping_val) < 0) + return -1; + return 1; + } + isl_stream_error(s, tok, "expecting ':'"); + isl_stream_push_token(s, tok); + return -1; + case isl_yaml_mapping_val: + if (get_yaml_indent(s) == ISL_YAML_INDENT_FLOW) { + if (!isl_stream_eat_if_available(s, ',')) + return 0; + if (update_state(s, isl_yaml_mapping_key) < 0) + return -1; + return 1; + } + tok = isl_stream_next_token(s); + if (!tok) + return 0; + indent = tok->col - 1; + isl_stream_push_token(s, tok); + if (indent < get_yaml_indent(s)) + return 0; + if (update_state(s, isl_yaml_mapping_key) < 0) + return -1; + return 1; + case isl_yaml_sequence_start: + if (get_yaml_indent(s) == ISL_YAML_INDENT_FLOW) { + if (isl_stream_next_token_is(s, ']')) + return 0; + if (update_state(s, isl_yaml_sequence) < 0) + return -1; + return 1; + } + tok = isl_stream_next_token(s); + if (!tok) { + if (s->eof) + isl_stream_error(s, NULL, "unexpected EOF"); + return -1; + } + if (tok->type == '-') { + isl_token_free(tok); + if (update_state(s, isl_yaml_sequence) < 0) + return -1; + return 1; + } + isl_stream_error(s, tok, "expecting '-'"); + isl_stream_push_token(s, tok); + return 0; + case isl_yaml_sequence: + if (get_yaml_indent(s) == ISL_YAML_INDENT_FLOW) + return isl_stream_eat_if_available(s, ','); + tok = isl_stream_next_token(s); + if (!tok) + return 0; + indent = tok->col - 1; + if (indent < get_yaml_indent(s) || tok->type != '-') { + isl_stream_push_token(s, tok); + return 0; + } + isl_token_free(tok); + return 1; + default: + isl_die(s->ctx, isl_error_internal, + "unexpected state", return 0); + } +} + +/* Start reading a YAML mapping. + * Return 0 on success and -1 on error. + * + * If the first token on the stream is a '{' then we remove this token + * from the stream and keep track of the fact that the mapping + * is given in flow format. + * Otherwise, we assume the first token is the first key of the mapping and + * keep track of its indentation, but keep the token on the stream. + * In both cases, the next token we expect is the first key of the mapping. + */ +int isl_stream_yaml_read_start_mapping(__isl_keep isl_stream *s) +{ + struct isl_token *tok; + int indent; + + if (push_state(s, isl_yaml_mapping_key_start) < 0) + return -1; + + tok = isl_stream_next_token(s); + if (!tok) { + if (s->eof) + isl_stream_error(s, NULL, "unexpected EOF"); + return -1; + } + if (isl_token_get_type(tok) == '{') { + isl_token_free(tok); + return set_yaml_indent(s, ISL_YAML_INDENT_FLOW); + } + indent = tok->col - 1; + isl_stream_push_token(s, tok); + + return set_yaml_indent(s, indent); +} + +/* Finish reading a YAML mapping. + * Return 0 on success and -1 on error. + * + * If the mapping started with a '{', then we expect a '}' to close + * the mapping. + * Otherwise, we double-check that the next token (if any) + * has a smaller indentation than that of the current mapping. + */ +int isl_stream_yaml_read_end_mapping(__isl_keep isl_stream *s) +{ + struct isl_token *tok; + int indent; + + if (get_yaml_indent(s) == ISL_YAML_INDENT_FLOW) { + if (isl_stream_eat(s, '}') < 0) + return -1; + return pop_state(s); + } + + tok = isl_stream_next_token(s); + if (!tok) + return pop_state(s); + + indent = tok->col - 1; + isl_stream_push_token(s, tok); + + if (indent >= get_yaml_indent(s)) + isl_die(isl_stream_get_ctx(s), isl_error_invalid, + "mapping not finished", return -1); + + return pop_state(s); +} + +/* Start reading a YAML sequence. + * Return 0 on success and -1 on error. + * + * If the first token on the stream is a '[' then we remove this token + * from the stream and keep track of the fact that the sequence + * is given in flow format. + * Otherwise, we assume the first token is the dash that introduces + * the first element of the sequence and keep track of its indentation, + * but keep the token on the stream. + * In both cases, the next token we expect is the first element + * of the sequence. + */ +int isl_stream_yaml_read_start_sequence(__isl_keep isl_stream *s) +{ + struct isl_token *tok; + int indent; + + if (push_state(s, isl_yaml_sequence_start) < 0) + return -1; + + tok = isl_stream_next_token(s); + if (!tok) { + if (s->eof) + isl_stream_error(s, NULL, "unexpected EOF"); + return -1; + } + if (isl_token_get_type(tok) == '[') { + isl_token_free(tok); + return set_yaml_indent(s, ISL_YAML_INDENT_FLOW); + } + indent = tok->col - 1; + isl_stream_push_token(s, tok); + + return set_yaml_indent(s, indent); +} + +/* Finish reading a YAML sequence. + * Return 0 on success and -1 on error. + * + * If the sequence started with a '[', then we expect a ']' to close + * the sequence. + * Otherwise, we double-check that the next token (if any) + * is not a dash or that it has a smaller indentation than + * that of the current sequence. + */ +int isl_stream_yaml_read_end_sequence(__isl_keep isl_stream *s) +{ + struct isl_token *tok; + int indent; + int dash; + + if (get_yaml_indent(s) == ISL_YAML_INDENT_FLOW) { + if (isl_stream_eat(s, ']') < 0) + return -1; + return pop_state(s); + } + + tok = isl_stream_next_token(s); + if (!tok) + return pop_state(s); + + indent = tok->col - 1; + dash = tok->type == '-'; + isl_stream_push_token(s, tok); + + if (indent >= get_yaml_indent(s) && dash) + isl_die(isl_stream_get_ctx(s), isl_error_invalid, + "sequence not finished", return -1); + + return pop_state(s); +} diff -Nru cloog-0.18.2/isl/isl_stream_private.h cloog-0.18.4/isl/isl_stream_private.h --- cloog-0.18.2/isl/isl_stream_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_stream_private.h 2015-07-24 12:23:09.000000000 +0000 @@ -1,4 +1,69 @@ +#include #include +#include + +struct isl_token { + int type; + + unsigned int on_new_line : 1; + unsigned is_keyword : 1; + int line; + int col; + + union { + isl_int v; + char *s; + isl_map *map; + isl_pw_aff *pwaff; + } u; +}; struct isl_token *isl_token_new(isl_ctx *ctx, int line, int col, unsigned on_new_line); + +/* An input stream that may be either a file or a string. + * + * line and col are the line and column number of the next character (1-based). + * start_line and start_col are set by isl_stream_getc to point + * to the position of the returned character. + * last_line is the line number of the previous token. + * + * yaml_state and yaml_indent keep track of the currently active YAML + * elements. yaml_size is the size of these arrays, while yaml_depth + * is the number of elements currently in use. + * yaml_state and yaml_indent may be NULL if no YAML parsing is being + * performed. + * yaml_state keeps track of what is expected next at each level. + * yaml_indent keeps track of the indentation at each level, with + * ISL_YAML_INDENT_FLOW meaning that the element is in flow format + * (such that the indentation is not relevant). + */ +struct isl_stream { + struct isl_ctx *ctx; + FILE *file; + const char *str; + int line; + int col; + int start_line; + int start_col; + int last_line; + int eof; + + char *buffer; + size_t size; + size_t len; + int c; + int un[5]; + int n_un; + + struct isl_token *tokens[5]; + int n_token; + + struct isl_hash_table *keywords; + enum isl_token_type next_type; + + int yaml_depth; + int yaml_size; + enum isl_yaml_state *yaml_state; + int *yaml_indent; +}; diff -Nru cloog-0.18.2/isl/isl_tab.c cloog-0.18.4/isl/isl_tab.c --- cloog-0.18.2/isl/isl_tab.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_tab.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,19 +1,23 @@ /* * Copyright 2008-2009 Katholieke Universiteit Leuven * Copyright 2013 Ecole Normale Superieure + * Copyright 2014 INRIA Rocquencourt * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, K.U.Leuven, Departement * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France + * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, + * B.P. 105 - 78153 Le Chesnay, France */ #include #include +#include #include "isl_map_private.h" #include "isl_tab.h" -#include +#include #include /* @@ -151,7 +155,7 @@ if (!var) return -1; tab->var = var; - tab->max_var += n_new; + tab->max_var = tab->n_var + n_new; } if (tab->mat->n_col < off + tab->n_col + n_new) { @@ -171,15 +175,6 @@ return 0; } -struct isl_tab *isl_tab_extend(struct isl_tab *tab, unsigned n_new) -{ - if (isl_tab_extend_cons(tab, n_new) >= 0) - return tab; - - isl_tab_free(tab); - return NULL; -} - static void free_undo_record(struct isl_tab_undo *undo) { switch (undo->type) { @@ -869,8 +864,7 @@ return NULL; } -struct isl_tab *isl_tab_add_sample(struct isl_tab *tab, - __isl_take isl_vec *sample) +int isl_tab_add_sample(struct isl_tab *tab, __isl_take isl_vec *sample) { if (!tab || !sample) goto error; @@ -893,11 +887,10 @@ tab->sample_index[tab->n_sample] = tab->n_sample; tab->n_sample++; - return tab; + return 0; error: isl_vec_free(sample); - isl_tab_free(tab); - return NULL; + return -1; } struct isl_tab *isl_tab_drop_sample(struct isl_tab *tab, int s) @@ -967,6 +960,22 @@ } } +/* Mark "tab" as a rational tableau. + * If it wasn't marked as a rational tableau already and if we may + * need to undo changes, then arrange for the marking to be undone + * during the undo. + */ +int isl_tab_mark_rational(struct isl_tab *tab) +{ + if (!tab) + return -1; + if (!tab->rational && tab->need_undo) + if (isl_tab_push(tab, isl_tab_undo_rational) < 0) + return -1; + tab->rational = 1; + return 0; +} + int isl_tab_mark_empty(struct isl_tab *tab) { if (!tab) @@ -1101,14 +1110,14 @@ int i, j; int sgn; int t; + isl_ctx *ctx; struct isl_mat *mat = tab->mat; struct isl_tab_var *var; unsigned off = 2 + tab->M; - if (tab->mat->ctx->abort) { - isl_ctx_set_error(tab->mat->ctx, isl_error_abort); + ctx = isl_tab_get_ctx(tab); + if (isl_ctx_next_operation(ctx) < 0) return -1; - } isl_int_swap(mat->row[row][0], mat->row[row][off + col]); sgn = isl_int_sgn(mat->row[row][0]); @@ -1419,7 +1428,8 @@ /* Return 1 if "var" can attain values <= -1. * Return 0 otherwise. * - * The sample value of "var" is assumed to be non-negative when the + * If the variable "var" is supposed to be non-negative (is_nonneg is set), + * then the sample value of "var" is assumed to be non-negative when the * the function is called. If 1 is returned then the constraint * is not redundant and the sample value is made non-negative again before * the function returns. @@ -1457,7 +1467,7 @@ do { find_pivot(tab, var, var, -1, &row, &col); if (row == var->index) { - if (restore_row(tab, var) < -1) + if (var->is_nonneg && restore_row(tab, var) < -1) return -1; return 1; } @@ -1653,19 +1663,75 @@ return r; } -/* Add a variable to the tableau and allocate a column for it. - * Return the index into the variable array "var". +/* Move the entries in tab->var up one position, starting at "first", + * creating room for an extra entry at position "first". + * Since some of the entries of tab->row_var and tab->col_var contain + * indices into this array, they have to be updated accordingly. + */ +static int var_insert_entry(struct isl_tab *tab, int first) +{ + int i; + + if (tab->n_var >= tab->max_var) + isl_die(isl_tab_get_ctx(tab), isl_error_internal, + "not enough room for new variable", return -1); + if (first > tab->n_var) + isl_die(isl_tab_get_ctx(tab), isl_error_internal, + "invalid initial position", return -1); + + for (i = tab->n_var - 1; i >= first; --i) { + tab->var[i + 1] = tab->var[i]; + if (tab->var[i + 1].is_row) + tab->row_var[tab->var[i + 1].index]++; + else + tab->col_var[tab->var[i + 1].index]++; + } + + tab->n_var++; + + return 0; +} + +/* Drop the entry at position "first" in tab->var, moving all + * subsequent entries down. + * Since some of the entries of tab->row_var and tab->col_var contain + * indices into this array, they have to be updated accordingly. */ -int isl_tab_allocate_var(struct isl_tab *tab) +static int var_drop_entry(struct isl_tab *tab, int first) +{ + int i; + + if (first >= tab->n_var) + isl_die(isl_tab_get_ctx(tab), isl_error_internal, + "invalid initial position", return -1); + + tab->n_var--; + + for (i = first; i < tab->n_var; ++i) { + tab->var[i] = tab->var[i + 1]; + if (tab->var[i + 1].is_row) + tab->row_var[tab->var[i].index]--; + else + tab->col_var[tab->var[i].index]--; + } + + return 0; +} + +/* Add a variable to the tableau at position "r" and allocate a column for it. + * Return the index into the variable array "var", i.e., "r", + * or -1 on error. + */ +int isl_tab_insert_var(struct isl_tab *tab, int r) { - int r; int i; unsigned off = 2 + tab->M; isl_assert(tab->mat->ctx, tab->n_col < tab->mat->n_col, return -1); - isl_assert(tab->mat->ctx, tab->n_var < tab->max_var, return -1); - r = tab->n_var; + if (var_insert_entry(tab, r) < 0) + return -1; + tab->var[r].index = tab->n_col; tab->var[r].is_row = 0; tab->var[r].is_nonneg = 0; @@ -1678,7 +1744,6 @@ for (i = 0; i < tab->n_row; ++i) isl_int_set_si(tab->mat->row[i][off + tab->n_col], 0); - tab->n_var++; tab->n_col++; if (isl_tab_push_var(tab, isl_tab_undo_allocate, &tab->var[r]) < 0) return -1; @@ -1686,6 +1751,17 @@ return r; } +/* Add a variable to the tableau and allocate a column for it. + * Return the index into the variable array "var". + */ +int isl_tab_allocate_var(struct isl_tab *tab) +{ + if (!tab) + return -1; + + return isl_tab_insert_var(tab, tab->n_var); +} + /* Add a row to the tableau. The row is given as an affine combination * of the original variables and needs to be expressed in terms of the * column variables. @@ -1763,13 +1839,22 @@ return 0; } +/* Drop the variable in column "col" along with the column. + * The column is removed first because it may need to be moved + * into the last position and this process requires + * the contents of the col_var array in a state + * before the removal of the variable. + */ static int drop_col(struct isl_tab *tab, int col) { - isl_assert(tab->mat->ctx, tab->col_var[col] == tab->n_var - 1, return -1); + int var; + + var = tab->col_var[col]; if (col != tab->n_col - 1) swap_cols(tab, col, tab->n_col - 1); tab->n_col--; - tab->n_var--; + if (var_drop_entry(tab, var) < 0) + return -1; return 0; } @@ -1992,12 +2077,9 @@ var = &tab->con[r]; row = var->index; if (row_is_manifestly_zero(tab, row)) { - if (snap) { - if (isl_tab_rollback(tab, snap) < 0) - return -1; - } else - drop_row(tab, row); - return 0; + if (snap) + return isl_tab_rollback(tab, snap); + return drop_row(tab, row); } if (tab->bmap) { @@ -2555,37 +2637,37 @@ * even after the relaxation, so we need to restore it. * We therefore prefer to pivot a column up to a row, if possible. */ -struct isl_tab *isl_tab_relax(struct isl_tab *tab, int con) +int isl_tab_relax(struct isl_tab *tab, int con) { struct isl_tab_var *var; - unsigned off = 2 + tab->M; if (!tab) - return NULL; + return -1; var = &tab->con[con]; if (var->is_row && (var->index < 0 || var->index < tab->n_redundant)) isl_die(tab->mat->ctx, isl_error_invalid, - "cannot relax redundant constraint", goto error); + "cannot relax redundant constraint", return -1); if (!var->is_row && (var->index < 0 || var->index < tab->n_dead)) isl_die(tab->mat->ctx, isl_error_invalid, - "cannot relax dead constraint", goto error); + "cannot relax dead constraint", return -1); if (!var->is_row && !max_is_manifestly_unbounded(tab, var)) if (to_row(tab, var, 1) < 0) - goto error; + return -1; if (!var->is_row && !min_is_manifestly_unbounded(tab, var)) if (to_row(tab, var, -1) < 0) - goto error; + return -1; if (var->is_row) { isl_int_add(tab->mat->row[var->index][1], tab->mat->row[var->index][1], tab->mat->row[var->index][0]); if (restore_row(tab, var) < 0) - goto error; + return -1; } else { int i; + unsigned off = 2 + tab->M; for (i = 0; i < tab->n_row; ++i) { if (isl_int_is_zero(tab->mat->row[i][off + var->index])) @@ -2597,12 +2679,67 @@ } if (isl_tab_push_var(tab, isl_tab_undo_relax, var) < 0) - goto error; + return -1; - return tab; -error: - isl_tab_free(tab); - return NULL; + return 0; +} + +/* Replace the variable v at position "pos" in the tableau "tab" + * by v' = v + shift. + * + * If the variable is in a column, then we first check if we can + * simply plug in v = v' - shift. The effect on a row with + * coefficient f/d for variable v is that the constant term c/d + * is replaced by (c - f * shift)/d. If shift is positive and + * f is negative for each row that needs to remain non-negative, + * then this is clearly safe. In other words, if the minimum of v + * is manifestly unbounded, then we can keep v in a column position. + * Otherwise, we can pivot it down to a row. + * Similarly, if shift is negative, we need to check if the maximum + * of is manifestly unbounded. + * + * If the variable is in a row (from the start or after pivoting), + * then the constant term c/d is replaced by (c + d * shift)/d. + */ +int isl_tab_shift_var(struct isl_tab *tab, int pos, isl_int shift) +{ + struct isl_tab_var *var; + + if (!tab) + return -1; + if (isl_int_is_zero(shift)) + return 0; + + var = &tab->var[pos]; + if (!var->is_row) { + if (isl_int_is_neg(shift)) { + if (!max_is_manifestly_unbounded(tab, var)) + if (to_row(tab, var, 1) < 0) + return -1; + } else { + if (!min_is_manifestly_unbounded(tab, var)) + if (to_row(tab, var, -1) < 0) + return -1; + } + } + + if (var->is_row) { + isl_int_addmul(tab->mat->row[var->index][1], + shift, tab->mat->row[var->index][0]); + } else { + int i; + unsigned off = 2 + tab->M; + + for (i = 0; i < tab->n_row; ++i) { + if (isl_int_is_zero(tab->mat->row[i][off + var->index])) + continue; + isl_int_submul(tab->mat->row[i][1], + shift, tab->mat->row[i][off + var->index]); + } + + } + + return 0; } /* Remove the sign constraint from constraint "con". @@ -3024,10 +3161,21 @@ return res; } +/* Is the constraint at position "con" marked as being redundant? + * If it is marked as representing an equality, then it is not + * considered to be redundant. + * Note that isl_tab_mark_redundant marks both the isl_tab_var as + * redundant and moves the corresponding row into the first + * tab->n_redundant positions (or removes the row, assigning it index -1), + * so the final test is actually redundant itself. + */ int isl_tab_is_redundant(struct isl_tab *tab, int con) { if (!tab) return -1; + if (con < 0 || con >= tab->n_con) + isl_die(isl_tab_get_ctx(tab), isl_error_invalid, + "position out of bounds", return -1); if (tab->con[con].is_zero) return 0; if (tab->con[con].is_redundant) @@ -3118,8 +3266,7 @@ case isl_tab_undo_allocate: if (undo->u.var_index >= 0) { isl_assert(tab->mat->ctx, !var->is_row, return -1); - drop_col(tab, var->index); - break; + return drop_col(tab, var->index); } if (!var->is_row) { if (!max_is_manifestly_unbounded(tab, var)) { @@ -3132,8 +3279,7 @@ if (to_row(tab, var, 0) < 0) return -1; } - drop_row(tab, var->index); - break; + return drop_row(tab, var->index); case isl_tab_undo_relax: return unrelax(tab, var); case isl_tab_undo_unrestrict: @@ -3229,6 +3375,9 @@ static int perform_undo(struct isl_tab *tab, struct isl_tab_undo *undo) { switch (undo->type) { + case isl_tab_undo_rational: + tab->rational = 0; + break; case isl_tab_undo_empty: tab->empty = 0; break; diff -Nru cloog-0.18.2/isl/isl_tab.h cloog-0.18.4/isl/isl_tab.h --- cloog-0.18.2/isl/isl_tab.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_tab.h 2015-07-24 12:23:09.000000000 +0000 @@ -14,6 +14,7 @@ #include #include #include +#include struct isl_tab_var { int index; @@ -28,6 +29,7 @@ enum isl_tab_undo_type { isl_tab_undo_bottom, + isl_tab_undo_rational, isl_tab_undo_empty, isl_tab_undo_nonneg, isl_tab_undo_redundant, @@ -204,7 +206,6 @@ isl_int *f, isl_int denom, isl_int *opt, isl_int *opt_denom, unsigned flags) WARN_UNUSED; -struct isl_tab *isl_tab_extend(struct isl_tab *tab, unsigned n_new) WARN_UNUSED; int isl_tab_add_ineq(struct isl_tab *tab, isl_int *ineq) WARN_UNUSED; int isl_tab_add_eq(struct isl_tab *tab, isl_int *eq) WARN_UNUSED; int isl_tab_add_valid_eq(struct isl_tab *tab, isl_int *eq) WARN_UNUSED; @@ -235,7 +236,7 @@ struct isl_tab_undo *isl_tab_snap(struct isl_tab *tab); int isl_tab_rollback(struct isl_tab *tab, struct isl_tab_undo *snap) WARN_UNUSED; -struct isl_tab *isl_tab_relax(struct isl_tab *tab, int con) WARN_UNUSED; +int isl_tab_relax(struct isl_tab *tab, int con) WARN_UNUSED; int isl_tab_select_facet(struct isl_tab *tab, int con) WARN_UNUSED; int isl_tab_unrestrict(struct isl_tab *tab, int con) WARN_UNUSED; @@ -267,6 +268,7 @@ struct isl_tab_var *isl_tab_var_from_row(struct isl_tab *tab, int i); int isl_tab_mark_redundant(struct isl_tab *tab, int row) WARN_UNUSED; +int isl_tab_mark_rational(struct isl_tab *tab) WARN_UNUSED; int isl_tab_mark_empty(struct isl_tab *tab) WARN_UNUSED; struct isl_tab *isl_tab_dup(struct isl_tab *tab); struct isl_tab *isl_tab_product(struct isl_tab *tab1, struct isl_tab *tab2); @@ -274,6 +276,7 @@ int isl_tab_allocate_con(struct isl_tab *tab) WARN_UNUSED; int isl_tab_extend_vars(struct isl_tab *tab, unsigned n_new) WARN_UNUSED; int isl_tab_allocate_var(struct isl_tab *tab) WARN_UNUSED; +int isl_tab_insert_var(struct isl_tab *tab, int pos) WARN_UNUSED; int isl_tab_pivot(struct isl_tab *tab, int row, int col) WARN_UNUSED; int isl_tab_add_row(struct isl_tab *tab, isl_int *line) WARN_UNUSED; int isl_tab_row_is_redundant(struct isl_tab *tab, int row); @@ -287,7 +290,7 @@ int isl_tab_push_basis(struct isl_tab *tab) WARN_UNUSED; struct isl_tab *isl_tab_init_samples(struct isl_tab *tab) WARN_UNUSED; -struct isl_tab *isl_tab_add_sample(struct isl_tab *tab, +int isl_tab_add_sample(struct isl_tab *tab, __isl_take isl_vec *sample) WARN_UNUSED; struct isl_tab *isl_tab_drop_sample(struct isl_tab *tab, int s); int isl_tab_save_samples(struct isl_tab *tab) WARN_UNUSED; @@ -301,4 +304,6 @@ int isl_tab_add_div(struct isl_tab *tab, __isl_keep isl_vec *div, int (*add_ineq)(void *user, isl_int *), void *user); +int isl_tab_shift_var(struct isl_tab *tab, int pos, isl_int shift) WARN_UNUSED; + #endif diff -Nru cloog-0.18.2/isl/isl_tab_pip.c cloog-0.18.4/isl/isl_tab_pip.c --- cloog-0.18.2/isl/isl_tab_pip.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_tab_pip.c 2015-07-24 12:23:09.000000000 +0000 @@ -12,10 +12,11 @@ #include #include "isl_map_private.h" -#include +#include #include "isl_tab.h" #include "isl_sample.h" #include +#include #include #include #include @@ -563,9 +564,8 @@ static void sol_map_add_empty(struct isl_sol_map *sol, struct isl_basic_set *bset) { - if (!bset) + if (!bset || !sol->empty) goto error; - isl_assert(bset->ctx, sol->empty, goto error); sol->empty = isl_set_grow(sol->empty, 1); bset = isl_basic_set_simplify(bset); @@ -1799,7 +1799,8 @@ sample = isl_tab_get_sample_value(tab); - tab = isl_tab_add_sample(tab, sample); + if (isl_tab_add_sample(tab, sample) < 0) + goto error; } if (!tab->empty && isl_tab_rollback(tab, snap) < 0) @@ -2075,6 +2076,8 @@ { int i; struct isl_tab *tab; + unsigned n_var; + unsigned o_var; tab = isl_tab_alloc(bmap->ctx, 2 * bmap->n_eq + bmap->n_ineq + 1, isl_basic_map_total_dim(bmap), M); @@ -2100,16 +2103,16 @@ tab->var[i].is_nonneg = 1; tab->var[i].frozen = 1; } + o_var = 1 + tab->n_param; + n_var = tab->n_var - tab->n_param - tab->n_div; for (i = 0; i < bmap->n_eq; ++i) { if (max) - isl_seq_neg(bmap->eq[i] + 1 + tab->n_param, - bmap->eq[i] + 1 + tab->n_param, - tab->n_var - tab->n_param - tab->n_div); + isl_seq_neg(bmap->eq[i] + o_var, + bmap->eq[i] + o_var, n_var); tab = add_lexmin_valid_eq(tab, bmap->eq[i]); if (max) - isl_seq_neg(bmap->eq[i] + 1 + tab->n_param, - bmap->eq[i] + 1 + tab->n_param, - tab->n_var - tab->n_param - tab->n_div); + isl_seq_neg(bmap->eq[i] + o_var, + bmap->eq[i] + o_var, n_var); if (!tab || tab->empty) return tab; } @@ -2117,14 +2120,12 @@ goto error; for (i = 0; i < bmap->n_ineq; ++i) { if (max) - isl_seq_neg(bmap->ineq[i] + 1 + tab->n_param, - bmap->ineq[i] + 1 + tab->n_param, - tab->n_var - tab->n_param - tab->n_div); + isl_seq_neg(bmap->ineq[i] + o_var, + bmap->ineq[i] + o_var, n_var); tab = add_lexmin_ineq(tab, bmap->ineq[i]); if (max) - isl_seq_neg(bmap->ineq[i] + 1 + tab->n_param, - bmap->ineq[i] + 1 + tab->n_param, - tab->n_var - tab->n_param - tab->n_div); + isl_seq_neg(bmap->ineq[i] + o_var, + bmap->ineq[i] + o_var, n_var); if (!tab || tab->empty) return tab; } @@ -2149,6 +2150,13 @@ * * Perhaps it would also be useful to look at the number of constraints * that conflict with any given constraint. + * + * best is the best row so far (-1 when we have not found any row yet). + * best_r is the number of other rows made redundant by row best. + * When best is still -1, bset_r is meaningless, but it is initialized + * to some arbitrary value (0) anyway. Without this redundant initialization + * valgrind may warn about uninitialized memory accesses when isl + * is compiled with some versions of gcc. */ static int best_split(struct isl_tab *tab, struct isl_tab *context_tab) { @@ -2156,7 +2164,7 @@ int split; int row; int best = -1; - int best_r; + int best_r = 0; if (isl_tab_extend_cons(context_tab, 2) < 0) return -1; @@ -2781,7 +2789,7 @@ sample = isl_tab_sample(cgbr->tab); - if (isl_tab_rollback(cgbr->tab, snap) < 0) { + if (!sample || isl_tab_rollback(cgbr->tab, snap) < 0) { isl_vec_free(sample); return NULL; } @@ -2824,7 +2832,8 @@ return; } - cgbr->tab = isl_tab_add_sample(cgbr->tab, sample); + if (isl_tab_add_sample(cgbr->tab, sample) < 0) + goto error; return; error: @@ -3062,8 +3071,10 @@ * that is one or negative one, we use it to kill a column * in the main tableau. Otherwise, we discard the tentatively * added row. + * + * Return 0 on success and -1 on failure. */ -static void propagate_equalities(struct isl_context_gbr *cgbr, +static int propagate_equalities(struct isl_context_gbr *cgbr, struct isl_tab *tab, unsigned first) { int i; @@ -3113,22 +3124,20 @@ isl_vec_free(eq); - return; + return 0; error: isl_vec_free(eq); isl_tab_free(cgbr->tab); cgbr->tab = NULL; + return -1; } static int context_gbr_detect_equalities(struct isl_context *context, struct isl_tab *tab) { struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context; - struct isl_ctx *ctx; unsigned n_ineq; - ctx = cgbr->tab->mat->ctx; - if (!cgbr->cone) { struct isl_basic_set *bset = isl_tab_peek_bset(cgbr->tab); cgbr->cone = isl_tab_from_recession_cone(bset, 0); @@ -3145,8 +3154,9 @@ cgbr->tab = isl_tab_detect_equalities(cgbr->tab, cgbr->cone); if (!cgbr->tab) return -1; - if (cgbr->tab->bmap->n_ineq > n_ineq) - propagate_equalities(cgbr, tab, n_ineq); + if (cgbr->tab->bmap->n_ineq > n_ineq && + propagate_equalities(cgbr, tab, n_ineq) < 0) + return -1; return 0; error: @@ -3255,10 +3265,8 @@ struct isl_gbr_tab_undo *snap = (struct isl_gbr_tab_undo *)save; if (!snap) goto error; - if (isl_tab_rollback(cgbr->tab, snap->tab_snap) < 0) { - isl_tab_free(cgbr->tab); - cgbr->tab = NULL; - } + if (isl_tab_rollback(cgbr->tab, snap->tab_snap) < 0) + goto error; if (snap->shifted_snap) { if (isl_tab_rollback(cgbr->shifted, snap->shifted_snap) < 0) @@ -3819,7 +3827,6 @@ sol_inc_level(sol); find_in_pos(sol, tab, ineq->el); tab->row_sign[split] = isl_tab_row_neg; - row = split; isl_seq_neg(ineq->el, ineq->el, ineq->size); isl_int_sub_ui(ineq->el[0], ineq->el[0], 1); if (!sol->error) @@ -4177,7 +4184,7 @@ int *first, int *second) { int i; - isl_ctx *ctx = isl_basic_map_get_ctx(bmap); + isl_ctx *ctx; struct isl_hash_table *table = NULL; struct isl_hash_table_entry *entry; struct isl_constraint_equal_info info; @@ -4281,13 +4288,11 @@ { int i, k; isl_basic_set *bset = NULL; - isl_ctx *ctx; isl_set *set = NULL; if (!dim || !var) goto error; - ctx = isl_space_get_ctx(dim); set = isl_set_alloc_space(isl_space_copy(dim), var->n_row, ISL_SET_DISJOINT); @@ -4614,7 +4619,7 @@ if (isl_basic_map_drop_inequality(bmap, list[i]) < 0) goto error; - bmap = isl_basic_map_add(bmap, isl_dim_in, 1); + bmap = isl_basic_map_add_dims(bmap, isl_dim_in, 1); bmap = isl_basic_map_extend_constraints(bmap, 0, 1); k = isl_basic_map_alloc_inequality(bmap); if (k < 0) @@ -4747,6 +4752,8 @@ static void sol_for_free(struct isl_sol_for *sol_for) { + if (!sol_for) + return; if (sol_for->sol.context) sol_for->sol.context->op->free(sol_for->sol.context); free(sol_for); @@ -5243,9 +5250,8 @@ static void sol_pma_add_empty(struct isl_sol_pma *sol, __isl_take isl_basic_set *bset) { - if (!bset) + if (!bset || !sol->empty) goto error; - isl_assert(bset->ctx, sol->empty, goto error); sol->empty = isl_set_grow(sol->empty, 1); bset = isl_basic_set_simplify(bset); @@ -5431,7 +5437,6 @@ int i; isl_aff *aff = NULL; isl_basic_set *bset = NULL; - isl_ctx *ctx; isl_pw_aff *paff = NULL; isl_space *pw_space; isl_local_space *ls = NULL; @@ -5439,7 +5444,6 @@ if (!space || !var) goto error; - ctx = isl_space_get_ctx(space); ls = isl_local_space_from_space(isl_space_copy(space)); pw_space = isl_space_copy(space); pw_space = isl_space_from_domain(pw_space); diff -Nru cloog-0.18.2/isl/isl_tarjan.c cloog-0.18.4/isl/isl_tarjan.c --- cloog-0.18.2/isl/isl_tarjan.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_tarjan.c 2015-07-24 12:23:09.000000000 +0000 @@ -58,8 +58,8 @@ /* Perform Tarjan's algorithm for computing the strongly connected components * in the graph with g->len nodes and with edges defined by "follows". */ -static int isl_tarjan_components(struct isl_tarjan_graph *g, int i, - int (*follows)(int i, int j, void *user), void *user) +static isl_stat isl_tarjan_components(struct isl_tarjan_graph *g, int i, + isl_bool (*follows)(int i, int j, void *user), void *user) { int j; @@ -70,7 +70,7 @@ g->stack[g->sp++] = i; for (j = g->len - 1; j >= 0; --j) { - int f; + isl_bool f; if (j == i) continue; @@ -81,7 +81,7 @@ f = follows(i, j, user); if (f < 0) - return -1; + return isl_stat_error; if (!f) continue; @@ -94,7 +94,7 @@ } if (g->node[i].index != g->node[i].min_index) - return 0; + return isl_stat_ok; do { j = g->stack[--g->sp]; @@ -103,7 +103,7 @@ } while (j != i); g->order[g->op++] = -1; - return 0; + return isl_stat_ok; } /* Decompose the graph with "len" nodes and edges defined by "follows" @@ -116,7 +116,7 @@ * in the result. */ struct isl_tarjan_graph *isl_tarjan_graph_init(isl_ctx *ctx, int len, - int (*follows)(int i, int j, void *user), void *user) + isl_bool (*follows)(int i, int j, void *user), void *user) { int i; struct isl_tarjan_graph *g = NULL; diff -Nru cloog-0.18.2/isl/isl_tarjan.h cloog-0.18.4/isl/isl_tarjan.h --- cloog-0.18.2/isl/isl_tarjan.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_tarjan.h 2015-07-24 12:23:09.000000000 +0000 @@ -34,7 +34,7 @@ }; struct isl_tarjan_graph *isl_tarjan_graph_init(isl_ctx *ctx, int len, - int (*follows)(int i, int j, void *user), void *user); + isl_bool (*follows)(int i, int j, void *user), void *user); void isl_tarjan_graph_free(struct isl_tarjan_graph *g); #endif diff -Nru cloog-0.18.2/isl/isl_test.c cloog-0.18.4/isl/isl_test.c --- cloog-0.18.2/isl/isl_test.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_test.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,10 +1,18 @@ /* * Copyright 2008-2009 Katholieke Universiteit Leuven + * Copyright 2010 INRIA Saclay + * Copyright 2012-2013 Ecole Normale Superieure + * Copyright 2014 INRIA Rocquencourt * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, K.U.Leuven, Departement * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium + * and INRIA Saclay - Ile-de-France, Parc Club Orsay Universite, + * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France + * and Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France + * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, + * B.P. 105 - 78153 Le Chesnay, France */ #include @@ -15,15 +23,20 @@ #include #include #include -#include +#include #include +#include #include #include #include +#include #include #include #include #include +#include +#include +#include #define ARRAY_SIZE(array) (sizeof(array)/sizeof(*array)) @@ -93,11 +106,30 @@ isl_pw_aff_free(pwaff); } +/* Check that we can read an isl_multi_val from "str" without errors. + */ +static int test_parse_multi_val(isl_ctx *ctx, const char *str) +{ + isl_multi_val *mv; + + mv = isl_multi_val_read_from_str(ctx, str); + isl_multi_val_free(mv); + + return mv ? 0 : -1; +} + int test_parse(struct isl_ctx *ctx) { isl_map *map, *map2; const char *str, *str2; + if (test_parse_multi_val(ctx, "{ A[B[2] -> C[5, 7]] }") < 0) + return -1; + if (test_parse_multi_val(ctx, "[n] -> { [2] }") < 0) + return -1; + if (test_parse_multi_val(ctx, "{ A[4, infty, NaN, -1/2, 2/3] }") < 0) + return -1; + str = "{ [i] -> [-i] }"; map = isl_map_read_from_str(ctx, str); assert(map); @@ -217,15 +249,40 @@ "{ [a] -> [b] : a != 5 or b = 5 }") < 0) return -1; + if (test_parse_map_equal(ctx, "{ [a] -> [a - 1 : a > 0] }", + "{ [a] -> [a - 1] : a > 0 }") < 0) + return -1; + if (test_parse_map_equal(ctx, + "{ [a] -> [a - 1 : a > 0; a : a <= 0] }", + "{ [a] -> [a - 1] : a > 0; [a] -> [a] : a <= 0 }") < 0) + return -1; + if (test_parse_map_equal(ctx, + "{ [a] -> [(a) * 2 : a >= 0; 0 : a < 0] }", + "{ [a] -> [2a] : a >= 0; [a] -> [0] : a < 0 }") < 0) + return -1; + if (test_parse_map_equal(ctx, + "{ [a] -> [(a * 2) : a >= 0; 0 : a < 0] }", + "{ [a] -> [2a] : a >= 0; [a] -> [0] : a < 0 }") < 0) + return -1; + if (test_parse_map_equal(ctx, + "{ [a] -> [(a * 2 : a >= 0); 0 : a < 0] }", + "{ [a] -> [2a] : a >= 0; [a] -> [0] : a < 0 }") < 0) + return -1; + if (test_parse_map_equal(ctx, + "{ [a] -> [(a * 2 : a >= 0; 0 : a < 0)] }", + "{ [a] -> [2a] : a >= 0; [a] -> [0] : a < 0 }") < 0) + return -1; + return 0; } -void test_read(struct isl_ctx *ctx) +static int test_read(isl_ctx *ctx) { char *filename; FILE *input; - struct isl_basic_set *bset1, *bset2; + isl_basic_set *bset1, *bset2; const char *str = "{[y]: Exists ( alpha : 2alpha = y)}"; + int equal; filename = get_filename(ctx, "set", "omega"); assert(filename); @@ -235,44 +292,70 @@ bset1 = isl_basic_set_read_from_file(ctx, input); bset2 = isl_basic_set_read_from_str(ctx, str); - assert(isl_basic_set_is_equal(bset1, bset2) == 1); + equal = isl_basic_set_is_equal(bset1, bset2); isl_basic_set_free(bset1); isl_basic_set_free(bset2); free(filename); fclose(input); + + if (equal < 0) + return -1; + if (!equal) + isl_die(ctx, isl_error_unknown, + "read sets not equal", return -1); + + return 0; } -void test_bounded(struct isl_ctx *ctx) +static int test_bounded(isl_ctx *ctx) { isl_set *set; int bounded; set = isl_set_read_from_str(ctx, "[n] -> {[i] : 0 <= i <= n }"); bounded = isl_set_is_bounded(set); - assert(bounded); isl_set_free(set); + if (bounded < 0) + return -1; + if (!bounded) + isl_die(ctx, isl_error_unknown, + "set not considered bounded", return -1); + set = isl_set_read_from_str(ctx, "{[n, i] : 0 <= i <= n }"); bounded = isl_set_is_bounded(set); assert(!bounded); isl_set_free(set); + if (bounded < 0) + return -1; + if (bounded) + isl_die(ctx, isl_error_unknown, + "set considered bounded", return -1); + set = isl_set_read_from_str(ctx, "[n] -> {[i] : i <= n }"); bounded = isl_set_is_bounded(set); - assert(!bounded); isl_set_free(set); + + if (bounded < 0) + return -1; + if (bounded) + isl_die(ctx, isl_error_unknown, + "set considered bounded", return -1); + + return 0; } /* Construct the basic set { [i] : 5 <= i <= N } */ -void test_construction(struct isl_ctx *ctx) +static int test_construction(isl_ctx *ctx) { isl_int v; isl_space *dim; isl_local_space *ls; - struct isl_basic_set *bset; - struct isl_constraint *c; + isl_basic_set *bset; + isl_constraint *c; isl_int_init(v); @@ -280,14 +363,14 @@ bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_inequality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_inequality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, 1); isl_constraint_set_coefficient(c, isl_dim_param, 0, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_inequality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_inequality(isl_local_space_copy(ls)); isl_int_set_si(v, 1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, -5); @@ -298,37 +381,54 @@ isl_basic_set_free(bset); isl_int_clear(v); + + return 0; } -void test_dim(struct isl_ctx *ctx) +static int test_dim(isl_ctx *ctx) { const char *str; isl_map *map1, *map2; + int equal; map1 = isl_map_read_from_str(ctx, "[n] -> { [i] -> [j] : exists (a = [i/10] : i - 10a <= n ) }"); map1 = isl_map_add_dims(map1, isl_dim_in, 1); map2 = isl_map_read_from_str(ctx, "[n] -> { [i,k] -> [j] : exists (a = [i/10] : i - 10a <= n ) }"); - assert(isl_map_is_equal(map1, map2)); + equal = isl_map_is_equal(map1, map2); isl_map_free(map2); map1 = isl_map_project_out(map1, isl_dim_in, 0, 1); map2 = isl_map_read_from_str(ctx, "[n] -> { [i] -> [j] : n >= 0 }"); - assert(isl_map_is_equal(map1, map2)); + if (equal >= 0 && equal) + equal = isl_map_is_equal(map1, map2); isl_map_free(map1); isl_map_free(map2); + if (equal < 0) + return -1; + if (!equal) + isl_die(ctx, isl_error_unknown, + "unexpected result", return -1); + str = "[n] -> { [i] -> [] : exists a : 0 <= i <= n and i = 2 a }"; map1 = isl_map_read_from_str(ctx, str); str = "{ [i] -> [j] : exists a : 0 <= i <= j and i = 2 a }"; map2 = isl_map_read_from_str(ctx, str); map1 = isl_map_move_dims(map1, isl_dim_out, 0, isl_dim_param, 0, 1); - assert(isl_map_is_equal(map1, map2)); - + equal = isl_map_is_equal(map1, map2); isl_map_free(map1); isl_map_free(map2); + + if (equal < 0) + return -1; + if (!equal) + isl_die(ctx, isl_error_unknown, + "unexpected result", return -1); + + return 0; } struct { @@ -374,6 +474,15 @@ { &isl_val_2exp, "1", "2" }, { &isl_val_2exp, "2", "4" }, { &isl_val_2exp, "3", "8" }, + { &isl_val_inv, "1", "1" }, + { &isl_val_inv, "2", "1/2" }, + { &isl_val_inv, "1/2", "2" }, + { &isl_val_inv, "-2", "-1/2" }, + { &isl_val_inv, "-1/2", "-2" }, + { &isl_val_inv, "0", "NaN" }, + { &isl_val_inv, "NaN", "NaN" }, + { &isl_val_inv, "infty", "0" }, + { &isl_val_inv, "-infty", "0" }, }; /* Perform some basic tests of unary operations on isl_val objects. @@ -565,7 +674,7 @@ bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_constant(c, v); isl_int_set_si(v, 1); @@ -574,7 +683,7 @@ isl_constraint_set_coefficient(c, isl_dim_set, 1, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, 1); isl_constraint_set_constant(c, v); isl_int_set_si(v, -1); @@ -594,7 +703,7 @@ bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, 1); isl_constraint_set_constant(c, v); isl_int_set_si(v, -1); @@ -603,7 +712,7 @@ isl_constraint_set_coefficient(c, isl_dim_set, 1, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_constant(c, v); isl_int_set_si(v, 1); @@ -623,7 +732,7 @@ bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, 1); isl_constraint_set_constant(c, v); isl_int_set_si(v, -1); @@ -632,7 +741,7 @@ isl_constraint_set_coefficient(c, isl_dim_set, 1, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -3); isl_constraint_set_constant(c, v); isl_int_set_si(v, 1); @@ -652,7 +761,7 @@ bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, 2); isl_constraint_set_constant(c, v); isl_int_set_si(v, -1); @@ -661,7 +770,7 @@ isl_constraint_set_coefficient(c, isl_dim_set, 1, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_constant(c, v); isl_int_set_si(v, 1); @@ -681,14 +790,14 @@ bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, 3); isl_constraint_set_coefficient(c, isl_dim_set, 2, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, 1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, -3); @@ -706,14 +815,14 @@ bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, 6); isl_constraint_set_coefficient(c, isl_dim_set, 2, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, 1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, -3); @@ -740,7 +849,7 @@ bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, -3); @@ -765,7 +874,7 @@ bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, -3); @@ -776,7 +885,7 @@ isl_constraint_set_coefficient(c, isl_dim_set, 4, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, 1); @@ -799,7 +908,7 @@ bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, 1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, -1); @@ -808,7 +917,7 @@ isl_constraint_set_coefficient(c, isl_dim_set, 2, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, 3); @@ -831,7 +940,7 @@ bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, 1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, -2); @@ -908,10 +1017,12 @@ fclose(input); } -void test_application(struct isl_ctx *ctx) +static int test_application(isl_ctx *ctx) { test_application_case(ctx, "application"); test_application_case(ctx, "application2"); + + return 0; } void test_affine_hull_case(struct isl_ctx *ctx, const char *name) @@ -1022,10 +1133,27 @@ fclose(input); } -void test_convex_hull_algo(struct isl_ctx *ctx, int convex) +struct { + const char *set; + const char *hull; +} convex_hull_tests[] = { + { "{ [i0, i1, i2] : (i2 = 1 and i0 = 0 and i1 >= 0) or " + "(i0 = 1 and i1 = 0 and i2 = 1) or " + "(i0 = 0 and i1 = 0 and i2 = 0) }", + "{ [i0, i1, i2] : i0 >= 0 and i2 >= i0 and i2 <= 1 and i1 >= 0 }" }, + { "[n] -> { [i0, i1, i0] : i0 <= -4 + n; " + "[i0, i0, i2] : n = 6 and i0 >= 0 and i2 <= 7 - i0 and " + "i2 <= 5 and i2 >= 4; " + "[3, i1, 3] : n = 5 and i1 <= 2 and i1 >= 0 }", + "[n] -> { [i0, i1, i2] : i2 <= -1 + n and 2i2 <= -6 + 3n - i0 and " + "i2 <= 5 + i0 and i2 >= i0 }" }, + { "{ [x, y] : 3y <= 2x and y >= -2 + 2x and 2y >= 2 - x }", + "{ [x, y] : 1 = 0 }" }, +}; + +static int test_convex_hull_algo(isl_ctx *ctx, int convex) { - const char *str1, *str2; - isl_set *set1, *set2; + int i; int orig_convex = ctx->opt->convex; ctx->opt->convex = convex; @@ -1046,24 +1174,36 @@ test_convex_hull_case(ctx, "convex14"); test_convex_hull_case(ctx, "convex15"); - str1 = "{ [i0, i1, i2] : (i2 = 1 and i0 = 0 and i1 >= 0) or " - "(i0 = 1 and i1 = 0 and i2 = 1) or " - "(i0 = 0 and i1 = 0 and i2 = 0) }"; - str2 = "{ [i0, i1, i2] : i0 >= 0 and i2 >= i0 and i2 <= 1 and i1 >= 0 }"; - set1 = isl_set_read_from_str(ctx, str1); - set2 = isl_set_read_from_str(ctx, str2); - set1 = isl_set_from_basic_set(isl_set_convex_hull(set1)); - assert(isl_set_is_equal(set1, set2)); - isl_set_free(set1); - isl_set_free(set2); + for (i = 0; i < ARRAY_SIZE(convex_hull_tests); ++i) { + isl_set *set1, *set2; + int equal; + + set1 = isl_set_read_from_str(ctx, convex_hull_tests[i].set); + set2 = isl_set_read_from_str(ctx, convex_hull_tests[i].hull); + set1 = isl_set_from_basic_set(isl_set_convex_hull(set1)); + equal = isl_set_is_equal(set1, set2); + isl_set_free(set1); + isl_set_free(set2); + + if (equal < 0) + return -1; + if (!equal) + isl_die(ctx, isl_error_unknown, + "unexpected convex hull", return -1); + } ctx->opt->convex = orig_convex; + + return 0; } -void test_convex_hull(struct isl_ctx *ctx) +static int test_convex_hull(isl_ctx *ctx) { - test_convex_hull_algo(ctx, ISL_CONVEX_HULL_FM); - test_convex_hull_algo(ctx, ISL_CONVEX_HULL_WRAP); + if (test_convex_hull_algo(ctx, ISL_CONVEX_HULL_FM) < 0) + return -1; + if (test_convex_hull_algo(ctx, ISL_CONVEX_HULL_WRAP) < 0) + return -1; + return 0; } void test_gist_case(struct isl_ctx *ctx, const char *name) @@ -1093,11 +1233,60 @@ fclose(input); } +struct { + const char *set; + const char *context; + const char *gist; +} gist_tests[] = { + { "{ [a, b, c] : a <= 15 and a >= 1 }", + "{ [a, b, c] : exists (e0 = floor((-1 + a)/16): a >= 1 and " + "c <= 30 and 32e0 >= -62 + 2a + 2b - c and b >= 0) }", + "{ [a, b, c] : a <= 15 }" }, + { "{ : }", "{ : 1 = 0 }", "{ : }" }, + { "{ : 1 = 0 }", "{ : 1 = 0 }", "{ : }" }, + { "[M] -> { [x] : exists (e0 = floor((-2 + x)/3): 3e0 = -2 + x) }", + "[M] -> { [3M] }" , "[M] -> { [x] : 1 = 0 }" }, + { "{ [m, n, a, b] : a <= 2147 + n }", + "{ [m, n, a, b] : (m >= 1 and n >= 1 and a <= 2148 - m and " + "b <= 2148 - n and b >= 0 and b >= 2149 - n - a) or " + "(n >= 1 and a >= 0 and b <= 2148 - n - a and " + "b >= 0) }", + "{ [m, n, ku, kl] }" }, +}; + static int test_gist(struct isl_ctx *ctx) { + int i; const char *str; isl_basic_set *bset1, *bset2; isl_map *map1, *map2; + int equal; + + for (i = 0; i < ARRAY_SIZE(gist_tests); ++i) { + int equal_input; + isl_set *set1, *set2, *copy; + + set1 = isl_set_read_from_str(ctx, gist_tests[i].set); + set2 = isl_set_read_from_str(ctx, gist_tests[i].context); + copy = isl_set_copy(set1); + set1 = isl_set_gist(set1, set2); + set2 = isl_set_read_from_str(ctx, gist_tests[i].gist); + equal = isl_set_is_equal(set1, set2); + isl_set_free(set1); + isl_set_free(set2); + set1 = isl_set_read_from_str(ctx, gist_tests[i].set); + equal_input = isl_set_is_equal(set1, copy); + isl_set_free(set1); + isl_set_free(copy); + if (equal < 0 || equal_input < 0) + return -1; + if (!equal) + isl_die(ctx, isl_error_unknown, + "incorrect gist result", return -1); + if (!equal_input) + isl_die(ctx, isl_error_unknown, + "gist modified input", return -1); + } test_gist_case(ctx, "gist1"); @@ -1177,31 +1366,45 @@ return 0; } +/* Inputs for coalescing tests with unbounded wrapping. + * "str" is a string representation of the input set. + * "single_disjunct" is set if we expect the result to consist of + * a single disjunct. + */ +struct { + int single_disjunct; + const char *str; +} coalesce_unbounded_tests[] = { + { 1, "{ [x,y,z] : y + 2 >= 0 and x - y + 1 >= 0 and " + "-x - y + 1 >= 0 and -3 <= z <= 3;" + "[x,y,z] : -x+z + 20 >= 0 and -x-z + 20 >= 0 and " + "x-z + 20 >= 0 and x+z + 20 >= 0 and " + "-10 <= y <= 0}" }, + { 1, "{ [x,y] : 0 <= x,y <= 10; [5,y]: 4 <= y <= 11 }" }, + { 1, "{ [x,0,0] : -5 <= x <= 5; [0,y,1] : -5 <= y <= 5 }" }, + { 1, "{ [x,y] : 0 <= x <= 10 and 0 >= y >= -1 and x+y >= 0; [0,1] }" }, + { 1, "{ [x,y] : (0 <= x,y <= 4) or (2 <= x,y <= 5 and x + y <= 9) }" }, +}; + +/* Test the functionality of isl_set_coalesce with the bounded wrapping + * option turned off. + */ int test_coalesce_unbounded_wrapping(isl_ctx *ctx) { + int i; int r = 0; int bounded; bounded = isl_options_get_coalesce_bounded_wrapping(ctx); isl_options_set_coalesce_bounded_wrapping(ctx, 0); - if (test_coalesce_set(ctx, - "{[x,y,z] : y + 2 >= 0 and x - y + 1 >= 0 and " - "-x - y + 1 >= 0 and -3 <= z <= 3;" - "[x,y,z] : -x+z + 20 >= 0 and -x-z + 20 >= 0 and " - "x-z + 20 >= 0 and x+z + 20 >= 0 and " - "-10 <= y <= 0}", 1) < 0) - goto error; - if (test_coalesce_set(ctx, - "{[x,y] : 0 <= x,y <= 10; [5,y]: 4 <=y <= 11}", 1) < 0) - goto error; - if (test_coalesce_set(ctx, - "{[x,0,0] : -5 <= x <= 5; [0,y,1] : -5 <= y <= 5 }", 1) < 0) - goto error; - - if (0) { -error: + for (i = 0; i < ARRAY_SIZE(coalesce_unbounded_tests); ++i) { + const char *str = coalesce_unbounded_tests[i].str; + int check_one = coalesce_unbounded_tests[i].single_disjunct; + if (test_coalesce_set(ctx, str, check_one) >= 0) + continue; r = -1; + break; } isl_options_set_coalesce_bounded_wrapping(ctx, bounded); @@ -1327,11 +1530,114 @@ "[x,0] : 3 <= x <= 5 }" }, { 0, "{ [x,y] : 0 <= x <= 2 and y >= 0 and x + y <= 4; " "[x,0] : 3 <= x <= 4 }" }, - { 1 , "{ [i0, i1] : i0 <= 122 and i0 >= 1 and 128i1 >= -249 + i0 and " + { 1, "{ [i0, i1] : i0 <= 122 and i0 >= 1 and 128i1 >= -249 + i0 and " "i1 <= 0; " "[i0, 0] : i0 >= 123 and i0 <= 124 }" }, + { 1, "{ [0,0]; [1,1] }" }, + { 1, "[n] -> { [k] : 16k <= -1 + n and k >= 1; [0] : n >= 2 }" }, + { 1, "{ [k, ii, k - ii] : ii >= -6 + k and ii <= 6 and ii >= 1 and " + "ii <= k;" + "[k, 0, k] : k <= 6 and k >= 1 }" }, + { 1, "{ [i,j] : i = 4 j and 0 <= i <= 100;" + "[i,j] : 1 <= i <= 100 and i >= 4j + 1 and i <= 4j + 2 }" }, + { 1, "{ [x,y] : x % 2 = 0 and y % 2 = 0; [x,x] : x % 2 = 0 }" }, + { 1, "[n] -> { [1] : n >= 0;" + "[x] : exists (e0 = floor((x)/2): x >= 2 and " + "2e0 >= -1 + x and 2e0 <= x and 2e0 <= n) }" }, + { 1, "[n] -> { [x, y] : exists (e0 = floor((x)/2), e1 = floor((y)/3): " + "3e1 = y and x >= 2 and 2e0 >= -1 + x and " + "2e0 <= x and 2e0 <= n);" + "[1, y] : exists (e0 = floor((y)/3): 3e0 = y and " + "n >= 0) }" }, + { 1, "[t1] -> { [i0] : (exists (e0 = floor((63t1)/64): " + "128e0 >= -134 + 127t1 and t1 >= 2 and " + "64e0 <= 63t1 and 64e0 >= -63 + 63t1)) or " + "t1 = 1 }" }, + { 1, "{ [i, i] : exists (e0 = floor((1 + 2i)/3): 3e0 <= 2i and " + "3e0 >= -1 + 2i and i <= 9 and i >= 1);" + "[0, 0] }" }, + { 1, "{ [t1] : exists (e0 = floor((-11 + t1)/2): 2e0 = -11 + t1 and " + "t1 >= 13 and t1 <= 16);" + "[t1] : t1 <= 15 and t1 >= 12 }" }, + { 1, "{ [x,y] : x = 3y and 0 <= y <= 2; [-3,-1] }" }, + { 1, "{ [x,y] : 2x = 3y and 0 <= y <= 4; [-3,-2] }" }, + { 0, "{ [x,y] : 2x = 3y and 0 <= y <= 4; [-2,-2] }" }, + { 0, "{ [x,y] : 2x = 3y and 0 <= y <= 4; [-3,-1] }" }, + { 1, "{ [i] : exists j : i = 4 j and 0 <= i <= 100;" + "[i] : exists j : 1 <= i <= 100 and i >= 4j + 1 and " + "i <= 4j + 2 }" }, + { 1, "{ [c0] : (exists (e0 : c0 - 1 <= 3e0 <= c0)) or " + "(exists (e0 : 3e0 = -2 + c0)) }" }, + { 0, "[n, b0, t0] -> " + "{ [i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12] : " + "(exists (e0 = floor((-32b0 + i4)/1048576), " + "e1 = floor((i8)/32): 1048576e0 = -32b0 + i4 and 32e1 = i8 and " + "n <= 2147483647 and b0 <= 32767 and b0 >= 0 and " + "32b0 <= -2 + n and t0 <= 31 and t0 >= 0 and i0 >= 8 + n and " + "3i4 <= -96 + 3t0 + i0 and 3i4 >= -95 - n + 3t0 + i0 and " + "i8 >= -157 + i0 - 4i4 and i8 >= 0 and " + "i8 <= -33 + i0 - 4i4 and 3i8 <= -91 + 4n - i0)) or " + "(exists (e0 = floor((-32b0 + i4)/1048576), " + "e1 = floor((i8)/32): 1048576e0 = -32b0 + i4 and 32e1 = i8 and " + "n <= 2147483647 and b0 <= 32767 and b0 >= 0 and " + "32b0 <= -2 + n and t0 <= 31 and t0 >= 0 and i0 <= 7 + n and " + "4i4 <= -3 + i0 and 3i4 <= -96 + 3t0 + i0 and " + "3i4 >= -95 - n + 3t0 + i0 and i8 >= -157 + i0 - 4i4 and " + "i8 >= 0 and i8 <= -4 + i0 - 3i4 and i8 <= -41 + i0));" + "[i0, i1, i2, i3, 0, i5, i6, i7, i8, i9, i10, i11, i12] : " + "(exists (e0 = floor((i8)/32): b0 = 0 and 32e0 = i8 and " + "n <= 2147483647 and t0 <= 31 and t0 >= 0 and i0 >= 11 and " + "i0 >= 96 - 3t0 and i0 <= 95 + n - 3t0 and i0 <= 7 + n and " + "i8 >= -40 + i0 and i8 <= -10 + i0)) }" }, + { 0, "{ [i0, i1, i2] : " + "(exists (e0, e1 = floor((i0)/32), e2 = floor((i1)/32): " + "32e1 = i0 and 32e2 = i1 and i1 >= -31 + i0 and " + "i1 <= 31 + i0 and i2 >= -30 + i0 and i2 >= -30 + i1 and " + "32e0 >= -30 + i0 and 32e0 >= -30 + i1 and " + "32e0 >= -31 + i2 and 32e0 <= 30 + i2 and 32e0 <= 31 + i1 and " + "32e0 <= 31 + i0)) or " + "i0 >= 0 }" }, }; +/* A specialized coalescing test case that would result + * in a segmentation fault or a failed assertion in earlier versions of isl. + */ +static int test_coalesce_special(struct isl_ctx *ctx) +{ + const char *str; + isl_map *map1, *map2; + + str = "[y] -> { [S_L220_OUT[] -> T7[]] -> " + "[[S_L309_IN[] -> T11[]] -> ce_imag2[1, o1]] : " + "(y = 201 and o1 <= 239 and o1 >= 212) or " + "(exists (e0 = [(y)/3]: 3e0 = y and y <= 198 and y >= 3 and " + "o1 <= 239 and o1 >= 212)) or " + "(exists (e0 = [(y)/3]: 3e0 = y and y <= 201 and y >= 3 and " + "o1 <= 241 and o1 >= 240));" + "[S_L220_OUT[] -> T7[]] -> " + "[[S_L309_IN[] -> T11[]] -> ce_imag2[0, o1]] : " + "(y = 2 and o1 <= 241 and o1 >= 212) or " + "(exists (e0 = [(-2 + y)/3]: 3e0 = -2 + y and y <= 200 and " + "y >= 5 and o1 <= 241 and o1 >= 212)) }"; + map1 = isl_map_read_from_str(ctx, str); + map1 = isl_map_align_divs(map1); + map1 = isl_map_coalesce(map1); + str = "[y] -> { [S_L220_OUT[] -> T7[]] -> " + "[[S_L309_IN[] -> T11[]] -> ce_imag2[o0, o1]] : " + "exists (e0 = [(-1 - y + o0)/3]: 3e0 = -1 - y + o0 and " + "y <= 201 and o0 <= 2 and o1 >= 212 and o1 <= 241 and " + "o0 >= 3 - y and o0 <= -2 + y and o0 >= 0) }"; + map2 = isl_map_read_from_str(ctx, str); + map2 = isl_map_union(map2, map1); + map2 = isl_map_align_divs(map2); + map2 = isl_map_coalesce(map2); + isl_map_free(map2); + if (!map2) + return -1; + + return 0; +} + /* Test the functionality of isl_set_coalesce. * That is, check that the output is always equal to the input * and in some cases that the result consists of a single disjunct. @@ -1349,11 +1655,13 @@ if (test_coalesce_unbounded_wrapping(ctx) < 0) return -1; + if (test_coalesce_special(ctx) < 0) + return -1; return 0; } -void test_closure(struct isl_ctx *ctx) +static int test_closure(isl_ctx *ctx) { const char *str; isl_set *dom; @@ -1590,17 +1898,28 @@ map = isl_map_transitive_closure(map, NULL); assert(map); isl_map_free(map); + + return 0; } -void test_lex(struct isl_ctx *ctx) +static int test_lex(struct isl_ctx *ctx) { isl_space *dim; isl_map *map; + int empty; dim = isl_space_set_alloc(ctx, 0, 0); map = isl_map_lex_le(dim); - assert(!isl_map_is_empty(map)); + empty = isl_map_is_empty(map); isl_map_free(map); + + if (empty < 0) + return -1; + if (empty) + isl_die(ctx, isl_error_unknown, + "expecting non-empty result", return -1); + + return 0; } static int test_lexmin(struct isl_ctx *ctx) @@ -1720,12 +2039,45 @@ return 0; } +/* Check that isl_set_min_val and isl_set_max_val compute the correct + * result on non-convex inputs. + */ +static int test_min(struct isl_ctx *ctx) +{ + isl_set *set; + isl_aff *aff; + isl_val *val; + int min_ok, max_ok; + + set = isl_set_read_from_str(ctx, "{ [-1]; [1] }"); + aff = isl_aff_read_from_str(ctx, "{ [x] -> [x] }"); + val = isl_set_min_val(set, aff); + min_ok = isl_val_is_negone(val); + isl_val_free(val); + val = isl_set_max_val(set, aff); + max_ok = isl_val_is_one(val); + isl_val_free(val); + isl_aff_free(aff); + isl_set_free(set); + + if (min_ok < 0 || max_ok < 0) + return -1; + if (!min_ok) + isl_die(ctx, isl_error_unknown, + "unexpected minimum", return -1); + if (!max_ok) + isl_die(ctx, isl_error_unknown, + "unexpected maximum", return -1); + + return 0; +} + struct must_may { isl_map *must; isl_map *may; }; -static int collect_must_may(__isl_take isl_map *dep, int must, +static isl_stat collect_must_may(__isl_take isl_map *dep, int must, void *dep_user, void *user) { struct must_may *mm = (struct must_may *)user; @@ -1735,7 +2087,7 @@ else mm->may = isl_map_union(mm->may, dep); - return 0; + return isl_stat_ok; } static int common_space(void *first, void *second) @@ -1772,7 +2124,7 @@ return 0; } -void test_dep(struct isl_ctx *ctx) +static int test_dep(struct isl_ctx *ctx) { const char *str; isl_space *dim; @@ -1958,89 +2310,135 @@ isl_map_free(mm.must); isl_map_free(mm.may); isl_flow_free(flow); + + return 0; } -int test_sv(isl_ctx *ctx) +/* Check that the dependence analysis proceeds without errors. + * Earlier versions of isl would break down during the analysis + * due to the use of the wrong spaces. + */ +static int test_flow(isl_ctx *ctx) { const char *str; - isl_map *map; - isl_union_map *umap; - int sv; + isl_union_map *access, *schedule; + isl_union_map *must_dep, *may_dep; + int r; + + str = "{ S0[j] -> i[]; S1[j,i] -> i[]; S2[] -> i[]; S3[] -> i[] }"; + access = isl_union_map_read_from_str(ctx, str); + str = "{ S0[j] -> [0,j,0,0] : 0 <= j < 10; " + "S1[j,i] -> [0,j,1,i] : 0 <= j < i < 10; " + "S2[] -> [1,0,0,0]; " + "S3[] -> [-1,0,0,0] }"; + schedule = isl_union_map_read_from_str(ctx, str); + r = isl_union_map_compute_flow(access, isl_union_map_copy(access), + isl_union_map_copy(access), schedule, + &must_dep, &may_dep, NULL, NULL); + isl_union_map_free(may_dep); + isl_union_map_free(must_dep); - str = "[N] -> { [i] -> [f] : 0 <= i <= N and 0 <= i - 10 f <= 9 }"; - map = isl_map_read_from_str(ctx, str); - sv = isl_map_is_single_valued(map); - isl_map_free(map); - if (sv < 0) - return -1; - if (!sv) - isl_die(ctx, isl_error_internal, - "map not detected as single valued", return -1); + return r; +} - str = "[N] -> { [i] -> [f] : 0 <= i <= N and 0 <= i - 10 f <= 10 }"; - map = isl_map_read_from_str(ctx, str); - sv = isl_map_is_single_valued(map); - isl_map_free(map); - if (sv < 0) - return -1; - if (sv) - isl_die(ctx, isl_error_internal, - "map detected as single valued", return -1); +struct { + const char *map; + int sv; +} sv_tests[] = { + { "[N] -> { [i] -> [f] : 0 <= i <= N and 0 <= i - 10 f <= 9 }", 1 }, + { "[N] -> { [i] -> [f] : 0 <= i <= N and 0 <= i - 10 f <= 10 }", 0 }, + { "{ [i] -> [3*floor(i/2) + 5*floor(i/3)] }", 1 }, + { "{ S1[i] -> [i] : 0 <= i <= 9; S2[i] -> [i] : 0 <= i <= 9 }", 1 }, + { "{ [i] -> S1[i] : 0 <= i <= 9; [i] -> S2[i] : 0 <= i <= 9 }", 0 }, + { "{ A[i] -> [i]; B[i] -> [i]; B[i] -> [i + 1] }", 0 }, + { "{ A[i] -> [i]; B[i] -> [i] : i < 0; B[i] -> [i + 1] : i > 0 }", 1 }, + { "{ A[i] -> [i]; B[i] -> A[i] : i < 0; B[i] -> [i + 1] : i > 0 }", 1 }, + { "{ A[i] -> [i]; B[i] -> [j] : i - 1 <= j <= i }", 0 }, +}; - str = "{ S1[i] -> [i] : 0 <= i <= 9; S2[i] -> [i] : 0 <= i <= 9 }"; - umap = isl_union_map_read_from_str(ctx, str); - sv = isl_union_map_is_single_valued(umap); - isl_union_map_free(umap); - if (sv < 0) - return -1; - if (!sv) - isl_die(ctx, isl_error_internal, - "map not detected as single valued", return -1); +int test_sv(isl_ctx *ctx) +{ + isl_union_map *umap; + int i; + int sv; - str = "{ [i] -> S1[i] : 0 <= i <= 9; [i] -> S2[i] : 0 <= i <= 9 }"; - umap = isl_union_map_read_from_str(ctx, str); - sv = isl_union_map_is_single_valued(umap); - isl_union_map_free(umap); - if (sv < 0) - return -1; - if (sv) - isl_die(ctx, isl_error_internal, - "map detected as single valued", return -1); + for (i = 0; i < ARRAY_SIZE(sv_tests); ++i) { + umap = isl_union_map_read_from_str(ctx, sv_tests[i].map); + sv = isl_union_map_is_single_valued(umap); + isl_union_map_free(umap); + if (sv < 0) + return -1; + if (sv_tests[i].sv && !sv) + isl_die(ctx, isl_error_internal, + "map not detected as single valued", return -1); + if (!sv_tests[i].sv && sv) + isl_die(ctx, isl_error_internal, + "map detected as single valued", return -1); + } return 0; } -void test_bijective_case(struct isl_ctx *ctx, const char *str, int bijective) +struct { + const char *str; + int bijective; +} bijective_tests[] = { + { "[N,M]->{[i,j] -> [i]}", 0 }, + { "[N,M]->{[i,j] -> [i] : j=i}", 1 }, + { "[N,M]->{[i,j] -> [i] : j=0}", 1 }, + { "[N,M]->{[i,j] -> [i] : j=N}", 1 }, + { "[N,M]->{[i,j] -> [j,i]}", 1 }, + { "[N,M]->{[i,j] -> [i+j]}", 0 }, + { "[N,M]->{[i,j] -> []}", 0 }, + { "[N,M]->{[i,j] -> [i,j,N]}", 1 }, + { "[N,M]->{[i,j] -> [2i]}", 0 }, + { "[N,M]->{[i,j] -> [i,i]}", 0 }, + { "[N,M]->{[i,j] -> [2i,i]}", 0 }, + { "[N,M]->{[i,j] -> [2i,j]}", 1 }, + { "[N,M]->{[i,j] -> [x,y] : 2x=i & y =j}", 1 }, +}; + +static int test_bijective(struct isl_ctx *ctx) { isl_map *map; + int i; + int bijective; - map = isl_map_read_from_str(ctx, str); - if (bijective) - assert(isl_map_is_bijective(map)); - else - assert(!isl_map_is_bijective(map)); - isl_map_free(map); -} + for (i = 0; i < ARRAY_SIZE(bijective_tests); ++i) { + map = isl_map_read_from_str(ctx, bijective_tests[i].str); + bijective = isl_map_is_bijective(map); + isl_map_free(map); + if (bijective < 0) + return -1; + if (bijective_tests[i].bijective && !bijective) + isl_die(ctx, isl_error_internal, + "map not detected as bijective", return -1); + if (!bijective_tests[i].bijective && bijective) + isl_die(ctx, isl_error_internal, + "map detected as bijective", return -1); + } -void test_bijective(struct isl_ctx *ctx) -{ - test_bijective_case(ctx, "[N,M]->{[i,j] -> [i]}", 0); - test_bijective_case(ctx, "[N,M]->{[i,j] -> [i] : j=i}", 1); - test_bijective_case(ctx, "[N,M]->{[i,j] -> [i] : j=0}", 1); - test_bijective_case(ctx, "[N,M]->{[i,j] -> [i] : j=N}", 1); - test_bijective_case(ctx, "[N,M]->{[i,j] -> [j,i]}", 1); - test_bijective_case(ctx, "[N,M]->{[i,j] -> [i+j]}", 0); - test_bijective_case(ctx, "[N,M]->{[i,j] -> []}", 0); - test_bijective_case(ctx, "[N,M]->{[i,j] -> [i,j,N]}", 1); - test_bijective_case(ctx, "[N,M]->{[i,j] -> [2i]}", 0); - test_bijective_case(ctx, "[N,M]->{[i,j] -> [i,i]}", 0); - test_bijective_case(ctx, "[N,M]->{[i,j] -> [2i,i]}", 0); - test_bijective_case(ctx, "[N,M]->{[i,j] -> [2i,j]}", 1); - test_bijective_case(ctx, "[N,M]->{[i,j] -> [x,y] : 2x=i & y =j}", 1); + return 0; } +/* Inputs for isl_pw_qpolynomial_gist tests. + * "pwqp" is the input, "set" is the context and "gist" is the expected result. + */ +struct { + const char *pwqp; + const char *set; + const char *gist; +} pwqp_gist_tests[] = { + { "{ [i] -> i }", "{ [k] : exists a : k = 2a }", "{ [i] -> i }" }, + { "{ [i] -> i + [ (i + [i/3])/2 ] }", "{ [10] }", "{ [i] -> 16 }" }, + { "{ [i] -> ([(i)/2]) }", "{ [k] : exists a : k = 2a+1 }", + "{ [i] -> -1/2 + 1/2 * i }" }, + { "{ [i] -> i^2 : i != 0 }", "{ [i] : i != 0 }", "{ [i] -> i^2 }" }, +}; + static int test_pwqp(struct isl_ctx *ctx) { + int i; const char *str; isl_set *set; isl_pw_qpolynomial *pwqp1, *pwqp2; @@ -2061,47 +2459,24 @@ isl_pw_qpolynomial_free(pwqp1); - str = "{ [i] -> i }"; - pwqp1 = isl_pw_qpolynomial_read_from_str(ctx, str); - str = "{ [k] : exists a : k = 2a }"; - set = isl_set_read_from_str(ctx, str); - pwqp1 = isl_pw_qpolynomial_gist(pwqp1, set); - str = "{ [i] -> i }"; - pwqp2 = isl_pw_qpolynomial_read_from_str(ctx, str); - - pwqp1 = isl_pw_qpolynomial_sub(pwqp1, pwqp2); - - assert(isl_pw_qpolynomial_is_zero(pwqp1)); - - isl_pw_qpolynomial_free(pwqp1); - - str = "{ [i] -> i + [ (i + [i/3])/2 ] }"; - pwqp1 = isl_pw_qpolynomial_read_from_str(ctx, str); - str = "{ [10] }"; - set = isl_set_read_from_str(ctx, str); - pwqp1 = isl_pw_qpolynomial_gist(pwqp1, set); - str = "{ [i] -> 16 }"; - pwqp2 = isl_pw_qpolynomial_read_from_str(ctx, str); - - pwqp1 = isl_pw_qpolynomial_sub(pwqp1, pwqp2); - - assert(isl_pw_qpolynomial_is_zero(pwqp1)); - - isl_pw_qpolynomial_free(pwqp1); - - str = "{ [i] -> ([(i)/2]) }"; - pwqp1 = isl_pw_qpolynomial_read_from_str(ctx, str); - str = "{ [k] : exists a : k = 2a+1 }"; - set = isl_set_read_from_str(ctx, str); - pwqp1 = isl_pw_qpolynomial_gist(pwqp1, set); - str = "{ [i] -> -1/2 + 1/2 * i }"; - pwqp2 = isl_pw_qpolynomial_read_from_str(ctx, str); - - pwqp1 = isl_pw_qpolynomial_sub(pwqp1, pwqp2); - - assert(isl_pw_qpolynomial_is_zero(pwqp1)); + for (i = 0; i < ARRAY_SIZE(pwqp_gist_tests); ++i) { + str = pwqp_gist_tests[i].pwqp; + pwqp1 = isl_pw_qpolynomial_read_from_str(ctx, str); + str = pwqp_gist_tests[i].set; + set = isl_set_read_from_str(ctx, str); + pwqp1 = isl_pw_qpolynomial_gist(pwqp1, set); + str = pwqp_gist_tests[i].gist; + pwqp2 = isl_pw_qpolynomial_read_from_str(ctx, str); + pwqp1 = isl_pw_qpolynomial_sub(pwqp1, pwqp2); + equal = isl_pw_qpolynomial_is_zero(pwqp1); + isl_pw_qpolynomial_free(pwqp1); - isl_pw_qpolynomial_free(pwqp1); + if (equal < 0) + return -1; + if (!equal) + isl_die(ctx, isl_error_unknown, + "unexpected result", return -1); + } str = "{ [i] -> ([([i/2] + [i/2])/5]) }"; pwqp1 = isl_pw_qpolynomial_read_from_str(ctx, str); @@ -2164,7 +2539,7 @@ return 0; } -void test_split_periods(isl_ctx *ctx) +static int test_split_periods(isl_ctx *ctx) { const char *str; isl_pw_qpolynomial *pwqp; @@ -2175,16 +2550,21 @@ pwqp = isl_pw_qpolynomial_read_from_str(ctx, str); pwqp = isl_pw_qpolynomial_split_periods(pwqp, 2); - assert(pwqp); isl_pw_qpolynomial_free(pwqp); + + if (!pwqp) + return -1; + + return 0; } -void test_union(isl_ctx *ctx) +static int test_union(isl_ctx *ctx) { const char *str; isl_union_set *uset1, *uset2; isl_union_map *umap1, *umap2; + int equal; str = "{ [i] : 0 <= i <= 1 }"; uset1 = isl_union_set_read_from_str(ctx, str); @@ -2192,11 +2572,17 @@ umap1 = isl_union_map_read_from_str(ctx, str); umap2 = isl_union_set_lex_gt_union_set(isl_union_set_copy(uset1), uset1); - assert(isl_union_map_is_equal(umap1, umap2)); + equal = isl_union_map_is_equal(umap1, umap2); isl_union_map_free(umap1); isl_union_map_free(umap2); + if (equal < 0) + return -1; + if (!equal) + isl_die(ctx, isl_error_unknown, "union maps not equal", + return -1); + str = "{ A[i] -> B[i]; B[i] -> C[i]; A[0] -> C[1] }"; umap1 = isl_union_map_read_from_str(ctx, str); str = "{ A[i]; B[i] }"; @@ -2204,32 +2590,85 @@ uset2 = isl_union_map_domain(umap1); - assert(isl_union_set_is_equal(uset1, uset2)); + equal = isl_union_set_is_equal(uset1, uset2); isl_union_set_free(uset1); isl_union_set_free(uset2); + + if (equal < 0) + return -1; + if (!equal) + isl_die(ctx, isl_error_unknown, "union sets not equal", + return -1); + + return 0; +} + +/* Check that computing a bound of a non-zero polynomial over an unbounded + * domain does not produce a rational value. + * Ideally, we want the value to be infinity, but we accept NaN for now. + * We certainly do not want to obtain the value zero. + */ +static int test_bound_unbounded_domain(isl_ctx *ctx) +{ + const char *str; + isl_set *dom; + isl_point *pnt; + isl_pw_qpolynomial *pwqp; + isl_pw_qpolynomial_fold *pwf; + isl_val *v; + int is_rat; + + str = "{ [m,n] -> -m * n }"; + pwqp = isl_pw_qpolynomial_read_from_str(ctx, str); + pwf = isl_pw_qpolynomial_bound(pwqp, isl_fold_max, NULL); + dom = isl_pw_qpolynomial_fold_domain(isl_pw_qpolynomial_fold_copy(pwf)); + pnt = isl_set_sample_point(dom); + v = isl_pw_qpolynomial_fold_eval(pwf, pnt); + is_rat = isl_val_is_rat(v); + isl_val_free(v); + + if (is_rat < 0) + return -1; + if (is_rat) + isl_die(ctx, isl_error_unknown, + "unexpected rational value", return -1); + + return 0; } -void test_bound(isl_ctx *ctx) +static int test_bound(isl_ctx *ctx) { const char *str; + unsigned dim; isl_pw_qpolynomial *pwqp; isl_pw_qpolynomial_fold *pwf; + if (test_bound_unbounded_domain(ctx) < 0) + return -1; + str = "{ [[a, b, c, d] -> [e]] -> 0 }"; pwqp = isl_pw_qpolynomial_read_from_str(ctx, str); pwf = isl_pw_qpolynomial_bound(pwqp, isl_fold_max, NULL); - assert(isl_pw_qpolynomial_fold_dim(pwf, isl_dim_in) == 4); + dim = isl_pw_qpolynomial_fold_dim(pwf, isl_dim_in); isl_pw_qpolynomial_fold_free(pwf); + if (dim != 4) + isl_die(ctx, isl_error_unknown, "unexpected input dimension", + return -1); str = "{ [[x]->[x]] -> 1 : exists a : x = 2 a }"; pwqp = isl_pw_qpolynomial_read_from_str(ctx, str); pwf = isl_pw_qpolynomial_bound(pwqp, isl_fold_max, NULL); - assert(isl_pw_qpolynomial_fold_dim(pwf, isl_dim_in) == 1); + dim = isl_pw_qpolynomial_fold_dim(pwf, isl_dim_in); isl_pw_qpolynomial_fold_free(pwf); + if (dim != 1) + isl_die(ctx, isl_error_unknown, "unexpected input dimension", + return -1); + + return 0; } -void test_lift(isl_ctx *ctx) +static int test_lift(isl_ctx *ctx) { const char *str; isl_basic_map *bmap; @@ -2241,6 +2680,8 @@ bmap = isl_basic_map_from_range(bset); bset = isl_basic_map_domain(bmap); isl_basic_set_free(bset); + + return 0; } struct { @@ -2266,6 +2707,18 @@ { "{ rat: [i] : 0 <= i <= 10 }", "{ [i] : 0 <= i <= 10 }", 0 }, { "{ rat: [0] }", "{ [i] : 0 <= i <= 10 }", 1 }, { "{ rat: [(1)/2] }", "{ [i] : 0 <= i <= 10 }", 0 }, + { "{ [t, i] : (exists (e0 = [(2 + t)/4]: 4e0 <= 2 + t and " + "4e0 >= -1 + t and i >= 57 and i <= 62 and " + "4e0 <= 62 + t - i and 4e0 >= -61 + t + i and " + "t >= 0 and t <= 511 and 4e0 <= -57 + t + i and " + "4e0 >= 58 + t - i and i >= 58 + t and i >= 62 - t)) }", + "{ [i0, i1] : (exists (e0 = [(4 + i0)/4]: 4e0 <= 62 + i0 - i1 and " + "4e0 >= 1 + i0 and i0 >= 0 and i0 <= 511 and " + "4e0 <= -57 + i0 + i1)) or " + "(exists (e0 = [(2 + i0)/4]: 4e0 <= i0 and " + "4e0 >= 58 + i0 - i1 and i0 >= 2 and i0 <= 511 and " + "4e0 >= -61 + i0 + i1)) or " + "(i1 <= 66 - i0 and i0 >= 2 and i1 >= 59 + i0) }", 1 }, }; static int test_subset(isl_ctx *ctx) @@ -2304,6 +2757,7 @@ { int i; isl_union_map *umap1, *umap2; + isl_union_pw_multi_aff *upma1, *upma2; isl_union_set *uset; int equal; @@ -2325,6 +2779,24 @@ "incorrect subtract domain result", return -1); } + for (i = 0; i < ARRAY_SIZE(subtract_domain_tests); ++i) { + upma1 = isl_union_pw_multi_aff_read_from_str(ctx, + subtract_domain_tests[i].minuend); + uset = isl_union_set_read_from_str(ctx, + subtract_domain_tests[i].subtrahend); + upma2 = isl_union_pw_multi_aff_read_from_str(ctx, + subtract_domain_tests[i].difference); + upma1 = isl_union_pw_multi_aff_subtract_domain(upma1, uset); + equal = isl_union_pw_multi_aff_plain_is_equal(upma1, upma2); + isl_union_pw_multi_aff_free(upma1); + isl_union_pw_multi_aff_free(upma2); + if (equal < 0) + return -1; + if (!equal) + isl_die(ctx, isl_error_unknown, + "incorrect subtract domain result", return -1); + } + return 0; } @@ -2370,7 +2842,7 @@ return 0; } -static int check_injective(__isl_take isl_map *map, void *user) +static isl_stat check_injective(__isl_take isl_map *map, void *user) { int *injective = user; @@ -2378,9 +2850,9 @@ isl_map_free(map); if (*injective < 0 || !*injective) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } int test_one_schedule(isl_ctx *ctx, const char *d, const char *w, @@ -2391,7 +2863,7 @@ isl_union_map *W, *R, *S; isl_union_map *empty; isl_union_map *dep_raw, *dep_war, *dep_waw, *dep; - isl_union_map *validity, *proximity; + isl_union_map *validity, *proximity, *coincidence; isl_union_map *schedule; isl_union_map *test; isl_union_set *delta; @@ -2399,6 +2871,7 @@ isl_set *delta_set; isl_set *slice; isl_set *origin; + isl_schedule_constraints *sc; isl_schedule *sched; int is_nonneg, is_parallel, is_tilable, is_injection, is_complete; @@ -2424,10 +2897,14 @@ dep = isl_union_map_union(dep_waw, dep_war); dep = isl_union_map_union(dep, dep_raw); validity = isl_union_map_copy(dep); + coincidence = isl_union_map_copy(dep); proximity = isl_union_map_copy(dep); - sched = isl_union_set_compute_schedule(isl_union_set_copy(D), - validity, proximity); + sc = isl_schedule_constraints_on_domain(isl_union_set_copy(D)); + sc = isl_schedule_constraints_set_validity(sc, validity); + sc = isl_schedule_constraints_set_coincidence(sc, coincidence); + sc = isl_schedule_constraints_set_proximity(sc, proximity); + sched = isl_schedule_constraints_compute_schedule(sc); schedule = isl_schedule_get_map(sched); isl_schedule_free(sched); isl_union_map_free(W); @@ -2506,25 +2983,47 @@ return 0; } -static __isl_give isl_union_map *compute_schedule(isl_ctx *ctx, - const char *domain, const char *validity, const char *proximity) +/* Compute a schedule for the given instance set, validity constraints, + * proximity constraints and context and return a corresponding union map + * representation. + */ +static __isl_give isl_union_map *compute_schedule_with_context(isl_ctx *ctx, + const char *domain, const char *validity, const char *proximity, + const char *context) { + isl_set *con; isl_union_set *dom; isl_union_map *dep; isl_union_map *prox; + isl_schedule_constraints *sc; isl_schedule *schedule; isl_union_map *sched; + con = isl_set_read_from_str(ctx, context); dom = isl_union_set_read_from_str(ctx, domain); dep = isl_union_map_read_from_str(ctx, validity); prox = isl_union_map_read_from_str(ctx, proximity); - schedule = isl_union_set_compute_schedule(dom, dep, prox); + sc = isl_schedule_constraints_on_domain(dom); + sc = isl_schedule_constraints_set_context(sc, con); + sc = isl_schedule_constraints_set_validity(sc, dep); + sc = isl_schedule_constraints_set_proximity(sc, prox); + schedule = isl_schedule_constraints_compute_schedule(sc); sched = isl_schedule_get_map(schedule); isl_schedule_free(schedule); return sched; } +/* Compute a schedule for the given instance set, validity constraints and + * proximity constraints and return a corresponding union map representation. + */ +static __isl_give isl_union_map *compute_schedule(isl_ctx *ctx, + const char *domain, const char *validity, const char *proximity) +{ + return compute_schedule_with_context(ctx, domain, validity, proximity, + "{ : }"); +} + /* Check that a schedule can be constructed on the given domain * with the given validity and proximity constraints. */ @@ -2571,6 +3070,7 @@ const char *str; isl_union_set *D; isl_union_map *validity, *proximity; + isl_schedule_constraints *sc; isl_schedule *sched; isl_union_map *map1, *map2; isl_band_list *list; @@ -2580,7 +3080,10 @@ D = isl_union_set_read_from_str(ctx, str); validity = isl_union_map_empty(isl_union_set_get_space(D)); proximity = isl_union_map_copy(validity); - sched = isl_union_set_compute_schedule(D, validity, proximity); + sc = isl_schedule_constraints_on_domain(D); + sc = isl_schedule_constraints_set_validity(sc, validity); + sc = isl_schedule_constraints_set_proximity(sc, proximity); + sched = isl_schedule_constraints_compute_schedule(sc); map1 = isl_schedule_get_map(sched); list = isl_schedule_get_band_forest(sched); isl_band_list_free(list); @@ -2600,6 +3103,319 @@ return 0; } +/* Check that conditional validity constraints are also taken into + * account across bands. + * In particular, try to make sure that live ranges D[1,0]->C[2,1] and + * D[2,0]->C[3,0] are not local in the outer band of the generated schedule + * and then check that the adjacent order constraint C[2,1]->D[2,0] + * is enforced by the rest of the schedule. + */ +static int test_special_conditional_schedule_constraints(isl_ctx *ctx) +{ + const char *str; + isl_union_set *domain; + isl_union_map *validity, *proximity, *condition; + isl_union_map *sink, *source, *dep; + isl_schedule_constraints *sc; + isl_schedule *schedule; + isl_union_access_info *access; + isl_union_flow *flow; + int empty; + + str = "[n] -> { C[k, i] : k <= -1 + n and i >= 0 and i <= -1 + k; " + "A[k] : k >= 1 and k <= -1 + n; " + "B[k, i] : k <= -1 + n and i >= 0 and i <= -1 + k; " + "D[k, i] : k <= -1 + n and i >= 0 and i <= -1 + k }"; + domain = isl_union_set_read_from_str(ctx, str); + sc = isl_schedule_constraints_on_domain(domain); + str = "[n] -> { D[k, i] -> C[1 + k, k - i] : " + "k <= -2 + n and i >= 1 and i <= -1 + k; " + "D[k, i] -> C[1 + k, i] : " + "k <= -2 + n and i >= 1 and i <= -1 + k; " + "D[k, 0] -> C[1 + k, k] : k >= 1 and k <= -2 + n; " + "D[k, 0] -> C[1 + k, 0] : k >= 1 and k <= -2 + n }"; + validity = isl_union_map_read_from_str(ctx, str); + sc = isl_schedule_constraints_set_validity(sc, validity); + str = "[n] -> { C[k, i] -> D[k, i] : " + "0 <= i <= -1 + k and k <= -1 + n }"; + proximity = isl_union_map_read_from_str(ctx, str); + sc = isl_schedule_constraints_set_proximity(sc, proximity); + str = "[n] -> { [D[k, i] -> a[]] -> [C[1 + k, k - i] -> b[]] : " + "i <= -1 + k and i >= 1 and k <= -2 + n; " + "[B[k, i] -> c[]] -> [B[k, 1 + i] -> c[]] : " + "k <= -1 + n and i >= 0 and i <= -2 + k }"; + condition = isl_union_map_read_from_str(ctx, str); + str = "[n] -> { [B[k, i] -> e[]] -> [D[k, i] -> a[]] : " + "i >= 0 and i <= -1 + k and k <= -1 + n; " + "[C[k, i] -> b[]] -> [D[k', -1 + k - i] -> a[]] : " + "i >= 0 and i <= -1 + k and k <= -1 + n and " + "k' <= -1 + n and k' >= k - i and k' >= 1 + k; " + "[C[k, i] -> b[]] -> [D[k, -1 + k - i] -> a[]] : " + "i >= 0 and i <= -1 + k and k <= -1 + n; " + "[B[k, i] -> c[]] -> [A[k'] -> d[]] : " + "k <= -1 + n and i >= 0 and i <= -1 + k and " + "k' >= 1 and k' <= -1 + n and k' >= 1 + k }"; + validity = isl_union_map_read_from_str(ctx, str); + sc = isl_schedule_constraints_set_conditional_validity(sc, condition, + validity); + schedule = isl_schedule_constraints_compute_schedule(sc); + str = "{ D[2,0] -> [] }"; + sink = isl_union_map_read_from_str(ctx, str); + access = isl_union_access_info_from_sink(sink); + str = "{ C[2,1] -> [] }"; + source = isl_union_map_read_from_str(ctx, str); + access = isl_union_access_info_set_must_source(access, source); + access = isl_union_access_info_set_schedule(access, schedule); + flow = isl_union_access_info_compute_flow(access); + dep = isl_union_flow_get_must_dependence(flow); + isl_union_flow_free(flow); + empty = isl_union_map_is_empty(dep); + isl_union_map_free(dep); + + if (empty < 0) + return -1; + if (empty) + isl_die(ctx, isl_error_unknown, + "conditional validity not respected", return -1); + + return 0; +} + +/* Input for testing of schedule construction based on + * conditional constraints. + * + * domain is the iteration domain + * flow are the flow dependences, which determine the validity and + * proximity constraints + * condition are the conditions on the conditional validity constraints + * conditional_validity are the conditional validity constraints + * outer_band_n is the expected number of members in the outer band + */ +struct { + const char *domain; + const char *flow; + const char *condition; + const char *conditional_validity; + int outer_band_n; +} live_range_tests[] = { + /* Contrived example that illustrates that we need to keep + * track of tagged condition dependences and + * tagged conditional validity dependences + * in isl_sched_edge separately. + * In particular, the conditional validity constraints on A + * cannot be satisfied, + * but they can be ignored because there are no corresponding + * condition constraints. However, we do have an additional + * conditional validity constraint that maps to the same + * dependence relation + * as the condition constraint on B. If we did not make a distinction + * between tagged condition and tagged conditional validity + * dependences, then we + * could end up treating this shared dependence as an condition + * constraint on A, forcing a localization of the conditions, + * which is impossible. + */ + { "{ S[i] : 0 <= 1 < 100; T[i] : 0 <= 1 < 100 }", + "{ S[i] -> S[i+1] : 0 <= i < 99 }", + "{ [S[i] -> B[]] -> [S[i+1] -> B[]] : 0 <= i < 99 }", + "{ [S[i] -> A[]] -> [T[i'] -> A[]] : 0 <= i', i < 100 and i != i';" + "[T[i] -> A[]] -> [S[i'] -> A[]] : 0 <= i', i < 100 and i != i';" + "[S[i] -> A[]] -> [S[i+1] -> A[]] : 0 <= i < 99 }", + 1 + }, + /* TACO 2013 Fig. 7 */ + { "[n] -> { S1[i,j] : 0 <= i,j < n; S2[i,j] : 0 <= i,j < n }", + "[n] -> { S1[i,j] -> S2[i,j] : 0 <= i,j < n;" + "S2[i,j] -> S2[i,j+1] : 0 <= i < n and 0 <= j < n - 1 }", + "[n] -> { [S1[i,j] -> t[]] -> [S2[i,j] -> t[]] : 0 <= i,j < n;" + "[S2[i,j] -> x1[]] -> [S2[i,j+1] -> x1[]] : " + "0 <= i < n and 0 <= j < n - 1 }", + "[n] -> { [S2[i,j] -> t[]] -> [S1[i,j'] -> t[]] : " + "0 <= i < n and 0 <= j < j' < n;" + "[S2[i,j] -> t[]] -> [S1[i',j'] -> t[]] : " + "0 <= i < i' < n and 0 <= j,j' < n;" + "[S2[i,j] -> x1[]] -> [S2[i,j'] -> x1[]] : " + "0 <= i,j,j' < n and j < j' }", + 2 + }, + /* TACO 2013 Fig. 7, without tags */ + { "[n] -> { S1[i,j] : 0 <= i,j < n; S2[i,j] : 0 <= i,j < n }", + "[n] -> { S1[i,j] -> S2[i,j] : 0 <= i,j < n;" + "S2[i,j] -> S2[i,j+1] : 0 <= i < n and 0 <= j < n - 1 }", + "[n] -> { S1[i,j] -> S2[i,j] : 0 <= i,j < n;" + "S2[i,j] -> S2[i,j+1] : 0 <= i < n and 0 <= j < n - 1 }", + "[n] -> { S2[i,j] -> S1[i,j'] : 0 <= i < n and 0 <= j < j' < n;" + "S2[i,j] -> S1[i',j'] : 0 <= i < i' < n and 0 <= j,j' < n;" + "S2[i,j] -> S2[i,j'] : 0 <= i,j,j' < n and j < j' }", + 1 + }, + /* TACO 2013 Fig. 12 */ + { "{ S1[i,0] : 0 <= i <= 1; S2[i,j] : 0 <= i <= 1 and 1 <= j <= 2;" + "S3[i,3] : 0 <= i <= 1 }", + "{ S1[i,0] -> S2[i,1] : 0 <= i <= 1;" + "S2[i,1] -> S2[i,2] : 0 <= i <= 1;" + "S2[i,2] -> S3[i,3] : 0 <= i <= 1 }", + "{ [S1[i,0]->t[]] -> [S2[i,1]->t[]] : 0 <= i <= 1;" + "[S2[i,1]->t[]] -> [S2[i,2]->t[]] : 0 <= i <= 1;" + "[S2[i,2]->t[]] -> [S3[i,3]->t[]] : 0 <= i <= 1 }", + "{ [S2[i,1]->t[]] -> [S2[i,2]->t[]] : 0 <= i <= 1;" + "[S2[0,j]->t[]] -> [S2[1,j']->t[]] : 1 <= j,j' <= 2;" + "[S2[0,j]->t[]] -> [S1[1,0]->t[]] : 1 <= j <= 2;" + "[S3[0,3]->t[]] -> [S2[1,j]->t[]] : 1 <= j <= 2;" + "[S3[0,3]->t[]] -> [S1[1,0]->t[]] }", + 1 + } +}; + +/* Test schedule construction based on conditional constraints. + * In particular, check the number of members in the outer band node + * as an indication of whether tiling is possible or not. + */ +static int test_conditional_schedule_constraints(isl_ctx *ctx) +{ + int i; + isl_union_set *domain; + isl_union_map *condition; + isl_union_map *flow; + isl_union_map *validity; + isl_schedule_constraints *sc; + isl_schedule *schedule; + isl_schedule_node *node; + int n_member; + + if (test_special_conditional_schedule_constraints(ctx) < 0) + return -1; + + for (i = 0; i < ARRAY_SIZE(live_range_tests); ++i) { + domain = isl_union_set_read_from_str(ctx, + live_range_tests[i].domain); + flow = isl_union_map_read_from_str(ctx, + live_range_tests[i].flow); + condition = isl_union_map_read_from_str(ctx, + live_range_tests[i].condition); + validity = isl_union_map_read_from_str(ctx, + live_range_tests[i].conditional_validity); + sc = isl_schedule_constraints_on_domain(domain); + sc = isl_schedule_constraints_set_validity(sc, + isl_union_map_copy(flow)); + sc = isl_schedule_constraints_set_proximity(sc, flow); + sc = isl_schedule_constraints_set_conditional_validity(sc, + condition, validity); + schedule = isl_schedule_constraints_compute_schedule(sc); + node = isl_schedule_get_root(schedule); + while (node && + isl_schedule_node_get_type(node) != isl_schedule_node_band) + node = isl_schedule_node_first_child(node); + n_member = isl_schedule_node_band_n_member(node); + isl_schedule_node_free(node); + isl_schedule_free(schedule); + + if (!schedule) + return -1; + if (n_member != live_range_tests[i].outer_band_n) + isl_die(ctx, isl_error_unknown, + "unexpected number of members in outer band", + return -1); + } + return 0; +} + +/* Check that the schedule computed for the given instance set and + * dependence relation strongly satisfies the dependences. + * In particular, check that no instance is scheduled before + * or together with an instance on which it depends. + * Earlier versions of isl would produce a schedule that + * only weakly satisfies the dependences. + */ +static int test_strongly_satisfying_schedule(isl_ctx *ctx) +{ + const char *domain, *dep; + isl_union_map *D, *schedule; + isl_map *map, *ge; + int empty; + + domain = "{ B[i0, i1] : 0 <= i0 <= 1 and 0 <= i1 <= 11; " + "A[i0] : 0 <= i0 <= 1 }"; + dep = "{ B[i0, i1] -> B[i0, 1 + i1] : 0 <= i0 <= 1 and 0 <= i1 <= 10; " + "B[0, 11] -> A[1]; A[i0] -> B[i0, 0] : 0 <= i0 <= 1 }"; + schedule = compute_schedule(ctx, domain, dep, dep); + D = isl_union_map_read_from_str(ctx, dep); + D = isl_union_map_apply_domain(D, isl_union_map_copy(schedule)); + D = isl_union_map_apply_range(D, schedule); + map = isl_map_from_union_map(D); + ge = isl_map_lex_ge(isl_space_domain(isl_map_get_space(map))); + map = isl_map_intersect(map, ge); + empty = isl_map_is_empty(map); + isl_map_free(map); + + if (empty < 0) + return -1; + if (!empty) + isl_die(ctx, isl_error_unknown, + "dependences not strongly satisfied", return -1); + + return 0; +} + +/* Compute a schedule for input where the instance set constraints + * conflict with the context constraints. + * Earlier versions of isl did not properly handle this situation. + */ +static int test_conflicting_context_schedule(isl_ctx *ctx) +{ + isl_union_map *schedule; + const char *domain, *context; + + domain = "[n] -> { A[] : n >= 0 }"; + context = "[n] -> { : n < 0 }"; + schedule = compute_schedule_with_context(ctx, + domain, "{}", "{}", context); + isl_union_map_free(schedule); + + if (!schedule) + return -1; + + return 0; +} + +/* Check that the dependence carrying step is not confused by + * a bound on the coefficient size. + * In particular, force the scheduler to move to a dependence carrying + * step by demanding outer coincidence and bound the size of + * the coefficients. Earlier versions of isl would take this + * bound into account while carrying dependences, breaking + * fundamental assumptions. + */ +static int test_bounded_coefficients_schedule(isl_ctx *ctx) +{ + const char *domain, *dep; + isl_union_set *I; + isl_union_map *D; + isl_schedule_constraints *sc; + isl_schedule *schedule; + + domain = "{ C[i0, i1] : 2 <= i0 <= 3999 and 0 <= i1 <= -1 + i0 }"; + dep = "{ C[i0, i1] -> C[i0, 1 + i1] : i0 <= 3999 and i1 >= 0 and " + "i1 <= -2 + i0; " + "C[i0, -1 + i0] -> C[1 + i0, 0] : i0 <= 3998 and i0 >= 1 }"; + I = isl_union_set_read_from_str(ctx, domain); + D = isl_union_map_read_from_str(ctx, dep); + sc = isl_schedule_constraints_on_domain(I); + sc = isl_schedule_constraints_set_validity(sc, isl_union_map_copy(D)); + sc = isl_schedule_constraints_set_coincidence(sc, D); + isl_options_set_schedule_outer_coincidence(ctx, 1); + isl_options_set_schedule_max_coefficient(ctx, 20); + schedule = isl_schedule_constraints_compute_schedule(sc); + isl_options_set_schedule_max_coefficient(ctx, -1); + isl_options_set_schedule_outer_coincidence(ctx, 0); + isl_schedule_free(schedule); + + if (!schedule) + return -1; + + return 0; +} + int test_schedule(isl_ctx *ctx) { const char *D, *W, *R, *V, *P, *S; @@ -2768,10 +3584,10 @@ "S_0[j, k] -> A[k] : j <= -1 + n and j >= 0 and " "k <= -1 + n and k >= 0 }"; S = "[n] -> { S_0[j, k] -> [2, j, k] }"; - ctx->opt->schedule_outer_zero_distance = 1; + ctx->opt->schedule_outer_coincidence = 1; if (test_one_schedule(ctx, D, W, R, S, 0, 0) < 0) return -1; - ctx->opt->schedule_outer_zero_distance = 0; + ctx->opt->schedule_outer_coincidence = 0; D = "{Stmt_for_body24[i0, i1, i2, i3]:" "i0 >= 0 and i0 <= 1 and i1 >= 0 and i1 <= 6 and i2 >= 2 and " @@ -2877,6 +3693,30 @@ return -1; ctx->opt->schedule_algorithm = ISL_SCHEDULE_ALGORITHM_ISL; + /* Check that we allow schedule rows that are only non-trivial + * on some full-dimensional domains. + */ + D = "{ S1[j] : 0 <= j <= 1; S0[]; S2[k] : 0 <= k <= 1 }"; + V = "{ S0[] -> S1[j] : 0 <= j <= 1; S2[0] -> S0[];" + "S1[j] -> S2[1] : 0 <= j <= 1 }"; + P = "{}"; + ctx->opt->schedule_algorithm = ISL_SCHEDULE_ALGORITHM_FEAUTRIER; + if (test_has_schedule(ctx, D, V, P) < 0) + return -1; + ctx->opt->schedule_algorithm = ISL_SCHEDULE_ALGORITHM_ISL; + + if (test_conditional_schedule_constraints(ctx) < 0) + return -1; + + if (test_strongly_satisfying_schedule(ctx) < 0) + return -1; + + if (test_conflicting_context_schedule(ctx) < 0) + return -1; + + if (test_bounded_coefficients_schedule(ctx) < 0) + return -1; + return 0; } @@ -2959,6 +3799,137 @@ return 0; } +struct { + __isl_give isl_aff *(*fn)(__isl_take isl_aff *aff1, + __isl_take isl_aff *aff2); +} aff_bin_op[] = { + ['+'] = { &isl_aff_add }, + ['-'] = { &isl_aff_sub }, + ['*'] = { &isl_aff_mul }, + ['/'] = { &isl_aff_div }, +}; + +struct { + const char *arg1; + unsigned char op; + const char *arg2; + const char *res; +} aff_bin_tests[] = { + { "{ [i] -> [i] }", '+', "{ [i] -> [i] }", + "{ [i] -> [2i] }" }, + { "{ [i] -> [i] }", '-', "{ [i] -> [i] }", + "{ [i] -> [0] }" }, + { "{ [i] -> [i] }", '*', "{ [i] -> [2] }", + "{ [i] -> [2i] }" }, + { "{ [i] -> [2] }", '*', "{ [i] -> [i] }", + "{ [i] -> [2i] }" }, + { "{ [i] -> [i] }", '/', "{ [i] -> [2] }", + "{ [i] -> [i/2] }" }, + { "{ [i] -> [2i] }", '/', "{ [i] -> [2] }", + "{ [i] -> [i] }" }, + { "{ [i] -> [i] }", '+', "{ [i] -> [NaN] }", + "{ [i] -> [NaN] }" }, + { "{ [i] -> [i] }", '-', "{ [i] -> [NaN] }", + "{ [i] -> [NaN] }" }, + { "{ [i] -> [i] }", '*', "{ [i] -> [NaN] }", + "{ [i] -> [NaN] }" }, + { "{ [i] -> [2] }", '*', "{ [i] -> [NaN] }", + "{ [i] -> [NaN] }" }, + { "{ [i] -> [i] }", '/', "{ [i] -> [NaN] }", + "{ [i] -> [NaN] }" }, + { "{ [i] -> [2] }", '/', "{ [i] -> [NaN] }", + "{ [i] -> [NaN] }" }, + { "{ [i] -> [NaN] }", '+', "{ [i] -> [i] }", + "{ [i] -> [NaN] }" }, + { "{ [i] -> [NaN] }", '-', "{ [i] -> [i] }", + "{ [i] -> [NaN] }" }, + { "{ [i] -> [NaN] }", '*', "{ [i] -> [2] }", + "{ [i] -> [NaN] }" }, + { "{ [i] -> [NaN] }", '*', "{ [i] -> [i] }", + "{ [i] -> [NaN] }" }, + { "{ [i] -> [NaN] }", '/', "{ [i] -> [2] }", + "{ [i] -> [NaN] }" }, + { "{ [i] -> [NaN] }", '/', "{ [i] -> [i] }", + "{ [i] -> [NaN] }" }, +}; + +/* Perform some basic tests of binary operations on isl_aff objects. + */ +static int test_bin_aff(isl_ctx *ctx) +{ + int i; + isl_aff *aff1, *aff2, *res; + __isl_give isl_aff *(*fn)(__isl_take isl_aff *aff1, + __isl_take isl_aff *aff2); + int ok; + + for (i = 0; i < ARRAY_SIZE(aff_bin_tests); ++i) { + aff1 = isl_aff_read_from_str(ctx, aff_bin_tests[i].arg1); + aff2 = isl_aff_read_from_str(ctx, aff_bin_tests[i].arg2); + res = isl_aff_read_from_str(ctx, aff_bin_tests[i].res); + fn = aff_bin_op[aff_bin_tests[i].op].fn; + aff1 = fn(aff1, aff2); + if (isl_aff_is_nan(res)) + ok = isl_aff_is_nan(aff1); + else + ok = isl_aff_plain_is_equal(aff1, res); + isl_aff_free(aff1); + isl_aff_free(res); + if (ok < 0) + return -1; + if (!ok) + isl_die(ctx, isl_error_unknown, + "unexpected result", return -1); + } + + return 0; +} + +struct { + __isl_give isl_union_pw_multi_aff *(*fn)( + __isl_take isl_union_pw_multi_aff *upma1, + __isl_take isl_union_pw_multi_aff *upma2); + const char *arg1; + const char *arg2; + const char *res; +} upma_bin_tests[] = { + { &isl_union_pw_multi_aff_add, "{ A[] -> [0]; B[0] -> [1] }", + "{ B[x] -> [2] : x >= 0 }", "{ B[0] -> [3] }" }, + { &isl_union_pw_multi_aff_union_add, "{ A[] -> [0]; B[0] -> [1] }", + "{ B[x] -> [2] : x >= 0 }", + "{ A[] -> [0]; B[0] -> [3]; B[x] -> [2] : x >= 1 }" }, +}; + +/* Perform some basic tests of binary operations on + * isl_union_pw_multi_aff objects. + */ +static int test_bin_upma(isl_ctx *ctx) +{ + int i; + isl_union_pw_multi_aff *upma1, *upma2, *res; + int ok; + + for (i = 0; i < ARRAY_SIZE(upma_bin_tests); ++i) { + upma1 = isl_union_pw_multi_aff_read_from_str(ctx, + upma_bin_tests[i].arg1); + upma2 = isl_union_pw_multi_aff_read_from_str(ctx, + upma_bin_tests[i].arg2); + res = isl_union_pw_multi_aff_read_from_str(ctx, + upma_bin_tests[i].res); + upma1 = upma_bin_tests[i].fn(upma1, upma2); + ok = isl_union_pw_multi_aff_plain_is_equal(upma1, res); + isl_union_pw_multi_aff_free(upma1); + isl_union_pw_multi_aff_free(res); + if (ok < 0) + return -1; + if (!ok) + isl_die(ctx, isl_error_unknown, + "unexpected result", return -1); + } + + return 0; +} + int test_aff(isl_ctx *ctx) { const char *str; @@ -2968,6 +3939,11 @@ isl_aff *aff; int zero, equal; + if (test_bin_aff(ctx) < 0) + return -1; + if (test_bin_upma(ctx) < 0) + return -1; + space = isl_space_set_alloc(ctx, 0, 1); ls = isl_local_space_from_space(space); aff = isl_aff_zero_on_domain(ls); @@ -3102,6 +4078,22 @@ if (!equal) isl_die(ctx, isl_error_unknown, "unexpected result", return -1); + /* Check that empty solution lie in the right space. */ + str = "[n] -> { [t,a] : 1 = 0 }"; + set = isl_set_read_from_str(ctx, str); + pwaff = isl_set_dim_max(set, 0); + set1 = isl_set_from_pw_aff(pwaff); + str = "[n] -> { [t] : 1 = 0 }"; + set2 = isl_set_read_from_str(ctx, str); + equal = isl_set_is_equal(set1, set2); + isl_set_free(set1); + isl_set_free(set2); + + if (equal < 0) + return -1; + if (!equal) + isl_die(ctx, isl_error_unknown, "unexpected result", return -1); + return 0; } @@ -3203,6 +4195,30 @@ return 0; } +/* Check that two sets are not considered disjoint just because + * they have a different set of (named) parameters. + */ +static int test_disjoint(isl_ctx *ctx) +{ + const char *str; + isl_set *set, *set2; + int disjoint; + + str = "[n] -> { [[]->[]] }"; + set = isl_set_read_from_str(ctx, str); + str = "{ [[]->[]] }"; + set2 = isl_set_read_from_str(ctx, str); + disjoint = isl_set_is_disjoint(set, set2); + isl_set_free(set); + isl_set_free(set2); + if (disjoint < 0) + return -1; + if (disjoint) + isl_die(ctx, isl_error_unknown, "unexpected result", return -1); + + return 0; +} + int test_equal(isl_ctx *ctx) { const char *str; @@ -3268,27 +4284,81 @@ return 0; } -int test_vertices(isl_ctx *ctx) +struct isl_vertices_test_data { + const char *set; + int n; + const char *vertex[2]; +} vertices_tests[] = { + { "{ A[t, i] : t = 12 and i >= 4 and i <= 12 }", + 2, { "{ A[12, 4] }", "{ A[12, 12] }" } }, + { "{ A[t, i] : t = 14 and i = 1 }", + 1, { "{ A[14, 1] }" } }, +}; + +/* Check that "vertex" corresponds to one of the vertices in data->vertex. + */ +static isl_stat find_vertex(__isl_take isl_vertex *vertex, void *user) { - const char *str; + struct isl_vertices_test_data *data = user; + isl_ctx *ctx; + isl_multi_aff *ma; isl_basic_set *bset; - isl_vertices *vertices; + isl_pw_multi_aff *pma; + int i; + isl_bool equal; - str = "{ A[t, i] : t = 12 and i >= 4 and i <= 12 }"; - bset = isl_basic_set_read_from_str(ctx, str); - vertices = isl_basic_set_compute_vertices(bset); - isl_basic_set_free(bset); - isl_vertices_free(vertices); - if (!vertices) - return -1; + ctx = isl_vertex_get_ctx(vertex); + bset = isl_vertex_get_domain(vertex); + ma = isl_vertex_get_expr(vertex); + pma = isl_pw_multi_aff_alloc(isl_set_from_basic_set(bset), ma); + + for (i = 0; i < data->n; ++i) { + isl_pw_multi_aff *pma_i; + + pma_i = isl_pw_multi_aff_read_from_str(ctx, data->vertex[i]); + equal = isl_pw_multi_aff_plain_is_equal(pma, pma_i); + isl_pw_multi_aff_free(pma_i); - str = "{ A[t, i] : t = 14 and i = 1 }"; - bset = isl_basic_set_read_from_str(ctx, str); - vertices = isl_basic_set_compute_vertices(bset); - isl_basic_set_free(bset); - isl_vertices_free(vertices); - if (!vertices) - return -1; + if (equal < 0 || equal) + break; + } + + isl_pw_multi_aff_free(pma); + isl_vertex_free(vertex); + + if (equal < 0) + return isl_stat_error; + + return equal ? isl_stat_ok : isl_stat_error; +} + +int test_vertices(isl_ctx *ctx) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vertices_tests); ++i) { + isl_basic_set *bset; + isl_vertices *vertices; + int ok = 1; + int n; + + bset = isl_basic_set_read_from_str(ctx, vertices_tests[i].set); + vertices = isl_basic_set_compute_vertices(bset); + n = isl_vertices_get_n_vertices(vertices); + if (vertices_tests[i].n != n) + ok = 0; + if (isl_vertices_foreach_vertex(vertices, &find_vertex, + &vertices_tests[i]) < 0) + ok = 0; + isl_vertices_free(vertices); + isl_basic_set_free(bset); + + if (!vertices) + return -1; + if (!ok) + isl_die(ctx, isl_error_unknown, "unexpected vertices", + return -1); + } return 0; } @@ -3337,7 +4407,7 @@ if (!s) equal = -1; else - equal = !strcmp(s, "(2 - x + 4*floord(x, 4) >= 0) ? (1) : 2"); + equal = !strcmp(s, "4 * floord(x, 4) + 2 >= x ? 1 : 2"); free(s); if (equal < 0) return -1; @@ -3597,6 +4667,7 @@ "[N] -> { [i] : exists a : i = 4 a and N - 1 <= i <= N }", "[N] -> { [i,j] : exists a : i = 4 a and N - 1 <= i, 2j <= N }", "[N] -> { [[i]->[j]] : exists a : i = 4 a and N - 1 <= i, 2j <= N }", + "[N] -> { [3*floor(N/2) + 5*floor(N/3)] }", }; /* Check that converting from isl_set to isl_pw_multi_aff and back @@ -3838,6 +4909,9 @@ { "{ B[i] -> C[([i/2])] }", "{ B[5] }", "{ C[2] }" }, { "[n] -> { B[i,j] -> C[([i/2]) + 2j] }", "[n] -> { B[n,[n/3]] }", "[n] -> { C[([n/2]) + 2*[n/3]] }", }, + { "{ [i, j] -> [floor((i)/4) + floor((2*i+j)/5)] }", + "{ [i, j] -> [floor((i)/3), j] }", + "{ [i, j] -> [(floor((i)/12) + floor((j + 2*floor((i)/3))/5))] }" }, }; static int test_pullback(isl_ctx *ctx) @@ -3865,25 +4939,33 @@ return 0; } -/* Check that negation is printed correctly. +/* Check that negation is printed correctly and that equal expressions + * are correctly identified. */ static int test_ast(isl_ctx *ctx) { isl_ast_expr *expr, *expr1, *expr2, *expr3; char *str; - int ok; + int ok, equal; expr1 = isl_ast_expr_from_id(isl_id_alloc(ctx, "A", NULL)); expr2 = isl_ast_expr_from_id(isl_id_alloc(ctx, "B", NULL)); expr = isl_ast_expr_add(expr1, expr2); + expr2 = isl_ast_expr_copy(expr); expr = isl_ast_expr_neg(expr); + expr2 = isl_ast_expr_neg(expr2); + equal = isl_ast_expr_is_equal(expr, expr2); str = isl_ast_expr_to_str(expr); ok = str ? !strcmp(str, "-(A + B)") : -1; free(str); isl_ast_expr_free(expr); + isl_ast_expr_free(expr2); - if (ok < 0) + if (ok < 0 || equal < 0) return -1; + if (!equal) + isl_die(ctx, isl_error_unknown, + "equal expressions not considered equal", return -1); if (!ok) isl_die(ctx, isl_error_unknown, "isl_ast_expr printed incorrectly", return -1); @@ -3907,6 +4989,31 @@ return 0; } +/* Check that isl_ast_build_expr_from_set returns a valid expression + * for an empty set. Note that isl_ast_build_expr_from_set getting + * called on an empty set probably indicates a bug in the caller. + */ +static int test_ast_build(isl_ctx *ctx) +{ + isl_set *set; + isl_ast_build *build; + isl_ast_expr *expr; + + set = isl_set_universe(isl_space_params_alloc(ctx, 0)); + build = isl_ast_build_from_context(set); + + set = isl_set_empty(isl_space_params_alloc(ctx, 0)); + expr = isl_ast_build_expr_from_set(build, set); + + isl_ast_expr_free(expr); + isl_ast_build_free(build); + + if (!expr) + return -1; + + return 0; +} + /* Internal data structure for before_for and after_for callbacks. * * depth is the current depth @@ -4047,7 +5154,7 @@ &before_for, &data); build = isl_ast_build_set_after_each_for(build, &after_for, &data); - tree = isl_ast_build_ast_from_schedule(build, schedule); + tree = isl_ast_build_node_from_schedule_map(build, schedule); isl_ast_build_free(build); if (!tree) return -1; @@ -4062,7 +5169,7 @@ } /* Check that the AST generator handles domains that are integrally disjoint - * but not ratinoally disjoint. + * but not rationally disjoint. */ static int test_ast_gen2(isl_ctx *ctx) { @@ -4081,7 +5188,7 @@ str = "{ [i,j] -> atomic[1] : i + j = 1; [i,j] -> unroll[1] : i = j }"; options = isl_union_map_read_from_str(ctx, str); build = isl_ast_build_set_options(build, options); - tree = isl_ast_build_ast_from_schedule(build, schedule); + tree = isl_ast_build_node_from_schedule_map(build, schedule); isl_ast_build_free(build); if (!tree) return -1; @@ -4127,7 +5234,7 @@ build = isl_ast_build_set_options(build, options); build = isl_ast_build_set_at_each_domain(build, &count_domains, &n_domain); - tree = isl_ast_build_ast_from_schedule(build, schedule); + tree = isl_ast_build_node_from_schedule_map(build, schedule); isl_ast_build_free(build); if (!tree) return -1; @@ -4163,7 +5270,7 @@ schedule = isl_union_map_read_from_str(ctx, str); set = isl_set_universe(isl_space_params_alloc(ctx, 0)); build = isl_ast_build_from_context(set); - tree = isl_ast_build_ast_from_schedule(build, schedule); + tree = isl_ast_build_node_from_schedule_map(build, schedule); isl_ast_build_free(build); if (!tree) return -1; @@ -4180,7 +5287,7 @@ schedule = isl_union_map_read_from_str(ctx, str); set = isl_set_universe(isl_space_params_alloc(ctx, 0)); build = isl_ast_build_from_context(set); - tree = isl_ast_build_ast_from_schedule(build, schedule); + tree = isl_ast_build_node_from_schedule_map(build, schedule); isl_ast_build_free(build); if (!tree) return -1; @@ -4215,7 +5322,7 @@ extra = isl_union_map_copy(schedule); extra = isl_union_map_from_domain(isl_union_map_domain(extra)); schedule = isl_union_map_range_product(schedule, extra); - tree = isl_ast_build_ast_from_schedule(build, schedule); + tree = isl_ast_build_node_from_schedule_map(build, schedule); isl_ast_build_free(build); if (!tree) @@ -4258,7 +5365,7 @@ build = isl_ast_build_from_context(set); build = isl_ast_build_set_options(build, options); build = isl_ast_build_set_create_leaf(build, &create_leaf, NULL); - tree = isl_ast_build_ast_from_schedule(build, schedule); + tree = isl_ast_build_node_from_schedule_map(build, schedule); isl_ast_build_free(build); isl_ast_node_free(tree); if (!tree) @@ -4311,6 +5418,54 @@ return 0; } +/* Check that we can properly parse multi piecewise affine expressions + * where the piecewise affine expressions have different domains. + */ +static int test_multi_pw_aff(isl_ctx *ctx) +{ + const char *str; + isl_set *dom, *dom2; + isl_multi_pw_aff *mpa1, *mpa2; + isl_pw_aff *pa; + int equal; + int equal_domain; + + mpa1 = isl_multi_pw_aff_read_from_str(ctx, "{ [i] -> [i] }"); + dom = isl_set_read_from_str(ctx, "{ [i] : i > 0 }"); + mpa1 = isl_multi_pw_aff_intersect_domain(mpa1, dom); + mpa2 = isl_multi_pw_aff_read_from_str(ctx, "{ [i] -> [2i] }"); + mpa2 = isl_multi_pw_aff_flat_range_product(mpa1, mpa2); + str = "{ [i] -> [(i : i > 0), 2i] }"; + mpa1 = isl_multi_pw_aff_read_from_str(ctx, str); + + equal = isl_multi_pw_aff_plain_is_equal(mpa1, mpa2); + + pa = isl_multi_pw_aff_get_pw_aff(mpa1, 0); + dom = isl_pw_aff_domain(pa); + pa = isl_multi_pw_aff_get_pw_aff(mpa1, 1); + dom2 = isl_pw_aff_domain(pa); + equal_domain = isl_set_is_equal(dom, dom2); + + isl_set_free(dom); + isl_set_free(dom2); + isl_multi_pw_aff_free(mpa1); + isl_multi_pw_aff_free(mpa2); + + if (equal < 0) + return -1; + if (!equal) + isl_die(ctx, isl_error_unknown, + "expressions not equal", return -1); + + if (equal_domain < 0) + return -1; + if (equal_domain) + isl_die(ctx, isl_error_unknown, + "domains unexpectedly equal", return -1); + + return 0; +} + /* This is a regression test for a bug where isl_basic_map_simplify * would end up in an infinite loop. In particular, we construct * an empty basic set that is not obviously empty. @@ -4391,22 +5546,368 @@ return 0; } +/* Check that the reaching domain elements and the prefix schedule + * at a leaf node are the same before and after grouping. + */ +static int test_schedule_tree_group_1(isl_ctx *ctx) +{ + int equal; + const char *str; + isl_id *id; + isl_union_set *uset; + isl_multi_union_pw_aff *mupa; + isl_union_pw_multi_aff *upma1, *upma2; + isl_union_set *domain1, *domain2; + isl_union_map *umap1, *umap2; + isl_schedule_node *node; + + str = "{ S1[i,j] : 0 <= i,j < 10; S2[i,j] : 0 <= i,j < 10 }"; + uset = isl_union_set_read_from_str(ctx, str); + node = isl_schedule_node_from_domain(uset); + node = isl_schedule_node_child(node, 0); + str = "[{ S1[i,j] -> [i]; S2[i,j] -> [9 - i] }]"; + mupa = isl_multi_union_pw_aff_read_from_str(ctx, str); + node = isl_schedule_node_insert_partial_schedule(node, mupa); + node = isl_schedule_node_child(node, 0); + str = "[{ S1[i,j] -> [j]; S2[i,j] -> [j] }]"; + mupa = isl_multi_union_pw_aff_read_from_str(ctx, str); + node = isl_schedule_node_insert_partial_schedule(node, mupa); + node = isl_schedule_node_child(node, 0); + umap1 = isl_schedule_node_get_prefix_schedule_union_map(node); + upma1 = isl_schedule_node_get_prefix_schedule_union_pw_multi_aff(node); + domain1 = isl_schedule_node_get_domain(node); + id = isl_id_alloc(ctx, "group", NULL); + node = isl_schedule_node_parent(node); + node = isl_schedule_node_group(node, id); + node = isl_schedule_node_child(node, 0); + umap2 = isl_schedule_node_get_prefix_schedule_union_map(node); + upma2 = isl_schedule_node_get_prefix_schedule_union_pw_multi_aff(node); + domain2 = isl_schedule_node_get_domain(node); + equal = isl_union_pw_multi_aff_plain_is_equal(upma1, upma2); + if (equal >= 0 && equal) + equal = isl_union_set_is_equal(domain1, domain2); + if (equal >= 0 && equal) + equal = isl_union_map_is_equal(umap1, umap2); + isl_union_map_free(umap1); + isl_union_map_free(umap2); + isl_union_set_free(domain1); + isl_union_set_free(domain2); + isl_union_pw_multi_aff_free(upma1); + isl_union_pw_multi_aff_free(upma2); + isl_schedule_node_free(node); + + if (equal < 0) + return -1; + if (!equal) + isl_die(ctx, isl_error_unknown, + "expressions not equal", return -1); + + return 0; +} + +/* Check that we can have nested groupings and that the union map + * schedule representation is the same before and after the grouping. + * Note that after the grouping, the union map representation contains + * the domain constraints from the ranges of the expansion nodes, + * while they are missing from the union map representation of + * the tree without expansion nodes. + * + * Also check that the global expansion is as expected. + */ +static int test_schedule_tree_group_2(isl_ctx *ctx) +{ + int equal, equal_expansion; + const char *str; + isl_id *id; + isl_union_set *uset; + isl_union_map *umap1, *umap2; + isl_union_map *expansion1, *expansion2; + isl_union_set_list *filters; + isl_multi_union_pw_aff *mupa; + isl_schedule *schedule; + isl_schedule_node *node; + + str = "{ S1[i,j] : 0 <= i,j < 10; S2[i,j] : 0 <= i,j < 10; " + "S3[i,j] : 0 <= i,j < 10 }"; + uset = isl_union_set_read_from_str(ctx, str); + node = isl_schedule_node_from_domain(uset); + node = isl_schedule_node_child(node, 0); + str = "[{ S1[i,j] -> [i]; S2[i,j] -> [i]; S3[i,j] -> [i] }]"; + mupa = isl_multi_union_pw_aff_read_from_str(ctx, str); + node = isl_schedule_node_insert_partial_schedule(node, mupa); + node = isl_schedule_node_child(node, 0); + str = "{ S1[i,j] }"; + uset = isl_union_set_read_from_str(ctx, str); + filters = isl_union_set_list_from_union_set(uset); + str = "{ S2[i,j]; S3[i,j] }"; + uset = isl_union_set_read_from_str(ctx, str); + filters = isl_union_set_list_add(filters, uset); + node = isl_schedule_node_insert_sequence(node, filters); + node = isl_schedule_node_child(node, 1); + node = isl_schedule_node_child(node, 0); + str = "{ S2[i,j] }"; + uset = isl_union_set_read_from_str(ctx, str); + filters = isl_union_set_list_from_union_set(uset); + str = "{ S3[i,j] }"; + uset = isl_union_set_read_from_str(ctx, str); + filters = isl_union_set_list_add(filters, uset); + node = isl_schedule_node_insert_sequence(node, filters); + + schedule = isl_schedule_node_get_schedule(node); + umap1 = isl_schedule_get_map(schedule); + uset = isl_schedule_get_domain(schedule); + umap1 = isl_union_map_intersect_domain(umap1, uset); + isl_schedule_free(schedule); + + node = isl_schedule_node_parent(node); + node = isl_schedule_node_parent(node); + id = isl_id_alloc(ctx, "group1", NULL); + node = isl_schedule_node_group(node, id); + node = isl_schedule_node_child(node, 1); + node = isl_schedule_node_child(node, 0); + id = isl_id_alloc(ctx, "group2", NULL); + node = isl_schedule_node_group(node, id); + + schedule = isl_schedule_node_get_schedule(node); + umap2 = isl_schedule_get_map(schedule); + isl_schedule_free(schedule); + + node = isl_schedule_node_root(node); + node = isl_schedule_node_child(node, 0); + expansion1 = isl_schedule_node_get_subtree_expansion(node); + isl_schedule_node_free(node); + + str = "{ group1[i] -> S1[i,j] : 0 <= i,j < 10; " + "group1[i] -> S2[i,j] : 0 <= i,j < 10; " + "group1[i] -> S3[i,j] : 0 <= i,j < 10 }"; + + expansion2 = isl_union_map_read_from_str(ctx, str); + + equal = isl_union_map_is_equal(umap1, umap2); + equal_expansion = isl_union_map_is_equal(expansion1, expansion2); + + isl_union_map_free(umap1); + isl_union_map_free(umap2); + isl_union_map_free(expansion1); + isl_union_map_free(expansion2); + + if (equal < 0 || equal_expansion < 0) + return -1; + if (!equal) + isl_die(ctx, isl_error_unknown, + "expressions not equal", return -1); + if (!equal_expansion) + isl_die(ctx, isl_error_unknown, + "unexpected expansion", return -1); + + return 0; +} + +/* Some tests for the isl_schedule_node_group function. + */ +static int test_schedule_tree_group(isl_ctx *ctx) +{ + if (test_schedule_tree_group_1(ctx) < 0) + return -1; + if (test_schedule_tree_group_2(ctx) < 0) + return -1; + return 0; +} + +struct { + const char *set; + const char *dual; +} coef_tests[] = { + { "{ rat: [i] : 0 <= i <= 10 }", + "{ rat: coefficients[[cst] -> [a]] : cst >= 0 and 10a + cst >= 0 }" }, + { "{ rat: [i] : FALSE }", + "{ rat: coefficients[[cst] -> [a]] }" }, + { "{ rat: [i] : }", + "{ rat: coefficients[[cst] -> [0]] : cst >= 0 }" }, +}; + +struct { + const char *set; + const char *dual; +} sol_tests[] = { + { "{ rat: coefficients[[cst] -> [a]] : cst >= 0 and 10a + cst >= 0 }", + "{ rat: [i] : 0 <= i <= 10 }" }, + { "{ rat: coefficients[[cst] -> [a]] : FALSE }", + "{ rat: [i] }" }, + { "{ rat: coefficients[[cst] -> [a]] }", + "{ rat: [i] : FALSE }" }, +}; + +/* Test the basic functionality of isl_basic_set_coefficients and + * isl_basic_set_solutions. + */ +static int test_dual(isl_ctx *ctx) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(coef_tests); ++i) { + int equal; + isl_basic_set *bset1, *bset2; + + bset1 = isl_basic_set_read_from_str(ctx, coef_tests[i].set); + bset2 = isl_basic_set_read_from_str(ctx, coef_tests[i].dual); + bset1 = isl_basic_set_coefficients(bset1); + equal = isl_basic_set_is_equal(bset1, bset2); + isl_basic_set_free(bset1); + isl_basic_set_free(bset2); + if (equal < 0) + return -1; + if (!equal) + isl_die(ctx, isl_error_unknown, + "incorrect dual", return -1); + } + + for (i = 0; i < ARRAY_SIZE(sol_tests); ++i) { + int equal; + isl_basic_set *bset1, *bset2; + + bset1 = isl_basic_set_read_from_str(ctx, sol_tests[i].set); + bset2 = isl_basic_set_read_from_str(ctx, sol_tests[i].dual); + bset1 = isl_basic_set_solutions(bset1); + equal = isl_basic_set_is_equal(bset1, bset2); + isl_basic_set_free(bset1); + isl_basic_set_free(bset2); + if (equal < 0) + return -1; + if (!equal) + isl_die(ctx, isl_error_unknown, + "incorrect dual", return -1); + } + + return 0; +} + +struct { + int scale_tile; + int shift_point; + const char *domain; + const char *schedule; + const char *sizes; + const char *tile; + const char *point; +} tile_tests[] = { + { 0, 0, "[n] -> { S[i,j] : 0 <= i,j < n }", + "[{ S[i,j] -> [i] }, { S[i,j] -> [j] }]", + "{ [32,32] }", + "[{ S[i,j] -> [floor(i/32)] }, { S[i,j] -> [floor(j/32)] }]", + "[{ S[i,j] -> [i] }, { S[i,j] -> [j] }]", + }, + { 1, 0, "[n] -> { S[i,j] : 0 <= i,j < n }", + "[{ S[i,j] -> [i] }, { S[i,j] -> [j] }]", + "{ [32,32] }", + "[{ S[i,j] -> [32*floor(i/32)] }, { S[i,j] -> [32*floor(j/32)] }]", + "[{ S[i,j] -> [i] }, { S[i,j] -> [j] }]", + }, + { 0, 1, "[n] -> { S[i,j] : 0 <= i,j < n }", + "[{ S[i,j] -> [i] }, { S[i,j] -> [j] }]", + "{ [32,32] }", + "[{ S[i,j] -> [floor(i/32)] }, { S[i,j] -> [floor(j/32)] }]", + "[{ S[i,j] -> [i%32] }, { S[i,j] -> [j%32] }]", + }, + { 1, 1, "[n] -> { S[i,j] : 0 <= i,j < n }", + "[{ S[i,j] -> [i] }, { S[i,j] -> [j] }]", + "{ [32,32] }", + "[{ S[i,j] -> [32*floor(i/32)] }, { S[i,j] -> [32*floor(j/32)] }]", + "[{ S[i,j] -> [i%32] }, { S[i,j] -> [j%32] }]", + }, +}; + +/* Basic tiling tests. Create a schedule tree with a domain and a band node, + * tile the band and then check if the tile and point bands have the + * expected partial schedule. + */ +static int test_tile(isl_ctx *ctx) +{ + int i; + int scale; + int shift; + + scale = isl_options_get_tile_scale_tile_loops(ctx); + shift = isl_options_get_tile_shift_point_loops(ctx); + + for (i = 0; i < ARRAY_SIZE(tile_tests); ++i) { + int opt; + int equal; + const char *str; + isl_union_set *domain; + isl_multi_union_pw_aff *mupa, *mupa2; + isl_schedule_node *node; + isl_multi_val *sizes; + + opt = tile_tests[i].scale_tile; + isl_options_set_tile_scale_tile_loops(ctx, opt); + opt = tile_tests[i].shift_point; + isl_options_set_tile_shift_point_loops(ctx, opt); + + str = tile_tests[i].domain; + domain = isl_union_set_read_from_str(ctx, str); + node = isl_schedule_node_from_domain(domain); + node = isl_schedule_node_child(node, 0); + str = tile_tests[i].schedule; + mupa = isl_multi_union_pw_aff_read_from_str(ctx, str); + node = isl_schedule_node_insert_partial_schedule(node, mupa); + str = tile_tests[i].sizes; + sizes = isl_multi_val_read_from_str(ctx, str); + node = isl_schedule_node_band_tile(node, sizes); + + str = tile_tests[i].tile; + mupa = isl_multi_union_pw_aff_read_from_str(ctx, str); + mupa2 = isl_schedule_node_band_get_partial_schedule(node); + equal = isl_multi_union_pw_aff_plain_is_equal(mupa, mupa2); + isl_multi_union_pw_aff_free(mupa); + isl_multi_union_pw_aff_free(mupa2); + + node = isl_schedule_node_child(node, 0); + + str = tile_tests[i].point; + mupa = isl_multi_union_pw_aff_read_from_str(ctx, str); + mupa2 = isl_schedule_node_band_get_partial_schedule(node); + if (equal >= 0 && equal) + equal = isl_multi_union_pw_aff_plain_is_equal(mupa, + mupa2); + isl_multi_union_pw_aff_free(mupa); + isl_multi_union_pw_aff_free(mupa2); + + isl_schedule_node_free(node); + + if (equal < 0) + return -1; + if (!equal) + isl_die(ctx, isl_error_unknown, + "unexpected result", return -1); + } + + isl_options_set_tile_scale_tile_loops(ctx, scale); + isl_options_set_tile_shift_point_loops(ctx, shift); + + return 0; +} + struct { const char *name; int (*fn)(isl_ctx *ctx); } tests [] = { + { "dual", &test_dual }, + { "dependence analysis", &test_flow }, { "val", &test_val }, { "compute divs", &test_compute_divs }, { "partial lexmin", &test_partial_lexmin }, { "simplify", &test_simplify }, { "curry", &test_curry }, { "piecewise multi affine expressions", &test_pw_multi_aff }, + { "multi piecewise affine expressions", &test_multi_pw_aff }, { "conversion", &test_conversion }, { "list", &test_list }, { "align parameters", &test_align_parameters }, { "preimage", &test_preimage }, { "pullback", &test_pullback }, { "AST", &test_ast }, + { "AST build", &test_ast_build }, { "AST generation", &test_ast_gen }, { "eliminate", &test_eliminate }, { "residue class", &test_residue_class }, @@ -4418,11 +5919,14 @@ { "vertices", &test_vertices }, { "fixed", &test_fixed }, { "equal", &test_equal }, + { "disjoint", &test_disjoint }, { "product", &test_product }, { "dim_max", &test_dim_max }, { "affine", &test_aff }, { "injective", &test_injective }, { "schedule", &test_schedule }, + { "schedule tree grouping", &test_schedule_tree_group }, + { "tile", &test_tile }, { "union_pw", &test_union_pw }, { "parse", &test_parse }, { "single-valued", &test_sv }, @@ -4432,38 +5936,44 @@ { "subset", &test_subset }, { "subtract", &test_subtract }, { "lexmin", &test_lexmin }, + { "min", &test_min }, { "gist", &test_gist }, { "piecewise quasi-polynomials", &test_pwqp }, + { "lift", &test_lift }, + { "bound", &test_bound }, + { "union", &test_union }, + { "split periods", &test_split_periods }, + { "lexicographic order", &test_lex }, + { "bijectivity", &test_bijective }, + { "dataflow analysis", &test_dep }, + { "reading", &test_read }, + { "bounded", &test_bounded }, + { "construction", &test_construction }, + { "dimension manipulation", &test_dim }, + { "map application", &test_application }, + { "convex hull", &test_convex_hull }, + { "transitive closure", &test_closure }, }; -int main() +int main(int argc, char **argv) { int i; struct isl_ctx *ctx; + struct isl_options *options; srcdir = getenv("srcdir"); assert(srcdir); - ctx = isl_ctx_alloc(); + options = isl_options_new_with_defaults(); + assert(options); + argc = isl_options_parse(options, argc, argv, ISL_ARG_ALL); + + ctx = isl_ctx_alloc_with_options(&isl_options_args, options); for (i = 0; i < ARRAY_SIZE(tests); ++i) { printf("%s\n", tests[i].name); if (tests[i].fn(ctx) < 0) goto error; } - test_lift(ctx); - test_bound(ctx); - test_union(ctx); - test_split_periods(ctx); - test_lex(ctx); - test_bijective(ctx); - test_dep(ctx); - test_read(ctx); - test_bounded(ctx); - test_construction(ctx); - test_dim(ctx); - test_application(ctx); - test_convex_hull(ctx); - test_closure(ctx); isl_ctx_free(ctx); return 0; error: diff -Nru cloog-0.18.2/isl/isl_transitive_closure.c cloog-0.18.4/isl/isl_transitive_closure.c --- cloog-0.18.2/isl/isl_transitive_closure.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_transitive_closure.c 2015-07-24 12:23:09.000000000 +0000 @@ -11,11 +11,12 @@ #include #include #include -#include +#include #include -#include +#include #include #include +#include #include #include @@ -69,13 +70,15 @@ bmap = isl_basic_map_alloc_space(dim, 0, 1, 1); if (exactly) { k = isl_basic_map_alloc_equality(bmap); + if (k < 0) + goto error; c = bmap->eq[k]; } else { k = isl_basic_map_alloc_inequality(bmap); + if (k < 0) + goto error; c = bmap->ineq[k]; } - if (k < 0) - goto error; isl_seq_clr(c, 1 + isl_basic_map_total_dim(bmap)); isl_int_set_si(c[0], -length); isl_int_set_si(c[1 + nparam + d - 1], -1); @@ -473,13 +476,15 @@ continue; if (eq && p != MIXED) { k = isl_basic_map_alloc_equality(path); + if (k < 0) + goto error; path_c = path->eq[k]; } else { k = isl_basic_map_alloc_inequality(path); + if (k < 0) + goto error; path_c = path->ineq[k]; } - if (k < 0) - goto error; isl_seq_clr(path_c, 1 + isl_basic_map_total_dim(path)); if (p == PURE_VAR) { isl_seq_cpy(path_c + off, @@ -753,6 +758,9 @@ unsigned d; int i, j, n; + if (!map) + goto error; + d = isl_map_dim(map, isl_dim_in); path = isl_map_identity(isl_space_copy(dim)); @@ -818,7 +826,11 @@ isl_set *i; int no_overlap; - if (!isl_space_tuple_match(set1->dim, isl_dim_set, set2->dim, isl_dim_set)) + if (!set1 || !set2) + return -1; + + if (!isl_space_tuple_is_equal(set1->dim, isl_dim_set, + set2->dim, isl_dim_set)) return 0; i = isl_set_intersect(isl_set_copy(set1), isl_set_copy(set2)); @@ -854,16 +866,20 @@ struct isl_set *range = NULL; struct isl_map *app = NULL; struct isl_map *path = NULL; + int overlaps; domain = isl_map_domain(isl_map_copy(map)); domain = isl_set_coalesce(domain); range = isl_map_range(isl_map_copy(map)); range = isl_set_coalesce(range); - if (!isl_set_overlaps(domain, range)) { + overlaps = isl_set_overlaps(domain, range); + if (overlaps < 0 || !overlaps) { isl_set_free(domain); isl_set_free(range); isl_space_free(dim); + if (overlaps < 0) + map = NULL; map = isl_map_copy(map); map = isl_map_add_dims(map, isl_dim_in, 1); map = isl_map_add_dims(map, isl_dim_out, 1); @@ -1750,16 +1766,16 @@ * *check_closed is set if the subset relation holds while * R_1 \circ R_2 is not empty. */ -static int basic_map_follows(int i, int j, void *user) +static isl_bool basic_map_follows(int i, int j, void *user) { struct isl_tc_follows_data *data = user; struct isl_map *map12 = NULL; struct isl_map *map21 = NULL; - int subset; + isl_bool subset; - if (!isl_space_tuple_match(data->list[i]->dim, isl_dim_in, + if (!isl_space_tuple_is_equal(data->list[i]->dim, isl_dim_in, data->list[j]->dim, isl_dim_out)) - return 0; + return isl_bool_false; map21 = isl_map_from_basic_map( isl_basic_map_apply_range( @@ -1770,15 +1786,15 @@ goto error; if (subset) { isl_map_free(map21); - return 0; + return isl_bool_false; } - if (!isl_space_tuple_match(data->list[i]->dim, isl_dim_in, + if (!isl_space_tuple_is_equal(data->list[i]->dim, isl_dim_in, data->list[i]->dim, isl_dim_out) || - !isl_space_tuple_match(data->list[j]->dim, isl_dim_in, + !isl_space_tuple_is_equal(data->list[j]->dim, isl_dim_in, data->list[j]->dim, isl_dim_out)) { isl_map_free(map21); - return 1; + return isl_bool_true; } map12 = isl_map_from_basic_map( @@ -1794,10 +1810,10 @@ if (subset) data->check_closed = 1; - return subset < 0 ? -1 : !subset; + return subset < 0 ? isl_bool_error : !subset; error: isl_map_free(map21); - return -1; + return isl_bool_error; } /* Given a union of basic maps R = \cup_i R_i \subseteq D \times D @@ -1946,14 +1962,12 @@ { struct isl_map *app = NULL; isl_space *dim = NULL; - unsigned d; if (!map) return NULL; dim = isl_map_get_space(map); - d = isl_space_dim(dim, isl_dim_in); dim = isl_space_add_dims(dim, isl_dim_in, 1); dim = isl_space_add_dims(dim, isl_dim_out, 1); @@ -2596,7 +2610,7 @@ return NULL; } -static int inc_count(__isl_take isl_map *map, void *user) +static isl_stat inc_count(__isl_take isl_map *map, void *user) { int *n = user; @@ -2604,10 +2618,10 @@ isl_map_free(map); - return 0; + return isl_stat_ok; } -static int collect_basic_map(__isl_take isl_map *map, void *user) +static isl_stat collect_basic_map(__isl_take isl_map *map, void *user) { int i; isl_basic_map ***next = user; @@ -2620,10 +2634,10 @@ } isl_map_free(map); - return 0; + return isl_stat_ok; error: isl_map_free(map); - return -1; + return isl_stat_error; } /* Perform Floyd-Warshall on the given list of basic relations. @@ -2891,14 +2905,14 @@ int *exact; }; -static int power(__isl_take isl_map *map, void *user) +static isl_stat power(__isl_take isl_map *map, void *user) { struct isl_union_power *up = user; map = isl_map_power(map, up->exact); up->pow = isl_union_map_from_map(map); - return -1; + return isl_stat_error; } /* Construct a map [x] -> [x+1], with parameters prescribed by "dim". diff -Nru cloog-0.18.2/isl/isl_union_map.c cloog-0.18.4/isl/isl_union_map.c --- cloog-0.18.2/isl/isl_union_map.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_union_map.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,35 +1,80 @@ /* * Copyright 2010-2011 INRIA Saclay + * Copyright 2013-2014 Ecole Normale Superieure + * Copyright 2014 INRIA Rocquencourt * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, * 91893 Orsay, France + * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, + * B.P. 105 - 78153 Le Chesnay, France */ #define ISL_DIM_H #include +#include #include #include #include #include #include #include -#include #include +#include + +/* Return the number of parameters of "umap", where "type" + * is required to be set to isl_dim_param. + */ +unsigned isl_union_map_dim(__isl_keep isl_union_map *umap, + enum isl_dim_type type) +{ + if (!umap) + return 0; + + if (type != isl_dim_param) + isl_die(isl_union_map_get_ctx(umap), isl_error_invalid, + "can only reference parameters", return 0); + + return isl_space_dim(umap->dim, type); +} + +/* Return the number of parameters of "uset", where "type" + * is required to be set to isl_dim_param. + */ +unsigned isl_union_set_dim(__isl_keep isl_union_set *uset, + enum isl_dim_type type) +{ + return isl_union_map_dim(uset, type); +} + +/* Return the id of the specified dimension. + */ +__isl_give isl_id *isl_union_map_get_dim_id(__isl_keep isl_union_map *umap, + enum isl_dim_type type, unsigned pos) +{ + if (!umap) + return NULL; + + if (type != isl_dim_param) + isl_die(isl_union_map_get_ctx(umap), isl_error_invalid, + "can only reference parameters", return NULL); + + return isl_space_get_dim_id(umap->dim, type, pos); +} /* Is this union set a parameter domain? */ -int isl_union_set_is_params(__isl_keep isl_union_set *uset) +isl_bool isl_union_set_is_params(__isl_keep isl_union_set *uset) { isl_set *set; - int params; + isl_bool params; if (!uset) - return -1; + return isl_bool_error; if (uset->table.n != 1) - return 0; + return isl_bool_false; set = isl_set_from_union_set(isl_union_set_copy(uset)); params = isl_set_is_params(set); @@ -37,22 +82,24 @@ return params; } -static __isl_give isl_union_map *isl_union_map_alloc(__isl_take isl_space *dim, - int size) +static __isl_give isl_union_map *isl_union_map_alloc( + __isl_take isl_space *space, int size) { isl_union_map *umap; - dim = isl_space_params(dim); - if (!dim) + space = isl_space_params(space); + if (!space) return NULL; - umap = isl_calloc_type(dim->ctx, isl_union_map); - if (!umap) + umap = isl_calloc_type(space->ctx, isl_union_map); + if (!umap) { + isl_space_free(space); return NULL; + } umap->ref = 1; - umap->dim = dim; - if (isl_hash_table_init(dim->ctx, &umap->table, size) < 0) + umap->dim = space; + if (isl_hash_table_init(space->ctx, &umap->table, size) < 0) return isl_union_map_free(umap); return umap; @@ -85,25 +132,37 @@ return isl_space_copy(umap->dim); } +/* Return the position of the parameter with the given name + * in "umap". + * Return -1 if no such dimension can be found. + */ +int isl_union_map_find_dim_by_name(__isl_keep isl_union_map *umap, + enum isl_dim_type type, const char *name) +{ + if (!umap) + return -1; + return isl_space_find_dim_by_name(umap->dim, type, name); +} + __isl_give isl_space *isl_union_set_get_space(__isl_keep isl_union_set *uset) { return isl_union_map_get_space(uset); } -static int free_umap_entry(void **entry, void *user) +static isl_stat free_umap_entry(void **entry, void *user) { isl_map *map = *entry; isl_map_free(map); - return 0; + return isl_stat_ok; } -static int add_map(__isl_take isl_map *map, void *user) +static isl_stat add_map(__isl_take isl_map *map, void *user) { isl_union_map **umap = (isl_union_map **)user; *umap = isl_union_map_add_map(*umap, map); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_dup(__isl_keep isl_union_map *umap) @@ -138,7 +197,7 @@ isl_union_map *res; }; -static int align_entry(void **entry, void *user) +static isl_stat align_entry(void **entry, void *user) { isl_map *map = *entry; isl_reordering *exp; @@ -150,7 +209,7 @@ data->res = isl_union_map_add_map(data->res, isl_map_realign(isl_map_copy(map), exp)); - return 0; + return isl_stat_ok; } /* Align the parameters of umap along those of model. @@ -243,7 +302,7 @@ return isl_union_map_copy(uset); } -void *isl_union_map_free(__isl_take isl_union_map *umap) +__isl_null isl_union_map *isl_union_map_free(__isl_take isl_union_map *umap) { if (!umap) return NULL; @@ -259,7 +318,7 @@ return NULL; } -void *isl_union_set_free(__isl_take isl_union_set *uset) +__isl_null isl_union_set *isl_union_set_free(__isl_take isl_union_set *uset) { return isl_union_map_free(uset); } @@ -359,11 +418,11 @@ struct isl_union_map_foreach_data { - int (*fn)(__isl_take isl_map *map, void *user); + isl_stat (*fn)(__isl_take isl_map *map, void *user); void *user; }; -static int call_on_copy(void **entry, void *user) +static isl_stat call_on_copy(void **entry, void *user) { isl_map *map = *entry; struct isl_union_map_foreach_data *data; @@ -382,26 +441,26 @@ return uset ? uset->table.n : 0; } -int isl_union_map_foreach_map(__isl_keep isl_union_map *umap, - int (*fn)(__isl_take isl_map *map, void *user), void *user) +isl_stat isl_union_map_foreach_map(__isl_keep isl_union_map *umap, + isl_stat (*fn)(__isl_take isl_map *map, void *user), void *user) { struct isl_union_map_foreach_data data = { fn, user }; if (!umap) - return -1; + return isl_stat_error; return isl_hash_table_foreach(umap->dim->ctx, &umap->table, &call_on_copy, &data); } -static int copy_map(void **entry, void *user) +static isl_stat copy_map(void **entry, void *user) { isl_map *map = *entry; isl_map **map_p = user; *map_p = isl_map_copy(map); - return -1; + return isl_stat_error; } __isl_give isl_map *isl_map_from_union_map(__isl_take isl_union_map *umap) @@ -415,13 +474,16 @@ if (umap->table.n != 1) isl_die(ctx, isl_error_invalid, "union map needs to contain elements in exactly " - "one space", return isl_union_map_free(umap)); + "one space", goto error); isl_hash_table_foreach(ctx, &umap->table, ©_map, &map); isl_union_map_free(umap); return map; +error: + isl_union_map_free(umap); + return NULL; } __isl_give isl_set *isl_set_from_union_set(__isl_take isl_union_set *uset) @@ -485,22 +547,22 @@ return isl_union_map_contains(uset, dim); } -int isl_union_set_foreach_set(__isl_keep isl_union_set *uset, - int (*fn)(__isl_take isl_set *set, void *user), void *user) +isl_stat isl_union_set_foreach_set(__isl_keep isl_union_set *uset, + isl_stat (*fn)(__isl_take isl_set *set, void *user), void *user) { return isl_union_map_foreach_map(uset, - (int(*)(__isl_take isl_map *, void*))fn, user); + (isl_stat(*)(__isl_take isl_map *, void*))fn, user); } struct isl_union_set_foreach_point_data { - int (*fn)(__isl_take isl_point *pnt, void *user); + isl_stat (*fn)(__isl_take isl_point *pnt, void *user); void *user; }; -static int foreach_point(__isl_take isl_set *set, void *user) +static isl_stat foreach_point(__isl_take isl_set *set, void *user) { struct isl_union_set_foreach_point_data *data = user; - int r; + isl_stat r; r = isl_set_foreach_point(set, data->fn, data->user); isl_set_free(set); @@ -508,8 +570,8 @@ return r; } -int isl_union_set_foreach_point(__isl_keep isl_union_set *uset, - int (*fn)(__isl_take isl_point *pnt, void *user), void *user) +isl_stat isl_union_set_foreach_point(__isl_keep isl_union_set *uset, + isl_stat (*fn)(__isl_take isl_point *pnt, void *user), void *user) { struct isl_union_set_foreach_point_data data = { fn, user }; return isl_union_set_foreach_set(uset, &foreach_point, &data); @@ -520,7 +582,7 @@ isl_union_map *res; }; -static int subtract_entry(void **entry, void *user) +static isl_stat subtract_entry(void **entry, void *user) { struct isl_union_map_gen_bin_data *data = user; uint32_t hash; @@ -538,20 +600,20 @@ empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } if (empty) { isl_map_free(map); - return 0; + return isl_stat_ok; } } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } static __isl_give isl_union_map *gen_bin_op(__isl_take isl_union_map *umap1, - __isl_take isl_union_map *umap2, int (*fn)(void **, void *)) + __isl_take isl_union_map *umap2, isl_stat (*fn)(void **, void *)) { struct isl_union_map_gen_bin_data data = { NULL, NULL }; @@ -595,7 +657,7 @@ isl_union_map *res; }; -static int intersect_params_entry(void **entry, void *user) +static isl_stat intersect_params_entry(void **entry, void *user) { struct isl_union_map_gen_bin_set_data *data = user; isl_map *map = *entry; @@ -607,16 +669,16 @@ empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } static __isl_give isl_union_map *gen_bin_set_op(__isl_take isl_union_map *umap, - __isl_take isl_set *set, int (*fn)(void **, void *)) + __isl_take isl_set *set, isl_stat (*fn)(void **, void *)) { struct isl_union_map_gen_bin_set_data data = { NULL, NULL }; @@ -643,10 +705,28 @@ return NULL; } +/* Intersect "umap" with the parameter domain "set". + * + * If "set" does not have any constraints, then we can return immediately. + */ __isl_give isl_union_map *isl_union_map_intersect_params( __isl_take isl_union_map *umap, __isl_take isl_set *set) { + int is_universe; + + is_universe = isl_set_plain_is_universe(set); + if (is_universe < 0) + goto error; + if (is_universe) { + isl_set_free(set); + return umap; + } + return gen_bin_set_op(umap, set, &intersect_params_entry); +error: + isl_union_map_free(umap); + isl_set_free(set); + return NULL; } __isl_give isl_union_set *isl_union_set_intersect_params( @@ -674,7 +754,7 @@ __isl_give isl_map *(*fn)(__isl_take isl_map*, __isl_take isl_map*); }; -static int match_bin_entry(void **entry, void *user) +static isl_stat match_bin_entry(void **entry, void *user) { struct isl_union_map_match_bin_data *data = user; uint32_t hash; @@ -686,7 +766,7 @@ entry2 = isl_hash_table_find(data->umap2->dim->ctx, &data->umap2->table, hash, &has_dim, map->dim, 0); if (!entry2) - return 0; + return isl_stat_ok; map = isl_map_copy(map); map = data->fn(map, isl_map_copy(entry2->data)); @@ -694,16 +774,16 @@ empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } if (empty) { isl_map_free(map); - return 0; + return isl_stat_ok; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } static __isl_give isl_union_map *match_bin_op(__isl_take isl_union_map *umap1, @@ -766,7 +846,7 @@ return NULL; } -static int gist_params_entry(void **entry, void *user) +static isl_stat gist_params_entry(void **entry, void *user) { struct isl_union_map_gen_bin_set_data *data = user; isl_map *map = *entry; @@ -778,12 +858,12 @@ empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_gist_params( @@ -860,14 +940,14 @@ return isl_union_map_reverse(isl_union_map_lex_le_union_map(umap2, umap1)); } -static int intersect_domain_entry(void **entry, void *user) +static isl_stat intersect_domain_entry(void **entry, void *user) { struct isl_union_map_gen_bin_data *data = user; uint32_t hash; struct isl_hash_table_entry *entry2; isl_space *dim; isl_map *map = *entry; - int empty; + isl_bool empty; dim = isl_map_get_space(map); dim = isl_space_domain(dim); @@ -876,7 +956,7 @@ hash, &has_dim, dim, 0); isl_space_free(dim); if (!entry2) - return 0; + return isl_stat_ok; map = isl_map_copy(map); map = isl_map_intersect_domain(map, isl_set_copy(entry2->data)); @@ -884,16 +964,16 @@ empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } if (empty) { isl_map_free(map); - return 0; + return isl_stat_ok; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } /* Intersect the domain of "umap" with "uset". @@ -911,14 +991,14 @@ /* Remove the elements of data->umap2 from the domain of *entry * and add the result to data->res. */ -static int subtract_domain_entry(void **entry, void *user) +static isl_stat subtract_domain_entry(void **entry, void *user) { struct isl_union_map_gen_bin_data *data = user; uint32_t hash; struct isl_hash_table_entry *entry2; isl_space *dim; isl_map *map = *entry; - int empty; + isl_bool empty; dim = isl_map_get_space(map); dim = isl_space_domain(dim); @@ -931,7 +1011,7 @@ if (!entry2) { data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } map = isl_map_subtract_domain(map, isl_set_copy(entry2->data)); @@ -939,16 +1019,16 @@ empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } if (empty) { isl_map_free(map); - return 0; + return isl_stat_ok; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } /* Remove the elements of "uset" from the domain of "umap". @@ -962,14 +1042,14 @@ /* Remove the elements of data->umap2 from the range of *entry * and add the result to data->res. */ -static int subtract_range_entry(void **entry, void *user) +static isl_stat subtract_range_entry(void **entry, void *user) { struct isl_union_map_gen_bin_data *data = user; uint32_t hash; struct isl_hash_table_entry *entry2; isl_space *space; isl_map *map = *entry; - int empty; + isl_bool empty; space = isl_map_get_space(map); space = isl_space_range(space); @@ -982,7 +1062,7 @@ if (!entry2) { data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } map = isl_map_subtract_range(map, isl_set_copy(entry2->data)); @@ -990,16 +1070,16 @@ empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } if (empty) { isl_map_free(map); - return 0; + return isl_stat_ok; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } /* Remove the elements of "uset" from the range of "umap". @@ -1010,14 +1090,14 @@ return gen_bin_op(umap, dom, &subtract_range_entry); } -static int gist_domain_entry(void **entry, void *user) +static isl_stat gist_domain_entry(void **entry, void *user) { struct isl_union_map_gen_bin_data *data = user; uint32_t hash; struct isl_hash_table_entry *entry2; isl_space *dim; isl_map *map = *entry; - int empty; + isl_bool empty; dim = isl_map_get_space(map); dim = isl_space_domain(dim); @@ -1026,7 +1106,7 @@ hash, &has_dim, dim, 0); isl_space_free(dim); if (!entry2) - return 0; + return isl_stat_ok; map = isl_map_copy(map); map = isl_map_gist_domain(map, isl_set_copy(entry2->data)); @@ -1034,12 +1114,12 @@ empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } /* Compute the gist of "umap" with respect to the domain "uset". @@ -1054,14 +1134,14 @@ return gen_bin_op(umap, uset, &gist_domain_entry); } -static int gist_range_entry(void **entry, void *user) +static isl_stat gist_range_entry(void **entry, void *user) { struct isl_union_map_gen_bin_data *data = user; uint32_t hash; struct isl_hash_table_entry *entry2; isl_space *space; isl_map *map = *entry; - int empty; + isl_bool empty; space = isl_map_get_space(map); space = isl_space_range(space); @@ -1070,7 +1150,7 @@ hash, &has_dim, space, 0); isl_space_free(space); if (!entry2) - return 0; + return isl_stat_ok; map = isl_map_copy(map); map = isl_map_gist_range(map, isl_set_copy(entry2->data)); @@ -1078,12 +1158,12 @@ empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } /* Compute the gist of "umap" with respect to the range "uset". @@ -1094,14 +1174,14 @@ return gen_bin_op(umap, uset, &gist_range_entry); } -static int intersect_range_entry(void **entry, void *user) +static isl_stat intersect_range_entry(void **entry, void *user) { struct isl_union_map_gen_bin_data *data = user; uint32_t hash; struct isl_hash_table_entry *entry2; isl_space *dim; isl_map *map = *entry; - int empty; + isl_bool empty; dim = isl_map_get_space(map); dim = isl_space_range(dim); @@ -1110,7 +1190,7 @@ hash, &has_dim, dim, 0); isl_space_free(dim); if (!entry2) - return 0; + return isl_stat_ok; map = isl_map_copy(map); map = isl_map_intersect_range(map, isl_set_copy(entry2->data)); @@ -1118,16 +1198,16 @@ empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } if (empty) { isl_map_free(map); - return 0; + return isl_stat_ok; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_intersect_range( @@ -1140,37 +1220,37 @@ isl_union_map *umap2; isl_union_map *res; isl_map *map; - int (*fn)(void **entry, void *user); + isl_stat (*fn)(void **entry, void *user); }; -static int apply_range_entry(void **entry, void *user) +static isl_stat apply_range_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_map *map2 = *entry; - int empty; + isl_bool empty; - if (!isl_space_tuple_match(data->map->dim, isl_dim_out, + if (!isl_space_tuple_is_equal(data->map->dim, isl_dim_out, map2->dim, isl_dim_in)) - return 0; + return isl_stat_ok; map2 = isl_map_apply_range(isl_map_copy(data->map), isl_map_copy(map2)); empty = isl_map_is_empty(map2); if (empty < 0) { isl_map_free(map2); - return -1; + return isl_stat_error; } if (empty) { isl_map_free(map2); - return 0; + return isl_stat_ok; } data->res = isl_union_map_add_map(data->res, map2); - return 0; + return isl_stat_ok; } -static int bin_entry(void **entry, void *user) +static isl_stat bin_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_map *map = *entry; @@ -1178,13 +1258,14 @@ data->map = map; if (isl_hash_table_foreach(data->umap2->dim->ctx, &data->umap2->table, data->fn, data) < 0) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } static __isl_give isl_union_map *bin_op(__isl_take isl_union_map *umap1, - __isl_take isl_union_map *umap2, int (*fn)(void **entry, void *user)) + __isl_take isl_union_map *umap2, + isl_stat (*fn)(void **entry, void *user)) { struct isl_union_map_bin_data data = { NULL, NULL, NULL, fn }; @@ -1231,20 +1312,20 @@ return isl_union_map_apply_range(uset, umap); } -static int map_lex_lt_entry(void **entry, void *user) +static isl_stat map_lex_lt_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_map *map2 = *entry; - if (!isl_space_tuple_match(data->map->dim, isl_dim_out, + if (!isl_space_tuple_is_equal(data->map->dim, isl_dim_out, map2->dim, isl_dim_out)) - return 0; + return isl_stat_ok; map2 = isl_map_lex_lt_map(isl_map_copy(data->map), isl_map_copy(map2)); data->res = isl_union_map_add_map(data->res, map2); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_lex_lt_union_map( @@ -1253,20 +1334,20 @@ return bin_op(umap1, umap2, &map_lex_lt_entry); } -static int map_lex_le_entry(void **entry, void *user) +static isl_stat map_lex_le_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_map *map2 = *entry; - if (!isl_space_tuple_match(data->map->dim, isl_dim_out, + if (!isl_space_tuple_is_equal(data->map->dim, isl_dim_out, map2->dim, isl_dim_out)) - return 0; + return isl_stat_ok; map2 = isl_map_lex_le_map(isl_map_copy(data->map), isl_map_copy(map2)); data->res = isl_union_map_add_map(data->res, map2); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_lex_le_union_map( @@ -1275,7 +1356,7 @@ return bin_op(umap1, umap2, &map_lex_le_entry); } -static int product_entry(void **entry, void *user) +static isl_stat product_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_map *map2 = *entry; @@ -1284,7 +1365,7 @@ data->res = isl_union_map_add_map(data->res, map2); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_product(__isl_take isl_union_map *umap1, @@ -1293,7 +1374,7 @@ return bin_op(umap1, umap2, &product_entry); } -static int set_product_entry(void **entry, void *user) +static isl_stat set_product_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_set *set2 = *entry; @@ -1302,7 +1383,7 @@ data->res = isl_union_set_add_set(data->res, set2); - return 0; + return isl_stat_ok; } __isl_give isl_union_set *isl_union_set_product(__isl_take isl_union_set *uset1, @@ -1311,21 +1392,21 @@ return bin_op(uset1, uset2, &set_product_entry); } -static int domain_product_entry(void **entry, void *user) +static isl_stat domain_product_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_map *map2 = *entry; - if (!isl_space_tuple_match(data->map->dim, isl_dim_out, + if (!isl_space_tuple_is_equal(data->map->dim, isl_dim_out, map2->dim, isl_dim_out)) - return 0; + return isl_stat_ok; map2 = isl_map_domain_product(isl_map_copy(data->map), isl_map_copy(map2)); data->res = isl_union_map_add_map(data->res, map2); - return 0; + return isl_stat_ok; } /* Given two maps A -> B and C -> D, construct a map [A -> C] -> (B * D) @@ -1336,21 +1417,21 @@ return bin_op(umap1, umap2, &domain_product_entry); } -static int range_product_entry(void **entry, void *user) +static isl_stat range_product_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_map *map2 = *entry; - if (!isl_space_tuple_match(data->map->dim, isl_dim_in, + if (!isl_space_tuple_is_equal(data->map->dim, isl_dim_in, map2->dim, isl_dim_in)) - return 0; + return isl_stat_ok; map2 = isl_map_range_product(isl_map_copy(data->map), isl_map_copy(map2)); data->res = isl_union_map_add_map(data->res, map2); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_range_product( @@ -1359,21 +1440,49 @@ return bin_op(umap1, umap2, &range_product_entry); } -static int flat_range_product_entry(void **entry, void *user) +/* If data->map A -> B and "map2" C -> D have the same range space, + * then add (A, C) -> (B * D) to data->res. + */ +static isl_stat flat_domain_product_entry(void **entry, void *user) +{ + struct isl_union_map_bin_data *data = user; + isl_map *map2 = *entry; + + if (!isl_space_tuple_is_equal(data->map->dim, isl_dim_out, + map2->dim, isl_dim_out)) + return isl_stat_ok; + + map2 = isl_map_flat_domain_product(isl_map_copy(data->map), + isl_map_copy(map2)); + + data->res = isl_union_map_add_map(data->res, map2); + + return isl_stat_ok; +} + +/* Given two maps A -> B and C -> D, construct a map (A, C) -> (B * D). + */ +__isl_give isl_union_map *isl_union_map_flat_domain_product( + __isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2) +{ + return bin_op(umap1, umap2, &flat_domain_product_entry); +} + +static isl_stat flat_range_product_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_map *map2 = *entry; - if (!isl_space_tuple_match(data->map->dim, isl_dim_in, + if (!isl_space_tuple_is_equal(data->map->dim, isl_dim_in, map2->dim, isl_dim_in)) - return 0; + return isl_stat_ok; map2 = isl_map_flat_range_product(isl_map_copy(data->map), isl_map_copy(map2)); data->res = isl_union_map_add_map(data->res, map2); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_flat_range_product( @@ -1383,7 +1492,7 @@ } static __isl_give isl_union_set *cond_un_op(__isl_take isl_union_map *umap, - int (*fn)(void **, void *)) + isl_stat (*fn)(void **, void *)) { isl_union_set *res; @@ -1402,7 +1511,7 @@ return NULL; } -static int from_range_entry(void **entry, void *user) +static isl_stat from_range_entry(void **entry, void *user) { isl_map *set = *entry; isl_union_set **res = user; @@ -1410,7 +1519,7 @@ *res = isl_union_map_add_map(*res, isl_map_from_range(isl_set_copy(set))); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_from_range( @@ -1433,7 +1542,7 @@ } static __isl_give isl_union_map *un_op(__isl_take isl_union_map *umap, - int (*fn)(void **, void *)) + isl_stat (*fn)(void **, void *)) { umap = isl_union_map_cow(umap); if (!umap) @@ -1448,13 +1557,13 @@ return NULL; } -static int affine_entry(void **entry, void *user) +static isl_stat affine_entry(void **entry, void *user) { isl_map **map = (isl_map **)entry; *map = isl_map_from_basic_map(isl_map_affine_hull(*map)); - return *map ? 0 : -1; + return *map ? isl_stat_ok : isl_stat_error; } __isl_give isl_union_map *isl_union_map_affine_hull( @@ -1469,13 +1578,13 @@ return isl_union_map_affine_hull(uset); } -static int polyhedral_entry(void **entry, void *user) +static isl_stat polyhedral_entry(void **entry, void *user) { isl_map **map = (isl_map **)entry; *map = isl_map_from_basic_map(isl_map_polyhedral_hull(*map)); - return *map ? 0 : -1; + return *map ? isl_stat_ok : isl_stat_error; } __isl_give isl_union_map *isl_union_map_polyhedral_hull( @@ -1490,13 +1599,13 @@ return isl_union_map_polyhedral_hull(uset); } -static int simple_entry(void **entry, void *user) +static isl_stat simple_entry(void **entry, void *user) { isl_map **map = (isl_map **)entry; *map = isl_map_from_basic_map(isl_map_simple_hull(*map)); - return *map ? 0 : -1; + return *map ? isl_stat_ok : isl_stat_error; } __isl_give isl_union_map *isl_union_map_simple_hull( @@ -1511,7 +1620,7 @@ return isl_union_map_simple_hull(uset); } -static int inplace_entry(void **entry, void *user) +static isl_stat inplace_entry(void **entry, void *user) { __isl_give isl_map *(*fn)(__isl_take isl_map *); isl_map **map = (isl_map **)entry; @@ -1520,12 +1629,12 @@ fn = *(__isl_give isl_map *(**)(__isl_take isl_map *)) user; copy = fn(isl_map_copy(*map)); if (!copy) - return -1; + return isl_stat_error; isl_map_free(*map); *map = copy; - return 0; + return isl_stat_ok; } static __isl_give isl_union_map *inplace(__isl_take isl_union_map *umap, @@ -1544,6 +1653,24 @@ return NULL; } +/* Remove redundant constraints in each of the basic maps of "umap". + * Since removing redundant constraints does not change the meaning + * or the space, the operation can be performed in-place. + */ +__isl_give isl_union_map *isl_union_map_remove_redundancies( + __isl_take isl_union_map *umap) +{ + return inplace(umap, &isl_map_remove_redundancies); +} + +/* Remove redundant constraints in each of the basic sets of "uset". + */ +__isl_give isl_union_set *isl_union_set_remove_redundancies( + __isl_take isl_union_set *uset) +{ + return isl_union_map_remove_redundancies(uset); +} + __isl_give isl_union_map *isl_union_map_coalesce( __isl_take isl_union_map *umap) { @@ -1580,13 +1707,13 @@ return isl_union_map_compute_divs(uset); } -static int lexmin_entry(void **entry, void *user) +static isl_stat lexmin_entry(void **entry, void *user) { isl_map **map = (isl_map **)entry; *map = isl_map_lexmin(*map); - return *map ? 0 : -1; + return *map ? isl_stat_ok : isl_stat_error; } __isl_give isl_union_map *isl_union_map_lexmin( @@ -1601,13 +1728,13 @@ return isl_union_map_lexmin(uset); } -static int lexmax_entry(void **entry, void *user) +static isl_stat lexmax_entry(void **entry, void *user) { isl_map **map = (isl_map **)entry; *map = isl_map_lexmax(*map); - return *map ? 0 : -1; + return *map ? isl_stat_ok : isl_stat_error; } __isl_give isl_union_map *isl_union_map_lexmax( @@ -1622,7 +1749,7 @@ return isl_union_map_lexmax(uset); } -static int universe_entry(void **entry, void *user) +static isl_stat universe_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_map **res = user; @@ -1630,7 +1757,7 @@ map = isl_map_universe(isl_map_get_space(map)); *res = isl_union_map_add_map(*res, map); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_universe(__isl_take isl_union_map *umap) @@ -1643,14 +1770,14 @@ return isl_union_map_universe(uset); } -static int reverse_entry(void **entry, void *user) +static isl_stat reverse_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_map **res = user; *res = isl_union_map_add_map(*res, isl_map_reverse(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_reverse(__isl_take isl_union_map *umap) @@ -1658,14 +1785,14 @@ return cond_un_op(umap, &reverse_entry); } -static int params_entry(void **entry, void *user) +static isl_stat params_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_set **res = user; *res = isl_union_set_add_set(*res, isl_map_params(isl_map_copy(map))); - return 0; + return isl_stat_ok; } /* Compute the parameter domain of the given union map. @@ -1676,10 +1803,17 @@ empty = isl_union_map_is_empty(umap); if (empty < 0) - return isl_union_map_free(umap); - if (empty) - return isl_set_empty(isl_union_map_get_space(umap)); + goto error; + if (empty) { + isl_space *space; + space = isl_union_map_get_space(umap); + isl_union_map_free(umap); + return isl_set_empty(space); + } return isl_set_from_union_set(cond_un_op(umap, ¶ms_entry)); +error: + isl_union_map_free(umap); + return NULL; } /* Compute the parameter domain of the given union set. @@ -1689,14 +1823,14 @@ return isl_union_map_params(uset); } -static int domain_entry(void **entry, void *user) +static isl_stat domain_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_set **res = user; *res = isl_union_set_add_set(*res, isl_map_domain(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_set *isl_union_map_domain(__isl_take isl_union_map *umap) @@ -1704,14 +1838,14 @@ return cond_un_op(umap, &domain_entry); } -static int range_entry(void **entry, void *user) +static isl_stat range_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_set **res = user; *res = isl_union_set_add_set(*res, isl_map_range(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_set *isl_union_map_range(__isl_take isl_union_map *umap) @@ -1719,7 +1853,7 @@ return cond_un_op(umap, &range_entry); } -static int domain_map_entry(void **entry, void *user) +static isl_stat domain_map_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_set **res = user; @@ -1727,7 +1861,7 @@ *res = isl_union_map_add_map(*res, isl_map_domain_map(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_domain_map( @@ -1736,7 +1870,40 @@ return cond_un_op(umap, &domain_map_entry); } -static int range_map_entry(void **entry, void *user) +/* Construct an isl_pw_multi_aff that maps "map" to its domain and + * add the result to "res". + */ +static isl_stat domain_map_upma(__isl_take isl_map *map, void *user) +{ + isl_union_pw_multi_aff **res = user; + isl_multi_aff *ma; + isl_pw_multi_aff *pma; + + ma = isl_multi_aff_domain_map(isl_map_get_space(map)); + pma = isl_pw_multi_aff_alloc(isl_map_wrap(map), ma); + *res = isl_union_pw_multi_aff_add_pw_multi_aff(*res, pma); + + return *res ? isl_stat_ok : isl_stat_error; + +} + +/* Return an isl_union_pw_multi_aff that maps a wrapped copy of "umap" + * to its domain. + */ +__isl_give isl_union_pw_multi_aff *isl_union_map_domain_map_union_pw_multi_aff( + __isl_take isl_union_map *umap) +{ + isl_union_pw_multi_aff *res; + + res = isl_union_pw_multi_aff_empty(isl_union_map_get_space(umap)); + if (isl_union_map_foreach_map(umap, &domain_map_upma, &res) < 0) + res = isl_union_pw_multi_aff_free(res); + + isl_union_map_free(umap); + return res; +} + +static isl_stat range_map_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_set **res = user; @@ -1744,7 +1911,7 @@ *res = isl_union_map_add_map(*res, isl_map_range_map(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_range_map( @@ -1753,17 +1920,48 @@ return cond_un_op(umap, &range_map_entry); } -static int deltas_entry(void **entry, void *user) +/* Check if "set" is of the form A[B -> C]. + * If so, add A[B -> C] -> B to "res". + */ +static isl_stat wrapped_domain_map_entry(void **entry, void *user) +{ + isl_set *set = *entry; + isl_union_set **res = user; + int wrapping; + + wrapping = isl_set_is_wrapping(set); + if (wrapping < 0) + return isl_stat_error; + if (!wrapping) + return isl_stat_ok; + + *res = isl_union_map_add_map(*res, + isl_set_wrapped_domain_map(isl_set_copy(set))); + + return isl_stat_ok; +} + +/* Given a collection of wrapped maps of the form A[B -> C], + * return the collection of maps A[B -> C] -> B. + */ +__isl_give isl_union_map *isl_union_set_wrapped_domain_map( + __isl_take isl_union_set *uset) +{ + return cond_un_op(uset, &wrapped_domain_map_entry); +} + +static isl_stat deltas_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_set **res = user; - if (!isl_space_tuple_match(map->dim, isl_dim_in, map->dim, isl_dim_out)) - return 0; + if (!isl_space_tuple_is_equal(map->dim, isl_dim_in, + map->dim, isl_dim_out)) + return isl_stat_ok; *res = isl_union_set_add_set(*res, isl_map_deltas(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_set *isl_union_map_deltas(__isl_take isl_union_map *umap) @@ -1771,18 +1969,19 @@ return cond_un_op(umap, &deltas_entry); } -static int deltas_map_entry(void **entry, void *user) +static isl_stat deltas_map_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_map **res = user; - if (!isl_space_tuple_match(map->dim, isl_dim_in, map->dim, isl_dim_out)) - return 0; + if (!isl_space_tuple_is_equal(map->dim, isl_dim_in, + map->dim, isl_dim_out)) + return isl_stat_ok; *res = isl_union_map_add_map(*res, isl_map_deltas_map(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_deltas_map( @@ -1791,14 +1990,14 @@ return cond_un_op(umap, &deltas_map_entry); } -static int identity_entry(void **entry, void *user) +static isl_stat identity_entry(void **entry, void *user) { isl_set *set = *entry; isl_union_map **res = user; *res = isl_union_map_add_map(*res, isl_set_identity(isl_set_copy(set))); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_set_identity(__isl_take isl_union_set *uset) @@ -1806,17 +2005,174 @@ return cond_un_op(uset, &identity_entry); } -static int unwrap_entry(void **entry, void *user) +/* Construct an identity isl_pw_multi_aff on "set" and add it to *res. + */ +static isl_stat identity_upma(__isl_take isl_set *set, void *user) +{ + isl_union_pw_multi_aff **res = user; + isl_space *space; + isl_pw_multi_aff *pma; + + space = isl_space_map_from_set(isl_set_get_space(set)); + pma = isl_pw_multi_aff_identity(space); + pma = isl_pw_multi_aff_intersect_domain(pma, set); + *res = isl_union_pw_multi_aff_add_pw_multi_aff(*res, pma); + + return *res ? isl_stat_ok : isl_stat_error; +} + +/* Return an identity function on "uset" in the form + * of an isl_union_pw_multi_aff. + */ +__isl_give isl_union_pw_multi_aff *isl_union_set_identity_union_pw_multi_aff( + __isl_take isl_union_set *uset) +{ + isl_union_pw_multi_aff *res; + + res = isl_union_pw_multi_aff_empty(isl_union_set_get_space(uset)); + if (isl_union_set_foreach_set(uset, &identity_upma, &res) < 0) + res = isl_union_pw_multi_aff_free(res); + + isl_union_set_free(uset); + return res; +} + +/* If "map" is of the form [A -> B] -> C, then add A -> C to "res". + */ +static isl_stat domain_factor_domain_entry(void **entry, void *user) +{ + isl_map *map = *entry; + isl_union_map **res = user; + + if (!isl_map_domain_is_wrapping(map)) + return isl_stat_ok; + + *res = isl_union_map_add_map(*res, + isl_map_domain_factor_domain(isl_map_copy(map))); + + return *res ? isl_stat_ok : isl_stat_error; +} + +/* For each map in "umap" of the form [A -> B] -> C, + * construct the map A -> C and collect the results. + */ +__isl_give isl_union_map *isl_union_map_domain_factor_domain( + __isl_take isl_union_map *umap) +{ + return cond_un_op(umap, &domain_factor_domain_entry); +} + +/* If "map" is of the form [A -> B] -> C, then add B -> C to "res". + */ +static isl_stat domain_factor_range_entry(void **entry, void *user) +{ + isl_map *map = *entry; + isl_union_map **res = user; + + if (!isl_map_domain_is_wrapping(map)) + return isl_stat_ok; + + *res = isl_union_map_add_map(*res, + isl_map_domain_factor_range(isl_map_copy(map))); + + return *res ? isl_stat_ok : isl_stat_error; +} + +/* For each map in "umap" of the form [A -> B] -> C, + * construct the map B -> C and collect the results. + */ +__isl_give isl_union_map *isl_union_map_domain_factor_range( + __isl_take isl_union_map *umap) +{ + return cond_un_op(umap, &domain_factor_range_entry); +} + +/* If "map" is of the form A -> [B -> C], then add A -> C to "res". + */ +static isl_stat range_factor_range_entry(void **entry, void *user) +{ + isl_map *map = *entry; + isl_union_map **res = user; + + if (!isl_map_range_is_wrapping(map)) + return isl_stat_ok; + + *res = isl_union_map_add_map(*res, + isl_map_range_factor_range(isl_map_copy(map))); + + return *res ? isl_stat_ok : isl_stat_error; +} + +/* For each map in "umap" of the form A -> [B -> C], + * construct the map A -> C and collect the results. + */ +__isl_give isl_union_map *isl_union_map_range_factor_range( + __isl_take isl_union_map *umap) +{ + return cond_un_op(umap, &range_factor_range_entry); +} + +/* If "map" is of the form [A -> B] -> [C -> D], then add A -> C to "res". + */ +static isl_stat factor_domain_entry(void **entry, void *user) +{ + isl_map *map = *entry; + isl_union_map **res = user; + + if (!isl_map_domain_is_wrapping(map) || !isl_map_range_is_wrapping(map)) + return isl_stat_ok; + + *res = isl_union_map_add_map(*res, + isl_map_factor_domain(isl_map_copy(map))); + + return *res ? isl_stat_ok : isl_stat_error; +} + +/* For each map in "umap" of the form [A -> B] -> [C -> D], + * construct the map A -> C and collect the results. + */ +__isl_give isl_union_map *isl_union_map_factor_domain( + __isl_take isl_union_map *umap) +{ + return cond_un_op(umap, &factor_domain_entry); +} + +/* If "map" is of the form [A -> B] -> [C -> D], then add B -> D to "res". + */ +static isl_stat factor_range_entry(void **entry, void *user) +{ + isl_map *map = *entry; + isl_union_map **res = user; + + if (!isl_map_domain_is_wrapping(map) || !isl_map_range_is_wrapping(map)) + return isl_stat_ok; + + *res = isl_union_map_add_map(*res, + isl_map_factor_range(isl_map_copy(map))); + + return *res ? isl_stat_ok : isl_stat_error; +} + +/* For each map in "umap" of the form [A -> B] -> [C -> D], + * construct the map B -> D and collect the results. + */ +__isl_give isl_union_map *isl_union_map_factor_range( + __isl_take isl_union_map *umap) +{ + return cond_un_op(umap, &factor_range_entry); +} + +static isl_stat unwrap_entry(void **entry, void *user) { isl_set *set = *entry; isl_union_set **res = user; if (!isl_set_is_wrapping(set)) - return 0; + return isl_stat_ok; *res = isl_union_map_add_map(*res, isl_set_unwrap(isl_set_copy(set))); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_set_unwrap(__isl_take isl_union_set *uset) @@ -1824,14 +2180,14 @@ return cond_un_op(uset, &unwrap_entry); } -static int wrap_entry(void **entry, void *user) +static isl_stat wrap_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_set **res = user; *res = isl_union_set_add_set(*res, isl_map_wrap(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_set *isl_union_map_wrap(__isl_take isl_union_map *umap) @@ -1841,10 +2197,10 @@ struct isl_union_map_is_subset_data { isl_union_map *umap2; - int is_subset; + isl_bool is_subset; }; -static int is_subset_entry(void **entry, void *user) +static isl_stat is_subset_entry(void **entry, void *user) { struct isl_union_map_is_subset_data *data = user; uint32_t hash; @@ -1857,24 +2213,24 @@ if (!entry2) { int empty = isl_map_is_empty(map); if (empty < 0) - return -1; + return isl_stat_error; if (empty) - return 0; + return isl_stat_ok; data->is_subset = 0; - return -1; + return isl_stat_error; } data->is_subset = isl_map_is_subset(map, entry2->data); if (data->is_subset < 0 || !data->is_subset) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } -int isl_union_map_is_subset(__isl_keep isl_union_map *umap1, +isl_bool isl_union_map_is_subset(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2) { - struct isl_union_map_is_subset_data data = { NULL, 1 }; + struct isl_union_map_is_subset_data data = { NULL, isl_bool_true }; umap1 = isl_union_map_copy(umap1); umap2 = isl_union_map_copy(umap2); @@ -1897,68 +2253,142 @@ error: isl_union_map_free(umap1); isl_union_map_free(umap2); - return -1; + return isl_bool_error; } -int isl_union_set_is_subset(__isl_keep isl_union_set *uset1, +isl_bool isl_union_set_is_subset(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2) { return isl_union_map_is_subset(uset1, uset2); } -int isl_union_map_is_equal(__isl_keep isl_union_map *umap1, +isl_bool isl_union_map_is_equal(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2) { - int is_subset; + isl_bool is_subset; if (!umap1 || !umap2) - return -1; + return isl_bool_error; is_subset = isl_union_map_is_subset(umap1, umap2); - if (is_subset != 1) + if (is_subset != isl_bool_true) return is_subset; is_subset = isl_union_map_is_subset(umap2, umap1); return is_subset; } -int isl_union_set_is_equal(__isl_keep isl_union_set *uset1, +isl_bool isl_union_set_is_equal(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2) { return isl_union_map_is_equal(uset1, uset2); } -int isl_union_map_is_strict_subset(__isl_keep isl_union_map *umap1, +isl_bool isl_union_map_is_strict_subset(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2) { - int is_subset; + isl_bool is_subset; if (!umap1 || !umap2) - return -1; + return isl_bool_error; is_subset = isl_union_map_is_subset(umap1, umap2); - if (is_subset != 1) + if (is_subset != isl_bool_true) return is_subset; is_subset = isl_union_map_is_subset(umap2, umap1); - if (is_subset == -1) + if (is_subset == isl_bool_error) return is_subset; return !is_subset; } -int isl_union_set_is_strict_subset(__isl_keep isl_union_set *uset1, +isl_bool isl_union_set_is_strict_subset(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2) { return isl_union_map_is_strict_subset(uset1, uset2); } -static int sample_entry(void **entry, void *user) -{ +/* Internal data structure for isl_union_map_is_disjoint. + * umap2 is the union map with which we are comparing. + * is_disjoint is initialized to 1 and is set to 0 as soon + * as the union maps turn out not to be disjoint. + */ +struct isl_union_map_is_disjoint_data { + isl_union_map *umap2; + isl_bool is_disjoint; +}; + +/* Check if "map" is disjoint from data->umap2 and abort + * the search if it is not. + */ +static isl_stat is_disjoint_entry(void **entry, void *user) +{ + struct isl_union_map_is_disjoint_data *data = user; + uint32_t hash; + struct isl_hash_table_entry *entry2; + isl_map *map = *entry; + + hash = isl_space_get_hash(map->dim); + entry2 = isl_hash_table_find(data->umap2->dim->ctx, &data->umap2->table, + hash, &has_dim, map->dim, 0); + if (!entry2) + return isl_stat_ok; + + data->is_disjoint = isl_map_is_disjoint(map, entry2->data); + if (data->is_disjoint < 0 || !data->is_disjoint) + return isl_stat_error; + + return isl_stat_ok; +} + +/* Are "umap1" and "umap2" disjoint? + */ +isl_bool isl_union_map_is_disjoint(__isl_keep isl_union_map *umap1, + __isl_keep isl_union_map *umap2) +{ + struct isl_union_map_is_disjoint_data data = { NULL, isl_bool_true }; + + umap1 = isl_union_map_copy(umap1); + umap2 = isl_union_map_copy(umap2); + umap1 = isl_union_map_align_params(umap1, + isl_union_map_get_space(umap2)); + umap2 = isl_union_map_align_params(umap2, + isl_union_map_get_space(umap1)); + + if (!umap1 || !umap2) + goto error; + + data.umap2 = umap2; + if (isl_hash_table_foreach(umap1->dim->ctx, &umap1->table, + &is_disjoint_entry, &data) < 0 && + data.is_disjoint) + goto error; + + isl_union_map_free(umap1); + isl_union_map_free(umap2); + + return data.is_disjoint; +error: + isl_union_map_free(umap1); + isl_union_map_free(umap2); + return isl_bool_error; +} + +/* Are "uset1" and "uset2" disjoint? + */ +isl_bool isl_union_set_is_disjoint(__isl_keep isl_union_set *uset1, + __isl_keep isl_union_set *uset2) +{ + return isl_union_map_is_disjoint(uset1, uset2); +} + +static isl_stat sample_entry(void **entry, void *user) +{ isl_basic_map **sample = (isl_basic_map **)user; isl_map *map = *entry; *sample = isl_map_sample(isl_map_copy(map)); if (!*sample) - return -1; + return isl_stat_error; if (!isl_basic_map_plain_is_empty(*sample)) - return -1; - return 0; + return isl_stat_error; + return isl_stat_ok; } __isl_give isl_basic_map *isl_union_map_sample(__isl_take isl_union_map *umap) @@ -1990,99 +2420,100 @@ } struct isl_forall_data { - int res; - int (*fn)(__isl_keep isl_map *map); + isl_bool res; + isl_bool (*fn)(__isl_keep isl_map *map); }; -static int forall_entry(void **entry, void *user) +static isl_stat forall_entry(void **entry, void *user) { struct isl_forall_data *data = user; isl_map *map = *entry; data->res = data->fn(map); if (data->res < 0) - return -1; + return isl_stat_error; if (!data->res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } -static int union_map_forall(__isl_keep isl_union_map *umap, - int (*fn)(__isl_keep isl_map *map)) +static isl_bool union_map_forall(__isl_keep isl_union_map *umap, + isl_bool (*fn)(__isl_keep isl_map *map)) { - struct isl_forall_data data = { 1, fn }; + struct isl_forall_data data = { isl_bool_true, fn }; if (!umap) - return -1; + return isl_bool_error; if (isl_hash_table_foreach(umap->dim->ctx, &umap->table, &forall_entry, &data) < 0 && data.res) - return -1; + return isl_bool_error; return data.res; } struct isl_forall_user_data { - int res; - int (*fn)(__isl_keep isl_map *map, void *user); + isl_bool res; + isl_bool (*fn)(__isl_keep isl_map *map, void *user); void *user; }; -static int forall_user_entry(void **entry, void *user) +static isl_stat forall_user_entry(void **entry, void *user) { struct isl_forall_user_data *data = user; isl_map *map = *entry; data->res = data->fn(map, data->user); if (data->res < 0) - return -1; + return isl_stat_error; if (!data->res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Check if fn(map, user) returns true for all maps "map" in umap. */ -static int union_map_forall_user(__isl_keep isl_union_map *umap, - int (*fn)(__isl_keep isl_map *map, void *user), void *user) +static isl_bool union_map_forall_user(__isl_keep isl_union_map *umap, + isl_bool (*fn)(__isl_keep isl_map *map, void *user), void *user) { - struct isl_forall_user_data data = { 1, fn, user }; + struct isl_forall_user_data data = { isl_bool_true, fn, user }; if (!umap) - return -1; + return isl_bool_error; if (isl_hash_table_foreach(umap->dim->ctx, &umap->table, &forall_user_entry, &data) < 0 && data.res) - return -1; + return isl_bool_error; return data.res; } -int isl_union_map_is_empty(__isl_keep isl_union_map *umap) +isl_bool isl_union_map_is_empty(__isl_keep isl_union_map *umap) { return union_map_forall(umap, &isl_map_is_empty); } -int isl_union_set_is_empty(__isl_keep isl_union_set *uset) +isl_bool isl_union_set_is_empty(__isl_keep isl_union_set *uset) { return isl_union_map_is_empty(uset); } -static int is_subset_of_identity(__isl_keep isl_map *map) +static isl_bool is_subset_of_identity(__isl_keep isl_map *map) { - int is_subset; + isl_bool is_subset; isl_space *dim; isl_map *id; if (!map) - return -1; + return isl_bool_error; - if (!isl_space_tuple_match(map->dim, isl_dim_in, map->dim, isl_dim_out)) - return 0; + if (!isl_space_tuple_is_equal(map->dim, isl_dim_in, + map->dim, isl_dim_out)) + return isl_bool_false; dim = isl_map_get_space(map); id = isl_map_identity(dim); @@ -2094,40 +2525,104 @@ return is_subset; } -/* Check if the given map is single-valued. - * We simply compute +/* Given an isl_union_map that consists of a single map, check + * if it is single-valued. + */ +static isl_bool single_map_is_single_valued(__isl_keep isl_union_map *umap) +{ + isl_map *map; + isl_bool sv; + + umap = isl_union_map_copy(umap); + map = isl_map_from_union_map(umap); + sv = isl_map_is_single_valued(map); + isl_map_free(map); + + return sv; +} + +/* Internal data structure for single_valued_on_domain. + * + * "umap" is the union map to be tested. + * "sv" is set to 1 as long as "umap" may still be single-valued. + */ +struct isl_union_map_is_sv_data { + isl_union_map *umap; + isl_bool sv; +}; + +/* Check if the data->umap is single-valued on "set". + * + * If data->umap consists of a single map on "set", then test it + * as an isl_map. + * + * Otherwise, compute * * M \circ M^-1 * - * and check if the result is a subset of the identity mapping. + * check if the result is a subset of the identity mapping and + * store the result in data->sv. + * + * Terminate as soon as data->umap has been determined not to + * be single-valued. */ -int isl_union_map_is_single_valued(__isl_keep isl_union_map *umap) +static isl_stat single_valued_on_domain(__isl_take isl_set *set, void *user) { - isl_union_map *test; - int sv; + struct isl_union_map_is_sv_data *data = user; + isl_union_map *umap, *test; + + umap = isl_union_map_copy(data->umap); + umap = isl_union_map_intersect_domain(umap, + isl_union_set_from_set(set)); if (isl_union_map_n_map(umap) == 1) { - isl_map *map; - umap = isl_union_map_copy(umap); - map = isl_map_from_union_map(umap); - sv = isl_map_is_single_valued(map); - isl_map_free(map); - return sv; + data->sv = single_map_is_single_valued(umap); + isl_union_map_free(umap); + } else { + test = isl_union_map_reverse(isl_union_map_copy(umap)); + test = isl_union_map_apply_range(test, umap); + + data->sv = union_map_forall(test, &is_subset_of_identity); + + isl_union_map_free(test); } - test = isl_union_map_reverse(isl_union_map_copy(umap)); - test = isl_union_map_apply_range(test, isl_union_map_copy(umap)); + if (data->sv < 0 || !data->sv) + return isl_stat_error; + return isl_stat_ok; +} - sv = union_map_forall(test, &is_subset_of_identity); +/* Check if the given map is single-valued. + * + * If the union map consists of a single map, then test it as an isl_map. + * Otherwise, check if the union map is single-valued on each of its + * domain spaces. + */ +isl_bool isl_union_map_is_single_valued(__isl_keep isl_union_map *umap) +{ + isl_union_map *universe; + isl_union_set *domain; + struct isl_union_map_is_sv_data data; - isl_union_map_free(test); + if (isl_union_map_n_map(umap) == 1) + return single_map_is_single_valued(umap); - return sv; + universe = isl_union_map_universe(isl_union_map_copy(umap)); + domain = isl_union_map_domain(universe); + + data.sv = isl_bool_true; + data.umap = umap; + if (isl_union_set_foreach_set(domain, + &single_valued_on_domain, &data) < 0 && data.sv) + data.sv = isl_bool_error; + isl_union_set_free(domain); + + return data.sv; } -int isl_union_map_is_injective(__isl_keep isl_union_map *umap) +isl_bool isl_union_map_is_injective(__isl_keep isl_union_map *umap) { - int in; + isl_bool in; umap = isl_union_map_copy(umap); umap = isl_union_map_reverse(umap); @@ -2195,7 +2690,7 @@ int pos; }; -static int fixed_at_pos(__isl_keep isl_map *map, void *user) +static isl_bool fixed_at_pos(__isl_keep isl_map *map, void *user) { struct isl_fixed_dim_data *data = user; @@ -2204,7 +2699,7 @@ &data->v[data->n++].v); } -static int plain_injective_on_range(__isl_take isl_union_map *umap, +static isl_bool plain_injective_on_range(__isl_take isl_union_map *umap, int first, int n_range); /* Given a list of the maps, with their fixed values at output dimension "pos", @@ -2268,7 +2763,7 @@ * and then check if these values, possibly along with fixed values * at later dimensions, entail distinct ranges. */ -static int plain_injective_on_range(__isl_take isl_union_map *umap, +static isl_bool plain_injective_on_range(__isl_take isl_union_map *umap, int first, int n_range) { isl_ctx *ctx; @@ -2283,12 +2778,12 @@ if (n <= 1) { isl_union_map_free(umap); - return 1; + return isl_bool_true; } if (first >= n_range) { isl_union_map_free(umap); - return 0; + return isl_bool_false; } data.v = alloc_isl_fixed_map_array(ctx, n); @@ -2296,7 +2791,7 @@ goto error; for (data.pos = first; data.pos < n_range; ++data.pos) { - int fixed; + isl_bool fixed; int injective; isl_space *dim; @@ -2315,17 +2810,18 @@ free_isl_fixed_map_array(data.v, n); isl_union_map_free(umap); - return 0; + return isl_bool_false; error: free_isl_fixed_map_array(data.v, n); isl_union_map_free(umap); - return -1; + return isl_bool_error; } /* Check whether the maps in umap that map to subsets of "ran" * have obviously distinct ranges. */ -static int plain_injective_on_range_wrap(__isl_keep isl_set *ran, void *user) +static isl_bool plain_injective_on_range_wrap(__isl_keep isl_set *ran, + void *user) { isl_union_map *umap = user; @@ -2341,17 +2837,17 @@ * injective and then check if all the ranges of these maps are * obviously disjoint. */ -int isl_union_map_plain_is_injective(__isl_keep isl_union_map *umap) +isl_bool isl_union_map_plain_is_injective(__isl_keep isl_union_map *umap) { - int in; + isl_bool in; isl_union_map *univ; isl_union_set *ran; in = union_map_forall(umap, &isl_map_plain_is_injective); if (in < 0) - return -1; + return isl_bool_error; if (!in) - return 0; + return isl_bool_false; univ = isl_union_map_universe(isl_union_map_copy(umap)); ran = isl_union_map_range(univ); @@ -2363,9 +2859,9 @@ return in; } -int isl_union_map_is_bijective(__isl_keep isl_union_map *umap) +isl_bool isl_union_map_is_bijective(__isl_keep isl_union_map *umap) { - int sv; + isl_bool sv; sv = isl_union_map_is_single_valued(umap); if (sv < 0 || !sv) @@ -2374,17 +2870,17 @@ return isl_union_map_is_injective(umap); } -static int zip_entry(void **entry, void *user) +static isl_stat zip_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_map **res = user; if (!isl_map_can_zip(map)) - return 0; + return isl_stat_ok; *res = isl_union_map_add_map(*res, isl_map_zip(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_zip(__isl_take isl_union_map *umap) @@ -2392,17 +2888,17 @@ return cond_un_op(umap, &zip_entry); } -static int uncurry_entry(void **entry, void *user) +static isl_stat uncurry_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_map **res = user; if (!isl_map_can_uncurry(map)) - return 0; + return isl_stat_ok; *res = isl_union_map_add_map(*res, isl_map_uncurry(isl_map_copy(map))); - return 0; + return isl_stat_ok; } /* Given a union map, take the maps of the form A -> (B -> C) and @@ -2413,17 +2909,17 @@ return cond_un_op(umap, &uncurry_entry); } -static int curry_entry(void **entry, void *user) +static isl_stat curry_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_map **res = user; if (!isl_map_can_curry(map)) - return 0; + return isl_stat_ok; *res = isl_union_map_add_map(*res, isl_map_curry(isl_map_copy(map))); - return 0; + return isl_stat_ok; } /* Given a union map, take the maps of the form (A -> B) -> C and @@ -2434,14 +2930,14 @@ return cond_un_op(umap, &curry_entry); } -static int lift_entry(void **entry, void *user) +static isl_stat lift_entry(void **entry, void *user) { isl_set *set = *entry; isl_union_set **res = user; *res = isl_union_set_add_set(*res, isl_set_lift(isl_set_copy(set))); - return 0; + return isl_stat_ok; } __isl_give isl_union_set *isl_union_set_lift(__isl_take isl_union_set *uset) @@ -2449,7 +2945,7 @@ return cond_un_op(uset, &lift_entry); } -static int coefficients_entry(void **entry, void *user) +static isl_stat coefficients_entry(void **entry, void *user) { isl_set *set = *entry; isl_union_set **res = user; @@ -2458,7 +2954,7 @@ set = isl_set_from_basic_set(isl_set_coefficients(set)); *res = isl_union_set_add_set(*res, set); - return 0; + return isl_stat_ok; } __isl_give isl_union_set *isl_union_set_coefficients( @@ -2486,7 +2982,7 @@ return NULL; } -static int solutions_entry(void **entry, void *user) +static isl_stat solutions_entry(void **entry, void *user) { isl_set *set = *entry; isl_union_set **res = user; @@ -2499,9 +2995,9 @@ *res = isl_union_set_add_set(*res, set); if (!*res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } __isl_give isl_union_set *isl_union_set_solutions( @@ -2530,49 +3026,162 @@ return NULL; } -/* Internal data structure for isl_union_map_preimage_domain_multi_aff. +/* Is the domain space of "map" equal to "space"? + */ +static int domain_match(__isl_keep isl_map *map, __isl_keep isl_space *space) +{ + return isl_space_tuple_is_equal(map->dim, isl_dim_in, + space, isl_dim_out); +} + +/* Is the range space of "map" equal to "space"? + */ +static int range_match(__isl_keep isl_map *map, __isl_keep isl_space *space) +{ + return isl_space_tuple_is_equal(map->dim, isl_dim_out, + space, isl_dim_out); +} + +/* Is the set space of "map" equal to "space"? + */ +static int set_match(__isl_keep isl_map *map, __isl_keep isl_space *space) +{ + return isl_space_tuple_is_equal(map->dim, isl_dim_set, + space, isl_dim_out); +} + +/* Internal data structure for preimage_pw_multi_aff. * - * "ma" is the function under which the preimage should be taken. - * "space" is the space of "ma". + * "pma" is the function under which the preimage should be taken. + * "space" is the space of "pma". * "res" collects the results. + * "fn" computes the preimage for a given map. + * "match" returns true if "fn" can be called. */ -struct isl_union_map_preimage_domain_data { +struct isl_union_map_preimage_data { isl_space *space; - isl_multi_aff *ma; + isl_pw_multi_aff *pma; isl_union_map *res; + int (*match)(__isl_keep isl_map *map, __isl_keep isl_space *space); + __isl_give isl_map *(*fn)(__isl_take isl_map *map, + __isl_take isl_pw_multi_aff *pma); }; -/* Compute the preimage of the domain of *entry under the function - * represented by data->ma, provided the domain space of *entry - * match the target space of data->ma, and add the result to data->res. +/* Call data->fn to compute the preimage of the domain or range of *entry + * under the function represented by data->pma, provided the domain/range + * space of *entry matches the target space of data->pma + * (as given by data->match), and add the result to data->res. */ -static int preimage_domain_entry(void **entry, void *user) +static isl_stat preimage_entry(void **entry, void *user) { int m; isl_map *map = *entry; - struct isl_union_map_preimage_domain_data *data = user; - int empty; + struct isl_union_map_preimage_data *data = user; + isl_bool empty; - m = isl_space_tuple_match(map->dim, isl_dim_in, - data->space, isl_dim_out); + m = data->match(map, data->space); if (m < 0) - return -1; + return isl_stat_error; if (!m) - return 0; + return isl_stat_ok; map = isl_map_copy(map); - map = isl_map_preimage_domain_multi_aff(map, - isl_multi_aff_copy(data->ma)); + map = data->fn(map, isl_pw_multi_aff_copy(data->pma)); empty = isl_map_is_empty(map); if (empty < 0 || empty) { isl_map_free(map); - return empty < 0 ? -1 : 0; + return empty < 0 ? isl_stat_error : isl_stat_ok; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; +} + +/* Compute the preimage of the domain or range of "umap" under the function + * represented by "pma". + * In other words, plug in "pma" in the domain or range of "umap". + * The function "fn" performs the actual preimage computation on a map, + * while "match" determines to which maps the function should be applied. + */ +static __isl_give isl_union_map *preimage_pw_multi_aff( + __isl_take isl_union_map *umap, __isl_take isl_pw_multi_aff *pma, + int (*match)(__isl_keep isl_map *map, __isl_keep isl_space *space), + __isl_give isl_map *(*fn)(__isl_take isl_map *map, + __isl_take isl_pw_multi_aff *pma)) +{ + isl_ctx *ctx; + isl_space *space; + struct isl_union_map_preimage_data data; + + umap = isl_union_map_align_params(umap, + isl_pw_multi_aff_get_space(pma)); + pma = isl_pw_multi_aff_align_params(pma, isl_union_map_get_space(umap)); + + if (!umap || !pma) + goto error; + + ctx = isl_union_map_get_ctx(umap); + space = isl_union_map_get_space(umap); + data.space = isl_pw_multi_aff_get_space(pma); + data.pma = pma; + data.res = isl_union_map_alloc(space, umap->table.n); + data.match = match; + data.fn = fn; + if (isl_hash_table_foreach(ctx, &umap->table, &preimage_entry, + &data) < 0) + data.res = isl_union_map_free(data.res); + + isl_space_free(data.space); + isl_union_map_free(umap); + isl_pw_multi_aff_free(pma); + return data.res; +error: + isl_union_map_free(umap); + isl_pw_multi_aff_free(pma); + return NULL; +} + +/* Compute the preimage of the domain of "umap" under the function + * represented by "pma". + * In other words, plug in "pma" in the domain of "umap". + * The result contains maps that live in the same spaces as the maps of "umap" + * with domain space equal to the target space of "pma", + * except that the domain has been replaced by the domain space of "pma". + */ +__isl_give isl_union_map *isl_union_map_preimage_domain_pw_multi_aff( + __isl_take isl_union_map *umap, __isl_take isl_pw_multi_aff *pma) +{ + return preimage_pw_multi_aff(umap, pma, &domain_match, + &isl_map_preimage_domain_pw_multi_aff); +} + +/* Compute the preimage of the range of "umap" under the function + * represented by "pma". + * In other words, plug in "pma" in the range of "umap". + * The result contains maps that live in the same spaces as the maps of "umap" + * with range space equal to the target space of "pma", + * except that the range has been replaced by the domain space of "pma". + */ +__isl_give isl_union_map *isl_union_map_preimage_range_pw_multi_aff( + __isl_take isl_union_map *umap, __isl_take isl_pw_multi_aff *pma) +{ + return preimage_pw_multi_aff(umap, pma, &range_match, + &isl_map_preimage_range_pw_multi_aff); +} + +/* Compute the preimage of "uset" under the function represented by "pma". + * In other words, plug in "pma" in "uset". + * The result contains sets that live in the same spaces as the sets of "uset" + * with space equal to the target space of "pma", + * except that the space has been replaced by the domain space of "pma". + */ +__isl_give isl_union_set *isl_union_set_preimage_pw_multi_aff( + __isl_take isl_union_set *uset, __isl_take isl_pw_multi_aff *pma) +{ + return preimage_pw_multi_aff(uset, pma, &set_match, + &isl_set_preimage_pw_multi_aff); } /* Compute the preimage of the domain of "umap" under the function @@ -2585,28 +3194,570 @@ __isl_give isl_union_map *isl_union_map_preimage_domain_multi_aff( __isl_take isl_union_map *umap, __isl_take isl_multi_aff *ma) { + return isl_union_map_preimage_domain_pw_multi_aff(umap, + isl_pw_multi_aff_from_multi_aff(ma)); +} + +/* Compute the preimage of the range of "umap" under the function + * represented by "ma". + * In other words, plug in "ma" in the range of "umap". + * The result contains maps that live in the same spaces as the maps of "umap" + * with range space equal to the target space of "ma", + * except that the range has been replaced by the domain space of "ma". + */ +__isl_give isl_union_map *isl_union_map_preimage_range_multi_aff( + __isl_take isl_union_map *umap, __isl_take isl_multi_aff *ma) +{ + return isl_union_map_preimage_range_pw_multi_aff(umap, + isl_pw_multi_aff_from_multi_aff(ma)); +} + +/* Compute the preimage of "uset" under the function represented by "ma". + * In other words, plug in "ma" in "uset". + * The result contains sets that live in the same spaces as the sets of "uset" + * with space equal to the target space of "ma", + * except that the space has been replaced by the domain space of "ma". + */ +__isl_give isl_union_map *isl_union_set_preimage_multi_aff( + __isl_take isl_union_set *uset, __isl_take isl_multi_aff *ma) +{ + return isl_union_set_preimage_pw_multi_aff(uset, + isl_pw_multi_aff_from_multi_aff(ma)); +} + +/* Internal data structure for preimage_multi_pw_aff. + * + * "mpa" is the function under which the preimage should be taken. + * "space" is the space of "mpa". + * "res" collects the results. + * "fn" computes the preimage for a given map. + * "match" returns true if "fn" can be called. + */ +struct isl_union_map_preimage_mpa_data { + isl_space *space; + isl_multi_pw_aff *mpa; + isl_union_map *res; + int (*match)(__isl_keep isl_map *map, __isl_keep isl_space *space); + __isl_give isl_map *(*fn)(__isl_take isl_map *map, + __isl_take isl_multi_pw_aff *mpa); +}; + +/* Call data->fn to compute the preimage of the domain or range of *entry + * under the function represented by data->mpa, provided the domain/range + * space of *entry matches the target space of data->mpa + * (as given by data->match), and add the result to data->res. + */ +static isl_stat preimage_mpa_entry(void **entry, void *user) +{ + int m; + isl_map *map = *entry; + struct isl_union_map_preimage_mpa_data *data = user; + isl_bool empty; + + m = data->match(map, data->space); + if (m < 0) + return isl_stat_error; + if (!m) + return isl_stat_ok; + + map = isl_map_copy(map); + map = data->fn(map, isl_multi_pw_aff_copy(data->mpa)); + + empty = isl_map_is_empty(map); + if (empty < 0 || empty) { + isl_map_free(map); + return empty < 0 ? isl_stat_error : isl_stat_ok; + } + + data->res = isl_union_map_add_map(data->res, map); + + return isl_stat_ok; +} + +/* Compute the preimage of the domain or range of "umap" under the function + * represented by "mpa". + * In other words, plug in "mpa" in the domain or range of "umap". + * The function "fn" performs the actual preimage computation on a map, + * while "match" determines to which maps the function should be applied. + */ +static __isl_give isl_union_map *preimage_multi_pw_aff( + __isl_take isl_union_map *umap, __isl_take isl_multi_pw_aff *mpa, + int (*match)(__isl_keep isl_map *map, __isl_keep isl_space *space), + __isl_give isl_map *(*fn)(__isl_take isl_map *map, + __isl_take isl_multi_pw_aff *mpa)) +{ isl_ctx *ctx; isl_space *space; - struct isl_union_map_preimage_domain_data data; + struct isl_union_map_preimage_mpa_data data; - if (!umap || !ma) + umap = isl_union_map_align_params(umap, + isl_multi_pw_aff_get_space(mpa)); + mpa = isl_multi_pw_aff_align_params(mpa, isl_union_map_get_space(umap)); + + if (!umap || !mpa) goto error; ctx = isl_union_map_get_ctx(umap); space = isl_union_map_get_space(umap); - data.space = isl_multi_aff_get_space(ma); - data.ma = ma; + data.space = isl_multi_pw_aff_get_space(mpa); + data.mpa = mpa; data.res = isl_union_map_alloc(space, umap->table.n); - if (isl_hash_table_foreach(ctx, &umap->table, &preimage_domain_entry, + data.match = match; + data.fn = fn; + if (isl_hash_table_foreach(ctx, &umap->table, &preimage_mpa_entry, &data) < 0) data.res = isl_union_map_free(data.res); isl_space_free(data.space); isl_union_map_free(umap); - isl_multi_aff_free(ma); + isl_multi_pw_aff_free(mpa); return data.res; error: isl_union_map_free(umap); - isl_multi_aff_free(ma); + isl_multi_pw_aff_free(mpa); return NULL; } + +/* Compute the preimage of the domain of "umap" under the function + * represented by "mpa". + * In other words, plug in "mpa" in the domain of "umap". + * The result contains maps that live in the same spaces as the maps of "umap" + * with domain space equal to the target space of "mpa", + * except that the domain has been replaced by the domain space of "mpa". + */ +__isl_give isl_union_map *isl_union_map_preimage_domain_multi_pw_aff( + __isl_take isl_union_map *umap, __isl_take isl_multi_pw_aff *mpa) +{ + return preimage_multi_pw_aff(umap, mpa, &domain_match, + &isl_map_preimage_domain_multi_pw_aff); +} + +/* Internal data structure for preimage_upma. + * + * "umap" is the map of which the preimage should be computed. + * "res" collects the results. + * "fn" computes the preimage for a given piecewise multi-affine function. + */ +struct isl_union_map_preimage_upma_data { + isl_union_map *umap; + isl_union_map *res; + __isl_give isl_union_map *(*fn)(__isl_take isl_union_map *umap, + __isl_take isl_pw_multi_aff *pma); +}; + +/* Call data->fn to compute the preimage of the domain or range of data->umap + * under the function represented by pma and add the result to data->res. + */ +static isl_stat preimage_upma(__isl_take isl_pw_multi_aff *pma, void *user) +{ + struct isl_union_map_preimage_upma_data *data = user; + isl_union_map *umap; + + umap = isl_union_map_copy(data->umap); + umap = data->fn(umap, pma); + data->res = isl_union_map_union(data->res, umap); + + return data->res ? isl_stat_ok : isl_stat_error; +} + +/* Compute the preimage of the domain or range of "umap" under the function + * represented by "upma". + * In other words, plug in "upma" in the domain or range of "umap". + * The function "fn" performs the actual preimage computation + * on a piecewise multi-affine function. + */ +static __isl_give isl_union_map *preimage_union_pw_multi_aff( + __isl_take isl_union_map *umap, + __isl_take isl_union_pw_multi_aff *upma, + __isl_give isl_union_map *(*fn)(__isl_take isl_union_map *umap, + __isl_take isl_pw_multi_aff *pma)) +{ + struct isl_union_map_preimage_upma_data data; + + data.umap = umap; + data.res = isl_union_map_empty(isl_union_map_get_space(umap)); + data.fn = fn; + if (isl_union_pw_multi_aff_foreach_pw_multi_aff(upma, + &preimage_upma, &data) < 0) + data.res = isl_union_map_free(data.res); + + isl_union_map_free(umap); + isl_union_pw_multi_aff_free(upma); + + return data.res; +} + +/* Compute the preimage of the domain of "umap" under the function + * represented by "upma". + * In other words, plug in "upma" in the domain of "umap". + * The result contains maps that live in the same spaces as the maps of "umap" + * with domain space equal to one of the target spaces of "upma", + * except that the domain has been replaced by one of the the domain spaces that + * corresponds to that target space of "upma". + */ +__isl_give isl_union_map *isl_union_map_preimage_domain_union_pw_multi_aff( + __isl_take isl_union_map *umap, + __isl_take isl_union_pw_multi_aff *upma) +{ + return preimage_union_pw_multi_aff(umap, upma, + &isl_union_map_preimage_domain_pw_multi_aff); +} + +/* Compute the preimage of the range of "umap" under the function + * represented by "upma". + * In other words, plug in "upma" in the range of "umap". + * The result contains maps that live in the same spaces as the maps of "umap" + * with range space equal to one of the target spaces of "upma", + * except that the range has been replaced by one of the the domain spaces that + * corresponds to that target space of "upma". + */ +__isl_give isl_union_map *isl_union_map_preimage_range_union_pw_multi_aff( + __isl_take isl_union_map *umap, + __isl_take isl_union_pw_multi_aff *upma) +{ + return preimage_union_pw_multi_aff(umap, upma, + &isl_union_map_preimage_range_pw_multi_aff); +} + +/* Compute the preimage of "uset" under the function represented by "upma". + * In other words, plug in "upma" in the range of "uset". + * The result contains sets that live in the same spaces as the sets of "uset" + * with space equal to one of the target spaces of "upma", + * except that the space has been replaced by one of the the domain spaces that + * corresponds to that target space of "upma". + */ +__isl_give isl_union_set *isl_union_set_preimage_union_pw_multi_aff( + __isl_take isl_union_set *uset, + __isl_take isl_union_pw_multi_aff *upma) +{ + return preimage_union_pw_multi_aff(uset, upma, + &isl_union_set_preimage_pw_multi_aff); +} + +/* Reset the user pointer on all identifiers of parameters and tuples + * of the space of *entry. + */ +static isl_stat reset_user(void **entry, void *user) +{ + isl_map **map = (isl_map **)entry; + + *map = isl_map_reset_user(*map); + + return *map ? isl_stat_ok : isl_stat_error; +} + +/* Reset the user pointer on all identifiers of parameters and tuples + * of the spaces of "umap". + */ +__isl_give isl_union_map *isl_union_map_reset_user( + __isl_take isl_union_map *umap) +{ + umap = isl_union_map_cow(umap); + if (!umap) + return NULL; + umap->dim = isl_space_reset_user(umap->dim); + if (!umap->dim) + return isl_union_map_free(umap); + umap = un_op(umap, &reset_user); + + return umap; +} + +/* Reset the user pointer on all identifiers of parameters and tuples + * of the spaces of "uset". + */ +__isl_give isl_union_set *isl_union_set_reset_user( + __isl_take isl_union_set *uset) +{ + return isl_union_map_reset_user(uset); +} + +/* Internal data structure for isl_union_map_project_out. + * "type", "first" and "n" are the arguments for the isl_map_project_out + * call. + * "res" collects the results. + */ +struct isl_union_map_project_out_data { + enum isl_dim_type type; + unsigned first; + unsigned n; + + isl_union_map *res; +}; + +/* Turn the data->n dimensions of type data->type, starting at data->first + * into existentially quantified variables and add the result to data->res. + */ +static isl_stat project_out(__isl_take isl_map *map, void *user) +{ + struct isl_union_map_project_out_data *data = user; + + map = isl_map_project_out(map, data->type, data->first, data->n); + data->res = isl_union_map_add_map(data->res, map); + + return isl_stat_ok; +} + +/* Turn the "n" dimensions of type "type", starting at "first" + * into existentially quantified variables. + * Since the space of an isl_union_map only contains parameters, + * type is required to be equal to isl_dim_param. + */ +__isl_give isl_union_map *isl_union_map_project_out( + __isl_take isl_union_map *umap, + enum isl_dim_type type, unsigned first, unsigned n) +{ + isl_space *space; + struct isl_union_map_project_out_data data = { type, first, n }; + + if (!umap) + return NULL; + + if (type != isl_dim_param) + isl_die(isl_union_map_get_ctx(umap), isl_error_invalid, + "can only project out parameters", + return isl_union_map_free(umap)); + + space = isl_union_map_get_space(umap); + space = isl_space_drop_dims(space, type, first, n); + data.res = isl_union_map_empty(space); + if (isl_union_map_foreach_map(umap, &project_out, &data) < 0) + data.res = isl_union_map_free(data.res); + + isl_union_map_free(umap); + + return data.res; +} + +/* Turn the "n" dimensions of type "type", starting at "first" + * into existentially quantified variables. + * Since the space of an isl_union_set only contains parameters, + * "type" is required to be equal to isl_dim_param. + */ +__isl_give isl_union_set *isl_union_set_project_out( + __isl_take isl_union_set *uset, + enum isl_dim_type type, unsigned first, unsigned n) +{ + return isl_union_map_project_out(uset, type, first, n); +} + +/* Internal data structure for isl_union_map_involves_dims. + * "first" and "n" are the arguments for the isl_map_involves_dims calls. + */ +struct isl_union_map_involves_dims_data { + unsigned first; + unsigned n; +}; + +/* Does "map" _not_ involve the data->n parameters starting at data->first? + */ +static isl_bool map_excludes(__isl_keep isl_map *map, void *user) +{ + struct isl_union_map_involves_dims_data *data = user; + isl_bool involves; + + involves = isl_map_involves_dims(map, + isl_dim_param, data->first, data->n); + if (involves < 0) + return isl_bool_error; + return !involves; +} + +/* Does "umap" involve any of the n parameters starting at first? + * "type" is required to be set to isl_dim_param. + * + * "umap" involves any of those parameters if any of its maps + * involve the parameters. In other words, "umap" does not + * involve any of the parameters if all its maps to not + * involve the parameters. + */ +isl_bool isl_union_map_involves_dims(__isl_keep isl_union_map *umap, + enum isl_dim_type type, unsigned first, unsigned n) +{ + struct isl_union_map_involves_dims_data data = { first, n }; + isl_bool excludes; + + if (type != isl_dim_param) + isl_die(isl_union_map_get_ctx(umap), isl_error_invalid, + "can only reference parameters", return isl_bool_error); + + excludes = union_map_forall_user(umap, &map_excludes, &data); + + if (excludes < 0) + return isl_bool_error; + + return !excludes; +} + +/* Internal data structure for isl_union_map_reset_range_space. + * "range" is the space from which to set the range space. + * "res" collects the results. + */ +struct isl_union_map_reset_range_space_data { + isl_space *range; + isl_union_map *res; +}; + +/* Replace the range space of "map" by the range space of data->range and + * add the result to data->res. + */ +static isl_stat reset_range_space(__isl_take isl_map *map, void *user) +{ + struct isl_union_map_reset_range_space_data *data = user; + isl_space *space; + + space = isl_map_get_space(map); + space = isl_space_domain(space); + space = isl_space_extend_domain_with_range(space, + isl_space_copy(data->range)); + map = isl_map_reset_space(map, space); + data->res = isl_union_map_add_map(data->res, map); + + return data->res ? isl_stat_ok : isl_stat_error; +} + +/* Replace the range space of all the maps in "umap" by + * the range space of "space". + * + * This assumes that all maps have the same output dimension. + * This function should therefore not be made publicly available. + * + * Since the spaces of the maps change, so do their hash value. + * We therefore need to create a new isl_union_map. + */ +__isl_give isl_union_map *isl_union_map_reset_range_space( + __isl_take isl_union_map *umap, __isl_take isl_space *space) +{ + struct isl_union_map_reset_range_space_data data = { space }; + + data.res = isl_union_map_empty(isl_union_map_get_space(umap)); + if (isl_union_map_foreach_map(umap, &reset_range_space, &data) < 0) + data.res = isl_union_map_free(data.res); + + isl_space_free(space); + isl_union_map_free(umap); + return data.res; +} + +/* Internal data structure for isl_union_map_order_at_multi_union_pw_aff. + * "mupa" is the function from which the isl_multi_pw_affs are extracted. + * "order" is applied to the extracted isl_multi_pw_affs that correspond + * to the domain and the range of each map. + * "res" collects the results. + */ +struct isl_union_order_at_data { + isl_multi_union_pw_aff *mupa; + __isl_give isl_map *(*order)(__isl_take isl_multi_pw_aff *mpa1, + __isl_take isl_multi_pw_aff *mpa2); + isl_union_map *res; +}; + +/* Intersect "map" with the result of applying data->order to + * the functions in data->mupa that apply to the domain and the range + * of "map" and add the result to data->res. + */ +static isl_stat order_at(__isl_take isl_map *map, void *user) +{ + struct isl_union_order_at_data *data = user; + isl_space *space; + isl_multi_pw_aff *mpa1, *mpa2; + isl_map *order; + + space = isl_space_domain(isl_map_get_space(map)); + mpa1 = isl_multi_union_pw_aff_extract_multi_pw_aff(data->mupa, space); + space = isl_space_range(isl_map_get_space(map)); + mpa2 = isl_multi_union_pw_aff_extract_multi_pw_aff(data->mupa, space); + order = data->order(mpa1, mpa2); + map = isl_map_intersect(map, order); + data->res = isl_union_map_add_map(data->res, map); + + return data->res ? isl_stat_ok : isl_stat_error; +} + +/* Intersect each map in "umap" with the result of calling "order" + * on the functions is "mupa" that apply to the domain and the range + * of the map. + */ +static __isl_give isl_union_map *isl_union_map_order_at_multi_union_pw_aff( + __isl_take isl_union_map *umap, __isl_take isl_multi_union_pw_aff *mupa, + __isl_give isl_map *(*order)(__isl_take isl_multi_pw_aff *mpa1, + __isl_take isl_multi_pw_aff *mpa2)) +{ + struct isl_union_order_at_data data; + + umap = isl_union_map_align_params(umap, + isl_multi_union_pw_aff_get_space(mupa)); + mupa = isl_multi_union_pw_aff_align_params(mupa, + isl_union_map_get_space(umap)); + data.mupa = mupa; + data.order = order; + data.res = isl_union_map_empty(isl_union_map_get_space(umap)); + if (isl_union_map_foreach_map(umap, &order_at, &data) < 0) + data.res = isl_union_map_free(data.res); + + isl_multi_union_pw_aff_free(mupa); + isl_union_map_free(umap); + return data.res; +} + +/* Return the subset of "umap" where the domain and the range + * have equal "mupa" values. + */ +__isl_give isl_union_map *isl_union_map_eq_at_multi_union_pw_aff( + __isl_take isl_union_map *umap, + __isl_take isl_multi_union_pw_aff *mupa) +{ + return isl_union_map_order_at_multi_union_pw_aff(umap, mupa, + &isl_multi_pw_aff_eq_map); +} + +/* Return the subset of "umap" where the domain has a lexicographically + * smaller "mupa" value than the range. + */ +__isl_give isl_union_map *isl_union_map_lex_lt_at_multi_union_pw_aff( + __isl_take isl_union_map *umap, + __isl_take isl_multi_union_pw_aff *mupa) +{ + return isl_union_map_order_at_multi_union_pw_aff(umap, mupa, + &isl_multi_pw_aff_lex_lt_map); +} + +/* Return the subset of "umap" where the domain has a lexicographically + * greater "mupa" value than the range. + */ +__isl_give isl_union_map *isl_union_map_lex_gt_at_multi_union_pw_aff( + __isl_take isl_union_map *umap, + __isl_take isl_multi_union_pw_aff *mupa) +{ + return isl_union_map_order_at_multi_union_pw_aff(umap, mupa, + &isl_multi_pw_aff_lex_gt_map); +} + +/* Return the union of the elements in the list "list". + */ +__isl_give isl_union_set *isl_union_set_list_union( + __isl_take isl_union_set_list *list) +{ + int i, n; + isl_ctx *ctx; + isl_space *space; + isl_union_set *res; + + if (!list) + return NULL; + + ctx = isl_union_set_list_get_ctx(list); + space = isl_space_params_alloc(ctx, 0); + res = isl_union_set_empty(space); + + n = isl_union_set_list_n_union_set(list); + for (i = 0; i < n; ++i) { + isl_union_set *uset_i; + + uset_i = isl_union_set_list_get_union_set(list, i); + res = isl_union_set_union(res, uset_i); + } + + isl_union_set_list_free(list); + return res; +} diff -Nru cloog-0.18.2/isl/isl_union_map_private.h cloog-0.18.4/isl/isl_union_map_private.h --- cloog-0.18.2/isl/isl_union_map_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_union_map_private.h 2015-07-24 12:23:09.000000000 +0000 @@ -1,3 +1,4 @@ +#define isl_union_set_list isl_union_map_list #define isl_union_set isl_union_map #include #include @@ -8,3 +9,6 @@ struct isl_hash_table table; }; + +__isl_give isl_union_map *isl_union_map_reset_range_space( + __isl_take isl_union_map *umap, __isl_take isl_space *space); diff -Nru cloog-0.18.2/isl/isl_union_templ.c cloog-0.18.4/isl/isl_union_templ.c --- cloog-0.18.2/isl/isl_union_templ.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_union_templ.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,11 +1,13 @@ /* * Copyright 2010 INRIA Saclay + * Copyright 2013 Ecole Normale Superieure * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, * 91893 Orsay, France + * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France */ #define xFN(TYPE,NAME) TYPE ## _ ## NAME @@ -18,7 +20,7 @@ #ifdef HAS_TYPE enum isl_fold type; #endif - isl_space *dim; + isl_space *space; struct isl_hash_table table; }; @@ -27,14 +29,41 @@ isl_ctx *FN(UNION,get_ctx)(__isl_keep UNION *u) { - return u ? u->dim->ctx : NULL; + return u ? u->space->ctx : NULL; } __isl_give isl_space *FN(UNION,get_space)(__isl_keep UNION *u) { if (!u) return NULL; - return isl_space_copy(u->dim); + return isl_space_copy(u->space); +} + +/* Return the number of parameters of "u", where "type" + * is required to be set to isl_dim_param. + */ +unsigned FN(UNION,dim)(__isl_keep UNION *u, enum isl_dim_type type) +{ + if (!u) + return 0; + + if (type != isl_dim_param) + isl_die(FN(UNION,get_ctx)(u), isl_error_invalid, + "can only reference parameters", return 0); + + return isl_space_dim(u->space, type); +} + +/* Return the position of the parameter with the given name + * in "u". + * Return -1 if no such dimension can be found. + */ +int FN(UNION,find_dim_by_name)(__isl_keep UNION *u, enum isl_dim_type type, + const char *name) +{ + if (!u) + return -1; + return isl_space_find_dim_by_name(u->space, type, name); } #ifdef HAS_TYPE @@ -52,20 +81,19 @@ u = isl_calloc_type(dim->ctx, UNION); if (!u) - return NULL; + goto error; u->ref = 1; #ifdef HAS_TYPE u->type = type; #endif - u->dim = dim; + u->space = dim; if (isl_hash_table_init(dim->ctx, &u->table, size) < 0) - goto error; + return FN(UNION,free)(u); return u; error: isl_space_free(dim); - FN(UNION,free)(u); return NULL; } @@ -90,13 +118,20 @@ return u; } +/* Return the number of base expressions in "u". + */ +int FN(FN(UNION,n),PARTS)(__isl_keep UNION *u) +{ + return u ? u->table.n : 0; +} + S(UNION,foreach_data) { - int (*fn)(__isl_take PART *part, void *user); + isl_stat (*fn)(__isl_take PART *part, void *user); void *user; }; -static int call_on_copy(void **entry, void *user) +static isl_stat FN(UNION,call_on_copy)(void **entry, void *user) { PART *part = *entry; S(UNION,foreach_data) *data = (S(UNION,foreach_data) *)user; @@ -104,90 +139,163 @@ return data->fn(FN(PART,copy)(part), data->user); } -int FN(FN(UNION,foreach),PARTS)(__isl_keep UNION *u, - int (*fn)(__isl_take PART *part, void *user), void *user) +isl_stat FN(FN(UNION,foreach),PARTS)(__isl_keep UNION *u, + isl_stat (*fn)(__isl_take PART *part, void *user), void *user) { S(UNION,foreach_data) data = { fn, user }; if (!u) - return -1; + return isl_stat_error; - return isl_hash_table_foreach(u->dim->ctx, &u->table, - &call_on_copy, &data); + return isl_hash_table_foreach(u->space->ctx, &u->table, + &FN(UNION,call_on_copy), &data); } -static int has_dim(const void *entry, const void *val) +/* Is the space of "entry" equal to "space"? + */ +static int FN(UNION,has_space)(const void *entry, const void *val) { PART *part = (PART *)entry; - isl_space *dim = (isl_space *)val; + isl_space *space = (isl_space *) val; + + return isl_space_is_equal(part->dim, space); +} + +/* This function is not currently used by isl_aff.c. + */ +static int FN(UNION,has_domain_space)(const void *entry, const void *val) + __attribute__ ((unused)); + +/* Is the domain space of "entry" equal to "space"? + */ +static int FN(UNION,has_domain_space)(const void *entry, const void *val) +{ + PART *part = (PART *)entry; + isl_space *space = (isl_space *) val; + + if (isl_space_is_params(space)) + return isl_space_is_set(part->dim); + + return isl_space_tuple_is_equal(part->dim, isl_dim_in, + space, isl_dim_set); +} + +/* Is the domain space of "entry" equal to the domain of "space"? + */ +static int FN(UNION,has_same_domain_space)(const void *entry, const void *val) +{ + PART *part = (PART *)entry; + isl_space *space = (isl_space *) val; + + if (isl_space_is_set(space)) + return isl_space_is_set(part->dim); - return isl_space_is_equal(part->dim, dim); + return isl_space_tuple_is_equal(part->dim, isl_dim_in, + space, isl_dim_in); } +/* Extract the element of "u" living in "space" (ignoring parameters). + * + * Return the ZERO element if "u" does not contain any element + * living in "space". + */ __isl_give PART *FN(FN(UNION,extract),PARTS)(__isl_keep UNION *u, - __isl_take isl_space *dim) + __isl_take isl_space *space) { uint32_t hash; struct isl_hash_table_entry *entry; - if (!u || !dim) + if (!u || !space) goto error; + if (!isl_space_match(u->space, isl_dim_param, space, isl_dim_param)) { + space = isl_space_drop_dims(space, isl_dim_param, + 0, isl_space_dim(space, isl_dim_param)); + space = isl_space_align_params(space, + FN(UNION,get_space)(u)); + if (!space) + goto error; + } - hash = isl_space_get_hash(dim); - entry = isl_hash_table_find(u->dim->ctx, &u->table, hash, - &has_dim, dim, 0); + hash = isl_space_get_hash(space); + entry = isl_hash_table_find(u->space->ctx, &u->table, hash, + &FN(UNION,has_space), space, 0); if (!entry) #ifdef HAS_TYPE - return FN(PART,ZERO)(dim, u->type); + return FN(PART,ZERO)(space, u->type); #else - return FN(PART,ZERO)(dim); + return FN(PART,ZERO)(space); #endif - isl_space_free(dim); + isl_space_free(space); return FN(PART,copy)(entry->data); error: - isl_space_free(dim); + isl_space_free(space); return NULL; } -__isl_give UNION *FN(FN(UNION,add),PARTS)(__isl_take UNION *u, - __isl_take PART *part) +/* Add "part" to "u". + * If "disjoint" is set, then "u" is not allowed to already have + * a part that is defined on the same space as "part". + * Otherwise, compute the union sum of "part" and the part in "u" + * defined on the same space. + */ +static __isl_give UNION *FN(UNION,add_part_generic)(__isl_take UNION *u, + __isl_take PART *part, int disjoint) { + int empty; uint32_t hash; struct isl_hash_table_entry *entry; if (!part) goto error; - if (DEFAULT_IS_ZERO && FN(PART,IS_ZERO)(part)) { + empty = FN(PART,IS_ZERO)(part); + if (empty < 0) + goto error; + if (empty) { FN(PART,free)(part); return u; } + u = FN(UNION,align_params)(u, FN(PART,get_space)(part)); + part = FN(PART,align_params)(part, FN(UNION,get_space)(u)); + u = FN(UNION,cow)(u); if (!u) goto error; - isl_assert(u->dim->ctx, isl_space_match(part->dim, isl_dim_param, u->dim, - isl_dim_param), goto error); - hash = isl_space_get_hash(part->dim); - entry = isl_hash_table_find(u->dim->ctx, &u->table, hash, - &has_dim, part->dim, 1); + entry = isl_hash_table_find(u->space->ctx, &u->table, hash, + &FN(UNION,has_same_domain_space), + part->dim, 1); if (!entry) goto error; if (!entry->data) entry->data = part; else { - entry->data = FN(PART,add)(entry->data, FN(PART,copy)(part)); + PART *entry_part = entry->data; + if (disjoint) + isl_die(FN(UNION,get_ctx)(u), isl_error_invalid, + "additional part should live on separate " + "space", goto error); + if (!isl_space_tuple_is_equal(entry_part->dim, isl_dim_out, + part->dim, isl_dim_out)) + isl_die(FN(UNION,get_ctx)(u), isl_error_invalid, + "union expression can only contain a single " + "expression over a given domain", goto error); + entry->data = FN(PART,union_add_)(entry->data, + FN(PART,copy)(part)); if (!entry->data) goto error; - FN(PART,free)(part); - if (DEFAULT_IS_ZERO && FN(PART,IS_ZERO)(entry->data)) { + empty = FN(PART,IS_ZERO)(part); + if (empty < 0) + goto error; + if (empty) { FN(PART,free)(entry->data); - isl_hash_table_remove(u->dim->ctx, &u->table, entry); + isl_hash_table_remove(u->space->ctx, &u->table, entry); } + FN(PART,free)(part); } return u; @@ -197,13 +305,22 @@ return NULL; } -static int add_part(__isl_take PART *part, void *user) +/* Add "part" to "u", where "u" is assumed not to already have + * a part that is defined on the same space as "part". + */ +__isl_give UNION *FN(FN(UNION,add),PARTS)(__isl_take UNION *u, + __isl_take PART *part) +{ + return FN(UNION,add_part_generic)(u, part, 1); +} + +static isl_stat FN(UNION,add_part)(__isl_take PART *part, void *user) { UNION **u = (UNION **)user; *u = FN(FN(UNION,add),PARTS)(*u, part); - return 0; + return isl_stat_ok; } __isl_give UNION *FN(UNION,dup)(__isl_keep UNION *u) @@ -214,11 +331,11 @@ return NULL; #ifdef HAS_TYPE - dup = FN(UNION,ZERO)(isl_space_copy(u->dim), u->type); + dup = FN(UNION,ZERO)(isl_space_copy(u->space), u->type); #else - dup = FN(UNION,ZERO)(isl_space_copy(u->dim)); + dup = FN(UNION,ZERO)(isl_space_copy(u->space)); #endif - if (FN(FN(UNION,foreach),PARTS)(u, &add_part, &dup) < 0) + if (FN(FN(UNION,foreach),PARTS)(u, &FN(UNION,add_part), &dup) < 0) goto error; return dup; error: @@ -237,14 +354,14 @@ return FN(UNION,dup)(u); } -static int free_u_entry(void **entry, void *user) +static isl_stat FN(UNION,free_u_entry)(void **entry, void *user) { PART *part = *entry; FN(PART,free)(part); - return 0; + return isl_stat_ok; } -void *FN(UNION,free)(__isl_take UNION *u) +__isl_null UNION *FN(UNION,free)(__isl_take UNION *u) { if (!u) return NULL; @@ -252,9 +369,10 @@ if (--u->ref > 0) return NULL; - isl_hash_table_foreach(u->dim->ctx, &u->table, &free_u_entry, NULL); + isl_hash_table_foreach(u->space->ctx, &u->table, + &FN(UNION,free_u_entry), NULL); isl_hash_table_clear(&u->table); - isl_space_free(u->dim); + isl_space_free(u->space); free(u); return NULL; } @@ -264,8 +382,7 @@ UNION *res; }; -#ifdef ALIGN_DOMAIN -static int align_entry(__isl_take PART *part, void *user) +static isl_stat FN(UNION,align_entry)(__isl_take PART *part, void *user) { isl_reordering *exp; S(UNION,align) *data = user; @@ -276,63 +393,87 @@ data->res = FN(FN(UNION,add),PARTS)(data->res, FN(PART,realign_domain)(part, exp)); - return 0; + return isl_stat_ok; } -#else -static int align_entry(__isl_take PART *part, void *user) + +/* Reorder the parameters of "u" according to the given reordering. + */ +static __isl_give UNION *FN(UNION,realign_domain)(__isl_take UNION *u, + __isl_take isl_reordering *r) { - isl_reordering *exp; - S(UNION,align) *data = user; + S(UNION,align) data = { NULL, NULL }; - exp = isl_reordering_extend_space(isl_reordering_copy(data->exp), - FN(PART,get_space)(part)); + if (!u || !r) + goto error; - data->res = FN(FN(UNION,add),PARTS)(data->res, - FN(PART,realign)(part, exp)); +#ifdef HAS_TYPE + data.res = FN(UNION,alloc)(isl_space_copy(r->dim), u->type, u->table.n); +#else + data.res = FN(UNION,alloc)(isl_space_copy(r->dim), u->table.n); +#endif + data.exp = r; + if (FN(FN(UNION,foreach),PARTS)(u, &FN(UNION,align_entry), &data) < 0) + data.res = FN(UNION,free)(data.res); - return 0; + isl_reordering_free(data.exp); + FN(UNION,free)(u); + return data.res; +error: + FN(UNION,free)(u); + isl_reordering_free(r); + return NULL; } -#endif +/* Align the parameters of "u" to those of "model". + */ __isl_give UNION *FN(UNION,align_params)(__isl_take UNION *u, __isl_take isl_space *model) { - S(UNION,align) data = { NULL, NULL }; + isl_reordering *r; if (!u || !model) goto error; - if (isl_space_match(u->dim, isl_dim_param, model, isl_dim_param)) { + if (isl_space_match(u->space, isl_dim_param, model, isl_dim_param)) { isl_space_free(model); return u; } - data.exp = isl_parameter_alignment_reordering(u->dim, model); - if (!data.exp) - goto error; - -#ifdef HAS_TYPE - data.res = FN(UNION,alloc)(isl_space_copy(data.exp->dim), - u->type, u->table.n); -#else - data.res = FN(UNION,alloc)(isl_space_copy(data.exp->dim), u->table.n); -#endif - if (FN(FN(UNION,foreach),PARTS)(u, &align_entry, &data) < 0) - goto error; - - isl_reordering_free(data.exp); - FN(UNION,free)(u); + model = isl_space_params(model); + r = isl_parameter_alignment_reordering(u->space, model); isl_space_free(model); - return data.res; + + return FN(UNION,realign_domain)(u, r); error: - isl_reordering_free(data.exp); - FN(UNION,free)(u); - FN(UNION,free)(data.res); isl_space_free(model); + FN(UNION,free)(u); return NULL; } -__isl_give UNION *FN(UNION,add)(__isl_take UNION *u1, __isl_take UNION *u2) +/* Add "part" to *u, taking the union sum if "u" already has + * a part defined on the same space as "part". + */ +static isl_stat FN(UNION,union_add_part)(__isl_take PART *part, void *user) +{ + UNION **u = (UNION **)user; + + *u = FN(UNION,add_part_generic)(*u, part, 0); + + return isl_stat_ok; +} + +/* Compute the sum of "u1" and "u2" on the union of their domains, + * with the actual sum on the shared domain and + * the defined expression on the symmetric difference of the domains. + * + * This is an internal function that is exposed under different + * names depending on whether the base expressions have a zero default + * value. + * If they do, then this function is called "add". + * Otherwise, it is called "union_add". + */ +static __isl_give UNION *FN(UNION,union_add_)(__isl_take UNION *u1, + __isl_take UNION *u2) { u1 = FN(UNION,align_params)(u1, FN(UNION,get_space)(u2)); u2 = FN(UNION,align_params)(u2, FN(UNION,get_space)(u1)); @@ -342,7 +483,7 @@ if (!u1 || !u2) goto error; - if (FN(FN(UNION,foreach),PARTS)(u2, &add_part, &u1) < 0) + if (FN(FN(UNION,foreach),PARTS)(u2, &FN(UNION,union_add_part), &u1) < 0) goto error; FN(UNION,free)(u2); @@ -385,55 +526,52 @@ * If so, call data->fn on the two elements and add the result to * data->res. */ -static int match_bin_entry(void **entry, void *user) +static isl_stat FN(UNION,match_bin_entry)(void **entry, void *user) { S(UNION,match_bin_data) *data = user; uint32_t hash; struct isl_hash_table_entry *entry2; isl_space *space; PART *part = *entry; + PART *part2; space = FN(PART,get_space)(part); hash = isl_space_get_hash(space); - entry2 = isl_hash_table_find(data->u2->dim->ctx, &data->u2->table, - hash, &has_dim, space, 0); + entry2 = isl_hash_table_find(data->u2->space->ctx, &data->u2->table, + hash, &FN(UNION,has_same_domain_space), + space, 0); isl_space_free(space); if (!entry2) - return 0; + return isl_stat_ok; + + part2 = entry2->data; + if (!isl_space_tuple_is_equal(part->dim, isl_dim_out, + part2->dim, isl_dim_out)) + isl_die(FN(UNION,get_ctx)(data->u2), isl_error_invalid, + "entries should have the same range space", + return isl_stat_error); part = FN(PART, copy)(part); part = data->fn(part, FN(PART, copy)(entry2->data)); - if (DEFAULT_IS_ZERO) { - int empty; - - empty = FN(PART,IS_ZERO)(part); - if (empty < 0) { - FN(PART,free)(part); - return -1; - } - if (empty) { - FN(PART,free)(part); - return 0; - } - } - data->res = FN(FN(UNION,add),PARTS)(data->res, part); + if (!data->res) + return isl_stat_error; - return 0; + return isl_stat_ok; } /* This function is currently only used from isl_polynomial.c * and not from isl_fold.c. */ -static __isl_give UNION *match_bin_op(__isl_take UNION *u1, +static __isl_give UNION *FN(UNION,match_bin_op)(__isl_take UNION *u1, __isl_take UNION *u2, __isl_give PART *(*fn)(__isl_take PART *, __isl_take PART *)) __attribute__ ((unused)); /* For each pair of elements in "u1" and "u2" living in the same space, * call "fn" and collect the results. */ -static __isl_give UNION *match_bin_op(__isl_take UNION *u1, +static __isl_give UNION *FN(UNION,match_bin_op)(__isl_take UNION *u1, __isl_take UNION *u2, __isl_give PART *(*fn)(__isl_take PART *, __isl_take PART *)) { @@ -447,12 +585,13 @@ data.u2 = u2; #ifdef HAS_TYPE - data.res = FN(UNION,alloc)(isl_space_copy(u1->dim), u1->type, u1->table.n); + data.res = FN(UNION,alloc)(isl_space_copy(u1->space), u1->type, + u1->table.n); #else - data.res = FN(UNION,alloc)(isl_space_copy(u1->dim), u1->table.n); + data.res = FN(UNION,alloc)(isl_space_copy(u1->space), u1->table.n); #endif - if (isl_hash_table_foreach(u1->dim->ctx, &u1->table, - &match_bin_entry, &data) < 0) + if (isl_hash_table_foreach(u1->space->ctx, &u1->table, + &FN(UNION,match_bin_entry), &data) < 0) goto error; FN(UNION,free)(u1); @@ -465,12 +604,27 @@ return NULL; } +/* Compute the sum of "u1" and "u2". + * + * If the base expressions have a default zero value, then the sum + * is computed on the union of the domains of "u1" and "u2". + * Otherwise, it is computed on their shared domains. + */ +__isl_give UNION *FN(UNION,add)(__isl_take UNION *u1, __isl_take UNION *u2) +{ +#if DEFAULT_IS_ZERO + return FN(UNION,union_add_)(u1, u2); +#else + return FN(UNION,match_bin_op)(u1, u2, &FN(PART,add)); +#endif +} + #ifndef NO_SUB /* Subtract "u2" from "u1" and return the result. */ __isl_give UNION *FN(UNION,sub)(__isl_take UNION *u1, __isl_take UNION *u2) { - return match_bin_op(u1, u2, &FN(PART,sub)); + return FN(UNION,match_bin_op)(u1, u2, &FN(PART,sub)); } #endif @@ -480,7 +634,7 @@ __isl_give PW *(*fn)(__isl_take PW*, __isl_take isl_set*); }; -static int any_set_entry(void **entry, void *user) +static isl_stat FN(UNION,any_set_entry)(void **entry, void *user) { S(UNION,any_set_data) *data = user; PW *pw = *entry; @@ -488,28 +642,16 @@ pw = FN(PW,copy)(pw); pw = data->fn(pw, isl_set_copy(data->set)); - if (DEFAULT_IS_ZERO) { - int empty; - - empty = FN(PW,IS_ZERO)(pw); - if (empty < 0) { - FN(PW,free)(pw); - return -1; - } - if (empty) { - FN(PW,free)(pw); - return 0; - } - } - data->res = FN(FN(UNION,add),PARTS)(data->res, pw); + if (!data->res) + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Update each element of "u" by calling "fn" on the element and "set". */ -static __isl_give UNION *any_set_op(__isl_take UNION *u, +static __isl_give UNION *FN(UNION,any_set_op)(__isl_take UNION *u, __isl_take isl_set *set, __isl_give PW *(*fn)(__isl_take PW*, __isl_take isl_set*)) { @@ -523,12 +665,13 @@ data.set = set; #ifdef HAS_TYPE - data.res = FN(UNION,alloc)(isl_space_copy(u->dim), u->type, u->table.n); + data.res = FN(UNION,alloc)(isl_space_copy(u->space), u->type, + u->table.n); #else - data.res = FN(UNION,alloc)(isl_space_copy(u->dim), u->table.n); + data.res = FN(UNION,alloc)(isl_space_copy(u->space), u->table.n); #endif - if (isl_hash_table_foreach(u->dim->ctx, &u->table, - &any_set_entry, &data) < 0) + if (isl_hash_table_foreach(u->space->ctx, &u->table, + &FN(UNION,any_set_entry), &data) < 0) goto error; FN(UNION,free)(u); @@ -546,7 +689,7 @@ __isl_give UNION *FN(UNION,intersect_params)(__isl_take UNION *u, __isl_take isl_set *set) { - return any_set_op(u, set, &FN(PW,intersect_params)); + return FN(UNION,any_set_op)(u, set, &FN(PW,intersect_params)); } /* Compute the gist of the domain of "u" with respect to @@ -555,7 +698,7 @@ __isl_give UNION *FN(UNION,gist_params)(__isl_take UNION *u, __isl_take isl_set *set) { - return any_set_op(u, set, &FN(PW,gist_params)); + return FN(UNION,any_set_op)(u, set, &FN(PW,gist_params)); } S(UNION,match_domain_data) { @@ -564,7 +707,7 @@ __isl_give PW *(*fn)(__isl_take PW*, __isl_take isl_set*); }; -static int set_has_dim(const void *entry, const void *val) +static int FN(UNION,set_has_dim)(const void *entry, const void *val) { isl_set *set = (isl_set *)entry; isl_space *dim = (isl_space *)val; @@ -572,11 +715,11 @@ return isl_space_is_equal(set->dim, dim); } -/* Find the set in data->uset that live in the same space as the domain +/* Find the set in data->uset that lives in the same space as the domain * of *entry, apply data->fn to *entry and this set (if any), and add * the result to data->res. */ -static int match_domain_entry(void **entry, void *user) +static isl_stat FN(UNION,match_domain_entry)(void **entry, void *user) { S(UNION,match_domain_data) *data = user; uint32_t hash; @@ -587,38 +730,26 @@ space = FN(PW,get_domain_space)(pw); hash = isl_space_get_hash(space); entry2 = isl_hash_table_find(data->uset->dim->ctx, &data->uset->table, - hash, &set_has_dim, space, 0); + hash, &FN(UNION,set_has_dim), space, 0); isl_space_free(space); if (!entry2) - return 0; + return isl_stat_ok; pw = FN(PW,copy)(pw); pw = data->fn(pw, isl_set_copy(entry2->data)); - if (DEFAULT_IS_ZERO) { - int empty; - - empty = FN(PW,IS_ZERO)(pw); - if (empty < 0) { - FN(PW,free)(pw); - return -1; - } - if (empty) { - FN(PW,free)(pw); - return 0; - } - } - data->res = FN(FN(UNION,add),PARTS)(data->res, pw); + if (!data->res) + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Apply fn to each pair of PW in u and set in uset such that * the set lives in the same space as the domain of PW * and collect the results. */ -static __isl_give UNION *match_domain_op(__isl_take UNION *u, +static __isl_give UNION *FN(UNION,match_domain_op)(__isl_take UNION *u, __isl_take isl_union_set *uset, __isl_give PW *(*fn)(__isl_take PW*, __isl_take isl_set*)) { @@ -632,12 +763,13 @@ data.uset = uset; #ifdef HAS_TYPE - data.res = FN(UNION,alloc)(isl_space_copy(u->dim), u->type, u->table.n); + data.res = FN(UNION,alloc)(isl_space_copy(u->space), u->type, + u->table.n); #else - data.res = FN(UNION,alloc)(isl_space_copy(u->dim), u->table.n); + data.res = FN(UNION,alloc)(isl_space_copy(u->space), u->table.n); #endif - if (isl_hash_table_foreach(u->dim->ctx, &u->table, - &match_domain_entry, &data) < 0) + if (isl_hash_table_foreach(u->space->ctx, &u->table, + &FN(UNION,match_domain_entry), &data) < 0) goto error; FN(UNION,free)(u); @@ -660,7 +792,64 @@ if (isl_union_set_is_params(uset)) return FN(UNION,intersect_params)(u, isl_set_from_union_set(uset)); - return match_domain_op(u, uset, &FN(PW,intersect_domain)); + return FN(UNION,match_domain_op)(u, uset, &FN(PW,intersect_domain)); +} + +/* Internal data structure for isl_union_*_subtract_domain. + * uset is the set that needs to be removed from the domain. + * res collects the results. + */ +S(UNION,subtract_domain_data) { + isl_union_set *uset; + UNION *res; +}; + +/* Take the set (which may be empty) in data->uset that lives + * in the same space as the domain of "pw", subtract it from the domain + * of "pw" and add the result to data->res. + */ +static isl_stat FN(UNION,subtract_domain_entry)(__isl_take PW *pw, void *user) +{ + S(UNION,subtract_domain_data) *data = user; + isl_space *space; + isl_set *set; + + space = FN(PW,get_domain_space)(pw); + set = isl_union_set_extract_set(data->uset, space); + pw = FN(PW,subtract_domain)(pw, set); + data->res = FN(FN(UNION,add),PARTS)(data->res, pw); + + return isl_stat_ok; +} + +/* Subtract "uset' from the domain of "u". + */ +__isl_give UNION *FN(UNION,subtract_domain)(__isl_take UNION *u, + __isl_take isl_union_set *uset) +{ + S(UNION,subtract_domain_data) data; + + if (!u || !uset) + goto error; + + data.uset = uset; +#ifdef HAS_TYPE + data.res = FN(UNION,alloc)(isl_space_copy(u->space), u->type, + u->table.n); +#else + data.res = FN(UNION,alloc)(isl_space_copy(u->space), u->table.n); +#endif + if (FN(FN(UNION,foreach),PARTS)(u, + &FN(UNION,subtract_domain_entry), &data) < 0) + data.res = FN(UNION,free)(data.res); + + FN(UNION,free)(u); + isl_union_set_free(uset); + return data.res; +error: + FN(UNION,free)(u); + isl_union_set_free(uset); + return NULL; } __isl_give UNION *FN(UNION,gist)(__isl_take UNION *u, @@ -668,38 +857,37 @@ { if (isl_union_set_is_params(uset)) return FN(UNION,gist_params)(u, isl_set_from_union_set(uset)); - return match_domain_op(u, uset, &FN(PW,gist)); + return FN(UNION,match_domain_op)(u, uset, &FN(PW,gist)); } #ifndef NO_EVAL -__isl_give isl_qpolynomial *FN(UNION,eval)(__isl_take UNION *u, +__isl_give isl_val *FN(UNION,eval)(__isl_take UNION *u, __isl_take isl_point *pnt) { uint32_t hash; struct isl_hash_table_entry *entry; isl_space *space; - isl_qpolynomial *qp; + isl_val *v; if (!u || !pnt) goto error; space = isl_space_copy(pnt->dim); - space = isl_space_from_domain(space); - space = isl_space_add_dims(space, isl_dim_out, 1); if (!space) goto error; hash = isl_space_get_hash(space); - entry = isl_hash_table_find(u->dim->ctx, &u->table, - hash, &has_dim, space, 0); + entry = isl_hash_table_find(u->space->ctx, &u->table, + hash, &FN(UNION,has_domain_space), + space, 0); isl_space_free(space); if (!entry) { - qp = isl_qpolynomial_zero_on_domain(isl_space_copy(pnt->dim)); + v = isl_val_zero(isl_point_get_ctx(pnt)); isl_point_free(pnt); } else { - qp = FN(PART,eval)(FN(PART,copy)(entry->data), pnt); + v = FN(PART,eval)(FN(PART,copy)(entry->data), pnt); } FN(UNION,free)(u); - return qp; + return v; error: FN(UNION,free)(u); isl_point_free(pnt); @@ -707,15 +895,15 @@ } #endif -static int coalesce_entry(void **entry, void *user) +static isl_stat FN(UNION,coalesce_entry)(void **entry, void *user) { PW **pw = (PW **)entry; *pw = FN(PW,coalesce)(*pw); if (!*pw) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } __isl_give UNION *FN(UNION,coalesce)(__isl_take UNION *u) @@ -723,8 +911,8 @@ if (!u) return NULL; - if (isl_hash_table_foreach(u->dim->ctx, &u->table, - &coalesce_entry, NULL) < 0) + if (isl_hash_table_foreach(u->space->ctx, &u->table, + &FN(UNION,coalesce_entry), NULL) < 0) goto error; return u; @@ -733,13 +921,13 @@ return NULL; } -static int domain(__isl_take PART *part, void *user) +static isl_stat FN(UNION,domain_entry)(__isl_take PART *part, void *user) { isl_union_set **uset = (isl_union_set **)user; *uset = isl_union_set_add_set(*uset, FN(PART,domain)(part)); - return 0; + return isl_stat_ok; } __isl_give isl_union_set *FN(UNION,domain)(__isl_take UNION *u) @@ -747,7 +935,7 @@ isl_union_set *uset; uset = isl_union_set_empty(FN(UNION,get_space)(u)); - if (FN(FN(UNION,foreach),PARTS)(u, &domain, &uset) < 0) + if (FN(FN(UNION,foreach),PARTS)(u, &FN(UNION,domain_entry), &uset) < 0) goto error; FN(UNION,free)(u); @@ -759,16 +947,16 @@ return NULL; } -static int mul_isl_int(void **entry, void *user) +static isl_stat FN(UNION,mul_isl_int_entry)(void **entry, void *user) { PW **pw = (PW **)entry; isl_int *v = user; *pw = FN(PW,mul_isl_int)(*pw, *v); if (!*pw) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } __isl_give UNION *FN(UNION,mul_isl_int)(__isl_take UNION *u, isl_int v) @@ -796,7 +984,8 @@ if (isl_int_is_neg(v)) u->type = isl_fold_type_negate(u->type); #endif - if (isl_hash_table_foreach(u->dim->ctx, &u->table, &mul_isl_int, v) < 0) + if (isl_hash_table_foreach(u->space->ctx, &u->table, + &FN(UNION,mul_isl_int_entry), &v) < 0) goto error; return u; @@ -809,16 +998,16 @@ * * Return 0 on success and -1 on error. */ -static int scale_val(void **entry, void *user) +static isl_stat FN(UNION,scale_val_entry)(void **entry, void *user) { PW **pw = (PW **)entry; isl_val *v = user; *pw = FN(PW,scale_val)(*pw, isl_val_copy(v)); if (!*pw) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Multiply "u" by "v" and return the result. @@ -858,7 +1047,63 @@ if (isl_val_is_neg(v)) u->type = isl_fold_type_negate(u->type); #endif - if (isl_hash_table_foreach(u->dim->ctx, &u->table, &scale_val, v) < 0) + if (isl_hash_table_foreach(u->space->ctx, &u->table, + &FN(UNION,scale_val_entry), v) < 0) + goto error; + + isl_val_free(v); + return u; +error: + isl_val_free(v); + FN(UNION,free)(u); + return NULL; +} + +/* Divide *entry by the isl_val "user". + * + * Return 0 on success and -1 on error. + */ +static isl_stat FN(UNION,scale_down_val_entry)(void **entry, void *user) +{ + PW **pw = (PW **)entry; + isl_val *v = user; + + *pw = FN(PW,scale_down_val)(*pw, isl_val_copy(v)); + if (!*pw) + return isl_stat_error; + + return isl_stat_ok; +} + +/* Divide "u" by "v" and return the result. + */ +__isl_give UNION *FN(UNION,scale_down_val)(__isl_take UNION *u, + __isl_take isl_val *v) +{ + if (!u || !v) + goto error; + if (isl_val_is_one(v)) { + isl_val_free(v); + return u; + } + + if (!isl_val_is_rat(v)) + isl_die(isl_val_get_ctx(v), isl_error_invalid, + "expecting rational factor", goto error); + if (isl_val_is_zero(v)) + isl_die(isl_val_get_ctx(v), isl_error_invalid, + "cannot scale down by zero", goto error); + + u = FN(UNION,cow)(u); + if (!u) + return NULL; + +#ifdef HAS_TYPE + if (isl_val_is_neg(v)) + u->type = isl_fold_type_negate(u->type); +#endif + if (isl_hash_table_foreach(FN(UNION,get_ctx)(u), &u->table, + &FN(UNION,scale_down_val_entry), v) < 0) goto error; isl_val_free(v); @@ -872,10 +1117,10 @@ S(UNION,plain_is_equal_data) { UNION *u2; - int is_equal; + isl_bool is_equal; }; -static int plain_is_equal_entry(void **entry, void *user) +static isl_stat FN(UNION,plain_is_equal_entry)(void **entry, void *user) { S(UNION,plain_is_equal_data) *data = user; uint32_t hash; @@ -883,30 +1128,31 @@ PW *pw = *entry; hash = isl_space_get_hash(pw->dim); - entry2 = isl_hash_table_find(data->u2->dim->ctx, &data->u2->table, - hash, &has_dim, pw->dim, 0); + entry2 = isl_hash_table_find(data->u2->space->ctx, &data->u2->table, + hash, &FN(UNION,has_same_domain_space), + pw->dim, 0); if (!entry2) { - data->is_equal = 0; - return -1; + data->is_equal = isl_bool_false; + return isl_stat_error; } data->is_equal = FN(PW,plain_is_equal)(pw, entry2->data); if (data->is_equal < 0 || !data->is_equal) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } -int FN(UNION,plain_is_equal)(__isl_keep UNION *u1, __isl_keep UNION *u2) +isl_bool FN(UNION,plain_is_equal)(__isl_keep UNION *u1, __isl_keep UNION *u2) { - S(UNION,plain_is_equal_data) data = { NULL, 1 }; + S(UNION,plain_is_equal_data) data = { NULL, isl_bool_true }; if (!u1 || !u2) - return -1; + return isl_bool_error; if (u1 == u2) - return 1; + return isl_bool_true; if (u1->table.n != u2->table.n) - return 0; + return isl_bool_false; u1 = FN(UNION,copy)(u1); u2 = FN(UNION,copy)(u2); @@ -916,8 +1162,8 @@ goto error; data.u2 = u2; - if (isl_hash_table_foreach(u1->dim->ctx, &u1->table, - &plain_is_equal_entry, &data) < 0 && + if (isl_hash_table_foreach(u1->space->ctx, &u1->table, + &FN(UNION,plain_is_equal_entry), &data) < 0 && data.is_equal) goto error; @@ -928,5 +1174,198 @@ error: FN(UNION,free)(u1); FN(UNION,free)(u2); - return -1; + return isl_bool_error; +} + +#ifndef NO_NEG +/* Replace *entry by its opposite. + * + * Return 0 on success and -1 on error. + */ +static isl_stat FN(UNION,neg_entry)(void **entry, void *user) +{ + PW **pw = (PW **) entry; + + *pw = FN(PW,neg)(*pw); + + return *pw ? isl_stat_ok : isl_stat_error; +} + +/* Return the opposite of "u". + */ +__isl_give UNION *FN(UNION,neg)(__isl_take UNION *u) +{ + u = FN(UNION,cow)(u); + if (!u) + return NULL; + + if (isl_hash_table_foreach(u->space->ctx, &u->table, + &FN(UNION,neg_entry), NULL) < 0) + return FN(UNION,free)(u); + + return u; +} +#endif + +/* Internal data structure for isl_union_*_drop_dims. + * type, first and n are passed to isl_*_drop_dims. + * res collects the results. + */ +S(UNION,drop_dims_data) { + enum isl_dim_type type; + unsigned first; + unsigned n; + + UNION *res; +}; + +/* Drop the parameters specified by "data" from "part" and + * add the results to data->res. + */ +static isl_stat FN(UNION,drop_dims_entry)(__isl_take PART *part, void *user) +{ + S(UNION,drop_dims_data) *data = user; + + part = FN(PART,drop_dims)(part, data->type, data->first, data->n); + data->res = FN(FN(UNION,add),PARTS)(data->res, part); + if (!data->res) + return isl_stat_error; + + return isl_stat_ok; +} + +/* Drop the specified parameters from "u". + * That is, type is required to be isl_dim_param. + */ +__isl_give UNION *FN(UNION,drop_dims)( __isl_take UNION *u, + enum isl_dim_type type, unsigned first, unsigned n) +{ + isl_space *space; + S(UNION,drop_dims_data) data = { type, first, n }; + + if (!u) + return NULL; + + if (type != isl_dim_param) + isl_die(FN(UNION,get_ctx)(u), isl_error_invalid, + "can only project out parameters", + return FN(UNION,free)(u)); + + space = FN(UNION,get_space)(u); + space = isl_space_drop_dims(space, type, first, n); +#ifdef HAS_TYPE + data.res = FN(UNION,alloc)(space, u->type, u->table.n); +#else + data.res = FN(UNION,alloc)(space, u->table.n); +#endif + if (FN(FN(UNION,foreach),PARTS)(u, + &FN(UNION,drop_dims_entry), &data) < 0) + data.res = FN(UNION,free)(data.res); + + FN(UNION,free)(u); + + return data.res; +} + +/* Internal data structure for isl_union_*_set_dim_name. + * pos is the position of the parameter that needs to be renamed. + * s is the new name. + * res collects the results. + */ +S(UNION,set_dim_name_data) { + unsigned pos; + const char *s; + + UNION *res; +}; + +/* Change the name of the parameter at position data->pos of "part" to data->s + * and add the result to data->res. + */ +static isl_stat FN(UNION,set_dim_name_entry)(__isl_take PART *part, void *user) +{ + S(UNION,set_dim_name_data) *data = user; + + part = FN(PART,set_dim_name)(part, isl_dim_param, data->pos, data->s); + data->res = FN(FN(UNION,add),PARTS)(data->res, part); + if (!data->res) + return isl_stat_error; + + return isl_stat_ok; +} + +/* Change the name of the parameter at position "pos" to "s". + * That is, type is required to be isl_dim_param. + */ +__isl_give UNION *FN(UNION,set_dim_name)(__isl_take UNION *u, + enum isl_dim_type type, unsigned pos, const char *s) +{ + S(UNION,set_dim_name_data) data = { pos, s }; + isl_space *space; + + if (!u) + return NULL; + + if (type != isl_dim_param) + isl_die(FN(UNION,get_ctx)(u), isl_error_invalid, + "can only set parameter names", + return FN(UNION,free)(u)); + + space = FN(UNION,get_space)(u); + space = isl_space_set_dim_name(space, type, pos, s); +#ifdef HAS_TYPE + data.res = FN(UNION,alloc)(space, u->type, u->table.n); +#else + data.res = FN(UNION,alloc)(space, u->table.n); +#endif + + if (FN(FN(UNION,foreach),PARTS)(u, + &FN(UNION,set_dim_name_entry), &data) < 0) + data.res = FN(UNION,free)(data.res); + + FN(UNION,free)(u); + + return data.res; +} + +/* Reset the user pointer on all identifiers of parameters and tuples + * of the space of "part" and add the result to *res. + */ +static isl_stat FN(UNION,reset_user_entry)(__isl_take PART *part, void *user) +{ + UNION **res = user; + + part = FN(PART,reset_user)(part); + *res = FN(FN(UNION,add),PARTS)(*res, part); + if (!*res) + return isl_stat_error; + + return isl_stat_ok; +} + +/* Reset the user pointer on all identifiers of parameters and tuples + * of the spaces of "u". + */ +__isl_give UNION *FN(UNION,reset_user)(__isl_take UNION *u) +{ + isl_space *space; + UNION *res; + + if (!u) + return NULL; + + space = FN(UNION,get_space)(u); + space = isl_space_reset_user(space); +#ifdef HAS_TYPE + res = FN(UNION,alloc)(space, u->type, u->table.n); +#else + res = FN(UNION,alloc)(space, u->table.n); +#endif + if (FN(FN(UNION,foreach),PARTS)(u, + &FN(UNION,reset_user_entry), &res) < 0) + res = FN(UNION,free)(res); + + FN(UNION,free)(u); + + return res; } diff -Nru cloog-0.18.2/isl/isl_val.c cloog-0.18.4/isl/isl_val.c --- cloog-0.18.2/isl/isl_val.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_val.c 2015-07-24 12:23:09.000000000 +0000 @@ -49,6 +49,13 @@ return isl_val_int_from_si(ctx, 1); } +/* Return a reference to an isl_val representing negative one. + */ +__isl_give isl_val *isl_val_negone(isl_ctx *ctx) +{ + return isl_val_int_from_si(ctx, -1); +} + /* Return a reference to an isl_val representing NaN. */ __isl_give isl_val *isl_val_nan(isl_ctx *ctx) @@ -252,7 +259,7 @@ /* Free "v" and return NULL. */ -void *isl_val_free(__isl_take isl_val *v) +__isl_null isl_val *isl_val_free(__isl_take isl_val *v) { if (!v) return NULL; @@ -386,6 +393,33 @@ return v; } +/* Return the inverse of "v". + */ +__isl_give isl_val *isl_val_inv(__isl_take isl_val *v) +{ + if (!v) + return NULL; + if (isl_val_is_nan(v)) + return v; + if (isl_val_is_zero(v)) { + isl_ctx *ctx = isl_val_get_ctx(v); + isl_val_free(v); + return isl_val_nan(ctx); + } + if (isl_val_is_infty(v) || isl_val_is_neginfty(v)) { + isl_ctx *ctx = isl_val_get_ctx(v); + isl_val_free(v); + return isl_val_zero(ctx); + } + + v = isl_val_cow(v); + if (!v) + return NULL; + isl_int_swap(v->n, v->d); + + return isl_val_normalize(v); +} + /* Return the absolute value of "v". */ __isl_give isl_val *isl_val_abs(__isl_take isl_val *v) @@ -851,16 +885,27 @@ return NULL; } +/* Divide "v1" by "v2". + * + * This is a private copy of isl_val_div for use in the generic + * isl_multi_*_scale_down_val instantiated for isl_val. + */ +__isl_give isl_val *isl_val_scale_down_val(__isl_take isl_val *v1, + __isl_take isl_val *v2) +{ + return isl_val_div(v1, v2); +} + /* Given two integer values "v1" and "v2", check if "v1" is divisible by "v2". */ -int isl_val_is_divisible_by(__isl_keep isl_val *v1, __isl_keep isl_val *v2) +isl_bool isl_val_is_divisible_by(__isl_keep isl_val *v1, __isl_keep isl_val *v2) { if (!v1 || !v2) - return -1; + return isl_bool_error; if (!isl_val_is_int(v1) || !isl_val_is_int(v2)) isl_die(isl_val_get_ctx(v1), isl_error_invalid, - "expecting two integers", return -1); + "expecting two integers", return isl_bool_error); return isl_int_is_divisible_by(v1->n, v2->n); } @@ -891,6 +936,18 @@ return NULL; } +/* Given two integer values "v1" and "v2", return the residue of "v1" + * modulo "v2". + * + * This is a private copy of isl_val_mod for use in the generic + * isl_multi_*_mod_multi_val instantiated for isl_val. + */ +__isl_give isl_val *isl_val_mod_val(__isl_take isl_val *v1, + __isl_take isl_val *v2) +{ + return isl_val_mod(v1, v2); +} + /* Given two integer values, return their greatest common divisor. */ __isl_give isl_val *isl_val_gcd(__isl_take isl_val *v1, __isl_take isl_val *v2) @@ -924,6 +981,48 @@ return NULL; } +/* Compute x, y and g such that g = gcd(a,b) and a*x+b*y = g. + */ +static void isl_int_gcdext(isl_int g, isl_int x, isl_int y, + isl_int a, isl_int b) +{ + isl_int d, tmp; + isl_int a_copy, b_copy; + + isl_int_init(a_copy); + isl_int_init(b_copy); + isl_int_init(d); + isl_int_init(tmp); + isl_int_set(a_copy, a); + isl_int_set(b_copy, b); + isl_int_abs(g, a_copy); + isl_int_abs(d, b_copy); + isl_int_set_si(x, 1); + isl_int_set_si(y, 0); + while (isl_int_is_pos(d)) { + isl_int_fdiv_q(tmp, g, d); + isl_int_submul(x, tmp, y); + isl_int_submul(g, tmp, d); + isl_int_swap(g, d); + isl_int_swap(x, y); + } + if (isl_int_is_zero(a_copy)) + isl_int_set_si(x, 0); + else if (isl_int_is_neg(a_copy)) + isl_int_neg(x, x); + if (isl_int_is_zero(b_copy)) + isl_int_set_si(y, 0); + else { + isl_int_mul(tmp, a_copy, x); + isl_int_sub(tmp, g, tmp); + isl_int_divexact(y, tmp, b_copy); + } + isl_int_clear(d); + isl_int_clear(tmp); + isl_int_clear(a_copy); + isl_int_clear(b_copy); +} + /* Given two integer values v1 and v2, return their greatest common divisor g, * as well as two integers x and y such that x * v1 + y * v2 = g. */ @@ -976,126 +1075,126 @@ /* Does "v" represent an integer value? */ -int isl_val_is_int(__isl_keep isl_val *v) +isl_bool isl_val_is_int(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_is_one(v->d); } /* Does "v" represent a rational value? */ -int isl_val_is_rat(__isl_keep isl_val *v) +isl_bool isl_val_is_rat(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return !isl_int_is_zero(v->d); } /* Does "v" represent NaN? */ -int isl_val_is_nan(__isl_keep isl_val *v) +isl_bool isl_val_is_nan(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_is_zero(v->n) && isl_int_is_zero(v->d); } /* Does "v" represent +infinity? */ -int isl_val_is_infty(__isl_keep isl_val *v) +isl_bool isl_val_is_infty(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_is_pos(v->n) && isl_int_is_zero(v->d); } /* Does "v" represent -infinity? */ -int isl_val_is_neginfty(__isl_keep isl_val *v) +isl_bool isl_val_is_neginfty(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_is_neg(v->n) && isl_int_is_zero(v->d); } /* Does "v" represent the integer zero? */ -int isl_val_is_zero(__isl_keep isl_val *v) +isl_bool isl_val_is_zero(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_is_zero(v->n) && !isl_int_is_zero(v->d); } /* Does "v" represent the integer one? */ -int isl_val_is_one(__isl_keep isl_val *v) +isl_bool isl_val_is_one(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_eq(v->n, v->d); } /* Does "v" represent the integer negative one? */ -int isl_val_is_negone(__isl_keep isl_val *v) +isl_bool isl_val_is_negone(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_is_neg(v->n) && isl_int_abs_eq(v->n, v->d); } /* Is "v" (strictly) positive? */ -int isl_val_is_pos(__isl_keep isl_val *v) +isl_bool isl_val_is_pos(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_is_pos(v->n); } /* Is "v" (strictly) negative? */ -int isl_val_is_neg(__isl_keep isl_val *v) +isl_bool isl_val_is_neg(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_is_neg(v->n); } /* Is "v" non-negative? */ -int isl_val_is_nonneg(__isl_keep isl_val *v) +isl_bool isl_val_is_nonneg(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; if (isl_val_is_nan(v)) - return 0; + return isl_bool_false; return isl_int_is_nonneg(v->n); } /* Is "v" non-positive? */ -int isl_val_is_nonpos(__isl_keep isl_val *v) +isl_bool isl_val_is_nonpos(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; if (isl_val_is_nan(v)) - return 0; + return isl_bool_false; return isl_int_is_nonpos(v->n); } @@ -1117,27 +1216,27 @@ /* Is "v1" (strictly) less than "v2"? */ -int isl_val_lt(__isl_keep isl_val *v1, __isl_keep isl_val *v2) +isl_bool isl_val_lt(__isl_keep isl_val *v1, __isl_keep isl_val *v2) { isl_int t; - int lt; + isl_bool lt; if (!v1 || !v2) - return -1; + return isl_bool_error; if (isl_val_is_int(v1) && isl_val_is_int(v2)) return isl_int_lt(v1->n, v2->n); if (isl_val_is_nan(v1) || isl_val_is_nan(v2)) - return 0; + return isl_bool_false; if (isl_val_eq(v1, v2)) - return 0; + return isl_bool_false; if (isl_val_is_infty(v2)) - return 1; + return isl_bool_true; if (isl_val_is_infty(v1)) - return 0; + return isl_bool_false; if (isl_val_is_neginfty(v1)) - return 1; + return isl_bool_true; if (isl_val_is_neginfty(v2)) - return 0; + return isl_bool_false; isl_int_init(t); isl_int_mul(t, v1->n, v2->d); @@ -1150,34 +1249,34 @@ /* Is "v1" (strictly) greater than "v2"? */ -int isl_val_gt(__isl_keep isl_val *v1, __isl_keep isl_val *v2) +isl_bool isl_val_gt(__isl_keep isl_val *v1, __isl_keep isl_val *v2) { return isl_val_lt(v2, v1); } /* Is "v1" less than or equal to "v2"? */ -int isl_val_le(__isl_keep isl_val *v1, __isl_keep isl_val *v2) +isl_bool isl_val_le(__isl_keep isl_val *v1, __isl_keep isl_val *v2) { isl_int t; - int le; + isl_bool le; if (!v1 || !v2) - return -1; + return isl_bool_error; if (isl_val_is_int(v1) && isl_val_is_int(v2)) return isl_int_le(v1->n, v2->n); if (isl_val_is_nan(v1) || isl_val_is_nan(v2)) - return 0; + return isl_bool_false; if (isl_val_eq(v1, v2)) - return 1; + return isl_bool_true; if (isl_val_is_infty(v2)) - return 1; + return isl_bool_true; if (isl_val_is_infty(v1)) - return 0; + return isl_bool_false; if (isl_val_is_neginfty(v1)) - return 1; + return isl_bool_true; if (isl_val_is_neginfty(v2)) - return 0; + return isl_bool_false; isl_int_init(t); isl_int_mul(t, v1->n, v2->d); @@ -1190,7 +1289,7 @@ /* Is "v1" greater than or equal to "v2"? */ -int isl_val_ge(__isl_keep isl_val *v1, __isl_keep isl_val *v2) +isl_bool isl_val_ge(__isl_keep isl_val *v1, __isl_keep isl_val *v2) { return isl_val_le(v2, v1); } @@ -1228,24 +1327,36 @@ /* Is "v1" equal to "v2"? */ -int isl_val_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2) +isl_bool isl_val_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2) { if (!v1 || !v2) - return -1; + return isl_bool_error; if (isl_val_is_nan(v1) || isl_val_is_nan(v2)) - return 0; + return isl_bool_false; return isl_int_eq(v1->n, v2->n) && isl_int_eq(v1->d, v2->d); } +/* Is "v1" equal to "v2" in absolute value? + */ +isl_bool isl_val_abs_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2) +{ + if (!v1 || !v2) + return isl_bool_error; + if (isl_val_is_nan(v1) || isl_val_is_nan(v2)) + return isl_bool_false; + + return isl_int_abs_eq(v1->n, v2->n) && isl_int_eq(v1->d, v2->d); +} + /* Is "v1" different from "v2"? */ -int isl_val_ne(__isl_keep isl_val *v1, __isl_keep isl_val *v2) +isl_bool isl_val_ne(__isl_keep isl_val *v1, __isl_keep isl_val *v2) { if (!v1 || !v2) - return -1; + return isl_bool_error; if (isl_val_is_nan(v1) || isl_val_is_nan(v2)) - return 0; + return isl_bool_false; return isl_int_ne(v1->n, v2->n) || isl_int_ne(v1->d, v2->d); } @@ -1281,6 +1392,33 @@ return p; } +/* Is "val1" (obviously) equal to "val2"? + * + * This is a private copy of isl_val_eq for use in the generic + * isl_multi_*_plain_is_equal instantiated for isl_val. + */ +int isl_val_plain_is_equal(__isl_keep isl_val *val1, __isl_keep isl_val *val2) +{ + return isl_val_eq(val1, val2); +} + +/* Does "v" have any non-zero coefficients + * for any dimension in the given range? + * + * This function is only meant to be used in the generic isl_multi_* + * functions which have to deal with base objects that have an associated + * space. Since an isl_val does not have any coefficients, this function + * always return 0. + */ +int isl_val_involves_dims(__isl_keep isl_val *v, enum isl_dim_type type, + unsigned first, unsigned n) +{ + if (!v) + return -1; + + return 0; +} + /* Insert "n" dimensions of type "type" at position "first". * * This function is only meant to be used in the generic isl_multi_* @@ -1320,6 +1458,22 @@ return v; } +/* Return the space of "v". + * + * This function is only meant to be used in the generic isl_multi_* + * functions which have to deal with base objects that have an associated + * space. The conditions surrounding the call to this function make sure + * that this function will never actually get called. We return a valid + * space anyway, just in case. + */ +__isl_give isl_space *isl_val_get_space(__isl_keep isl_val *v) +{ + if (!v) + return NULL; + + return isl_space_params_alloc(isl_val_get_ctx(v), 0); +} + /* Reset the domain space of "v" to "space". * * This function is only meant to be used in the generic isl_multi_* @@ -1336,6 +1490,24 @@ return v; } +/* Align the parameters of "v" to those of "space". + * + * This function is only meant to be used in the generic isl_multi_* + * functions which have to deal with base objects that have an associated + * space. Since an isl_val does not have an associated space, this function + * does not do anything, apart from error handling and cleaning up memory. + * Note that the conditions surrounding the call to this function make sure + * that this function will never actually get called. + */ +__isl_give isl_val *isl_val_align_params(__isl_take isl_val *v, + __isl_take isl_space *space) +{ + if (!space) + return isl_val_free(v); + isl_space_free(space); + return v; +} + /* Reorder the dimensions of the domain of "v" according * to the given reordering. * @@ -1371,6 +1543,20 @@ return isl_val_zero(ctx); } +/* Do the parameters of "v" match those of "space"? + * + * This function is only meant to be used in the generic isl_multi_* + * functions which have to deal with base objects that have an associated + * space. Since an isl_val does not have an associated space, this function + * simply returns 1, except if "v" or "space" are NULL. + */ +int isl_val_matching_params(__isl_keep isl_val *v, __isl_keep isl_space *space) +{ + if (!v || !space) + return -1; + return 1; +} + /* Check that the domain space of "v" matches "space". * * Return 0 on success and -1 on error. @@ -1391,9 +1577,10 @@ #undef BASE #define BASE val -#define NO_GIST +#define NO_DOMAIN #define NO_IDENTITY #define NO_FROM_BASE +#define NO_MOVE_DIMS #include /* Apply "fn" to each of the elements of "mv" with as second argument "v". diff -Nru cloog-0.18.2/isl/isl_val_imath.c cloog-0.18.4/isl/isl_val_imath.c --- cloog-0.18.2/isl/isl_val_imath.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_val_imath.c 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,64 @@ +#include + +/* Return a reference to an isl_val representing the unsigned + * integer value stored in the "n" chunks of size "size" at "chunks". + * The least significant chunk is assumed to be stored first. + */ +__isl_give isl_val *isl_val_int_from_chunks(isl_ctx *ctx, size_t n, + size_t size, const void *chunks) +{ + isl_val *v; + + v = isl_val_alloc(ctx); + if (!v) + return NULL; + + impz_import(v->n, n, -1, size, 0, 0, chunks); + isl_int_set_si(v->d, 1); + + return v; +} + +/* Store a representation of the absolute value of the numerator of "v" + * in terms of chunks of size "size" at "chunks". + * The least significant chunk is stored first. + * The number of chunks in the result can be obtained by calling + * isl_val_n_abs_num_chunks. The user is responsible for allocating + * enough memory to store the results. + * + * In the special case of a zero value, isl_val_n_abs_num_chunks will + * return one, while impz_export will not fill in any chunks. We therefore + * do it ourselves. + */ +int isl_val_get_abs_num_chunks(__isl_keep isl_val *v, size_t size, + void *chunks) +{ + if (!v || !chunks) + return -1; + + if (!isl_val_is_rat(v)) + isl_die(isl_val_get_ctx(v), isl_error_invalid, + "expecting rational value", return -1); + + impz_export(chunks, NULL, -1, size, 0, 0, v->n); + if (isl_val_is_zero(v)) + memset(chunks, 0, size); + + return 0; +} + +/* Return the number of chunks of size "size" required to + * store the absolute value of the numerator of "v". + */ +size_t isl_val_n_abs_num_chunks(__isl_keep isl_val *v, size_t size) +{ + if (!v) + return 0; + + if (!isl_val_is_rat(v)) + isl_die(isl_val_get_ctx(v), isl_error_invalid, + "expecting rational value", return 0); + + size *= 8; + return (impz_sizeinbase(v->n, 2) + size - 1) / size; +} diff -Nru cloog-0.18.2/isl/isl_val_private.h cloog-0.18.4/isl/isl_val_private.h --- cloog-0.18.2/isl/isl_val_private.h 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_val_private.h 2015-07-24 12:23:09.000000000 +0000 @@ -1,7 +1,7 @@ #ifndef ISL_VAL_PRIVATE_H #define ISL_VAL_PRIVATE_H -#include +#include #include #include #include @@ -34,21 +34,33 @@ isl_int n, isl_int d); __isl_give isl_val *isl_val_cow(__isl_take isl_val *val); +int isl_val_involves_dims(__isl_keep isl_val *v, enum isl_dim_type type, + unsigned first, unsigned n); __isl_give isl_val *isl_val_insert_dims(__isl_take isl_val *v, enum isl_dim_type type, unsigned first, unsigned n); __isl_give isl_val *isl_val_drop_dims(__isl_take isl_val *v, enum isl_dim_type type, unsigned first, unsigned n); __isl_give isl_val *isl_val_set_dim_name(__isl_take isl_val *v, enum isl_dim_type type, unsigned pos, const char *s); +__isl_give isl_space *isl_val_get_space(__isl_keep isl_val *v); __isl_give isl_val *isl_val_reset_domain_space(__isl_take isl_val *v, __isl_take isl_space *space); +__isl_give isl_val *isl_val_align_params(__isl_take isl_val *v, + __isl_take isl_space *space); __isl_give isl_val *isl_val_realign_domain(__isl_take isl_val *v, __isl_take isl_reordering *r); __isl_give isl_val *isl_val_zero_on_domain(__isl_take isl_local_space *ls); __isl_give isl_val *isl_val_scale_val(__isl_take isl_val *v1, __isl_take isl_val *v2); +__isl_give isl_val *isl_val_scale_down_val(__isl_take isl_val *v1, + __isl_take isl_val *v2); +__isl_give isl_val *isl_val_mod_val(__isl_take isl_val *v1, + __isl_take isl_val *v2); + +int isl_val_plain_is_equal(__isl_keep isl_val *val1, __isl_keep isl_val *val2); +int isl_val_matching_params(__isl_keep isl_val *v, __isl_keep isl_space *space); int isl_val_check_match_domain_space(__isl_keep isl_val *v, __isl_keep isl_space *space); diff -Nru cloog-0.18.2/isl/isl_vec.c cloog-0.18.4/isl/isl_vec.c --- cloog-0.18.2/isl/isl_vec.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_vec.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,16 +1,19 @@ /* * Copyright 2008-2009 Katholieke Universiteit Leuven + * Copyright 2013 Ecole Normale Superieure * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, K.U.Leuven, Departement * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium + * and Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France */ #include -#include -#include +#include #include +#include +#include isl_ctx *isl_vec_get_ctx(__isl_keep isl_vec *vec) { @@ -157,7 +160,7 @@ return vec2; } -void *isl_vec_free(__isl_take isl_vec *vec) +__isl_null isl_vec *isl_vec_free(__isl_take isl_vec *vec) { if (!vec) return NULL; @@ -267,13 +270,13 @@ return isl_int_cmp(vec1->el[pos], vec2->el[pos]); } -int isl_vec_is_equal(__isl_keep isl_vec *vec1, __isl_keep isl_vec *vec2) +isl_bool isl_vec_is_equal(__isl_keep isl_vec *vec1, __isl_keep isl_vec *vec2) { if (!vec1 || !vec2) - return -1; + return isl_bool_error; if (vec1->size != vec2->size) - return 0; + return isl_bool_false; return isl_seq_eq(vec1->el, vec2->el, vec1->size); } @@ -526,3 +529,51 @@ return vec; } + +/* Move the "n" elements starting as "src_pos" of "vec" + * to "dst_pos". The elements originally at "dst_pos" are moved + * up or down depending on whether "dst_pos" is smaller or greater + * than "src_pos". + */ +__isl_give isl_vec *isl_vec_move_els(__isl_take isl_vec *vec, + unsigned dst_pos, unsigned src_pos, unsigned n) +{ + isl_vec *res; + + if (!vec) + return NULL; + + if (src_pos + n > vec->size) + isl_die(vec->ctx, isl_error_invalid, + "source range out of bounds", return isl_vec_free(vec)); + if (dst_pos + n > vec->size) + isl_die(vec->ctx, isl_error_invalid, + "destination range out of bounds", + return isl_vec_free(vec)); + + if (n == 0 || dst_pos == src_pos) + return vec; + + res = isl_vec_alloc(vec->ctx, vec->size); + if (!res) + return isl_vec_free(vec); + + if (dst_pos < src_pos) { + isl_seq_cpy(res->el, vec->el, dst_pos); + isl_seq_cpy(res->el + dst_pos, vec->el + src_pos, n); + isl_seq_cpy(res->el + dst_pos + n, + vec->el + dst_pos, src_pos - dst_pos); + isl_seq_cpy(res->el + src_pos + n, + vec->el + src_pos + n, res->size - src_pos - n); + } else { + isl_seq_cpy(res->el, vec->el, src_pos); + isl_seq_cpy(res->el + src_pos, + vec->el + src_pos + n, dst_pos - src_pos); + isl_seq_cpy(res->el + dst_pos, vec->el + src_pos, n); + isl_seq_cpy(res->el + dst_pos + n, + vec->el + dst_pos + n, res->size - dst_pos - n); + } + + isl_vec_free(vec); + return res; +} diff -Nru cloog-0.18.2/isl/isl_vec_private.h cloog-0.18.4/isl/isl_vec_private.h --- cloog-0.18.2/isl/isl_vec_private.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_vec_private.h 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,24 @@ +#ifndef ISL_VEC_PRIVATE_H +#define ISL_VEC_PRIVATE_H + +#include +#include + +struct isl_vec { + int ref; + + struct isl_ctx *ctx; + + unsigned size; + isl_int *el; + + struct isl_blk block; +}; + +__isl_give isl_vec *isl_vec_cow(__isl_take isl_vec *vec); + +void isl_vec_lcm(struct isl_vec *vec, isl_int *lcm); +int isl_vec_get_element(__isl_keep isl_vec *vec, int pos, isl_int *v); +__isl_give isl_vec *isl_vec_set(__isl_take isl_vec *vec, isl_int v); + +#endif diff -Nru cloog-0.18.2/isl/isl_version.c cloog-0.18.4/isl/isl_version.c --- cloog-0.18.2/isl/isl_version.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_version.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,6 +1,14 @@ +#include "isl_config.h" #include "gitversion.h" const char *isl_version(void) { - return GIT_HEAD_ID"\n"; + return GIT_HEAD_ID +#ifdef USE_GMP_FOR_MP + "-GMP" +#endif +#ifdef USE_IMATH_FOR_MP + "-IMath" +#endif + "\n"; } diff -Nru cloog-0.18.2/isl/isl_vertices.c cloog-0.18.4/isl/isl_vertices.c --- cloog-0.18.2/isl/isl_vertices.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/isl_vertices.c 2015-07-24 12:23:09.000000000 +0000 @@ -9,13 +9,15 @@ */ #include +#include #include -#include +#include #include #include #include #include #include +#include #define SELECTED 1 #define DESELECTED -1 @@ -112,14 +114,12 @@ __isl_keep isl_basic_set *bset, struct isl_tab *tab) { unsigned nvar; - unsigned nparam; struct isl_vertex_list *v = NULL; if (isl_tab_detect_implicit_equalities(tab) < 0) return -1; nvar = isl_basic_set_dim(bset, isl_dim_set); - nparam = isl_basic_set_dim(bset, isl_dim_param); v = isl_calloc_type(tab->mat->ctx, struct isl_vertex_list); if (!v) @@ -153,13 +153,10 @@ static __isl_give isl_vertices *vertices_empty(__isl_keep isl_basic_set *bset) { isl_vertices *vertices; - unsigned nparam; if (!bset) return NULL; - nparam = isl_basic_set_dim(bset, isl_dim_param); - vertices = isl_calloc_type(bset->ctx, isl_vertices); if (!vertices) return NULL; @@ -181,13 +178,10 @@ static __isl_give isl_vertices *vertices_0D(__isl_keep isl_basic_set *bset) { isl_vertices *vertices; - unsigned nparam; if (!bset) return NULL; - nparam = isl_basic_set_dim(bset, isl_dim_param); - vertices = isl_calloc_type(bset->ctx, isl_vertices); if (!vertices) return NULL; @@ -629,7 +623,7 @@ c->c.vertices = isl_alloc_array(tab->mat->ctx, int, n_vertices); if (n_vertices && !c->c.vertices) goto error; - c->c.dom = isl_basic_set_from_basic_map(isl_basic_map_copy(tab->bmap)); + c->c.dom = isl_basic_set_copy(isl_tab_peek_bset(tab)); c->c.dom = isl_basic_set_set_rational(c->c.dom); c->c.dom = isl_basic_set_cow(c->c.dom); c->c.dom = isl_basic_set_update_from_tab(c->c.dom, tab); @@ -706,7 +700,7 @@ if (!todo->constraint) goto error; isl_seq_neg(todo->constraint->el, tab->bmap->ineq[con], 1 + tab->n_var); - todo->bset = isl_basic_set_from_basic_map(isl_basic_map_copy(tab->bmap)); + todo->bset = isl_basic_set_copy(isl_tab_peek_bset(tab)); todo->bset = isl_basic_set_set_rational(todo->bset); todo->bset = isl_basic_set_cow(todo->bset); todo->bset = isl_basic_set_update_from_tab(todo->bset, tab); @@ -985,6 +979,25 @@ return vertex ? vertex->id : -1; } +__isl_give isl_basic_set *isl_basic_set_set_integral(__isl_take isl_basic_set *bset) +{ + if (!bset) + return NULL; + + if (!ISL_F_ISSET(bset, ISL_BASIC_MAP_RATIONAL)) + return bset; + + bset = isl_basic_set_cow(bset); + if (!bset) + return NULL; + + ISL_F_CLR(bset, ISL_BASIC_MAP_RATIONAL); + + return isl_basic_set_finalize(bset); +} + +/* Return the activity domain of the vertex "vertex". + */ __isl_give isl_basic_set *isl_vertex_get_domain(__isl_keep isl_vertex *vertex) { struct isl_vertex *v; @@ -996,21 +1009,27 @@ if (!v->dom) { v->dom = isl_basic_set_copy(v->vertex); v->dom = isl_basic_set_params(v->dom); + v->dom = isl_basic_set_set_integral(v->dom); } return isl_basic_set_copy(v->dom); } -__isl_give isl_basic_set *isl_vertex_get_expr(__isl_keep isl_vertex *vertex) +/* Return a multiple quasi-affine expression describing the vertex "vertex" + * in terms of the parameters, + */ +__isl_give isl_multi_aff *isl_vertex_get_expr(__isl_keep isl_vertex *vertex) { struct isl_vertex *v; + isl_basic_set *bset; if (!vertex) return NULL; v = &vertex->vertices->v[vertex->id]; - return isl_basic_set_copy(v->vertex); + bset = isl_basic_set_copy(v->vertex); + return isl_multi_aff_from_basic_set_equalities(bset); } static __isl_give isl_vertex *isl_vertex_alloc(__isl_take isl_vertices *vertices, @@ -1044,23 +1063,6 @@ free(vertex); } -__isl_give isl_basic_set *isl_basic_set_set_integral(__isl_take isl_basic_set *bset) -{ - if (!bset) - return NULL; - - if (!ISL_F_ISSET(bset, ISL_BASIC_MAP_RATIONAL)) - return bset; - - bset = isl_basic_set_cow(bset); - if (!bset) - return NULL; - - ISL_F_CLR(bset, ISL_BASIC_MAP_RATIONAL); - - return isl_basic_set_finalize(bset); -} - isl_ctx *isl_cell_get_ctx(__isl_keep isl_cell *cell) { return cell ? cell->dom->ctx : NULL; @@ -1258,87 +1260,87 @@ return -1; } -int isl_vertices_foreach_cell(__isl_keep isl_vertices *vertices, - int (*fn)(__isl_take isl_cell *cell, void *user), void *user) +isl_stat isl_vertices_foreach_cell(__isl_keep isl_vertices *vertices, + isl_stat (*fn)(__isl_take isl_cell *cell, void *user), void *user) { int i; isl_cell *cell; if (!vertices) - return -1; + return isl_stat_error; if (vertices->n_chambers == 0) - return 0; + return isl_stat_ok; for (i = 0; i < vertices->n_chambers; ++i) { - int r; + isl_stat r; isl_basic_set *dom = isl_basic_set_copy(vertices->c[i].dom); cell = isl_cell_alloc(isl_vertices_copy(vertices), dom, i); if (!cell) - return -1; + return isl_stat_error; r = fn(cell, user); if (r < 0) - return -1; + return isl_stat_error; } - return 0; + return isl_stat_ok; } -int isl_vertices_foreach_vertex(__isl_keep isl_vertices *vertices, - int (*fn)(__isl_take isl_vertex *vertex, void *user), void *user) +isl_stat isl_vertices_foreach_vertex(__isl_keep isl_vertices *vertices, + isl_stat (*fn)(__isl_take isl_vertex *vertex, void *user), void *user) { int i; isl_vertex *vertex; if (!vertices) - return -1; + return isl_stat_error; if (vertices->n_vertices == 0) - return 0; + return isl_stat_ok; for (i = 0; i < vertices->n_vertices; ++i) { - int r; + isl_stat r; vertex = isl_vertex_alloc(isl_vertices_copy(vertices), i); if (!vertex) - return -1; + return isl_stat_error; r = fn(vertex, user); if (r < 0) - return -1; + return isl_stat_error; } - return 0; + return isl_stat_ok; } -int isl_cell_foreach_vertex(__isl_keep isl_cell *cell, - int (*fn)(__isl_take isl_vertex *vertex, void *user), void *user) +isl_stat isl_cell_foreach_vertex(__isl_keep isl_cell *cell, + isl_stat (*fn)(__isl_take isl_vertex *vertex, void *user), void *user) { int i; isl_vertex *vertex; if (!cell) - return -1; + return isl_stat_error; if (cell->n_vertices == 0) - return 0; + return isl_stat_ok; for (i = 0; i < cell->n_vertices; ++i) { - int r; + isl_stat r; vertex = isl_vertex_alloc(isl_vertices_copy(cell->vertices), cell->ids[i]); if (!vertex) - return -1; + return isl_stat_error; r = fn(vertex, user); if (r < 0) - return -1; + return isl_stat_error; } - return 0; + return isl_stat_ok; } isl_ctx *isl_vertices_get_ctx(__isl_keep isl_vertices *vertices) diff -Nru cloog-0.18.2/isl/isl_yaml.h cloog-0.18.4/isl/isl_yaml.h --- cloog-0.18.2/isl/isl_yaml.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/isl_yaml.h 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,18 @@ +#ifndef ISL_YAML_H +#define ISL_YAML_H + +#define ISL_YAML_INDENT_FLOW -1 + +enum isl_yaml_state { + isl_yaml_none, + isl_yaml_mapping_first_key_start, + isl_yaml_mapping_key_start, + isl_yaml_mapping_key, + isl_yaml_mapping_val_start, + isl_yaml_mapping_val, + isl_yaml_sequence_first_start, + isl_yaml_sequence_start, + isl_yaml_sequence +}; + +#endif diff -Nru cloog-0.18.2/isl/ltmain.sh cloog-0.18.4/isl/ltmain.sh --- cloog-0.18.2/isl/ltmain.sh 2013-12-18 12:35:57.000000000 +0000 +++ cloog-0.18.4/isl/ltmain.sh 2014-10-02 14:14:35.000000000 +0000 @@ -1,10 +1,9 @@ -#! /bin/sh -# libtool (GNU libtool) 2.4.2.418 -# Provide generalized library-building support services. +# libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -24,2013 +23,881 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -PROGRAM=libtool -PACKAGE=libtool -VERSION=2.4.2.418 -package_revision=2.4.2.418 - - -## ------ ## -## Usage. ## -## ------ ## - -# Run './libtool --help' for help with using this script from the -# command line. - - -## ------------------------------- ## -## User overridable command paths. ## -## ------------------------------- ## - -# After configure completes, it has a better idea of some of the -# shell tools we need than the defaults used by the functions shared -# with bootstrap, so set those here where they can still be over- -# ridden by the user, but otherwise take precedence. - -: ${AUTOCONF="autoconf"} -: ${AUTOMAKE="automake"} - - -## -------------------------- ## -## Source external libraries. ## -## -------------------------- ## - -# Much of our low-level functionality needs to be sourced from external -# libraries, which are installed to $pkgauxdir. - -# Set a version string for this script. -scriptversion=2013-08-23.20; # UTC - -# General shell script boiler plate, and helper functions. -# Written by Gary V. Vaughan, 2004 - -# Copyright (C) 2004-2013 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program 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 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES 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 this program. If not, see . - -# Please report bugs or propose patches to gary@gnu.org. +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -## ------ ## -## Usage. ## -## ------ ## - -# Evaluate this file near the top of your script to gain access to -# the functions and variables defined here: +# Usage: $progname [OPTION]... [MODE-ARG]... # -# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# Provide generalized library-building support services. # -# If you need to override any of the default environment variable -# settings, do that before evaluating this file. - +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --no-warn don't display warning messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . -## -------------------- ## -## Shell normalisation. ## -## -------------------- ## - -# Some shells need a little help to be as Bourne compatible as possible. -# Before doing anything else, make sure all that help has been provided! +PROGRAM=libtool +PACKAGE=libtool +VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1" +TIMESTAMP="" +package_revision=1.3337 -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} -# NLS nuisances: We save the old values in case they are required later. -_G_user_locale= -_G_safe_locale= -for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do - eval "if test set = \"\${$_G_var+set}\"; then - save_$_G_var=\$$_G_var - $_G_var=C - export $_G_var - _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" - _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +$lt_unset CDPATH -# Make sure IFS has a sensible default -sp=' ' -nl=' -' -IFS="$sp $nl" -# There are still modern systems that have problems with 'echo' mis- -# handling backslashes, among others, so make sure $bs_echo is set to a -# command that correctly interprets backslashes. -# (this code from Autoconf 2.68) - -# Printing a long string crashes Solaris 7 /usr/bin/printf. -bs_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo -bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $bs_echo`" = "X$bs_echo") 2>/dev/null; then - bs_echo='print -r --' - bs_echo_n='print -rn --' -elif (test "X`printf %s $bs_echo`" = "X$bs_echo") 2>/dev/null; then - bs_echo='printf %s\n' - bs_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $bs_echo) 2>/dev/null`" = "X-n $bs_echo"; then - bs_echo_body='eval /usr/ucb/echo -n "$1$nl"' - bs_echo_n='/usr/ucb/echo -n' - else - bs_echo_body='eval expr "X$1" : "X\\(.*\\)"' - bs_echo_n_body='eval - arg=$1; - case $arg in #( - *"$nl"*) - expr "X$arg" : "X\\(.*\\)$nl"; - arg=`expr "X$arg" : ".*$nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$nl" - ' - export bs_echo_n_body - bs_echo_n='sh -c $bs_echo_n_body bs_echo' - fi - export bs_echo_body - bs_echo='sh -c $bs_echo_body bs_echo' -fi +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" -## ------------------------------- ## -## User overridable command paths. ## -## ------------------------------- ## - -# All uppercase variable names are used for environment variables. These -# variables can be overridden by the user before calling a script that -# uses them if a suitable command of that name is not already available -# in the command search PATH. : ${CP="cp -f"} -: ${ECHO="$bs_echo"} -: ${EGREP="grep -E"} -: ${FGREP="grep -F"} -: ${GREP="grep"} -: ${LN_S="ln -s"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} -: ${SED="sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. -## -------------------- ## -## Useful sed snippets. ## -## -------------------- ## +exit_status=$EXIT_SUCCESS -sed_dirname='s|/[^/]*$||' -sed_basename='s|^.*/||' +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s|\([`"$\\]\)|\\\1|g' +dirname="s,/[^/]*$,," +basename="s,^.*/,," -# Same as above, but do not quote variable references. -sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation -# Sed substitution that turns a string into a regex matching for the -# string literally. -sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' -# Sed substitution that converts a w32 file name or path -# that contains forward slashes, into one that contains -# (escaped) backslashes. A very naive implementation. -sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation -# Re-'\' parameter expansions in output of sed_double_quote_subst that -# were '\'-ed in input to the same. If an odd number of '\' preceded a -# '$' in input to sed_double_quote_subst, that '$' was protected from -# expansion. Since each input '\' is now two '\'s, look for any number -# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. -_G_bs='\\' -_G_bs2='\\\\' -_G_bs4='\\\\\\\\' -_G_dollar='\$' -sed_double_backslash="\ - s/$_G_bs4/&\\ -/g - s/^$_G_bs2$_G_dollar/$_G_bs&/ - s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g - s/\n//g" +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation -## ----------------- ## -## Global variables. ## -## ----------------- ## - -# Except for the global variables explicitly listed below, the following -# functions in the '^func_' namespace, and the '^require_' namespace -# variables initialised in the 'Resource management' section, sourcing -# this file will not pollute your global namespace with anything -# else. There's no portable way to scope variables in Bourne shell -# though, so actually running these functions will sometimes place -# results into a variable named after the function, and often use -# temporary variables in the '^_G_' namespace. If you are careful to -# avoid using those namespaces casually in your sourcing script, things -# should continue to work as you expect. And, of course, you can freely -# overwrite any of the functions or variables defined here before -# calling anything to customize them. -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation -# Allow overriding, eg assuming that you follow the convention of -# putting '$debug_cmd' at the start of all your functions, you can get -# bash to show function call trace with: -# -# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name -debug_cmd=${debug_cmd-":"} -exit_cmd=: -# By convention, finish your script with: -# -# exit $exit_status -# -# so that you can set exit_status to non-zero if you want to indicate -# something went wrong during execution without actually bailing out at -# the point of failure. -exit_status=$EXIT_SUCCESS +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath=$0 +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done -# The name of this program. -progname=`$bs_echo "$progpath" |$SED "$sed_basename"` + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result -# Make sure we have an absolute progpath for reexecution: +# Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) - progdir=`$bs_echo "$progpath" |$SED "$sed_dirname"` + progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` - progpath=$progdir/$progname + progpath="$progdir/$progname" ;; *) - _G_IFS=$IFS + save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do - IFS=$_G_IFS + IFS="$save_IFS" test -x "$progdir/$progname" && break done - IFS=$_G_IFS + IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` - progpath=$progdir/$progname + progpath="$progdir/$progname" ;; esac +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' -## ----------------- ## -## Standard options. ## -## ----------------- ## - -# The following options affect the operation of the functions defined -# below, and should be set appropriately depending on run-time para- -# meters passed on the command line. +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" +# Standard options: opt_dry_run=false +opt_help=false opt_quiet=false opt_verbose=false +opt_warning=: -# Categories 'all' and 'none' are always available. Append any others -# you will pass as the first argument to func_warning from your own -# code. -warning_categories= - -# By default, display warnings according to 'opt_warning_types'. Set -# 'warning_func' to ':' to elide all warnings, or func_fatal_error to -# treat the next displayed warning as a fatal error. -warning_func=func_warn_and_continue - -# Set to 'all' to display all warnings, 'none' to suppress all -# warnings, or a space delimited list of some subset of -# 'warning_categories' to display only the listed warnings. -opt_warning_types=all - - -## -------------------- ## -## Resource management. ## -## -------------------- ## - -# This section contains definitions for functions that each ensure a -# particular resource (a file, or a non-empty configuration variable for -# example) is available, and if appropriate to extract default values -# from pertinent package files. Call them using their associated -# 'require_*' variable to ensure that they are executed, at most, once. -# -# It's entirely deliberate that calling these functions can set -# variables that don't obey the namespace limitations obeyed by the rest -# of this file, in order that that they be as useful as possible to -# callers. - - -# require_term_colors -# ------------------- -# Allow display of bold text on terminals that support it. -require_term_colors=func_require_term_colors -func_require_term_colors () -{ - $debug_cmd - - test -t 1 && { - # COLORTERM and USE_ANSI_COLORS environment variables take - # precedence, because most terminfo databases neglect to describe - # whether color sequences are supported. - test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} - - if test 1 = "$USE_ANSI_COLORS"; then - # Standard ANSI escape sequences - tc_reset='' - tc_bold=''; tc_standout='' - tc_red=''; tc_green='' - tc_blue=''; tc_cyan='' - else - # Otherwise trust the terminfo database after all. - test -n "`tput sgr0 2>/dev/null`" && { - tc_reset=`tput sgr0` - test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` - tc_standout=$tc_bold - test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` - test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` - test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` - test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` - test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` - } - fi - } - - require_term_colors=: +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} -## ----------------- ## -## Function library. ## -## ----------------- ## - -# This section contains a variety of useful functions to call in your -# scripts. Take note of the portable wrappers for features provided by -# some modern shells, which will fall back to slower equivalents on -# less featureful shells. - - -# func_append VAR VALUE -# --------------------- -# Append VALUE onto the existing contents of VAR. - - # We should try to minimise forks, especially on Windows where they are - # unreasonably slow, so skip the feature probes when bash or zsh are - # being used: - if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then - : ${_G_HAVE_ARITH_OP="yes"} - : ${_G_HAVE_XSI_OPS="yes"} - # The += operator was introduced in bash 3.1 - case $BASH_VERSION in - [12].* | 3.0 | 3.0*) ;; - *) - : ${_G_HAVE_PLUSEQ_OP="yes"} - ;; - esac - fi - - # _G_HAVE_PLUSEQ_OP - # Can be empty, in which case the shell is probed, "yes" if += is - # useable or anything else if it does not work. - test -z "$_G_HAVE_PLUSEQ_OP" \ - && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ - && _G_HAVE_PLUSEQ_OP=yes - -if test yes = "$_G_HAVE_PLUSEQ_OP" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_append () - { - $debug_cmd - - eval "$1+=\$2" - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_append () - { - $debug_cmd - - eval "$1=\$$1\$2" - } -fi - - -# func_append_quoted VAR VALUE -# ---------------------------- -# Quote VALUE and append to the end of shell variable VAR, separated -# by a space. -if test yes = "$_G_HAVE_PLUSEQ_OP"; then - eval 'func_append_quoted () - { - $debug_cmd - - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" - }' -else - func_append_quoted () - { - $debug_cmd - - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" - } -fi - - -# func_append_uniq VAR VALUE -# -------------------------- -# Append unique VALUE onto the existing contents of VAR, assuming -# entries are delimited by the first character of VALUE. For example: -# -# func_append_uniq options " --another-option option-argument" -# -# will only append to $options if " --another-option option-argument " -# is not already present somewhere in $options already (note spaces at -# each end implied by leading space in second argument). -func_append_uniq () -{ - $debug_cmd - - eval _G_current_value='`$bs_echo $'$1'`' - _G_delim=`expr "$2" : '\(.\)'` - - case $_G_delim$_G_current_value$_G_delim in - *"$2$_G_delim"*) ;; - *) func_append "$@" ;; - esac + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : } - -# func_arith TERM... -# ------------------ -# Set func_arith_result to the result of evaluating TERMs. - test -z "$_G_HAVE_ARITH_OP" \ - && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ - && _G_HAVE_ARITH_OP=yes - -if test yes = "$_G_HAVE_ARITH_OP"; then - eval 'func_arith () - { - $debug_cmd - - func_arith_result=$(( $* )) - }' -else - func_arith () - { - $debug_cmd - - func_arith_result=`expr "$@"` - } -fi - - -# func_basename FILE -# ------------------ -# Set func_basename_result to FILE with everything up to and including -# the last / stripped. -if test yes = "$_G_HAVE_XSI_OPS"; then - # If this shell supports suffix pattern removal, then use it to avoid - # forking. Hide the definitions single quotes in case the shell chokes - # on unsupported syntax... - _b='func_basename_result=${1##*/}' - _d='case $1 in - */*) func_dirname_result=${1%/*}$2 ;; - * ) func_dirname_result=$3 ;; - esac' - -else - # ...otherwise fall back to using sed. - _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' - _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` - if test "X$func_dirname_result" = "X$1"; then - func_dirname_result=$3 - else - func_append func_dirname_result "$2" - fi' -fi - -eval 'func_basename () +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () { - $debug_cmd - - '"$_b"' -}' + $ECHO "$*" +} +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 +} -# func_dirname FILE APPEND NONDIR_REPLACEMENT -# ------------------------------------------- -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -eval 'func_dirname () +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () { - $debug_cmd + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 - '"$_d"' -}' + # bash bug again: + : +} +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} -# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT -# -------------------------------------------------------- -# Perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# For efficiency, we do not delegate to the functions above but instead -# duplicate the functionality here. -eval 'func_dirname_and_basename () -{ - $debug_cmd - - '"$_b"' - '"$_d"' -}' - - -# func_echo ARG... -# ---------------- -# Echo program name prefixed message. -func_echo () -{ - $debug_cmd - - _G_message=$* - - func_echo_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_IFS - $bs_echo "$progname: $_G_line" - done - IFS=$func_echo_IFS -} - - -# func_echo_all ARG... -# -------------------- -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - - -# func_echo_infix_1 INFIX ARG... -# ------------------------------ -# Echo program name, followed by INFIX on the first line, with any -# additional lines not showing INFIX. -func_echo_infix_1 () -{ - $debug_cmd - - $require_term_colors - - _G_infix=$1; shift - _G_indent=$_G_infix - _G_prefix="$progname: $_G_infix: " - _G_message=$* - - # Strip color escape sequences before counting printable length - for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" - do - test -n "$_G_tc" && { - _G_esc_tc=`$bs_echo "$_G_tc" | sed "$sed_make_literal_regex"` - _G_indent=`$bs_echo "$_G_indent" | sed "s|$_G_esc_tc||g"` - } - done - _G_indent="$progname: "`echo "$_G_indent" | sed 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes - - func_echo_infix_1_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_infix_1_IFS - $bs_echo "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 - _G_prefix=$_G_indent - done - IFS=$func_echo_infix_1_IFS -} - - -# func_error ARG... -# ----------------- -# Echo program name prefixed message to standard error. -func_error () -{ - $debug_cmd - - $require_term_colors - - func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 -} - - -# func_fatal_error ARG... -# ----------------------- -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - $debug_cmd - - func_error "$*" - exit $EXIT_FAILURE -} - - -# func_grep EXPRESSION FILENAME -# ----------------------------- -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $debug_cmd - - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_len STRING -# --------------- -# Set func_len_result to the length of STRING. STRING may not -# start with a hyphen. - test -z "$_G_HAVE_XSI_OPS" \ - && (eval 'x=a/b/c; - test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ - && _G_HAVE_XSI_OPS=yes - -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_len () - { - $debug_cmd - - func_len_result=${#1} - }' -else - func_len () - { - $debug_cmd - - func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` - } -fi - - -# func_mkdir_p DIRECTORY-PATH -# --------------------------- -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - $debug_cmd - - _G_directory_path=$1 - _G_dir_list= - - if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then - - # Protect directory names starting with '-' - case $_G_directory_path in - -*) _G_directory_path=./$_G_directory_path ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$_G_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - _G_dir_list=$_G_directory_path:$_G_dir_list - - # If the last portion added has no slash in it, the list is done - case $_G_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` - done - _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` - - func_mkdir_p_IFS=$IFS; IFS=: - for _G_dir in $_G_dir_list; do - IFS=$func_mkdir_p_IFS - # mkdir can fail with a 'File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$_G_dir" 2>/dev/null || : - done - IFS=$func_mkdir_p_IFS - - # Bail out if we (or some other process) failed to create a directory. - test -d "$_G_directory_path" || \ - func_fatal_error "Failed to create '$1'" - fi -} - - -# func_mktempdir [BASENAME] -# ------------------------- -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, BASENAME is the basename for that directory. -func_mktempdir () -{ - $debug_cmd - - _G_template=${TMPDIR-/tmp}/${1-$progname} - - if test : = "$opt_dry_run"; then - # Return a directory name, but don't create it in dry-run mode - _G_tmpdir=$_G_template-$$ - else - - # If mktemp works, use that first and foremost - _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` - - if test ! -d "$_G_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - _G_tmpdir=$_G_template-${RANDOM-0}$$ - - func_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$_G_tmpdir" - umask $func_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$_G_tmpdir" || \ - func_fatal_error "cannot create temporary directory '$_G_tmpdir'" - fi - - $ECHO "$_G_tmpdir" -} - - -# func_normal_abspath PATH -# ------------------------ -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -func_normal_abspath () -{ - $debug_cmd - - # These SED scripts presuppose an absolute path with a trailing slash. - _G_pathcar='s|^/\([^/]*\).*$|\1|' - _G_pathcdr='s|^/[^/]*||' - _G_removedotparts=':dotsl - s|/\./|/|g - t dotsl - s|/\.$|/|' - _G_collapseslashes='s|/\{1,\}|/|g' - _G_finalslash='s|/*$|/|' - - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` - while :; do - # Processed it all yet? - if test / = "$func_normal_abspath_tpath"; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result"; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} - - -# func_notquiet ARG... -# -------------------- -# Echo program name prefixed message only when not in quiet mode. -func_notquiet () -{ - $debug_cmd - - $opt_quiet || func_echo ${1+"$@"} - - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : -} - - -# func_relative_path SRCDIR DSTDIR -# -------------------------------- -# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. -func_relative_path () -{ - $debug_cmd - - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=$func_dirname_result - if test -z "$func_relative_path_tlibdir"; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done - - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test -n "$func_stripname_result"; then - func_append func_relative_path_result "/$func_stripname_result" - fi - - # Normalisation. If bindir is libdir, return '.' else relative path. - if test -n "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - fi - - test -n "$func_relative_path_result" || func_relative_path_result=. - - : -} - - -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () -{ - $debug_cmd - - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - case $1 in - *[\\\`\"\$]*) - _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; - *) - _G_unquoted_arg=$1 ;; - esac - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" - fi - - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_quoted_arg=\"$_G_unquoted_arg\" - ;; - *) - _G_quoted_arg=$_G_unquoted_arg - ;; - esac - - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" - else - func_append func_quote_for_eval_result "$_G_quoted_arg" - fi - shift - done -} - - -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - $debug_cmd - - case $1 in - *[\\\`\"]*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; - esac - - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_arg=\"$_G_arg\" - ;; - esac - - func_quote_for_expand_result=$_G_arg -} - - -# func_stripname PREFIX SUFFIX NAME -# --------------------------------- -# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_stripname () - { - $debug_cmd - - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary variable first. - func_stripname_result=$3 - func_stripname_result=${func_stripname_result#"$1"} - func_stripname_result=${func_stripname_result%"$2"} - }' -else - func_stripname () - { - $debug_cmd - - case $2 in - .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; - *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; - esac - } -fi - - -# func_show_eval CMD [FAIL_EXP] -# ----------------------------- -# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - $debug_cmd - - _G_cmd=$1 - _G_fail_exp=${2-':'} - - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" - - $opt_dry_run || { - eval "$_G_cmd" - _G_status=$? - if test 0 -ne "$_G_status"; then - eval "(exit $_G_status); $_G_fail_exp" - fi - } -} - - -# func_show_eval_locale CMD [FAIL_EXP] -# ------------------------------------ -# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - $debug_cmd - - _G_cmd=$1 - _G_fail_exp=${2-':'} - - $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - $opt_dry_run || { - eval "$_G_user_locale - $_G_cmd" - _G_status=$? - eval "$_G_safe_locale" - if test 0 -ne "$_G_status"; then - eval "(exit $_G_status); $_G_fail_exp" - fi - } -} - - -# func_tr_sh -# ---------- -# Turn $1 into a string suitable for a shell variable name. -# Result is stored in $func_tr_sh_result. All characters -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, -# if $1 begins with a digit, a '_' is prepended as well. -func_tr_sh () -{ - $debug_cmd - - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` - ;; - * ) - func_tr_sh_result=$1 - ;; - esac -} - - -# func_verbose ARG... -# ------------------- -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $debug_cmd - - $opt_verbose && func_echo "$*" - - : -} - - -# func_warn_and_continue ARG... -# ----------------------------- -# Echo program name prefixed warning message to standard error. -func_warn_and_continue () -{ - $debug_cmd - - $require_term_colors - - func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 -} - - -# func_warning CATEGORY ARG... -# ---------------------------- -# Echo program name prefixed warning message to standard error. Warning -# messages can be filtered according to CATEGORY, where this function -# elides messages where CATEGORY is not listed in the global variable -# 'opt_warning_types'. -func_warning () -{ - $debug_cmd - - # CATEGORY must be in the warning_categories list! - case " $warning_categories " in - *" $1 "*) ;; - *) func_internal_error "invalid warning category '$1'" ;; - esac - - _G_category=$1 - shift - - case " $opt_warning_types " in - *" $_G_category "*) $warning_func ${1+"$@"} ;; - esac -} - - -# func_sort_ver VER1 VER2 -# ----------------------- -# 'sort -V' is not generally available. -# Note this deviates from the version comparison in automake -# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a -# but this should suffice as we won't be specifying old -# version formats or redundant trailing .0 in bootstrap.conf. -# If we did want full compatibility then we should probably -# use m4_version_compare from autoconf. -func_sort_ver () -{ - $debug_cmd - - ver1=$1 - ver2=$2 - - # Split on '.' and compare each component. - i=1 - while :; do - p1=`echo "$ver1" |cut -d. -f$i` - p2=`echo "$ver2" |cut -d. -f$i` - if test ! "$p1"; then - echo "$1 $2" - break - elif test ! "$p2"; then - echo "$2 $1" - break - elif test ! "$p1" = "$p2"; then - if test "$p1" -gt "$p2" 2>/dev/null; then # numeric comparison - echo "$2 $1" - elif test "$p2" -gt "$p1" 2>/dev/null; then # numeric comparison - echo "$1 $2" - else # numeric, then lexicographic comparison - lp=`printf "$p1\n$p2\n" |sort -n |tail -n1` - if test "$lp" = "$p2"; then - echo "$1 $2" - else - echo "$2 $1" - fi - fi - break - fi - i=`expr $i + 1` - done -} - - -# Local variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" -# time-stamp-time-zone: "UTC" -# End: -#! /bin/sh - -# Set a version string for this script. -scriptversion=2012-10-21.11; # UTC - -# A portable, pluggable option parser for Bourne shell. -# Written by Gary V. Vaughan, 2010 - -# Copyright (C) 2010-2013 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program 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 of the License, or -# (at your option) any later version. - -# This program 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 this program. If not, see . - -# Please report bugs or propose patches to gary@gnu.org. - - -## ------ ## -## Usage. ## -## ------ ## - -# This file is a library for parsing options in your shell scripts along -# with assorted other useful supporting features that you can make use -# of too. -# -# For the simplest scripts you might need only: -# -# #!/bin/sh -# . relative/path/to/funclib.sh -# . relative/path/to/options-parser -# scriptversion=1.0 -# func_options ${1+"$@"} -# eval set dummy "$func_options_result"; shift -# ...rest of your script... -# -# In order for the '--version' option to work, you will need to have a -# suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. -# -# For '-h' and '--help' to work, you will also need a one line -# description of your script's purpose in a comment directly above the -# '# Written by ' line, like the one at the top of this file. -# -# The default options also support '--debug', which will turn on shell -# execution tracing (see the comment above debug_cmd below for another -# use), and '--verbose' and the func_verbose function to allow your script -# to display verbose messages only when your user has specified -# '--verbose'. -# -# After sourcing this file, you can plug processing for additional -# options by amending the variables from the 'Configuration' section -# below, and following the instructions in the 'Option parsing' -# section further down. - -## -------------- ## -## Configuration. ## -## -------------- ## - -# You should override these variables in your script after sourcing this -# file so that they reflect the customisations you have added to the -# option parser. - -# The usage line for option parsing errors and the start of '-h' and -# '--help' output messages. You can embed shell variables for delayed -# expansion at the time the message is displayed, but you will need to -# quote other shell meta-characters carefully to prevent them being -# expanded when the contents are evaled. -usage='$progpath [OPTION]...' - -# Short help message in response to '-h' and '--help'. Add to this or -# override it after sourcing this library to reflect the full set of -# options your script accepts. -usage_message="\ - --debug enable verbose shell tracing - -W, --warnings=CATEGORY - report the warnings falling in CATEGORY [all] - -v, --verbose verbosely report processing - --version print version information and exit - -h, --help print short or long help message and exit -" - -# Additional text appended to 'usage_message' in response to '--help'. -long_help_message=" -Warning categories include: - 'all' show all warnings - 'none' turn off all the warnings - 'error' warnings are treated as fatal errors" - -# Help message printed before fatal option parsing errors. -fatal_help="Try '\$progname --help' for more information." - - - -## ------------------------- ## -## Hook function management. ## -## ------------------------- ## - -# This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. - -# func_hookable FUNC_NAME -# ----------------------- -# Declare that FUNC_NAME will run hooks added with -# 'func_add_hook FUNC_NAME ...'. -func_hookable () -{ - $debug_cmd - - func_append hookable_fns " $1" -} - - -# func_add_hook FUNC_NAME HOOK_FUNC -# --------------------------------- -# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must -# first have been declared "hookable" by a call to 'func_hookable'. -func_add_hook () -{ - $debug_cmd - - case " $hookable_fns " in - *" $1 "*) ;; - *) func_fatal_error "'$1' does not accept hook functions." ;; - esac - - eval func_append ${1}_hooks '" $2"' -} - - -# func_remove_hook FUNC_NAME HOOK_FUNC -# ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. -func_remove_hook () -{ - $debug_cmd - - eval ${1}_hooks='`$bs_echo "\$'$1'_hooks" |$SED "s| '$2'||"`' -} - - -# func_run_hooks FUNC_NAME [ARG]... -# --------------------------------- -# Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more -# than a whitespace-delimited list of legal shell function names, and -# no effort is wasted trying to catch shell meta-characters or preserve -# whitespace. -func_run_hooks () -{ - $debug_cmd - - case " $hookable_fns " in - *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; - esac - - eval _G_hook_fns=\$$1_hooks; shift - - for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift - done - - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result -} - - - -## --------------- ## -## Option parsing. ## -## --------------- ## - -# In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed -# options in '_result', escaped suitably for -# 'eval'. Like this: -# -# my_options_prep () -# { -# $debug_cmd -# -# # Extend the existing usage message. -# usage_message=$usage_message' -# -s, --silent don'\''t print informational messages -# ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result -# } -# func_add_hook func_options_prep my_options_prep -# -# -# my_silent_option () -# { -# $debug_cmd -# -# # Note that for efficiency, we parse as many options as we can -# # recognise in a loop before passing the remainder back to the -# # caller on the first unrecognised argument we encounter. -# while test $# -gt 0; do -# opt=$1; shift -# case $opt in -# --silent|-s) opt_silent=: ;; -# # Separate non-argument short options: -# -s*) func_split_short_opt "$_G_opt" -# set dummy "$func_split_short_opt_name" \ -# "-$func_split_short_opt_arg" ${1+"$@"} -# shift -# ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; -# esac -# done -# -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result -# } -# func_add_hook func_parse_options my_silent_option -# -# -# my_option_validation () -# { -# $debug_cmd -# -# $opt_silent && $opt_verbose && func_fatal_help "\ -# '--silent' and '--verbose' options are mutually exclusive." -# -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result -# } -# func_add_hook func_validate_options my_option_validation -# -# You'll alse need to manually amend $usage_message to reflect the extra -# options you parse. It's preferable to append if you can, so that -# multiple option parsing hooks can be added safely. - - -# func_options [ARG]... -# --------------------- -# All the functions called inside func_options are hookable. See the -# individual implementations for details. -func_hookable func_options -func_options () +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () { - $debug_cmd - - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} - - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} - - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result + func_error ${1+"$@"} + func_fatal_error "$help" } +help="Try \`$progname --help' for more information." ## default -# func_options_prep [ARG]... -# -------------------------- -# All initialisations required before starting the option parse loop. -# Note that when calling hook functions, we pass through the list of -# positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning. -func_hookable func_options_prep -func_options_prep () +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () { - $debug_cmd - - # Option defaults: - opt_verbose=false - opt_warning_types= - - func_run_hooks func_options_prep ${1+"$@"} - - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result + $GREP "$1" "$2" >/dev/null 2>&1 } -# func_parse_options [ARG]... -# --------------------------- -# The main option parsing loop. -func_hookable func_parse_options -func_parse_options () +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () { - $debug_cmd + my_directory_path="$1" + my_dir_list= - func_parse_options_result= + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then - # this just eases exit handling - while test $# -gt 0; do - # Defer to hook functions for initial option parsing, so they - # get priority in the event of reusing an option name. - func_run_hooks func_parse_options ${1+"$@"} + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" - # Break out of the loop if we already parsed every option. - test $# -gt 0 || break + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac - _G_opt=$1 - shift - case $_G_opt in - --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" - $debug_cmd - ;; - - --no-warnings|--no-warning|--no-warn) - set dummy --warnings none ${1+"$@"} - shift - ;; + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` - --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break - case " $warning_categories $1" in - *" $1 "*) - # trailing space prevents matching last $1 above - func_append_uniq opt_warning_types " $1" - ;; - *all) - opt_warning_types=$warning_categories - ;; - *none) - opt_warning_types=none - warning_func=: - ;; - *error) - opt_warning_types=$warning_categories - warning_func=func_fatal_error - ;; - *) - func_fatal_error \ - "unsupported warning category: '$1'" - ;; - esac - shift - ;; - - --verbose|-v) opt_verbose=: ;; - --version) func_version ;; - -\?|-h) func_usage ;; - --help) func_help ;; - - # Separate optargs to long options (plugins may need this): - --*=*) func_split_equals "$_G_opt" - set dummy "$func_split_equals_lhs" \ - "$func_split_equals_rhs" ${1+"$@"} - shift - ;; - - # Separate optargs to short options: - -W*) - func_split_short_opt "$_G_opt" - set dummy "$func_split_short_opt_name" \ - "$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - # Separate non-argument short options: - -\?*|-h*|-v*|-x*) - func_split_short_opt "$_G_opt" - set dummy "$func_split_short_opt_name" \ - "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - --) break ;; - -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; - esac - done + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi } -# func_validate_options [ARG]... -# ------------------------------ -# Perform any sanity checks on option settings and/or unconsumed -# arguments. -func_hookable func_validate_options -func_validate_options () +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () { - $debug_cmd - - # Display all warnings if -W was not given. - test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" + my_template="${TMPDIR-/tmp}/${1-$progname}" - func_run_hooks func_validate_options ${1+"$@"} - - # Bail if the options were screwed! - $exit_cmd $EXIT_FAILURE + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result -} + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi -## ------------------## -## Helper functions. ## -## ------------------## + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi -# This section contains the helper functions used by the rest of the -# hookable option parser framework in ascii-betical order. + $ECHO "$my_tmpdir" +} -# func_fatal_help ARG... -# ---------------------- -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () { - $debug_cmd + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac - eval \$bs_echo \""Usage: $usage"\" - eval \$bs_echo \""$fatal_help"\" - func_error ${1+"$@"} - exit $EXIT_FAILURE + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac } -# func_help -# --------- -# Echo long help message to standard output and exit. -func_help () +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () { - $debug_cmd + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac - func_usage_message - $bs_echo "$long_help_message" - exit 0 + func_quote_for_expand_result="$my_arg" } -# func_missing_arg ARGNAME -# ------------------------ -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () { - $debug_cmd + my_cmd="$1" + my_fail_exp="${2-:}" - func_error "Missing argument for '$1'." - exit_cmd=exit -} + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} -# func_split_equals STRING -# ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. -test -z "$_G_HAVE_XSI_OPS" \ - && (eval 'x=a/b/c; - test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ - && _G_HAVE_XSI_OPS=yes - -if test yes = "$_G_HAVE_XSI_OPS" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_split_equals () - { - $debug_cmd - func_split_equals_lhs=${1%%=*} - func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_split_equals () - { - $debug_cmd +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" - func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` - func_split_equals_rhs= - test "x$func_split_equals_lhs" = "x$1" \ - || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` - } -fi #func_split_equals + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} -# func_split_short_opt SHORTOPT -# ----------------------------- -# Set func_split_short_opt_name and func_split_short_opt_arg shell -# variables after splitting SHORTOPT after the 2nd character. -if test yes = "$_G_HAVE_XSI_OPS" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_split_short_opt () - { - $debug_cmd +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} - func_split_short_opt_arg=${1#??} - func_split_short_opt_name=${1%"$func_split_short_opt_arg"} - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_split_short_opt () - { - $debug_cmd - func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` - func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` - } -fi #func_split_short_opt +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $opt_debug + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} # func_usage -# ---------- # Echo short help message to standard output and exit. func_usage () { - $debug_cmd + $opt_debug - func_usage_message - $bs_echo "Run '$progname --help |${PAGER-more}' for full usage" - exit 0 + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? } +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $opt_debug + + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ + p + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} -# func_usage_message -# ------------------ -# Echo short help message to standard output. -func_usage_message () +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () { - $debug_cmd + $opt_debug - eval \$bs_echo \""Usage: $usage"\" - echo - $SED -n 's|^# || - /^Written by/{ - x;p;x - } - h - /^Written by/q' < "$progpath" - echo - eval \$bs_echo \""$usage_message"\" + func_error "missing argument for $1." + exit_cmd=exit } -# func_version -# ------------ -# Echo version message to standard output and exit. -func_version () +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () { - $debug_cmd + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' - printf '%s\n' "$progname $scriptversion" - $SED -n '/^##/q - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more - } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| - p - } - /^# Written by / { - s|^# || - p - } - /^warranty; /q' < "$progpath" + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation - exit $? -} +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' -# Local variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" -# time-stamp-time-zone: "UTC" -# End: + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation -# Set a version string. -scriptversion='(GNU libtool) 2.4.2.418' +exit_cmd=: -# func_echo ARG... -# ---------------- -# Libtool also displays the current mode in messages, so override -# funclib.sh func_echo with this custom definition. -func_echo () -{ - $debug_cmd - _G_message=$* - func_echo_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_IFS - $bs_echo "$progname${opt_mode+: $opt_mode}: $_G_line" - done - IFS=$func_echo_IFS -} +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" -# func_warning ARG... -# ------------------- -# Libtool warnings are not categorized, so override funclib.sh -# func_warning with this simpler definition. -func_warning () -{ - $debug_cmd +# Global variables. +nonopt= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 - $warning_func ${1+"$@"} -} +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}=\$${1}\${2}" +} # func_append may be replaced by extended shell implementation -## ---------------- ## -## Options parsing. ## -## ---------------- ## - -# Hook in the functions to make sure our own options are parsed during -# the option parsing loop. - -usage='$progpath [OPTION]... [MODE-ARG]...' - -# Short help message in response to '-h'. -usage_message="Options: - --config show all configuration variables - --debug enable verbose shell tracing - -n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --mode=MODE use operation mode MODE - --no-warnings equivalent to '-Wnone' - --preserve-dup-deps don't remove duplicate dependency libraries - --quiet, --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - -v, --verbose print more informational messages than default - --version print version information - -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] - -h, --help, --help-all print short, long, or detailed help message -" +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}=\$${1}\\ \$func_quote_for_eval_result" +} # func_append_quoted may be replaced by extended shell implementation -# Additional text appended to 'usage_message' in response to '--help'. -long_help_message=$long_help_message" -MODE must be one of the following: +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "${@}"` +} # func_arith may be replaced by extended shell implementation - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. When passed as first option, -'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. -Try '$progname --help --mode=MODE' for a more detailed description of MODE. - -When reporting a bug, please describe a test case to reproduce it and -include the following information: - - host-triplet: $host - shell: $SHELL - compiler: $LTCC - compiler flags: $LTCFLAGS - linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.2.418 - automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` - autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` - -Report bugs to . -GNU libtool home page: . -General help using GNU software: ." - - -# func_lo2o OBJECT-NAME -# --------------------- -# Transform OBJECT-NAME from a '.lo' suffix to the platform specific -# object suffix. -lo2o=s/\\.lo\$/.$objext/ -o2lo=s/\\.$objext\$/.lo/ +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_lo2o () - { - case $1 in - *.lo) func_lo2o_result=${1%.lo}.$objext ;; - * ) func_lo2o_result=$1 ;; - esac - }' - # func_xform LIBOBJ-OR-SOURCE - # --------------------------- - # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) - # suffix to a '.lo' libtool-object suffix. - eval 'func_xform () - { - func_xform_result=${1%.*}.lo - }' -else - # ...otherwise fall back to using sed. - func_lo2o () - { - func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` - } +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation - func_xform () - { - func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` - } -fi + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation -# func_fatal_configuration ARG... -# ------------------------------- +# func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { - func__fatal_error ${1+"$@"} \ - "See the $PACKAGE documentation for more information." \ - "Fatal configuration error." + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." } # func_config -# ----------- # Display the configuration for all the tags in this script. func_config () { @@ -2048,19 +915,17 @@ exit $? } - # func_features -# ------------- # Display the features supported by this script. func_features () { echo "host: $host" - if test yes = "$build_libtool_libs"; then + if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi - if test yes = "$build_old_libs"; then + if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" @@ -2069,325 +934,298 @@ exit $? } - -# func_enable_tag TAGNAME -# ----------------------- +# func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { - # Global variable: - tagname=$1 + # Global variable: + tagname="$1" - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf=/$re_begincf/,/$re_endcf/p - - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac } - # func_check_version_match -# ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF - else - cat >&2 <<_LT_EOF + else + cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF - fi - else - cat >&2 <<_LT_EOF + fi + else + cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF - fi - - exit $EXIT_MISMATCH fi -} - - -# libtool_options_prep [ARG]... -# ----------------------------- -# Preparation for options parsed by libtool. -libtool_options_prep () -{ - $debug_mode - - # Option defaults: - opt_config=false - opt_dlopen= - opt_dry_run=false - opt_help=false - opt_mode= - opt_preserve_dup_deps=false - opt_quiet=false - - nonopt= - preserve_args= - - # Shorthand for --mode=foo, only valid as the first argument - case $1 in - clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; - compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; - execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; - finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; - install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; - link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; - uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; - esac - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + exit $EXIT_MISMATCH + fi } -func_add_hook func_options_prep libtool_options_prep - - -# libtool_parse_options [ARG]... -# --------------------------------- -# Provide handling for libtool specific options. -libtool_parse_options () -{ - $debug_cmd - # Perform our own loop to consume as many options as possible in - # each iteration. - while test $# -gt 0; do - _G_opt=$1 - shift - case $_G_opt in - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - - --config) func_config ;; - - --dlopen|-dlopen) - opt_dlopen="${opt_dlopen+$opt_dlopen -}$1" - shift - ;; - - --preserve-dup-deps) - opt_preserve_dup_deps=: ;; - - --features) func_features ;; - - --finish) set dummy --mode finish ${1+"$@"}; shift ;; - - --help) opt_help=: ;; - - --help-all) opt_help=': help-all' ;; - - --mode) test $# = 0 && func_missing_arg $_G_opt && break - opt_mode=$1 - case $1 in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $_G_opt" - exit_cmd=exit - break - ;; - esac - shift - ;; - - --no-silent|--no-quiet) - opt_quiet=false - func_append preserve_args " $_G_opt" - ;; - - --no-warnings|--no-warning|--no-warn) - opt_warning=false - func_append preserve_args " $_G_opt" - ;; - - --no-verbose) - opt_verbose=false - func_append preserve_args " $_G_opt" - ;; - - --silent|--quiet) - opt_quiet=: - opt_verbose=false - func_append preserve_args " $_G_opt" - ;; - - --tag) test $# = 0 && func_missing_arg $_G_opt && break - opt_tag=$1 - func_append preserve_args " $_G_opt $1" - func_enable_tag "$1" - shift - ;; - - --verbose|-v) opt_quiet=false - opt_verbose=: - func_append preserve_args " $_G_opt" - ;; - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; - esac - done +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result -} -func_add_hook func_parse_options libtool_parse_options +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false -# libtool_validate_options [ARG]... -# --------------------------------- -# Perform any sanity checks on option settings and/or unconsumed -# arguments. -libtool_validate_options () +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. { - # save first non-option argument - if test 0 -lt $#; then - nonopt=$1 - shift - fi + # this just eases exit handling + while test $# -gt 0; do + opt="$1" + shift + case $opt in + --debug|-x) opt_debug='set -x' + func_echo "enabling shell trace mode" + $opt_debug + ;; + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" + shift + ;; + --preserve-dup-deps) + opt_preserve_dup_deps=: + ;; + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) + opt_silent=false +func_append preserve_args " $opt" + ;; + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" + shift + ;; + + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + + # Separate optargs to long options: + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done - # preserve --debug - test : = "$debug_cmd" || func_append preserve_args " --debug" + # Validate options: - case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi - $opt_help || { - # Sanity checks first: - func_check_version_match - - test yes != "$build_libtool_libs" \ - && test yes != "$build_old_libs" \ - && func_fatal_configuration "not configured to build any kind of library" - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test execute != "$opt_mode"; then - func_error "unrecognized option '-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help=$help - help="Try '$progname --help --mode=$opt_mode' for more information." - } + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac - # Pass back the unparsed argument list - func_quote_for_eval ${1+"$@"} - libtool_validate_options_result=$func_quote_for_eval_result -} -func_add_hook func_validate_options libtool_validate_options + $opt_help || { + # Sanity checks first: + func_check_version_match + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi -# Process options as early as possible so that --help and --version -# can return quickly. -func_options ${1+"$@"} -eval set dummy "$func_options_result"; shift + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } -## ----------- ## -## Main. ## -## ----------- ## -magic='%%%MAGIC variable%%%' -magic_exe='%%%MAGIC EXE variable%%%' + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} -# Global variables. -extracted_archives= -extracted_serial=0 -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} +## ----------- ## +## Main. ## +## ----------- ## # func_lalib_p file -# True iff FILE is a libtool '.la' library or '.lo' object file. +# True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () @@ -2398,12 +1236,12 @@ } # func_lalib_unsafe_p file -# True iff FILE is a libtool '.la' library or '.lo' object file. +# True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be -# fatal anyway. Works if 'file' does not exist. +# fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no @@ -2411,13 +1249,13 @@ for lalib_p_l in 1 2 3 4 do read lalib_p_line - case $lalib_p_line in + case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi - test yes = "$lalib_p" + test "$lalib_p" = yes } # func_ltwrapper_script_p file @@ -2451,7 +1289,7 @@ { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file @@ -2470,13 +1308,11 @@ # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { - $debug_cmd - + $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do - IFS=$sp$nl - eval cmd=\"$cmd\" IFS=$save_ifs + eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs @@ -2488,11 +1324,10 @@ # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing -# 'FILE.' does not work on cygwin managed mounts. +# `FILE.' does not work on cygwin managed mounts. func_source () { - $debug_cmd - + $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; @@ -2519,10 +1354,10 @@ # store the result into func_replace_sysroot_result. func_replace_sysroot () { - case $lt_sysroot:$1 in + case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result='='$func_stripname_result + func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. @@ -2539,8 +1374,7 @@ # arg is usually of the form 'gcc ...' func_infer_tag () { - $debug_cmd - + $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do @@ -2559,7 +1393,7 @@ for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. - eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. @@ -2584,7 +1418,7 @@ # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with '--tag'" + func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi @@ -2600,15 +1434,15 @@ # but don't create it if we're doing a dry run. func_write_libtool_object () { - write_libobj=$1 - if test yes = "$build_libtool_libs"; then - write_lobj=\'$2\' + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' else write_lobj=none fi - if test yes = "$build_old_libs"; then - write_oldobj=\'$3\' + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' else write_oldobj=none fi @@ -2616,7 +1450,7 @@ $opt_dry_run || { cat >${write_libobj}T </dev/null` - if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$sed_naive_backslashify"` + $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi @@ -2681,19 +1514,18 @@ # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { - $debug_cmd - + $opt_debug # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result= + func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result"; then + if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi @@ -2722,8 +1554,7 @@ # environment variable; do not put it in $PATH. func_cygpath () { - $debug_cmd - + $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then @@ -2732,7 +1563,7 @@ fi else func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath @@ -2743,11 +1574,10 @@ # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { - $debug_cmd - + $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 @@ -2758,14 +1588,13 @@ # func_to_host_file_result to ARG1). func_convert_file_check () { - $debug_cmd - - if test -z "$2" && test -n "$1"; then + $opt_debug + if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" - func_error " '$1'" + func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: - func_to_host_file_result=$1 + func_to_host_file_result="$1" fi } # end func_convert_file_check @@ -2777,11 +1606,10 @@ # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { - $debug_cmd - + $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" - func_error " '$3'" + func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. @@ -2790,7 +1618,7 @@ func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else - func_to_host_path_result=$3 + func_to_host_path_result="$3" fi fi } @@ -2802,10 +1630,9 @@ # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { - $debug_cmd - + $opt_debug case $4 in - $1 ) func_to_host_path_result=$3$func_to_host_path_result + $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in @@ -2819,7 +1646,7 @@ ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## -# invoked via '$to_host_file_cmd ARG' +# invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. @@ -2830,8 +1657,7 @@ # in func_to_host_file_result. func_to_host_file () { - $debug_cmd - + $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file @@ -2843,8 +1669,7 @@ # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { - $debug_cmd - + $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 @@ -2862,7 +1687,7 @@ # Copy ARG to func_to_host_file_result. func_convert_file_noop () { - func_to_host_file_result=$1 + func_to_host_file_result="$1" } # end func_convert_file_noop @@ -2873,12 +1698,11 @@ # func_to_host_file_result. func_convert_file_msys_to_w32 () { - $debug_cmd - - func_to_host_file_result=$1 + $opt_debug + func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" - func_to_host_file_result=$func_convert_core_msys_to_w32_result + func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -2890,9 +1714,8 @@ # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { - $debug_cmd - - func_to_host_file_result=$1 + $opt_debug + func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. @@ -2908,12 +1731,11 @@ # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { - $debug_cmd - - func_to_host_file_result=$1 + $opt_debug + func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" - func_to_host_file_result=$func_convert_core_file_wine_to_w32_result + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -2925,13 +1747,12 @@ # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { - $debug_cmd - - func_to_host_file_result=$1 + $opt_debug + func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" - func_to_host_file_result=$func_cygpath_result + func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -2944,14 +1765,13 @@ # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { - $debug_cmd - - func_to_host_file_result=$1 + $opt_debug + func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" - func_to_host_file_result=$func_cygpath_result + func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -2961,7 +1781,7 @@ ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# -# invoked via '$to_host_path_cmd ARG' +# invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. @@ -2985,11 +1805,10 @@ to_host_path_cmd= func_init_to_host_path_cmd () { - $debug_cmd - + $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd=func_convert_path_$func_stripname_result + to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } @@ -2999,8 +1818,7 @@ # in func_to_host_path_result. func_to_host_path () { - $debug_cmd - + $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } @@ -3011,7 +1829,7 @@ # Copy ARG to func_to_host_path_result. func_convert_path_noop () { - func_to_host_path_result=$1 + func_to_host_path_result="$1" } # end func_convert_path_noop @@ -3022,9 +1840,8 @@ # func_to_host_path_result. func_convert_path_msys_to_w32 () { - $debug_cmd - - func_to_host_path_result=$1 + $opt_debug + func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; @@ -3032,7 +1849,7 @@ func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result=$func_convert_core_msys_to_w32_result + func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" @@ -3046,9 +1863,8 @@ # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { - $debug_cmd - - func_to_host_path_result=$1 + $opt_debug + func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" @@ -3067,15 +1883,14 @@ # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { - $debug_cmd - - func_to_host_path_result=$1 + $opt_debug + func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result=$func_convert_core_path_wine_to_w32_result + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" @@ -3089,16 +1904,15 @@ # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { - $debug_cmd - - func_to_host_path_result=$1 + $opt_debug + func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result=$func_cygpath_result + func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" @@ -3113,9 +1927,8 @@ # func_to_host_file_result. func_convert_path_nix_to_cygwin () { - $debug_cmd - - func_to_host_path_result=$1 + $opt_debug + func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them @@ -3124,7 +1937,7 @@ func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result=$func_cygpath_result + func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" @@ -3133,31 +1946,13 @@ # end func_convert_path_nix_to_cygwin -# func_dll_def_p FILE -# True iff FILE is a Windows DLL '.def' file. -# Keep in sync with _LT_DLL_DEF_P in libtool.m4 -func_dll_def_p () -{ - $debug_cmd - - func_dll_def_p_tmp=`$SED -n \ - -e 's/^[ ]*//' \ - -e '/^\(;.*\)*$/d' \ - -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ - -e q \ - "$1"` - test DEF = "$func_dll_def_p_tmp" -} - - # func_mode_compile arg... func_mode_compile () { - $debug_cmd - + $opt_debug # Get the compilation command and the source file. base_compile= - srcfile=$nonopt # always keep a non-empty value in "srcfile" + srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal @@ -3170,12 +1965,12 @@ case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile - lastarg=$arg + lastarg="$arg" arg_mode=normal ;; target ) - libobj=$arg + libobj="$arg" arg_mode=normal continue ;; @@ -3185,7 +1980,7 @@ case $arg in -o) test -n "$libobj" && \ - func_fatal_error "you cannot specify '-o' more than once" + func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; @@ -3214,12 +2009,12 @@ func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= - save_ifs=$IFS; IFS=, + save_ifs="$IFS"; IFS=',' for arg in $args; do - IFS=$save_ifs + IFS="$save_ifs" func_append_quoted lastarg "$arg" done - IFS=$save_ifs + IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result @@ -3232,8 +2027,8 @@ # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # - lastarg=$srcfile - srcfile=$arg + lastarg="$srcfile" + srcfile="$arg" ;; esac # case $arg ;; @@ -3248,13 +2043,13 @@ func_fatal_error "you must specify an argument for -Xcompile" ;; target) - func_fatal_error "you must specify a target with '-o'" + func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" - libobj=$func_basename_result + libobj="$func_basename_result" } ;; esac @@ -3274,7 +2069,7 @@ case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) - func_fatal_error "cannot determine name of library object from '$libobj'" + func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac @@ -3283,8 +2078,8 @@ for arg in $later; do case $arg in -shared) - test yes = "$build_libtool_libs" \ - || func_fatal_configuration "cannot build a shared library" + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; @@ -3310,17 +2105,17 @@ func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && func_warning "libobj name '$libobj' may not contain shell special characters." + && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" - objname=$func_basename_result - xdir=$func_dirname_result - lobj=$xdir$objdir/$objname + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. - if test yes = "$build_old_libs"; then + if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" @@ -3332,16 +2127,16 @@ pic_mode=default ;; esac - if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c - if test no = "$compiler_c_o"; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext - lockfile=$output_obj.lock + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" else output_obj= need_locks=no @@ -3350,12 +2145,12 @@ # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file - if test yes = "$need_locks"; then + if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done - elif test warn = "$need_locks"; then + elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: @@ -3363,7 +2158,7 @@ This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you +your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -3385,11 +2180,11 @@ qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. - if test yes = "$build_libtool_libs"; then + if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile - if test no != "$pic_mode"; then + if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code @@ -3406,7 +2201,7 @@ func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - if test warn = "$need_locks" && + if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: @@ -3417,7 +2212,7 @@ This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you +your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -3433,20 +2228,20 @@ fi # Allow error messages only from the first compilation. - if test yes = "$suppress_opt"; then + if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. - if test yes = "$build_old_libs"; then - if test yes != "$pic_mode"; then + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi - if test yes = "$compiler_c_o"; then + if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi @@ -3455,7 +2250,7 @@ func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - if test warn = "$need_locks" && + if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: @@ -3466,7 +2261,7 @@ This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you +your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -3486,7 +2281,7 @@ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked - if test no != "$need_locks"; then + if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi @@ -3496,7 +2291,7 @@ } $opt_help || { - test compile = "$opt_mode" && func_mode_compile ${1+"$@"} + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () @@ -3516,7 +2311,7 @@ Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE -(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated @@ -3535,16 +2330,16 @@ -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only - -shared do not build a '.o' file suitable for static linking - -static only build a '.o' file suitable for static linking + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler -COMPILE-COMMAND is a command to be used in creating a 'standard' object file +COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix '.c' with the -library object suffix, '.lo'." +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." ;; execute) @@ -3557,7 +2352,7 @@ -dlopen FILE add the directory containing FILE to the library path -This mode sets the library path environment variable according to '-dlopen' +This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated @@ -3576,7 +2371,7 @@ Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use -the '--dry-run' option if you just want to see what would be executed." +the \`--dry-run' option if you just want to see what would be executed." ;; install) @@ -3586,7 +2381,7 @@ Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be -either the 'install' or 'cp' program. +either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: @@ -3612,7 +2407,7 @@ -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) - -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE @@ -3646,20 +2441,20 @@ -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) -All other options (arguments beginning with '-') are ignored. +All other options (arguments beginning with \`-') are ignored. -Every other argument is treated as a filename. Files ending in '.la' are +Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. -If the OUTPUT-FILE ends in '.la', then a libtool library is created, -only library objects ('.lo' files) may be specified, and '-rpath' is +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. -If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created -using 'ar' and 'ranlib', or on Windows using 'lib'. +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. -If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; @@ -3670,7 +2465,7 @@ Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE -(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. @@ -3678,17 +2473,17 @@ ;; *) - func_fatal_help "invalid operation mode '$opt_mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo - $ECHO "Try '$progname --help' for more information about other modes." + $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then - if test : = "$opt_help"; then + if test "$opt_help" = :; then func_mode_help else { @@ -3721,17 +2516,16 @@ # func_mode_execute arg... func_mode_execute () { - $debug_cmd - + $opt_debug # The first argument is the command name. - cmd=$nonopt + cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ - || func_fatal_help "'$file' is not a file" + || func_fatal_help "\`$file' is not a file" dir= case $file in @@ -3741,7 +2535,7 @@ # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ - || func_fatal_help "'$lib' is not a valid libtool archive" + || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= @@ -3752,18 +2546,18 @@ if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ - func_warning "'$file' was not linked with '-export-dynamic'" + func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." - dir=$func_dirname_result + dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; @@ -3771,18 +2565,18 @@ *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." - dir=$func_dirname_result + dir="$func_dirname_result" ;; *) - func_warning "'-dlopen' is ignored for non-libtool libraries and objects" + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir=$absdir + test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then @@ -3794,7 +2588,7 @@ # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. - libtool_execute_magic=$magic + libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= @@ -3807,12 +2601,12 @@ if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. - file=$progdir/$program + file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. - file=$progdir/$program + file="$progdir/$program" fi ;; esac @@ -3820,15 +2614,7 @@ func_append_quoted args "$file" done - if $opt_dry_run; then - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS - else + if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" @@ -3845,18 +2631,25 @@ done # Now prepare to actually exec the command. - exec_cmd=\$cmd$args + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS fi } -test execute = "$opt_mode" && func_mode_execute ${1+"$@"} +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { - $debug_cmd - + $opt_debug libs= libdirs= admincmds= @@ -3870,11 +2663,11 @@ if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else - func_warning "'$opt' is not a valid libtool archive" + func_warning "\`$opt' is not a valid libtool archive" fi else - func_fatal_error "invalid argument '$opt'" + func_fatal_error "invalid argument \`$opt'" fi done @@ -3889,12 +2682,12 @@ # Remove sysroot references if $opt_dry_run; then for lib in $libs; do - echo "removing references to $lt_sysroot and '=' prefixes from $lib" + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do - sed -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done @@ -3919,7 +2712,7 @@ fi # Exit here if they wanted silent mode. - $opt_quiet && exit $EXIT_SUCCESS + $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" @@ -3930,27 +2723,27 @@ echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the '-LLIBDIR'" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the '$shlibpath_var' environment variable" + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then - echo " - add LIBDIR to the '$runpath_var' environment variable" + echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" - $ECHO " - use the '$flag' linker flag" + $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo @@ -3969,20 +2762,18 @@ exit $EXIT_SUCCESS } -test finish = "$opt_mode" && func_mode_finish ${1+"$@"} +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { - $debug_cmd - + $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). - if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac - then + case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " @@ -4009,7 +2800,7 @@ opts= prev= install_type= - isdir=false + isdir=no stripme= no_mode=: for arg @@ -4022,7 +2813,7 @@ fi case $arg in - -d) isdir=: ;; + -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg @@ -4040,7 +2831,7 @@ *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then - if test X-m = "X$prev" && test -n "$install_override_mode"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi @@ -4065,7 +2856,7 @@ func_fatal_help "you must specify an install program" test -n "$prev" && \ - func_fatal_help "the '$prev' option requires an argument" + func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else @@ -4087,19 +2878,19 @@ dest=$func_stripname_result # Check to see that the destination is a directory. - test -d "$dest" && isdir=: - if $isdir; then - destdir=$dest + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." - destdir=$func_dirname_result - destname=$func_basename_result + destdir="$func_dirname_result" + destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ - func_fatal_help "'$dest' is not a directory" + func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; @@ -4108,7 +2899,7 @@ case $file in *.lo) ;; *) - func_fatal_help "'$destdir' must be an absolute directory name" + func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done @@ -4117,7 +2908,7 @@ # This variable tells wrapper scripts just to set variables rather # than running their programs. - libtool_install_magic=$magic + libtool_install_magic="$magic" staticlibs= future_libdirs= @@ -4137,7 +2928,7 @@ # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ - || func_fatal_help "'$file' is not a valid libtool archive" + || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= @@ -4159,7 +2950,7 @@ fi func_dirname "$file" "/" "" - dir=$func_dirname_result + dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then @@ -4173,7 +2964,7 @@ # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. @@ -4182,29 +2973,29 @@ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi - func_warning "relinking '$file'" + func_warning "relinking \`$file'" func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then - realname=$1 + realname="$1" shift - srcname=$realname - test -n "$relink_command" && srcname=${realname}T + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' - tstripme=$stripme + tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) - tstripme= + tstripme="" ;; esac ;; @@ -4215,7 +3006,7 @@ if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. - # Try 'ln -sf' first, because the 'ln' binary might depend on + # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname @@ -4226,14 +3017,14 @@ fi # Do each command in the postinstall commands. - lib=$destdir/$realname + lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" - name=$func_basename_result - instname=$dir/${name}i + name="$func_basename_result" + instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. @@ -4245,11 +3036,11 @@ # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then - destfile=$destdir/$destname + destfile="$destdir/$destname" else func_basename "$file" - destfile=$func_basename_result - destfile=$destdir/$destfile + destfile="$func_basename_result" + destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. @@ -4259,11 +3050,11 @@ staticdest=$func_lo2o_result ;; *.$objext) - staticdest=$destfile + staticdest="$destfile" destfile= ;; *) - func_fatal_help "cannot copy a libtool object to '$destfile'" + func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac @@ -4272,7 +3063,7 @@ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. - if test yes = "$build_old_libs"; then + if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result @@ -4284,23 +3075,23 @@ *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then - destfile=$destdir/$destname + destfile="$destdir/$destname" else func_basename "$file" - destfile=$func_basename_result - destfile=$destdir/$destfile + destfile="$func_basename_result" + destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install - stripped_ext= + stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result - stripped_ext=.exe + stripped_ext=".exe" fi ;; esac @@ -4328,19 +3119,19 @@ # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script '$wrapper'" + func_fatal_error "invalid libtool wrapper script \`$wrapper'" - finalize=: + finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi - libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "'$lib' has not been installed in '$libdir'" - finalize=false + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no fi done @@ -4348,29 +3139,29 @@ func_source "$wrapper" outputname= - if test no = "$fast_install" && test -n "$relink_command"; then + if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { - if $finalize; then + if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" - file=$func_basename_result - outputname=$tmpdir/$file + file="$func_basename_result" + outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - $opt_quiet || { + $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else - func_error "error: relink '$file' with the above command before installing it" + func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi - file=$outputname + file="$outputname" else - func_warning "cannot relink '$file'" + func_warning "cannot relink \`$file'" fi } else @@ -4407,10 +3198,10 @@ for file in $staticlibs; do func_basename "$file" - name=$func_basename_result + name="$func_basename_result" # Set up the ranlib parameters. - oldlib=$destdir/$name + oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result @@ -4425,18 +3216,18 @@ done test -n "$future_libdirs" && \ - func_warning "remember to run '$progname --finish$future_libdirs'" + func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } -test install = "$opt_mode" && func_mode_install ${1+"$@"} +test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p @@ -4444,17 +3235,16 @@ # a dlpreopen symbol table. func_generate_dlsyms () { - $debug_cmd - - my_outputname=$1 - my_originator=$2 - my_pic_p=${3-false} + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms=${my_outputname}S.c + my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi @@ -4465,7 +3255,7 @@ "") ;; *.c) # Discover the nlist of each of the dlfiles. - nlist=$output_objdir/$my_outputname.nm + nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" @@ -4473,36 +3263,34 @@ func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif -#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE -/* DATA imports from DLLs on WIN32 can't be const, because runtime +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST -#elif defined __osf__ +#elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif -#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) - /* External symbol declarations for the compiler. */\ " - if test yes = "$dlself"; then - func_verbose "generating symbol list for '$output'" + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" @@ -4510,7 +3298,7 @@ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from '$func_to_tool_file_result'" + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done @@ -4530,10 +3318,10 @@ # Prepare the list of exported symbols if test -z "$export_symbols"; then - export_symbols=$output_objdir/$outputname.exp + export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols - eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' @@ -4543,7 +3331,7 @@ } else $opt_dry_run || { - eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in @@ -4557,22 +3345,22 @@ fi for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from '$dlprefile'" + func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" - name=$func_basename_result + name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename= + dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname"; then + if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" - dlprefile_dlbasename=$func_basename_result + dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" @@ -4580,7 +3368,7 @@ fi fi $opt_dry_run || { - if test -n "$dlprefile_dlbasename"; then + if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" @@ -4636,11 +3424,6 @@ echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi - func_show_eval '$RM "${nlist}I"' - if test -n "$global_symbol_to_import"; then - eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' - fi - echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ @@ -4649,30 +3432,11 @@ void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[];\ -" - - if test -s "$nlist"I; then - echo >> "$output_objdir/$my_dlsyms" "\ -static void lt_syminit(void) -{ - LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; - for (; symbol->name; ++symbol) - {" - $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" - echo >> "$output_objdir/$my_dlsyms" "\ - } -}" - fi - echo >> "$output_objdir/$my_dlsyms" "\ +lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = -{ {\"$my_originator\", (void *) 0}," - - if test -s "$nlist"I; then - echo >> "$output_objdir/$my_dlsyms" "\ - {\"@INIT@\", (void *) <_syminit}," - fi +{\ + { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) @@ -4714,7 +3478,9 @@ *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) - $my_pic_p && pic_flag_for_symtable=" $pic_flag" + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi ;; esac ;; @@ -4731,10 +3497,10 @@ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. - symfileobj=$output_objdir/${my_outputname}S.$objext + symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then @@ -4752,7 +3518,7 @@ esac ;; *) - func_fatal_error "unknown suffix for '$my_dlsyms'" + func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else @@ -4766,32 +3532,6 @@ fi } -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $debug_cmd - - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $debug_cmd - - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - # func_win32_libid arg # return the library type of file 'arg' # @@ -4801,9 +3541,8 @@ # Despite the name, also deal with 64 bit binaries. func_win32_libid () { - $debug_cmd - - win32_libid_type=unknown + $opt_debug + win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import @@ -4813,29 +3552,16 @@ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - case $nm_interface in - "MS dumpbin") - if func_cygming_ms_implib_p "$1" || - func_cygming_gnu_implib_p "$1" - then - win32_nmres=import - else - win32_nmres= - fi - ;; - *) - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' 1,100{ / I /{ - s|.*|import| + s,.*,import, p q } }'` - ;; - esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; @@ -4867,8 +3593,7 @@ # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { - $debug_cmd - + $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } @@ -4885,8 +3610,7 @@ # specified import library. func_cygming_dll_for_implib_fallback_core () { - $debug_cmd - + $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ @@ -4922,8 +3646,8 @@ /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the - # archive that possess that section. Heuristic: eliminate - # all those that have a first or second character that is + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually @@ -4934,6 +3658,30 @@ $SED -e '/^\./d;/^.\./d;q' } +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified @@ -4947,17 +3695,16 @@ # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { - $debug_cmd - - if func_cygming_gnu_implib_p "$1"; then + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1"; then + elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown - sharedlib_from_linklib_result= + sharedlib_from_linklib_result="" fi } @@ -4965,11 +3712,10 @@ # func_extract_an_archive dir oldlib func_extract_an_archive () { - $debug_cmd - - f_ex_an_ar_dir=$1; shift - f_ex_an_ar_oldlib=$1 - if test yes = "$lock_old_archive_extraction"; then + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" @@ -4978,7 +3724,7 @@ fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' - if test yes = "$lock_old_archive_extraction"; then + if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then @@ -4992,23 +3738,22 @@ # func_extract_archives gentop oldlib ... func_extract_archives () { - $debug_cmd - - my_gentop=$1; shift + $opt_debug + my_gentop="$1"; shift my_oldlibs=${1+"$@"} - my_oldobjs= - my_xlib= - my_xabs= - my_xdir= + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" - my_xlib=$func_basename_result + my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in @@ -5020,7 +3765,7 @@ esac done extracted_archives="$extracted_archives $my_xlib_u" - my_xdir=$my_gentop/$my_xlib_u + my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" @@ -5033,20 +3778,19 @@ cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` - func_basename "$darwin_archive" - darwin_base_archive=$func_basename_result + darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches; do - func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" - $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" - cd "unfat-$$/$darwin_base_archive-$darwin_arch" - func_extract_an_archive "`pwd`" "$darwin_base_archive" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" - $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` @@ -5071,7 +3815,7 @@ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done - func_extract_archives_result=$my_oldobjs + func_extract_archives_result="$my_oldobjs" } @@ -5086,7 +3830,7 @@ # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script -# will assume that the directory where it is stored is +# will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () @@ -5097,7 +3841,7 @@ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. @@ -5154,9 +3898,9 @@ # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ that is used only on +# /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options that match +# (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and @@ -5189,7 +3933,7 @@ # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then - echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } @@ -5200,7 +3944,7 @@ lt_dump_args_N=1; for lt_arg do - \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } @@ -5214,7 +3958,7 @@ *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then - \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} @@ -5224,7 +3968,7 @@ *) $ECHO "\ if test -n \"\$lt_option_debug\"; then - \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} @@ -5299,13 +4043,13 @@ test -n \"\$absdir\" && thisdir=\"\$absdir\" " - if test yes = "$fast_install"; then + if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" @@ -5357,7 +4101,7 @@ fi # Export our shlibpath_var if we have one. - if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" @@ -5377,7 +4121,7 @@ fi else # The program doesn't exist. - \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 @@ -5396,7 +4140,7 @@ cat < #include -#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) - /* declarations of non-ANSI functions */ -#if defined __MINGW32__ +#if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif -#elif defined __CYGWIN__ +#elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif -/* #elif defined other_platform || defined ... */ +/* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ -#if defined _MSC_VER +#if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC -#elif defined __MINGW32__ +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv -#elif defined __CYGWIN__ +#elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" -/* #elif defined other platforms ... */ +/* #elif defined (other platforms) ... */ #endif -#if defined PATH_MAX +#if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX -#elif defined MAXPATHLEN +#elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 @@ -5488,8 +4234,8 @@ # define PATH_SEPARATOR ':' #endif -#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ - defined __OS2__ +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 @@ -5522,10 +4268,10 @@ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ - if (stale) { free (stale); stale = 0; } \ + if (stale) { free ((void *) stale); stale = 0; } \ } while (0) -#if defined LT_DEBUGWRAPPER +#if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; @@ -5558,7 +4304,7 @@ const char * LIB_PATH_VARNAME = "$shlibpath_var"; EOF - if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then func_to_host_path "$temp_rpath" cat < 0) && IS_PATH_SEPARATOR (new_value[len-1])) + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { - new_value[--len] = '\0'; + new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); @@ -6336,8 +5082,7 @@ # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { - $debug_cmd - + $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; @@ -6347,18 +5092,17 @@ # func_mode_link arg... func_mode_link () { - $debug_cmd - + $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out - # what system we are compiling for in order to pass an extra + # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll that has undefined symbols, in which case not + # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. @@ -6405,7 +5149,7 @@ non_pic_objects= precious_files_regex= prefer_static_libs=no - preload=false + preload=no prev= prevarg= release= @@ -6417,7 +5161,7 @@ vinfo= vinfo_number=no weak_libs= - single_module=$wl-single_module + single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. @@ -6425,15 +5169,15 @@ do case $arg in -shared) - test yes != "$build_libtool_libs" \ - && func_fatal_configuration "cannot build a shared library" + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) - if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then @@ -6466,7 +5210,7 @@ # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do - arg=$1 + arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result @@ -6483,21 +5227,21 @@ case $prev in bindir) - bindir=$arg + bindir="$arg" prev= continue ;; dlfiles|dlprefiles) - $preload || { + if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" - preload=: - } + preload=yes + fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) - if test no = "$dlself"; then + if test "$dlself" = no; then dlself=needless export_dynamic=yes fi @@ -6505,9 +5249,9 @@ continue ;; self) - if test dlprefiles = "$prev"; then + if test "$prev" = dlprefiles; then dlself=yes - elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless @@ -6517,7 +5261,7 @@ continue ;; *) - if test dlfiles = "$prev"; then + if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" @@ -6528,14 +5272,14 @@ esac ;; expsyms) - export_symbols=$arg + export_symbols="$arg" test -f "$arg" \ - || func_fatal_error "symbol file '$arg' does not exist" + || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) - export_symbols_regex=$arg + export_symbols_regex="$arg" prev= continue ;; @@ -6553,13 +5297,7 @@ continue ;; inst_prefix) - inst_prefix_dir=$arg - prev= - continue - ;; - mllvm) - # Clang does not use LLVM to link, so we can simply discard any - # '-mllvm $arg' options when doing the link step. + inst_prefix_dir="$arg" prev= continue ;; @@ -6583,21 +5321,21 @@ if test -z "$pic_object" || test -z "$non_pic_object" || - test none = "$pic_object" && - test none = "$non_pic_object"; then - func_fatal_error "cannot find name of object for '$arg'" + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir=$func_dirname_result + xdir="$func_dirname_result" - if test none != "$pic_object"; then + if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. - pic_object=$xdir$pic_object + pic_object="$xdir$pic_object" - if test dlfiles = "$prev"; then - if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue @@ -6608,7 +5346,7 @@ fi # CHECK ME: I think I busted this. -Ossama - if test dlprefiles = "$prev"; then + if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= @@ -6616,23 +5354,23 @@ # A PIC object. func_append libobjs " $pic_object" - arg=$pic_object + arg="$pic_object" fi # Non-PIC object. - if test none != "$non_pic_object"; then + if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. - non_pic_object=$xdir$non_pic_object + non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test none = "$pic_object"; then - arg=$non_pic_object + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. - non_pic_object=$pic_object + non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else @@ -6640,7 +5378,7 @@ if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir=$func_dirname_result + xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result @@ -6648,24 +5386,24 @@ func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else - func_fatal_error "'$arg' is not a valid libtool object" + func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else - func_fatal_error "link input file '$arg' does not exist" + func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) - precious_files_regex=$arg + precious_files_regex="$arg" prev= continue ;; release) - release=-$arg + release="-$arg" prev= continue ;; @@ -6677,7 +5415,7 @@ func_fatal_error "only absolute run-paths are allowed" ;; esac - if test rpath = "$prev"; then + if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; @@ -6692,7 +5430,7 @@ continue ;; shrext) - shrext_cmds=$arg + shrext_cmds="$arg" prev= continue ;; @@ -6732,7 +5470,7 @@ esac fi # test -n "$prev" - prevarg=$arg + prevarg="$arg" case $arg in -all-static) @@ -6746,7 +5484,7 @@ -allow-undefined) # FIXME: remove this flag sometime in the future. - func_fatal_error "'-allow-undefined' must not be used because it is the default" + func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) @@ -6778,7 +5516,7 @@ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi - if test X-export-symbols = "X$arg"; then + if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex @@ -6812,9 +5550,9 @@ func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then - func_fatal_error "require no space between '-L' and '$1'" + func_fatal_error "require no space between \`-L' and \`$1'" else - func_fatal_error "need path for '-L' option" + func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" @@ -6825,8 +5563,8 @@ *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of '$dir'" - dir=$absdir + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" ;; esac case "$deplibs " in @@ -6861,7 +5599,7 @@ ;; -l*) - if test X-lc = "X$arg" || test X-lm = "X$arg"; then + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) @@ -6869,11 +5607,11 @@ ;; *-*-os2*) # These systems don't actually have a C library (as such) - test X-lc = "X$arg" && continue + test "X$arg" = "X-lc" && continue ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. - test X-lc = "X$arg" && continue + test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework @@ -6882,16 +5620,16 @@ ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype - test X-lc = "X$arg" && continue + test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work - test X-lc = "X$arg" && continue + test "X$arg" = "X-lc" && continue ;; esac - elif test X-lc_r = "X$arg"; then + elif test "X$arg" = "X-lc_r"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -6901,11 +5639,6 @@ continue ;; - -mllvm) - prev=mllvm - continue - ;; - -module) module=yes continue @@ -6935,7 +5668,7 @@ ;; -multi_module) - single_module=$wl-multi_module + single_module="${wl}-multi_module" continue ;; @@ -6949,8 +5682,8 @@ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. - func_warning "'-no-install' is ignored for $host" - func_warning "assuming '-no-fast-install' instead" + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; @@ -7055,14 +5788,14 @@ func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= - save_ifs=$IFS; IFS=, + save_ifs="$IFS"; IFS=',' for flag in $args; do - IFS=$save_ifs + IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done - IFS=$save_ifs + IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; @@ -7071,15 +5804,15 @@ func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= - save_ifs=$IFS; IFS=, + save_ifs="$IFS"; IFS=',' for flag in $args; do - IFS=$save_ifs + IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done - IFS=$save_ifs + IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; @@ -7102,7 +5835,7 @@ # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: @@ -7117,13 +5850,12 @@ # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support - # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization - # -stdlib=* select c++ std lib with clang + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-stdlib=*) + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" @@ -7133,7 +5865,7 @@ # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + arg="$func_quote_for_eval_result" ;; *.$objext) @@ -7154,21 +5886,21 @@ if test -z "$pic_object" || test -z "$non_pic_object" || - test none = "$pic_object" && - test none = "$non_pic_object"; then - func_fatal_error "cannot find name of object for '$arg'" + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir=$func_dirname_result + xdir="$func_dirname_result" - test none = "$pic_object" || { + if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. - pic_object=$xdir$pic_object + pic_object="$xdir$pic_object" - if test dlfiles = "$prev"; then - if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue @@ -7179,7 +5911,7 @@ fi # CHECK ME: I think I busted this. -Ossama - if test dlprefiles = "$prev"; then + if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= @@ -7187,23 +5919,23 @@ # A PIC object. func_append libobjs " $pic_object" - arg=$pic_object - } + arg="$pic_object" + fi # Non-PIC object. - if test none != "$non_pic_object"; then + if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. - non_pic_object=$xdir$non_pic_object + non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test none = "$pic_object"; then - arg=$non_pic_object + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. - non_pic_object=$pic_object + non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else @@ -7211,7 +5943,7 @@ if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir=$func_dirname_result + xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result @@ -7219,7 +5951,7 @@ func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else - func_fatal_error "'$arg' is not a valid libtool object" + func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; @@ -7235,11 +5967,11 @@ # A libtool-controlled library. func_resolve_sysroot "$arg" - if test dlfiles = "$prev"; then + if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= - elif test dlprefiles = "$prev"; then + elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= @@ -7254,7 +5986,7 @@ # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + arg="$func_quote_for_eval_result" ;; esac # arg @@ -7266,9 +5998,9 @@ done # argument parsing loop test -n "$prev" && \ - func_fatal_help "the '$prevarg' option requires an argument" + func_fatal_help "the \`$prevarg' option requires an argument" - if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" @@ -7277,12 +6009,12 @@ oldlibs= # calculate the name of the file, without its directory func_basename "$output" - outputname=$func_basename_result - libobjs_save=$libobjs + outputname="$func_basename_result" + libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi @@ -7290,7 +6022,7 @@ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" - output_objdir=$func_dirname_result$objdir + output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. @@ -7313,7 +6045,7 @@ # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do - if $opt_preserve_dup_deps; then + if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac @@ -7321,7 +6053,7 @@ func_append libs " $deplib" done - if test lib = "$linkmode"; then + if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps @@ -7353,7 +6085,7 @@ case $file in *.la) ;; *) - func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done @@ -7361,7 +6093,7 @@ prog) compile_deplibs= finalize_deplibs= - alldeplibs=false + alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" @@ -7373,29 +6105,32 @@ for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... - if test lib,link = "$linkmode,$pass"; then + if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done - deplibs=$tmp_deplibs + deplibs="$tmp_deplibs" fi - if test lib,link = "$linkmode,$pass" || - test prog,scan = "$linkmode,$pass"; then - libs=$deplibs + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" deplibs= fi - if test prog = "$linkmode"; then + if test "$linkmode" = prog; then case $pass in - dlopen) libs=$dlfiles ;; - dlpreopen) libs=$dlprefiles ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; esac fi - if test lib,dlpreopen = "$linkmode,$pass"; then + if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs @@ -7416,26 +6151,26 @@ esac done done - libs=$dlprefiles + libs="$dlprefiles" fi - if test dlopen = "$pass"; then + if test "$pass" = dlopen; then # Collect dlpreopened libraries - save_deplibs=$deplibs + save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= - found=false + found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - if test prog,link = "$linkmode,$pass"; then + if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" - if test lib = "$linkmode"; then + if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; @@ -7445,13 +6180,13 @@ continue ;; -l*) - if test lib != "$linkmode" && test prog != "$linkmode"; then - func_warning "'-l' is ignored for archives/objects" + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result - if test lib = "$linkmode"; then + if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" @@ -7459,22 +6194,31 @@ for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library - lib=$searchdir/lib$name$search_ext + lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then - if test .la = "$search_ext"; then - found=: + if test "$search_ext" = ".la"; then + found=yes else - found=false + found=no fi break 2 fi done done - if $found; then - # deplib is a libtool library + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. - if test yes = "$allow_libtool_libs_with_static_runtimes"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then @@ -7482,19 +6226,19 @@ old_library= func_source "$lib" for l in $old_library $library_names; do - ll=$l + ll="$l" done - if test "X$ll" = "X$old_library"; then # only static version available - found=false + if test "X$ll" = "X$old_library" ; then # only static version available + found=no func_dirname "$lib" "" "." - ladir=$func_dirname_result + ladir="$func_dirname_result" lib=$ladir/$old_library - if test prog,link = "$linkmode,$pass"; then + if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" - test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi @@ -7503,25 +6247,15 @@ *) ;; esac fi - else - # deplib doesn't seem to be a libtool library - if test prog,link = "$linkmode,$pass"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" - fi - continue fi ;; # -l *.ltframework) - if test prog,link = "$linkmode,$pass"; then + if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" - if test lib = "$linkmode"; then + if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; @@ -7534,18 +6268,18 @@ case $linkmode in lib) deplibs="$deplib $deplibs" - test conv = "$pass" && continue + test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) - if test conv = "$pass"; then + if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi - if test scan = "$pass"; then + if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" @@ -7556,13 +6290,13 @@ func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) - func_warning "'-L' is ignored for archives/objects" + func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) - if test link = "$pass"; then + if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result @@ -7580,7 +6314,7 @@ lib=$func_resolve_sysroot_result ;; *.$libext) - if test conv = "$pass"; then + if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi @@ -7591,26 +6325,21 @@ case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) - valid_a_lib=false + valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=: + valid_a_lib=yes fi ;; pass_all) - valid_a_lib=: + valid_a_lib=yes ;; esac - if $valid_a_lib; then - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - else + if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" @@ -7618,13 +6347,18 @@ echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) - if test link != "$pass"; then + if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" @@ -7635,10 +6369,10 @@ esac # linkmode ;; # *.$libext *.lo | *.$objext) - if test conv = "$pass"; then + if test "$pass" = conv; then deplibs="$deplib $deplibs" - elif test prog = "$linkmode"; then - if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" @@ -7651,20 +6385,22 @@ continue ;; %DEPLIBS%) - alldeplibs=: + alldeplibs=yes continue ;; esac # case $deplib - $found || test -f "$lib" \ - || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ - || func_fatal_error "'$lib' is not a valid libtool archive" + || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." - ladir=$func_dirname_result + ladir="$func_dirname_result" dlname= dlopen= @@ -7694,36 +6430,36 @@ done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test lib,link = "$linkmode,$pass" || - test prog,scan = "$linkmode,$pass" || - { test prog != "$linkmode" && test lib != "$linkmode"; }; then + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi - if test conv = "$pass"; then + if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for '$lib'" + func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" - elif test prog != "$linkmode" && test lib != "$linkmode"; then - func_fatal_error "'$lib' is not a convenience library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" fi - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done continue fi # $pass = conv @@ -7731,26 +6467,26 @@ # Get the name of the library we link against. linklib= if test -n "$old_library" && - { test yes = "$prefer_static_libs" || - test built,no = "$prefer_static_libs,$installed"; }; then + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do - linklib=$l + linklib="$l" done fi if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for '$lib'" + func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. - if test dlopen = "$pass"; then - test -z "$libdir" \ - && func_fatal_error "cannot -dlopen a convenience library: '$lib'" + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi if test -z "$dlname" || - test yes != "$dlopen_support" || - test no = "$build_libtool_libs" - then + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't @@ -7764,40 +6500,40 @@ # We need an absolute path. case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of '$ladir'" + func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" - abs_ladir=$ladir + abs_ladir="$ladir" fi ;; esac func_basename "$lib" - laname=$func_basename_result + laname="$func_basename_result" # Find the relevant object directory and library name. - if test yes = "$installed"; then + if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library '$lib' was moved." - dir=$ladir - absdir=$abs_ladir - libdir=$abs_ladir + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" else - dir=$lt_sysroot$libdir - absdir=$lt_sysroot$libdir + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$libdir" fi - test yes = "$hardcode_automatic" && avoidtemprpath=yes + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir=$ladir - absdir=$abs_ladir + dir="$ladir" + absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else - dir=$ladir/$objdir - absdir=$abs_ladir/$objdir + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi @@ -7806,11 +6542,11 @@ name=$func_stripname_result # This library was specified with -dlpreopen. - if test dlpreopen = "$pass"; then - if test -z "$libdir" && test prog = "$linkmode"; then - func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi - case $host in + case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both @@ -7854,9 +6590,9 @@ if test -z "$libdir"; then # Link the convenience library - if test lib = "$linkmode"; then + if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" - elif test prog,link = "$linkmode,$pass"; then + elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else @@ -7866,14 +6602,14 @@ fi - if test prog = "$linkmode" && test link != "$pass"; then + if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" - linkalldeplibs=false - if test no != "$link_all_deplibs" || test -z "$library_names" || - test no = "$build_libtool_libs"; then - linkalldeplibs=: + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes fi tmp_libs= @@ -7885,14 +6621,14 @@ ;; esac # Need to link against all dependency_libs? - if $linkalldeplibs; then + if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi - if $opt_preserve_dup_deps; then + if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac @@ -7902,15 +6638,15 @@ continue fi # $linkmode = prog... - if test prog,link = "$linkmode,$pass"; then + if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && - { { test no = "$prefer_static_libs" || - test built,yes = "$prefer_static_libs,$installed"; } || + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. - case $temp_rpath: in + case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac @@ -7939,9 +6675,9 @@ esac fi # $linkmode,$pass = prog,link... - if $alldeplibs && - { test pass_all = "$deplibs_check_method" || - { test yes = "$build_libtool_libs" && + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue @@ -7950,11 +6686,11 @@ link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs - if test built = "$use_static_libs" && test yes = "$installed"; then + if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && - { test no = "$use_static_libs" || test -z "$old_library"; }; then + { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded @@ -7962,7 +6698,7 @@ need_relink=no ;; *) - if test no = "$installed"; then + if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi @@ -7972,24 +6708,24 @@ # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule= + dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule=$dlpremoduletest + dlopenmodule="$dlpremoduletest" break fi done - if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo - if test prog = "$linkmode"; then + if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi - if test lib = "$linkmode" && - test yes = "$hardcode_into_libs"; then + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. @@ -8017,43 +6753,43 @@ # figure out the soname set dummy $library_names shift - realname=$1 + realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then - soname=$dlname + soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result - versuffix=-$major + versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else - soname=$realname + soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use - soroot=$soname + soroot="$soname" func_basename "$soroot" - soname=$func_basename_result + soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else - func_verbose "extracting exported symbol list from '$soname'" + func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for '$soname'" + func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library @@ -8061,58 +6797,58 @@ linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" - if test prog = "$linkmode" || test relink != "$opt_mode"; then + if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) - if test no = "$hardcode_direct"; then - add=$dir/$linklib + if test "$hardcode_direct" = no; then + add="$dir/$linklib" case $host in - *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; - *-*-sysv4*uw2*) add_dir=-L$dir ;; + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir=-L$dir ;; + *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) - # if the lib is a (non-dlopened) module then we cannot + # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null; then + $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library"; then + if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else - add=$dir/$old_library + add="$dir/$old_library" fi elif test -n "$old_library"; then - add=$dir/$old_library + add="$dir/$old_library" fi fi esac - elif test no = "$hardcode_minus_L"; then + elif test "$hardcode_minus_L" = no; then case $host in - *-*-sunos*) add_shlibpath=$dir ;; + *-*-sunos*) add_shlibpath="$dir" ;; esac - add_dir=-L$dir - add=-l$name - elif test no = "$hardcode_shlibpath_var"; then - add_shlibpath=$dir - add=-l$name + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" else lib_linked=no fi ;; relink) - if test yes = "$hardcode_direct" && - test no = "$hardcode_direct_absolute"; then - add=$dir/$linklib - elif test yes = "$hardcode_minus_L"; then - add_dir=-L$absdir + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in @@ -8121,10 +6857,10 @@ ;; esac fi - add=-l$name - elif test yes = "$hardcode_shlibpath_var"; then - add_shlibpath=$dir - add=-l$name + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" else lib_linked=no fi @@ -8132,7 +6868,7 @@ *) lib_linked=no ;; esac - if test yes != "$lib_linked"; then + if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi @@ -8142,15 +6878,15 @@ *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi - if test prog = "$linkmode"; then + if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" - if test yes != "$hardcode_direct" && - test yes != "$hardcode_minus_L" && - test yes = "$hardcode_shlibpath_var"; then + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; @@ -8159,33 +6895,33 @@ fi fi - if test prog = "$linkmode" || test relink = "$opt_mode"; then + if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. - if test yes = "$hardcode_direct" && - test no = "$hardcode_direct_absolute"; then - add=$libdir/$linklib - elif test yes = "$hardcode_minus_L"; then - add_dir=-L$libdir - add=-l$name - elif test yes = "$hardcode_shlibpath_var"; then + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac - add=-l$name - elif test yes = "$hardcode_automatic"; then + add="-l$name" + elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib"; then - add=$inst_prefix_dir$libdir/$linklib + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" else - add=$libdir/$linklib + add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. - add_dir=-L$libdir + add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in @@ -8194,10 +6930,10 @@ ;; esac fi - add=-l$name + add="-l$name" fi - if test prog = "$linkmode"; then + if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else @@ -8205,43 +6941,43 @@ test -n "$add" && deplibs="$add $deplibs" fi fi - elif test prog = "$linkmode"; then + elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. - if test unsupported != "$hardcode_direct"; then - test -n "$old_library" && linklib=$old_library + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi - elif test yes = "$build_libtool_libs"; then + elif test "$build_libtool_libs" = yes; then # Not a shared library - if test pass_all != "$deplibs_check_method"; then + if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo - $ECHO "*** Warning: This system cannot link to static lib archive $lib." + $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." - if test yes = "$module"; then + if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." - echo "*** 'nm' from GNU binutils and a full rebuild may help." + echo "*** \`nm' from GNU binutils and a full rebuild may help." fi - if test no = "$build_old_libs"; then + if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else @@ -8254,11 +6990,11 @@ fi fi # link shared/static library? - if test lib = "$linkmode"; then + if test "$linkmode" = lib; then if test -n "$dependency_libs" && - { test yes != "$hardcode_into_libs" || - test yes = "$build_old_libs" || - test yes = "$link_static"; }; then + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do @@ -8272,12 +7008,12 @@ *) func_append temp_deplibs " $libdir";; esac done - dependency_libs=$temp_deplibs + dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library - test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do @@ -8287,7 +7023,7 @@ func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac - if $opt_preserve_dup_deps; then + if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; @@ -8296,12 +7032,12 @@ func_append tmp_libs " $func_resolve_sysroot_result" done - if test no != "$link_all_deplibs"; then + if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in - -L*) path=$deplib ;; + -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result @@ -8309,12 +7045,12 @@ dir=$func_dirname_result # We need an absolute path. case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of '$dir'" - absdir=$dir + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" fi ;; esac @@ -8322,35 +7058,35 @@ case $host in *-*-darwin*) depdepl= - eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names"; then - for tmp in $deplibrary_names; do + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do depdepl=$tmp done - if test -f "$absdir/$objdir/$depdepl"; then - depdepl=$absdir/$objdir/$depdepl - darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then - darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi - func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" - func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) - path=-L$absdir/$objdir + path="-L$absdir/$objdir" ;; esac else - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ - func_fatal_error "'$deplib' is not a valid libtool archive" + func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ - func_warning "'$deplib' seems to be moved" + func_warning "\`$deplib' seems to be moved" - path=-L$absdir + path="-L$absdir" fi ;; esac @@ -8362,23 +7098,23 @@ fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs - if test link = "$pass"; then - if test prog = "$linkmode"; then + if test "$pass" = link; then + if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi - dependency_libs=$newdependency_libs - if test dlpreopen = "$pass"; then + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi - if test dlopen != "$pass"; then - test conv = "$pass" || { + if test "$pass" != dlopen; then + if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do @@ -8388,12 +7124,12 @@ esac done newlib_search_path= - } + fi - if test prog,link = "$linkmode,$pass"; then - vars="compile_deplibs finalize_deplibs" + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" else - vars=deplibs + vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order @@ -8454,59 +7190,59 @@ # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= - for i in $dependency_libs; do + for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) - i= + i="" ;; esac - if test -n "$i"; then + if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass - if test prog = "$linkmode"; then - dlfiles=$newdlfiles + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" fi - if test prog = "$linkmode" || test lib = "$linkmode"; then - dlprefiles=$newdlprefiles + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then - func_warning "'-dlopen' is ignored for archives" + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) - func_warning "'-l' and '-L' are ignored for archives" ;; + func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ - func_warning "'-rpath' is ignored for archives" + func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ - func_warning "'-R' is ignored for archives" + func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ - func_warning "'-version-info/-version-number' is ignored for archives" + func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ - func_warning "'-release' is ignored for archives" + func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ - func_warning "'-export-symbols' is ignored for archives" + func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no - oldlibs=$output + oldlibs="$output" func_append objs "$old_deplibs" ;; lib) - # Make sure we only generate libraries of the form 'libNAME.la'. + # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" @@ -8515,10 +7251,10 @@ eval libname=\"$libname_spec\" ;; *) - test no = "$module" \ - && func_fatal_help "libtool library '$output' must begin with 'lib'" + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" - if test no != "$need_lib_prefix"; then + if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result @@ -8532,8 +7268,8 @@ esac if test -n "$objs"; then - if test pass_all != "$deplibs_check_method"; then - func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" @@ -8542,21 +7278,21 @@ fi fi - test no = "$dlself" \ - || func_warning "'-dlopen self' is ignored for libtool libraries" + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift - test 1 -lt "$#" \ - && func_warning "ignoring multiple '-rpath's for a libtool library" + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" - install_libdir=$1 + install_libdir="$1" oldlibs= if test -z "$rpath"; then - if test yes = "$build_libtool_libs"; then + if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. - # Some compilers have problems with a '.al' extension so + # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" @@ -8565,20 +7301,20 @@ fi test -n "$vinfo" && \ - func_warning "'-version-info/-version-number' is ignored for convenience libraries" + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ - func_warning "'-release' is ignored for convenience libraries" + func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. - save_ifs=$IFS; IFS=: + save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift - IFS=$save_ifs + IFS="$save_ifs" test -n "$7" && \ - func_fatal_help "too many parameters to '-version-info'" + func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts @@ -8586,42 +7322,45 @@ case $vinfo_number in yes) - number_major=$1 - number_minor=$2 - number_revision=$3 + number_major="$1" + number_minor="$2" + number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix - # that has an extra 1 added just for fun + # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result - age=$number_minor - revision=$number_revision + age="$number_minor" + revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) - current=$number_major - revision=$number_minor - age=0 + current="$number_major" + revision="$number_minor" + age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result - age=$number_minor - revision=$number_minor + age="$number_minor" + revision="$number_minor" lt_irix_increment=no ;; + *) + func_fatal_configuration "$modename: unknown library version type \`$version_type'" + ;; esac ;; no) - current=$1 - revision=$2 - age=$3 + current="$1" + revision="$2" + age="$3" ;; esac @@ -8629,30 +7368,30 @@ case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "CURRENT '$current' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "REVISION '$revision' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "AGE '$age' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then - func_error "AGE '$age' is greater than the current interface number '$current'" - func_fatal_error "'$vinfo' is not valid version information" + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. @@ -8667,35 +7406,26 @@ # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result - versuffix=$major.$age.$revision + versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result - xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - # On Darwin other compilers - case $CC in - nagfor*) - verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" - ;; - *) - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - esac ;; freebsd-aout) - major=.$current - versuffix=.$current.$revision + major=".$current" + versuffix=".$current.$revision"; ;; freebsd-elf) - major=.$current - versuffix=.$current + major=".$current" + versuffix=".$current" ;; irix | nonstopux) - if test no = "$lt_irix_increment"; then + if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 @@ -8706,69 +7436,69 @@ nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac - verstring=$verstring_prefix$major.$revision + verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision - while test 0 -ne "$loop"; do + while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result - verstring=$verstring_prefix$major.$iface:$verstring + verstring="$verstring_prefix$major.$iface:$verstring" done - # Before this point, $major must not contain '.'. + # Before this point, $major must not contain `.'. major=.$major - versuffix=$major.$revision + versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result - versuffix=$major.$age.$revision + versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result - versuffix=.$current.$age.$revision - verstring=$current.$age.$revision + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age - while test 0 -ne "$loop"; do + while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result - verstring=$verstring:$iface.0 + verstring="$verstring:${iface}.0" done # Make executables depend on our current version. - func_append verstring ":$current.0" + func_append verstring ":${current}.0" ;; qnx) - major=.$current - versuffix=.$current + major=".$current" + versuffix=".$current" ;; sunos) - major=.$current - versuffix=.$current.$revision + major=".$current" + versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 file systems. + # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result - versuffix=-$major + versuffix="-$major" ;; *) - func_fatal_configuration "unknown library version type '$version_type'" + func_fatal_configuration "unknown library version type \`$version_type'" ;; esac @@ -8782,45 +7512,42 @@ verstring= ;; *) - verstring=0.0 + verstring="0.0" ;; esac - if test no = "$need_version"; then + if test "$need_version" = no; then versuffix= else - versuffix=.0.0 + versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided - if test yes,no = "$avoid_version,$need_version"; then + if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= - verstring= + verstring="" fi # Check to see if the archive will have undefined symbols. - if test yes = "$allow_undefined"; then - if test unsupported = "$allow_undefined_flag"; then - if test yes = "$build_old_libs"; then - func_warning "undefined symbols not allowed in $host shared libraries; building static only" - build_libtool_libs=no - else - func_fatal_error "can't build $host shared library unless -no-undefined is specified" - fi + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes fi else # Don't allow undefined symbols. - allow_undefined_flag=$no_undefined_flag + allow_undefined_flag="$no_undefined_flag" fi fi - func_generate_dlsyms "$libname" "$libname" : + func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" - test " " = "$libobjs" && libobjs= + test "X$libobjs" = "X " && libobjs= - if test relink != "$opt_mode"; then + if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= @@ -8829,8 +7556,8 @@ case $p in *.$objext | *.gcno) ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) - if test -n "$precious_files_regex"; then + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue @@ -8846,11 +7573,11 @@ fi # Now set the variables for building old libraries. - if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. @@ -8871,13 +7598,13 @@ *) func_append finalize_rpath " $libdir" ;; esac done - if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles=$dlfiles + old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in @@ -8887,7 +7614,7 @@ done # Make sure dlprefiles contains only unique files - old_dlprefiles=$dlprefiles + old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in @@ -8896,7 +7623,7 @@ esac done - if test yes = "$build_libtool_libs"; then + if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) @@ -8920,7 +7647,7 @@ ;; *) # Add libc to deplibs on all other systems if necessary. - if test yes = "$build_libtool_need_lc"; then + if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; @@ -8936,9 +7663,9 @@ # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? - release= - versuffix= - major= + release="" + versuffix="" + major="" newdeplibs= droppeddeps=no case $deplibs_check_method in @@ -8967,20 +7694,20 @@ -l*) func_stripname -l '' "$i" name=$func_stripname_result - if test yes = "$allow_libtool_libs_with_static_runtimes"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) func_append newdeplibs " $i" - i= + i="" ;; esac fi - if test -n "$i"; then + if test -n "$i" ; then libname=`eval "\\$ECHO \"$libname_spec\""` deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` set dummy $deplib_matches; shift deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then func_append newdeplibs " $i" else droppeddeps=yes @@ -9010,20 +7737,20 @@ $opt_dry_run || $RM conftest if $LTCC $LTCFLAGS -o conftest conftest.c $i; then ldd_output=`ldd conftest` - if test yes = "$allow_libtool_libs_with_static_runtimes"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) func_append newdeplibs " $i" - i= + i="" ;; esac fi - if test -n "$i"; then + if test -n "$i" ; then libname=`eval "\\$ECHO \"$libname_spec\""` deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` set dummy $deplib_matches; shift deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then func_append newdeplibs " $i" else droppeddeps=yes @@ -9060,24 +7787,24 @@ -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result - if test yes = "$allow_libtool_libs_with_static_runtimes"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" - a_deplib= + a_deplib="" ;; esac fi - if test -n "$a_deplib"; then + if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` if test -n "$file_magic_glob"; then libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` else libnameglob=$libname fi - test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob` + test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - if test yes = "$want_nocaseglob"; then + if test "$want_nocaseglob" = yes; then shopt -s nocaseglob potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` $nocaseglob @@ -9095,25 +7822,25 @@ # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? - potlib=$potent_lib + potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | $SED 's/.* -> //'` + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; - *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" - a_deplib= + a_deplib="" break 2 fi done done fi - if test -n "$a_deplib"; then + if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." @@ -9121,7 +7848,7 @@ echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib"; then + if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" @@ -9144,30 +7871,30 @@ -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result - if test yes = "$allow_libtool_libs_with_static_runtimes"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" - a_deplib= + a_deplib="" ;; esac fi - if test -n "$a_deplib"; then + if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do - potlib=$potent_lib # see symlink-check above in file_magic test + potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" - a_deplib= + a_deplib="" break 2 fi done done fi - if test -n "$a_deplib"; then + if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." @@ -9175,7 +7902,7 @@ echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib"; then + if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" @@ -9191,18 +7918,18 @@ done # Gone through all deplibs. ;; none | unknown | *) - newdeplibs= + newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test yes = "$allow_libtool_libs_with_static_runtimes"; then - for i in $predeps $postdeps; do + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo - if test none = "$deplibs_check_method"; then + if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." @@ -9226,8 +7953,8 @@ ;; esac - if test yes = "$droppeddeps"; then - if test yes = "$module"; then + if test "$droppeddeps" = yes; then + if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" @@ -9236,12 +7963,12 @@ if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." - echo "*** 'nm' from GNU binutils and a full rebuild may help." + echo "*** \`nm' from GNU binutils and a full rebuild may help." fi - if test no = "$build_old_libs"; then - oldlibs=$output_objdir/$libname.$libext + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else @@ -9252,14 +7979,14 @@ echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." - if test no = "$allow_undefined"; then + if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." - if test no = "$build_old_libs"; then - oldlibs=$output_objdir/$libname.$libext + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else @@ -9305,7 +8032,7 @@ *) func_append new_libs " $deplib" ;; esac done - deplibs=$new_libs + deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= @@ -9313,25 +8040,25 @@ dlname= # Test again, we may have decided not to build it any more - if test yes = "$build_libtool_libs"; then - # Remove $wl instances when linking with ld. + if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac - if test yes = "$hardcode_into_libs"; then + if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= - rpath=$finalize_rpath - test relink = "$opt_mode" || rpath=$compile_rpath$rpath + rpath="$finalize_rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir + hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -9356,7 +8083,7 @@ # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs + libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then @@ -9370,8 +8097,8 @@ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi - shlibpath=$finalize_shlibpath - test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath + shlibpath="$finalize_shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi @@ -9381,19 +8108,19 @@ eval library_names=\"$library_names_spec\" set dummy $library_names shift - realname=$1 + realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else - soname=$realname + soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi - lib=$output_objdir/$realname + lib="$output_objdir/$realname" linknames= for link do @@ -9407,7 +8134,7 @@ delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols=$output_objdir/$libname.uexp + export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi @@ -9416,31 +8143,31 @@ cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile - func_dll_def_p "$export_symbols" || { + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. - orig_export_symbols=$export_symbols + orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes - } + fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then - if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for '$libname.la'" - export_symbols=$output_objdir/$libname.exp + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds - save_ifs=$IFS; IFS='~' + save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do - IFS=$save_ifs + IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in @@ -9454,7 +8181,7 @@ try_normal_branch=no ;; esac - if test yes = "$try_normal_branch" \ + if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then @@ -9465,7 +8192,7 @@ output_la=$func_basename_result save_libobjs=$libobjs save_output=$output - output=$output_objdir/$output_la.nm + output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" @@ -9488,8 +8215,8 @@ break fi done - IFS=$save_ifs - if test -n "$export_symbols_regex" && test : != "$skipped_export"; then + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi @@ -9497,16 +8224,16 @@ fi if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols=$export_symbols - test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi - if test : != "$skipped_export" && test -n "$orig_export_symbols"; then + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands, which not all seds can handle. GNU sed should be fine + # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. @@ -9525,11 +8252,11 @@ ;; esac done - deplibs=$tmp_deplibs + deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && - test yes = "$compiler_needs_object" && + test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. @@ -9540,7 +8267,7 @@ eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else - gentop=$output_objdir/${outputname}x + gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience @@ -9549,18 +8276,18 @@ fi fi - if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking - if test relink = "$opt_mode"; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. - if test yes = "$module" && test -n "$module_cmds"; then + if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds @@ -9578,7 +8305,7 @@ fi fi - if test : != "$skipped_export" && + if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then @@ -9611,8 +8338,8 @@ last_robj= k=1 - if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then - output=$output_objdir/$output_la.lnkscript + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs @@ -9624,14 +8351,14 @@ func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then - output=$output_objdir/$output_la.lnk + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= - if test yes = "$compiler_needs_object"; then + if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi @@ -9646,7 +8373,7 @@ else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-$k.$objext + output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result @@ -9658,13 +8385,13 @@ func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result - if test -z "$objlist" || + if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. - if test 1 -eq "$k"; then + if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" @@ -9674,10 +8401,10 @@ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi - last_robj=$output_objdir/$output_la-$k.$objext + last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result - output=$output_objdir/$output_la-$k.$objext + output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result @@ -9689,9 +8416,9 @@ # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds$reload_cmds\" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" @@ -9699,9 +8426,9 @@ output= fi - ${skipped_export-false} && { - func_verbose "generating symbol list for '$libname.la'" - export_symbols=$output_objdir/$libname.exp + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. @@ -9710,16 +8437,16 @@ if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi - } + fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. - save_ifs=$IFS; IFS='~' + save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do - IFS=$save_ifs - $opt_quiet || { + IFS="$save_ifs" + $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } @@ -9727,7 +8454,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -9736,7 +8463,7 @@ exit $lt_exit } done - IFS=$save_ifs + IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' @@ -9744,18 +8471,18 @@ fi fi - ${skipped_export-false} && { + if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols=$export_symbols - test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands, which not all seds can handle. GNU sed should be fine + # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. @@ -9764,7 +8491,7 @@ export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi - } + fi libobjs=$output # Restore the value of output. @@ -9778,7 +8505,7 @@ # value of $libobjs for piecewise linking. # Do each of the archive commands. - if test yes = "$module" && test -n "$module_cmds"; then + if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else @@ -9800,7 +8527,7 @@ # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then - gentop=$output_objdir/${outputname}x + gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles @@ -9808,12 +8535,11 @@ test "X$libobjs" = "X " && libobjs= fi - save_ifs=$IFS; IFS='~' + save_ifs="$IFS"; IFS='~' for cmd in $cmds; do - IFS=$sp$nl + IFS="$save_ifs" eval cmd=\"$cmd\" - IFS=$save_ifs - $opt_quiet || { + $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } @@ -9821,7 +8547,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -9830,10 +8556,10 @@ exit $lt_exit } done - IFS=$save_ifs + IFS="$save_ifs" # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then @@ -9853,39 +8579,39 @@ done # If -module or -export-dynamic was specified, set the dlname. - if test yes = "$module" || test yes = "$export_dynamic"; then + if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. - dlname=$soname + dlname="$soname" fi fi ;; obj) - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then - func_warning "'-dlopen' is ignored for objects" + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) - func_warning "'-l' and '-L' are ignored for objects" ;; + func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ - func_warning "'-rpath' is ignored for objects" + func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ - func_warning "'-R' is ignored for objects" + func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ - func_warning "'-version-info' is ignored for objects" + func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ - func_warning "'-release' is ignored for objects" + func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object '$output' from non-libtool objects" + func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" @@ -9893,7 +8619,7 @@ ;; *) libobj= - obj=$output + obj="$output" ;; esac @@ -9916,7 +8642,7 @@ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else - gentop=$output_objdir/${obj}x + gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience @@ -9925,12 +8651,12 @@ fi # If we're not building shared, we need to use non_pic_objs - test yes = "$build_libtool_libs" || libobjs=$non_pic_objects + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. - reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - output=$obj + output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. @@ -9942,7 +8668,7 @@ exit $EXIT_SUCCESS fi - test yes = "$build_libtool_libs" || { + if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi @@ -9952,12 +8678,12 @@ # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS - } + fi - if test -n "$pic_flag" || test default != "$pic_mode"; then + if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" - output=$libobj + output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi @@ -9974,14 +8700,16 @@ output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ - func_warning "'-version-info' is ignored for programs" + func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ - func_warning "'-release' is ignored for programs" + func_warning "\`-release' is ignored for programs" - $preload \ - && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ - && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) @@ -9995,11 +8723,11 @@ *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). - if test CXX = "$tagname"; then + if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) - func_append compile_command " $wl-bind_at_load" - func_append finalize_command " $wl-bind_at_load" + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" ;; esac fi @@ -10035,7 +8763,7 @@ *) func_append new_libs " $deplib" ;; esac done - compile_deplibs=$new_libs + compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" @@ -10059,7 +8787,7 @@ if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir + hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -10082,7 +8810,7 @@ fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; @@ -10099,10 +8827,10 @@ # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs + libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi - compile_rpath=$rpath + compile_rpath="$rpath" rpath= hardcode_libdirs= @@ -10110,7 +8838,7 @@ if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir + hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -10135,43 +8863,45 @@ # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs + libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi - finalize_rpath=$rpath + finalize_rpath="$rpath" - if test -n "$libobjs" && test yes = "$build_old_libs"; then + if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi - func_generate_dlsyms "$outputname" "@PROGRAM@" false + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi - wrappers_required=: + wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=false + wrappers_required=no ;; *cygwin* | *mingw* ) - test yes = "$build_libtool_libs" || wrappers_required=false + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi ;; *) - if test no = "$need_relink" || test yes != "$build_libtool_libs"; then - wrappers_required=false + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no fi ;; esac - $wrappers_required || { + if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command=$compile_command$compile_rpath + link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 @@ -10184,12 +8914,12 @@ fi # Delete the generated files. - if test -f "$output_objdir/${outputname}S.$objext"; then - func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status - } + fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" @@ -10219,9 +8949,9 @@ fi fi - if test yes = "$no_install"; then + if test "$no_install" = yes; then # We don't need to create a wrapper script. - link_command=$compile_var$compile_command$compile_rpath + link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. @@ -10238,28 +8968,27 @@ exit $EXIT_SUCCESS fi - case $hardcode_action,$fast_install in - relink,*) - # Fast installation is not supported - link_command=$compile_var$compile_command$compile_rpath - relink_command=$finalize_var$finalize_command$finalize_rpath - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "'$output' will be relinked during installation" - ;; - *,yes) - link_command=$finalize_var$compile_command$finalize_rpath - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - ;; - *,no) - link_command=$compile_var$compile_command$compile_rpath - relink_command=$finalize_var$finalize_command$finalize_rpath - ;; - *,needless) - link_command=$finalize_var$compile_command$finalize_rpath - relink_command= - ;; - esac + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` @@ -10316,8 +9045,8 @@ func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result - cwrappersource=$output_path/$objdir/lt-$output_name.c - cwrapper=$output_path/$output_name.exe + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 @@ -10338,7 +9067,7 @@ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host"; then + if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result @@ -10361,27 +9090,25 @@ # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do - case $build_libtool_libs in - convenience) - oldobjs="$libobjs_save $symfileobj" - addlibs=$convenience - build_libtool_libs=no - ;; - module) - oldobjs=$libobjs_save - addlibs=$old_convenience + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" build_libtool_libs=no - ;; - *) + else oldobjs="$old_deplibs $non_pic_objects" - $preload && test -f "$symfileobj" \ - && func_append oldobjs " $symfileobj" - addlibs=$old_convenience - ;; - esac + if test "$preload" = yes && test -f "$symfileobj"; then + func_append oldobjs " $symfileobj" + fi + fi + addlibs="$old_convenience" + fi if test -n "$addlibs"; then - gentop=$output_objdir/${outputname}x + gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs @@ -10389,13 +9116,13 @@ fi # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then - gentop=$output_objdir/${outputname}x + gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles @@ -10416,7 +9143,7 @@ : else echo "copying selected object files to avoid basename conflicts..." - gentop=$output_objdir/${outputname}x + gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs @@ -10425,7 +9152,7 @@ for obj in $save_oldobjs do func_basename "$obj" - objbase=$func_basename_result + objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) @@ -10494,18 +9221,18 @@ else # the above command should be used before it gets too long oldobjs=$objlist - if test "$obj" = "$last_oldobj"; then + if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist - if test -z "$oldobjs"; then + if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" @@ -10522,7 +9249,7 @@ case $output in *.la) old_library= - test yes = "$build_old_libs" && old_library=$libname.$libext + test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior @@ -10537,31 +9264,31 @@ fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - if test yes = "$hardcode_automatic"; then + if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do - if test yes = "$installed"; then + if test "$installed" = yes; then if test -z "$install_libdir"; then break fi - output=$output_objdir/${outputname}i + output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" - name=$func_basename_result + name="$func_basename_result" func_resolve_sysroot "$deplib" - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ - func_fatal_error "'$deplib' is not a valid libtool archive" + func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) @@ -10577,23 +9304,23 @@ *) func_append newdependency_libs " $deplib" ;; esac done - dependency_libs=$newdependency_libs + dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" - name=$func_basename_result - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ - func_fatal_error "'$lib' is not a valid libtool archive" + func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done - dlfiles=$newdlfiles + dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in @@ -10603,34 +9330,34 @@ # didn't already link the preopened objects directly into # the library: func_basename "$lib" - name=$func_basename_result - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ - func_fatal_error "'$lib' is not a valid libtool archive" + func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done - dlprefiles=$newdlprefiles + dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done - dlfiles=$newdlfiles + dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done - dlprefiles=$newdlprefiles + dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin @@ -10646,9 +9373,10 @@ case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. - if test -n "$bindir"; then + if test "x$bindir" != x ; + then func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result/$dlname + tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname @@ -10657,7 +9385,7 @@ esac $ECHO > $output "\ # $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. @@ -10671,7 +9399,7 @@ # The name of the static archive. old_library='$old_library' -# Linker flags that cannot go in dependency_libs. +# Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. @@ -10697,7 +9425,7 @@ # Directory that this library needs to be installed in: libdir='$install_libdir'" - if test no,yes = "$installed,$need_relink"; then + if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi @@ -10712,29 +9440,27 @@ exit $EXIT_SUCCESS } -if test link = "$opt_mode" || test relink = "$opt_mode"; then - func_mode_link ${1+"$@"} -fi +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && + func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { - $debug_cmd - - RM=$nonopt + $opt_debug + RM="$nonopt" files= - rmforce=false + rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. - libtool_install_magic=$magic + libtool_install_magic="$magic" for arg do case $arg in - -f) func_append RM " $arg"; rmforce=: ;; + -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac @@ -10747,18 +9473,18 @@ for file in $files; do func_dirname "$file" "" "." - dir=$func_dirname_result - if test . = "$dir"; then - odir=$objdir + dir="$func_dirname_result" + if test "X$dir" = X.; then + odir="$objdir" else - odir=$dir/$objdir + odir="$dir/$objdir" fi func_basename "$file" - name=$func_basename_result - test uninstall = "$opt_mode" && odir=$dir + name="$func_basename_result" + test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates - if test clean = "$opt_mode"; then + if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; @@ -10773,11 +9499,11 @@ elif test -d "$file"; then exit_status=1 continue - elif $rmforce; then + elif test "$rmforce" = yes; then continue fi - rmfiles=$file + rmfiles="$file" case $name in *.la) @@ -10791,7 +9517,7 @@ done test -n "$old_library" && func_append rmfiles " $odir/$old_library" - case $opt_mode in + case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; @@ -10802,12 +9528,12 @@ uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; @@ -10823,19 +9549,21 @@ func_source $dir/$name # Add PIC object to the list of files to remove. - if test -n "$pic_object" && test none != "$pic_object"; then + if test -n "$pic_object" && + test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && test none != "$non_pic_object"; then + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) - if test clean = "$opt_mode"; then + if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) @@ -10862,12 +9590,12 @@ # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles - func_append rmfiles " $odir/$name $odir/${name}S.$objext" - if test yes = "$fast_install" && test -n "$relink_command"; then + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi - if test "X$noexename" != "X$name"; then - func_append rmfiles " $odir/lt-$noexename.c" + if test "X$noexename" != "X$name" ; then + func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi @@ -10876,7 +9604,7 @@ func_show_eval "$RM $rmfiles" 'exit_status=1' done - # Try to remove the $objdir's in the directories where we deleted files + # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" @@ -10886,17 +9614,16 @@ exit $exit_status } -if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then - func_mode_uninstall ${1+"$@"} -fi +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && + func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { - help=$generic_help + help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode '$opt_mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" @@ -10907,7 +9634,7 @@ # The TAGs below are defined such that we never get into a situation -# where we disable both kinds of libraries. Given conflicting +# in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support @@ -10930,3 +9657,5 @@ # mode:shell-script # sh-indentation:2 # End: +# vi:sw=2 + diff -Nru cloog-0.18.2/isl/m4/ax_detect_git_head.m4 cloog-0.18.4/isl/m4/ax_detect_git_head.m4 --- cloog-0.18.2/isl/m4/ax_detect_git_head.m4 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/m4/ax_detect_git_head.m4 2014-10-02 15:33:27.000000000 +0000 @@ -2,10 +2,15 @@ AC_SUBST(GIT_HEAD_ID) AC_SUBST(GIT_HEAD) AC_SUBST(GIT_HEAD_VERSION) - if test -f $srcdir/.git/HEAD; then + if test -f $srcdir/.git; then + gitdir=`GIT_DIR=$srcdir/.git git rev-parse --git-dir` + GIT_HEAD="$gitdir/index" + GIT_REPO="$gitdir" + GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe --always` + elif test -f $srcdir/.git/HEAD; then GIT_HEAD="$srcdir/.git/index" GIT_REPO="$srcdir/.git" - GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe` + GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe --always` elif test -f $srcdir/GIT_HEAD_ID; then GIT_HEAD_ID=`cat $srcdir/GIT_HEAD_ID` else @@ -22,6 +27,6 @@ if test -z "$GIT_REPO" ; then GIT_HEAD_VERSION="$GIT_HEAD_ID" else - GIT_HEAD_VERSION="\`GIT_DIR=$GIT_REPO git describe\`" + GIT_HEAD_VERSION="\`GIT_DIR=$GIT_REPO git describe --always\`" fi ]) diff -Nru cloog-0.18.2/isl/m4/ax_detect_gmp.m4 cloog-0.18.4/isl/m4/ax_detect_gmp.m4 --- cloog-0.18.2/isl/m4/ax_detect_gmp.m4 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/m4/ax_detect_gmp.m4 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,48 @@ +AC_DEFUN([AX_DETECT_GMP], [ +AC_DEFINE([USE_GMP_FOR_MP], [], [use gmp to implement isl_int]) +AX_SUBMODULE(gmp,system|build,system) +case "$with_gmp" in +system) + if test "x$with_gmp_prefix" != "x"; then + isl_configure_args="$isl_configure_args --with-gmp=$with_gmp_prefix" + MP_CPPFLAGS="-I$with_gmp_prefix/include" + MP_LDFLAGS="-L$with_gmp_prefix/lib" + fi + MP_LIBS=-lgmp + SAVE_CPPFLAGS="$CPPFLAGS" + SAVE_LDFLAGS="$LDFLAGS" + SAVE_LIBS="$LIBS" + CPPFLAGS="$MP_CPPFLAGS $CPPFLAGS" + LDFLAGS="$MP_LDFLAGS $LDFLAGS" + LIBS="$MP_LIBS $LIBS" + AC_CHECK_HEADER([gmp.h], [], [AC_ERROR([gmp.h header not found])]) + AC_CHECK_LIB([gmp], [main], [], [AC_ERROR([gmp library not found])]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ + mpz_t n, d; + if (mpz_divisible_p(n, d)) + mpz_divexact_ui(n, n, 4); + ]])], [], [AC_ERROR([gmp library too old])]) + CPPFLAGS="$SAVE_CPPFLAGS" + LDFLAGS="$SAVE_LDFLAGS" + LIBS="$SAVE_LIBS" + ;; +build) + MP_CPPFLAGS="-I$gmp_srcdir -I$with_gmp_builddir" + MP_LIBS="$with_gmp_builddir/libgmp.la" + ;; +esac +SAVE_CPPFLAGS="$CPPFLAGS" +SAVE_LDFLAGS="$LDFLAGS" +SAVE_LIBS="$LIBS" +CPPFLAGS="$MP_CPPFLAGS $CPPFLAGS" +LDFLAGS="$MP_LDFLAGS $LDFLAGS" +LIBS="$MP_LIBS $LIBS" +need_get_memory_functions=false +AC_CHECK_DECLS(mp_get_memory_functions,[],[ + need_get_memory_functions=true +],[#include ]) +CPPFLAGS="$SAVE_CPPFLAGS" +LDFLAGS="$SAVE_LDFLAGS" +LIBS="$SAVE_LIBS" +AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS, test x$need_get_memory_functions = xtrue) +]) diff -Nru cloog-0.18.2/isl/m4/ax_detect_imath.m4 cloog-0.18.4/isl/m4/ax_detect_imath.m4 --- cloog-0.18.2/isl/m4/ax_detect_imath.m4 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/m4/ax_detect_imath.m4 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,15 @@ +AC_DEFUN([AX_DETECT_IMATH], [ +AC_DEFINE([USE_IMATH_FOR_MP], [], [use imath to implement isl_int]) + +MP_CPPFLAGS="-I$srcdir/imath_wrap" +MP_LDFLAGS="" +MP_LIBS="" + +SAVE_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$MP_CPPFLAGS $CPPFLAGS" +AC_CHECK_HEADER([imath.h], [], [AC_ERROR([imath.h header not found])]) +AC_CHECK_HEADER([gmp_compat.h], [], [AC_ERROR([gmp_compat.h header not found])]) +CPPFLAGS="$SAVE_CPPFLAGS" + +AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS, test x = xfalse) +]) diff -Nru cloog-0.18.2/isl/m4/libtool.m4 cloog-0.18.4/isl/m4/libtool.m4 --- cloog-0.18.2/isl/m4/libtool.m4 2013-12-18 12:35:57.000000000 +0000 +++ cloog-0.18.4/isl/m4/libtool.m4 2014-10-02 14:14:35.000000000 +0000 @@ -1,6 +1,8 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -37,7 +39,7 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) -# serial 58 LT_INIT +# serial 57 LT_INIT # LT_PREREQ(VERSION) @@ -89,7 +91,7 @@ _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed -LIBTOOL_DEPS=$ltmain +LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -128,7 +130,7 @@ # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set -# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} @@ -177,13 +179,13 @@ m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options that allow our +# See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}"; then +if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) -if test -n "${ZSH_VERSION+set}"; then +if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi @@ -196,7 +198,7 @@ # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. - if test set != "${COLLECT_NAMES+set}"; then + if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -207,14 +209,14 @@ ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, +# All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a -with_gnu_ld=$lt_cv_prog_gnu_ld +with_gnu_ld="$lt_cv_prog_gnu_ld" -old_CC=$CC -old_CFLAGS=$CFLAGS +old_CC="$CC" +old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc @@ -267,14 +269,14 @@ # _LT_PROG_LTMAIN # --------------- -# Note that this code is called both from 'configure', and 'config.status' +# Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# 'config.status' has no value for ac_aux_dir unless we are using Automake, +# `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain=$ac_aux_dir/ltmain.sh +ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN @@ -284,7 +286,7 @@ # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the 'libtool' +# in macros and then make a single call at the end using the `libtool' # label. @@ -419,8 +421,8 @@ # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ -# Quote a variable value, and forward it to 'config.status' so that its -# declaration there will have the same value as in 'configure'. VARNAME +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) @@ -444,7 +446,7 @@ # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags='_LT_TAGS'dnl +available_tags="_LT_TAGS"dnl ]) @@ -472,7 +474,7 @@ # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], @@ -498,8 +500,8 @@ # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations -# into 'config.status', and then the shell code to quote escape them in -# for loops in 'config.status'. Finally, any additional code accumulated +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], @@ -545,7 +547,7 @@ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -558,7 +560,7 @@ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -574,7 +576,7 @@ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the -# '#!' sequence but before initialization text begins. After this +# `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). @@ -596,7 +598,7 @@ _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF -test 0 = "$lt_write_fail" && chmod +x $1[]dnl +test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT @@ -619,7 +621,7 @@ } >&AS_MESSAGE_LOG_FD lt_cl_help="\ -'$as_me' creates a local libtool stub from the current configuration, +\`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. @@ -641,7 +643,7 @@ This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." -while test 0 != $[#] +while test $[#] != 0 do case $[1] in --version | --v* | -V ) @@ -654,10 +656,10 @@ lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] -Try '$[0] --help' for more information.]) ;; +Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] -Try '$[0] --help' for more information.]) ;; +Try \`$[0] --help' for more information.]) ;; esac shift done @@ -683,7 +685,7 @@ # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: -test yes = "$silent" && +test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false @@ -703,13 +705,13 @@ _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ - # See if we are running on zsh, and set the options that allow our + # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}"; then + if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi - cfgfile=${ofile}T + cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" @@ -717,7 +719,7 @@ #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE) $VERSION +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # @@ -737,7 +739,7 @@ # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. -if test set != "${COLLECT_NAMES+set}"; then +if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -754,6 +756,8 @@ sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) + _LT_PROG_REPLACE_SHELLFNS + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -771,6 +775,7 @@ [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS @@ -969,7 +974,7 @@ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no - if test -z "$LT_MULTI_MODULE"; then + if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the @@ -987,7 +992,7 @@ cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. - elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1005,7 +1010,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS=$save_LDFLAGS + LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], @@ -1027,7 +1032,7 @@ _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD - elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1037,32 +1042,32 @@ ]) case $host_os in rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac - if test yes = "$lt_cv_apple_cc_single_mod"; then + if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi - if test yes = "$lt_cv_ld_exported_symbols_list"; then - _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -1082,29 +1087,29 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - if test yes = "$lt_cv_ld_force_load"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in - ifort*|nagfor*) _lt_dar_can_shared=yes ;; + ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac - if test yes = "$_lt_dar_can_shared"; then + if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all - _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], -[ if test yes != "$lt_cv_apple_cc_single_mod"; then - _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else @@ -1124,7 +1129,7 @@ # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl -if test set = "${lt_cv_aix_libpath+set}"; then +if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], @@ -1142,7 +1147,7 @@ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) @@ -1162,8 +1167,8 @@ # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start -# of the generated configure script that will find a shell with a builtin -# printf (that we can use as an echo command). +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO @@ -1191,10 +1196,10 @@ # Invoke $ECHO with all args, space-separated. func_echo_all () { - $ECHO "$*" + $ECHO "$*" } -case $ECHO in +case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; @@ -1220,17 +1225,16 @@ AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], - [Search for dependent libraries within DIR (or the compiler's sysroot - if not specified).])], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= -case $with_sysroot in #( +case ${with_sysroot} in #( yes) - if test yes = "$GCC"; then + if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( @@ -1240,14 +1244,14 @@ no|'') ;; #( *) - AC_MSG_RESULT([$with_sysroot]) + AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl -[dependent libraries, and where our libraries should be installed.])]) +[dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- @@ -1255,33 +1259,31 @@ [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) -test no = "$enable_libtool_lock" || enable_libtool_lock=yes +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) - # Find out what ABI is being produced by ac_compile, and set mode - # options accordingly. + # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) - HPUX_IA64_MODE=32 + HPUX_IA64_MODE="32" ;; *ELF-64*) - HPUX_IA64_MODE=64 + HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. + # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - if test yes = "$lt_cv_prog_gnu_ld"; then + if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" @@ -1310,46 +1312,9 @@ rm -rf conftest* ;; -mips64*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - emul=elf - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - emul="${emul}32" - ;; - *64-bit*) - emul="${emul}64" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *MSB*) - emul="${emul}btsmip" - ;; - *LSB*) - emul="${emul}ltsmip" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *N32*) - emul="${emul}n32" - ;; - esac - LD="${LD-ld} -m $emul" - fi - rm -rf conftest* - ;; - x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. Note that the listed cases only cover the - # situations where additional linker options are needed (such as when - # doing 32-bit compilation for a host where ld defaults to 64-bit, or - # vice versa); the common cases where no linker options are needed do - # not appear in the list. + # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in @@ -1368,10 +1333,10 @@ ;; esac ;; - powerpc64le-*linux*) + powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; - powerpc64-*linux*) + powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -1390,10 +1355,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - powerpcle-*linux*) + powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; - powerpc-*linux*) + powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -1411,20 +1376,19 @@ *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS=$CFLAGS + SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) - if test yes != "$lt_cv_cc_needs_belf"; then + if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS=$SAVE_CFLAGS + CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. + # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in @@ -1432,7 +1396,7 @@ case $lt_cv_prog_gnu_ld in yes*) case $host in - i?86-*-solaris*|x86_64-*-solaris*) + i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) @@ -1441,7 +1405,7 @@ esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD=${LD-ld}_sol2 + LD="${LD-ld}_sol2" fi ;; *) @@ -1457,7 +1421,7 @@ ;; esac -need_locks=$enable_libtool_lock +need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK @@ -1476,11 +1440,11 @@ [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) - if test 0 -eq "$ac_status"; then + if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) - if test 0 -ne "$ac_status"; then + if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi @@ -1488,7 +1452,7 @@ ]) ]) -if test no = "$lt_cv_ar_at_file"; then +if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file @@ -1519,7 +1483,7 @@ if test -n "$RANLIB"; then case $host_os in - bitrig* | openbsd*) + openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) @@ -1555,7 +1519,7 @@ [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment + lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -1582,7 +1546,7 @@ $RM conftest* ]) -if test yes = "[$]$2"; then +if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) @@ -1604,7 +1568,7 @@ m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no - save_LDFLAGS=$LDFLAGS + save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -1623,10 +1587,10 @@ fi fi $RM -r conftest* - LDFLAGS=$save_LDFLAGS + LDFLAGS="$save_LDFLAGS" ]) -if test yes = "[$]$2"; then +if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) @@ -1647,7 +1611,7 @@ AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 - teststring=ABCD + teststring="ABCD" case $build_os in msdosdjgpp*) @@ -1687,7 +1651,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1738,22 +1702,22 @@ *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8; do + for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && - test 17 != "$i" # 1/2 MB should be enough + test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring @@ -1769,7 +1733,7 @@ ;; esac ]) -if test -n "$lt_cv_sys_max_cmd_len"; then +if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) @@ -1797,7 +1761,7 @@ # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl -if test yes = "$cross_compiling"; then : +if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -1846,7 +1810,7 @@ /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -1872,7 +1836,7 @@ return status; }] _LT_EOF - if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in @@ -1893,7 +1857,7 @@ # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl -if test yes != "$enable_dlopen"; then +if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown @@ -1903,52 +1867,44 @@ case $host_os in beos*) - lt_cv_dlopen=load_add_on + lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) - lt_cv_dlopen=LoadLibrary + lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) - lt_cv_dlopen=dlopen + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) - # if libdl is installed we need to link against it + # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ - lt_cv_dlopen=dyld + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; - tpf*) - # Don't try to run any link tests for TPF. We know it's impossible - # because TPF is a cross-compiler, and we know how we open DSOs. - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - lt_cv_dlopen_self=no - ;; - *) AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen=shl_load], + [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen=dlopen], + [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) @@ -1957,21 +1913,21 @@ ;; esac - if test no = "$lt_cv_dlopen"; then - enable_dlopen=no - else + if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes + else + enable_dlopen=no fi case $lt_cv_dlopen in dlopen) - save_CPPFLAGS=$CPPFLAGS - test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS=$LDFLAGS + save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS=$LIBS + save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], @@ -1981,7 +1937,7 @@ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) - if test yes = "$lt_cv_dlopen_self"; then + if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl @@ -1991,9 +1947,9 @@ ]) fi - CPPFLAGS=$save_CPPFLAGS - LDFLAGS=$save_LDFLAGS - LIBS=$save_LIBS + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" ;; esac @@ -2085,8 +2041,8 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) -hard_links=nottested -if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes @@ -2096,8 +2052,8 @@ ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) - if test no = "$hard_links"; then - AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else @@ -2124,8 +2080,8 @@ _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", - [Define to the sub-directory where libtool stores uninstalled libraries.]) +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR @@ -2137,15 +2093,15 @@ _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || - test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. - if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one - ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && - test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else @@ -2159,12 +2115,12 @@ fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) -if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || - test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no -elif test yes = "$shlibpath_overrides_runpath" || - test no = "$enable_shared"; then +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi @@ -2188,7 +2144,7 @@ # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) - if test -n "$STRIP"; then + if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) @@ -2219,14 +2175,14 @@ AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ -if test yes = "$GCC"; then +if test "$GCC" = yes; then case $host_os in - darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; - *) lt_awk_arg='/^libraries:/' ;; + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; - *) lt_sed_strip_eq='s|=/|/|g' ;; + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in @@ -2242,35 +2198,28 @@ ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary... + # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= - lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - # ...but if some path component already ends with the multilib dir we assume - # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). - case "$lt_multi_os_dir; $lt_search_path_spec " in - "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) - lt_multi_os_dir= - ;; - esac + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" - elif test -n "$lt_multi_os_dir"; then + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS = " "; FS = "/|\n";} { - lt_foo = ""; - lt_count = 0; +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { - lt_foo = "/" $lt_i lt_foo; + lt_foo="/" $lt_i lt_foo; } else { lt_count--; } @@ -2284,7 +2233,7 @@ # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else @@ -2293,7 +2242,7 @@ library_names_spec= libname_spec='lib$name' soname_spec= -shrext_cmds=.so +shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -2313,11 +2262,11 @@ case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='$libname$release$shared_ext$major' + soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) @@ -2325,40 +2274,40 @@ need_lib_prefix=no need_version=no hardcode_into_libs=yes - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 supports IA64 - library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with - # the line '#! .'. This would cause the generated library to - # depend on '.', always an invalid library. This was fixed in + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' - echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac - # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test yes = "$aix_use_runtimelinking"; then + if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi @@ -2369,18 +2318,18 @@ powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) - library_names_spec='$libname$shared_ext' + library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -2388,8 +2337,8 @@ bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" @@ -2401,7 +2350,7 @@ cygwin* | mingw* | pw32* | cegcc*) version_type=windows - shrext_cmds=.dll + shrext_cmds=".dll" need_version=no need_lib_prefix=no @@ -2410,8 +2359,8 @@ # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ @@ -2427,17 +2376,17 @@ case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix - soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' @@ -2446,8 +2395,8 @@ *,cl*) # Native MSVC libname_spec='$name' - soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' - library_names_spec='$libname.dll.lib' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' case $build_os in mingw*) @@ -2474,7 +2423,7 @@ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) - sys_lib_search_path_spec=$LIB + sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` @@ -2487,8 +2436,8 @@ esac # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' @@ -2501,7 +2450,7 @@ *) # Assume MSVC wrapper - library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac @@ -2514,8 +2463,8 @@ version_type=darwin need_lib_prefix=no need_version=no - library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' - soname_spec='$libname$release$major$shared_ext' + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' @@ -2528,8 +2477,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -2547,12 +2496,12 @@ version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac @@ -2582,10 +2531,10 @@ need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=no + shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -2603,9 +2552,9 @@ dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - if test 32 = "$HPUX_IA64_MODE"; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" @@ -2618,8 +2567,8 @@ dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; @@ -2628,8 +2577,8 @@ dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... @@ -2642,8 +2591,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -2654,7 +2603,7 @@ case $host_os in nonstopux*) version_type=nonstopux ;; *) - if test yes = "$lt_cv_prog_gnu_ld"; then + if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix @@ -2662,8 +2611,8 @@ esac need_lib_prefix=no need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= @@ -2682,8 +2631,8 @@ esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" - sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; @@ -2692,33 +2641,13 @@ dynamic_linker=no ;; -linux*android*) - version_type=none # Android doesn't support versioned libraries. - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext' - soname_spec='$libname$release$shared_ext' - finish_cmds= - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - ;; - # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -2758,17 +2687,29 @@ dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH @@ -2778,7 +2719,7 @@ newsos6) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; @@ -2787,34 +2728,45 @@ version_type=qnx need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; -openbsd* | bitrig*) +openbsd*) version_type=sunos - sys_lib_dlsearch_path_spec=/usr/lib + sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - need_version=no - else - need_version=yes - fi - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi ;; os2*) libname_spec='$name' - shrext_cmds=.dll + shrext_cmds=".dll" need_lib_prefix=no - library_names_spec='$libname$shared_ext $libname.a' + library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; @@ -2823,11 +2775,11 @@ version_type=osf need_lib_prefix=no need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) @@ -2838,8 +2790,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes @@ -2849,11 +2801,11 @@ sunos4*) version_type=sunos - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes - if test yes = "$with_gnu_ld"; then + if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes @@ -2861,8 +2813,8 @@ sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) @@ -2883,10 +2835,10 @@ ;; sysv4*MP*) - if test -d /usr/nec; then + if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' - soname_spec='$libname$shared_ext.$major' + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; @@ -2895,12 +2847,12 @@ version_type=freebsd-elf need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes - if test yes = "$with_gnu_ld"; then + if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' @@ -2918,7 +2870,7 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes @@ -2926,8 +2878,8 @@ uts4*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -2936,18 +2888,18 @@ ;; esac AC_MSG_RESULT([$dynamic_linker]) -test no = "$dynamic_linker" && can_build_shared=no +test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test yes = "$GCC"; then +if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then - sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi -if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then - sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], @@ -2989,32 +2941,32 @@ # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- -# find a file program that can recognize shared library +# find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD=$MAGIC_CMD - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$1"; then - lt_cv_path_MAGIC_CMD=$ac_dir/"$1" + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD=$lt_cv_path_MAGIC_CMD + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -3037,11 +2989,11 @@ break fi done - IFS=$lt_save_ifs - MAGIC_CMD=$lt_save_MAGIC_CMD + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) -MAGIC_CMD=$lt_cv_path_MAGIC_CMD +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else @@ -3059,7 +3011,7 @@ # _LT_PATH_MAGIC # -------------- -# find a file program that can recognize a shared library +# find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then @@ -3086,16 +3038,16 @@ AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test no = "$withval" || with_gnu_ld=yes], + [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld -if test yes = "$GCC"; then +if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) - # gcc leaves a trailing carriage return, which upsets mingw + # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; @@ -3109,7 +3061,7 @@ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done - test -z "$LD" && LD=$ac_prog + test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. @@ -3120,37 +3072,37 @@ with_gnu_ld=unknown ;; esac -elif test yes = "$with_gnu_ld"; then +elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD=$ac_dir/$ac_prog + lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 /dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else @@ -3347,7 +3300,7 @@ lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -3365,8 +3318,8 @@ lt_cv_deplibs_check_method=pass_all ;; -openbsd* | bitrig*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' @@ -3459,33 +3412,33 @@ AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. - lt_cv_path_NM=$NM + lt_cv_path_NM="$NM" else - lt_nm_to_check=${ac_tool_prefix}nm + lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/$lt_tmp_nm - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. - # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" - break 2 + break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" - break 2 + break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but @@ -3496,21 +3449,21 @@ esac fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) -if test no != "$lt_cv_path_NM"; then - NM=$lt_cv_path_NM +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) - DUMPBIN="$DUMPBIN -symbols -headers" + DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: @@ -3518,8 +3471,8 @@ esac fi AC_SUBST([DUMPBIN]) - if test : != "$DUMPBIN"; then - NM=$DUMPBIN + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm @@ -3565,8 +3518,8 @@ case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh; - # decide which one to use based on capabilities of $DLLTOOL + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib @@ -3578,7 +3531,7 @@ ;; *) # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd=$ECHO + lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) @@ -3605,28 +3558,13 @@ lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) -if test yes != "$lt_cv_path_mainfest_tool"; then +if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL -# _LT_DLL_DEF_P([FILE]) -# --------------------- -# True iff FILE is a Windows DLL '.def' file. -# Keep in sync with func_dll_def_p in the libtool script -AC_DEFUN([_LT_DLL_DEF_P], -[dnl - test DEF = "`$SED -n dnl - -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace - -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments - -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl - -e q dnl Only consider the first "real" line - $1`" dnl -])# _LT_DLL_DEF_P - - # LT_LIB_M # -------- # check for math library @@ -3638,11 +3576,11 @@ # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) - AC_CHECK_LIB(m, cos, LIBM=-lm) + AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) @@ -3661,7 +3599,7 @@ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -if test yes = "$GCC"; then +if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; @@ -3713,7 +3651,7 @@ symcode='[[ABCDGISTW]]' ;; hpux*) - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; @@ -3746,44 +3684,14 @@ symcode='[[ABCDGIRSTW]]' ;; esac -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" - # Adjust the below global symbol transforms to fixup imported variables. - lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" - lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" - lt_c_name_lib_hook="\ - -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ - -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" -else - # Disable hooks by default. - lt_cv_sys_global_symbol_to_import= - lt_cdecl_hook= - lt_c_name_hook= - lt_c_name_lib_hook= -fi - # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ -$lt_cdecl_hook\ -" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ -$lt_c_name_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" - -# Transform an extracted symbol line into symbol name with lib prefix and -# symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ -$lt_c_name_lib_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -3801,24 +3709,21 @@ # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function, - # D for any global variable and I for any imported variable. + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ -" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ -" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ -" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ -" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ -" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" @@ -3858,11 +3763,11 @@ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE -/* DATA imports from DLLs on WIN32 can't be const, because runtime +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST -#elif defined __osf__ +#elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else @@ -3888,7 +3793,7 @@ { { "@PROGRAM@", (void *) 0 }, _LT_EOF - $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; @@ -3908,9 +3813,9 @@ mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS - LIBS=conftstm.$ac_objext + LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS @@ -3931,7 +3836,7 @@ rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. - if test yes = "$pipe_works"; then + if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= @@ -3958,16 +3863,12 @@ [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) -_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], - [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) -_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], - [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3983,18 +3884,17 @@ m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. - if test yes = "$GXX"; then + if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) @@ -4005,8 +3905,8 @@ ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -4071,7 +3971,7 @@ case $host_os in aix[[4-9]]*) # All AIX code is PIC. - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else @@ -4112,14 +4012,14 @@ case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' - if test ia64 != "$host_cpu"; then + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default @@ -4156,7 +4056,7 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) - # old Intel C++ for x86_64, which still supported -KPIC. + # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' @@ -4212,7 +4112,7 @@ ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -4301,18 +4201,17 @@ fi ], [ - if test yes = "$GCC"; then + if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) @@ -4323,8 +4222,8 @@ ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -4411,7 +4310,7 @@ case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else @@ -4419,20 +4318,6 @@ fi ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - case $cc_basename in - nagfor*) - # NAG Fortran compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). @@ -4453,7 +4338,7 @@ ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) @@ -4464,7 +4349,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in - # old Intel for x86_64, which still supported -KPIC. + # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4489,12 +4374,6 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -4592,7 +4471,7 @@ ;; sysv4*MP*) - if test -d /usr/nec; then + if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi @@ -4621,7 +4500,7 @@ fi ]) case $host_os in - # For platforms that do not support PIC, -DPIC is meaningless: + # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; @@ -4697,7 +4576,7 @@ fi ;; pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in @@ -4710,6 +4589,9 @@ ;; esac ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -4743,9 +4625,9 @@ # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ' (' and ')$', so one must not match beginning or - # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', - # as well as any symbol that contains 'd'. + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if @@ -4761,7 +4643,7 @@ # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. - if test yes != "$GCC"; then + if test "$GCC" != yes; then with_gnu_ld=no fi ;; @@ -4769,9 +4651,12 @@ # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; - openbsd* | bitrig*) + openbsd*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes @@ -4779,7 +4664,7 @@ # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no - if test yes = "$with_gnu_ld"; then + if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility @@ -4801,24 +4686,24 @@ esac fi - if test yes = "$lt_use_gnu_ld_interface"; then + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='$wl' + wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -4831,7 +4716,7 @@ case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken - if test ia64 != "$host_cpu"; then + if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 @@ -4850,7 +4735,7 @@ case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) @@ -4866,7 +4751,7 @@ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4876,7 +4761,7 @@ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes @@ -4884,61 +4769,61 @@ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no - if test linux-dietlibc = "$host_os"; then + if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test no = "$tmp_diet" + && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -4949,44 +4834,42 @@ lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; - nagfor*) # NAGFOR 5.3 - tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test yes = "$supports_anon_versioning"; then + if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test yes = "$supports_anon_versioning"; then + if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4995,13 +4878,13 @@ fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -5019,8 +4902,8 @@ _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -5032,7 +4915,7 @@ _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify @@ -5047,9 +4930,9 @@ # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -5066,15 +4949,15 @@ *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac - if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= @@ -5090,7 +4973,7 @@ # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes - if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported @@ -5098,12 +4981,12 @@ ;; aix[[4-9]]*) - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag= + no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm @@ -5121,7 +5004,7 @@ # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do - if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi @@ -5144,13 +5027,13 @@ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - if test yes = "$GCC"; then + if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` + collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -5169,61 +5052,62 @@ ;; esac shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag="$shared_flag "'$wl-G' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' fi + _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' else - shared_flag='$wl-bM:SRE' + shared_flag='${wl}-bM:SRE' fi fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes - if test yes = "$aix_use_runtimelinking"; then + if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else - if test ia64 = "$host_cpu"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' - if test yes = "$with_gnu_ld"; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; @@ -5232,7 +5116,7 @@ case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) @@ -5262,17 +5146,16 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll + shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes @@ -5281,18 +5164,18 @@ # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # Assume MSVC wrapper @@ -5301,7 +5184,7 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll + shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. @@ -5351,33 +5234,33 @@ ;; hpux9*) - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) - if test yes,no = "$GCC,$with_gnu_ld"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes @@ -5385,25 +5268,25 @@ ;; hpux11*) - if test yes,no = "$GCC,$with_gnu_ld"; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ @@ -5411,14 +5294,14 @@ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in @@ -5429,7 +5312,7 @@ *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. @@ -5440,16 +5323,16 @@ ;; irix5* | irix6* | nonstopux*) - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], - [save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], @@ -5462,22 +5345,22 @@ end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) - LDFLAGS=$save_LDFLAGS]) - if test yes = "$lt_cv_irix_exported_symbol"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -5491,7 +5374,7 @@ newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; @@ -5499,19 +5382,27 @@ *nto* | *qnx*) ;; - openbsd* | bitrig*) + openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac fi else _LT_TAGVAR(ld_shlibs, $1)=no @@ -5527,28 +5418,28 @@ ;; osf3*) - if test yes = "$GCC"; then - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag - if test yes = "$GCC"; then - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -5559,24 +5450,24 @@ solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' - if test yes = "$GCC"; then - wlarc='$wl' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' - _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) - wlarc='$wl' - _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi @@ -5586,11 +5477,11 @@ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. GCC discards it without '$wl', + # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test yes = "$GCC"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi @@ -5600,10 +5491,10 @@ ;; sunos4*) - if test sequent = "$host_vendor"; then + if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi @@ -5652,43 +5543,43 @@ ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not + # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; @@ -5703,17 +5594,17 @@ ;; esac - if test sni = "$host_vendor"; then + if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) -test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld @@ -5730,7 +5621,7 @@ # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - if test yes,yes = "$GCC,$enable_shared"; then + if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. @@ -5810,12 +5701,12 @@ _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], - [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is - "absolute", i.e impossible to change by setting $shlibpath_var if the + "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR @@ -5856,10 +5747,10 @@ # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to 'libtool'. +# the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl -lt_save_CC=$CC +lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. @@ -5899,18 +5790,18 @@ LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB - # Report what library types will actually be built + # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test no = "$can_build_shared" && enable_shared=no + test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test yes = "$enable_shared" && enable_static=no + test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' @@ -5918,8 +5809,8 @@ ;; aix[[4-9]]*) - if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then - test yes = "$enable_shared" && enable_static=no + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no fi ;; esac @@ -5927,13 +5818,13 @@ AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes + test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP -CC=$lt_save_CC +CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG @@ -5941,14 +5832,14 @@ # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to 'libtool'. +# the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl -if test -n "$CXX" && ( test no != "$CXX" && - ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || - (test g++ != "$CXX"))); then +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes @@ -5990,7 +5881,7 @@ # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_caught_CXX_error"; then +if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" @@ -6032,35 +5923,35 @@ if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately - if test yes = "$GXX"; then + if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi - if test yes = "$GXX"; then + if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. - if test yes = "$with_gnu_ld"; then - _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) - wlarc='$wl' + wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi @@ -6096,12 +5987,12 @@ _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag= + no_entry_flag="" else aix_use_runtimelinking=no @@ -6135,13 +6026,13 @@ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - if test yes = "$GXX"; then + if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` + collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -6159,56 +6050,56 @@ fi esac shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag=$shared_flag' $wl-G' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' else - shared_flag='$wl-bM:SRE' + shared_flag='${wl}-bM:SRE' fi fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes - if test yes = "$aix_use_runtimelinking"; then + if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else - if test ia64 = "$host_cpu"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' - if test yes = "$with_gnu_ld"; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' @@ -6216,7 +6107,7 @@ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; @@ -6226,7 +6117,7 @@ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6254,58 +6145,57 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll + shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6351,14 +6241,14 @@ ;; haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default @@ -6370,7 +6260,7 @@ _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -6379,11 +6269,11 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test yes = "$GXX"; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -6393,15 +6283,15 @@ ;; hpux10*|hpux11*) - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi @@ -6427,13 +6317,13 @@ aCC*) case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists @@ -6444,20 +6334,20 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test yes = "$GXX"; then - if test no = "$with_gnu_ld"; then + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -6472,22 +6362,22 @@ interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -6496,17 +6386,17 @@ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) - if test yes = "$GXX"; then - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; @@ -6519,8 +6409,8 @@ # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -6529,10 +6419,10 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. @@ -6546,59 +6436,59 @@ # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -6612,18 +6502,18 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) @@ -6631,10 +6521,10 @@ *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on @@ -6692,17 +6582,22 @@ _LT_TAGVAR(ld_shlibs, $1)=yes ;; - openbsd* | bitrig*) + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else @@ -6718,9 +6613,9 @@ # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using @@ -6738,17 +6633,17 @@ cxx*) case $host in osf3*) - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ - $RM $lib.exp' + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac @@ -6763,21 +6658,21 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test yes,no = "$GXX,$with_gnu_ld"; then - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists @@ -6823,9 +6718,9 @@ # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -6833,7 +6728,7 @@ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. + # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; @@ -6850,30 +6745,30 @@ ;; gcx*) # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker - if test yes,no = "$GXX,$with_gnu_ld"; then - _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else - # g++ 2.7 appears to require '-G' NOT '-shared' on this + # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -6881,11 +6776,11 @@ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi @@ -6894,52 +6789,52 @@ ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not + # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ - '"$_LT_TAGVAR(old_archive_cmds, $1)" + '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" + '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; @@ -6970,10 +6865,10 @@ esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - _LT_TAGVAR(GCC, $1)=$GXX - _LT_TAGVAR(LD, $1)=$LD + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7000,7 +6895,7 @@ lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test yes != "$_lt_caught_CXX_error" +fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG @@ -7022,9 +6917,9 @@ AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { - case @S|@2 in - .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; - *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF @@ -7112,13 +7007,13 @@ pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case $prev$p in + case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. - if test x-L = "$p" || - test x-R = "$p"; then + if test $p = "-L" || + test $p = "-R"; then prev=$p continue fi @@ -7134,16 +7029,16 @@ case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac - if test no = "$pre_test_object_deps_done"; then - case $prev in + if test "$pre_test_object_deps_done" = no; then + case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being @@ -7151,9 +7046,9 @@ esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)=$prev$p + _LT_TAGVAR(postdeps, $1)="${prev}${p}" else - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= @@ -7168,15 +7063,15 @@ continue fi - if test no = "$pre_test_object_deps_done"; then + if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)=$p + _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then - _LT_TAGVAR(postdep_objects, $1)=$p + _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi @@ -7223,7 +7118,7 @@ ;; esac - if test yes != "$solaris_use_stlport4"; then + if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; @@ -7246,7 +7141,7 @@ # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. - if test yes != "$solaris_use_stlport4"; then + if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; @@ -7260,7 +7155,7 @@ esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) @@ -7280,10 +7175,10 @@ # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. +# to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) -if test -z "$F77" || test no = "$F77"; then +if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi @@ -7320,7 +7215,7 @@ # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_disable_F77"; then +if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t @@ -7342,7 +7237,7 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. - lt_save_CC=$CC + lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} @@ -7356,21 +7251,21 @@ AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test no = "$can_build_shared" && enable_shared=no + test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test yes = "$enable_shared" && enable_static=no + test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) - if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then - test yes = "$enable_shared" && enable_static=no + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no fi ;; esac @@ -7378,11 +7273,11 @@ AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes + test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) - _LT_TAGVAR(GCC, $1)=$G77 - _LT_TAGVAR(LD, $1)=$LD + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7399,9 +7294,9 @@ fi # test -n "$compiler" GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS -fi # test yes != "$_lt_disable_F77" + CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" +fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG @@ -7411,11 +7306,11 @@ # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. +# to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) -if test -z "$FC" || test no = "$FC"; then +if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi @@ -7452,7 +7347,7 @@ # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_disable_FC"; then +if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t @@ -7474,7 +7369,7 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. - lt_save_CC=$CC + lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} @@ -7490,21 +7385,21 @@ AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test no = "$can_build_shared" && enable_shared=no + test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test yes = "$enable_shared" && enable_static=no + test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) - if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then - test yes = "$enable_shared" && enable_static=no + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no fi ;; esac @@ -7512,11 +7407,11 @@ AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes + test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) - _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu - _LT_TAGVAR(LD, $1)=$LD + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7536,7 +7431,7 @@ GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS -fi # test yes != "$_lt_disable_FC" +fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG @@ -7546,7 +7441,7 @@ # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. +# to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE @@ -7580,7 +7475,7 @@ CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)=$LD +_LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. @@ -7617,7 +7512,7 @@ # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. +# to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE @@ -7651,7 +7546,7 @@ CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)=$LD +_LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. @@ -7688,7 +7583,7 @@ # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. +# to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE @@ -7704,7 +7599,7 @@ lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests -lt_simple_link_test_code=$lt_simple_compile_test_code +lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER @@ -7714,7 +7609,7 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC=$CC +lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= @@ -7743,7 +7638,7 @@ [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) - test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) @@ -7854,7 +7749,7 @@ # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f "$lt_ac_sed" && continue + test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in @@ -7871,9 +7766,9 @@ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough - test 10 -lt "$lt_ac_count" && break + test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` - if test "$lt_ac_count" -gt "$lt_ac_max"; then + if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi @@ -7897,7 +7792,27 @@ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], -[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false @@ -7921,9 +7836,102 @@ ])# _LT_CHECK_SHELL_FEATURES +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) + + +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) + + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) + + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) + + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi + +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) + + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) + # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- -# Determine what file name conversion functions should be used by +# Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], diff -Nru cloog-0.18.2/isl/m4/lt~obsolete.m4 cloog-0.18.4/isl/m4/lt~obsolete.m4 --- cloog-0.18.2/isl/m4/lt~obsolete.m4 2013-12-18 12:35:57.000000000 +0000 +++ cloog-0.18.4/isl/m4/lt~obsolete.m4 2014-10-02 14:14:36.000000000 +0000 @@ -1,7 +1,6 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007, 2009, 2011-2013 Free Software -# Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives @@ -12,7 +11,7 @@ # These exist entirely to fool aclocal when bootstrapping libtool. # -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # @@ -26,7 +25,7 @@ # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until diff -Nru cloog-0.18.2/isl/m4/ltoptions.m4 cloog-0.18.4/isl/m4/ltoptions.m4 --- cloog-0.18.2/isl/m4/ltoptions.m4 2013-12-18 12:35:57.000000000 +0000 +++ cloog-0.18.4/isl/m4/ltoptions.m4 2014-10-02 14:14:35.000000000 +0000 @@ -1,14 +1,14 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2013 Free Software -# Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 8 ltoptions.m4 +# serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -29,7 +29,7 @@ [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option '$2'])])[]dnl + [m4_warning([Unknown $1 option `$2'])])[]dnl ]) @@ -75,13 +75,13 @@ dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither - dnl 'shared' nor 'disable-shared' was passed, we enable building of shared + dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) + [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS @@ -112,7 +112,7 @@ [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'dlopen' option into LT_INIT's first parameter.]) +put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -148,7 +148,7 @@ _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'win32-dll' option into LT_INIT's first parameter.]) +put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -157,9 +157,9 @@ # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- -# implement the --enable-shared flag, and supports the 'shared' and -# 'disable-shared' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], @@ -172,14 +172,14 @@ *) enable_shared=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) @@ -211,9 +211,9 @@ # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- -# implement the --enable-static flag, and support the 'static' and -# 'disable-static' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], @@ -226,14 +226,14 @@ *) enable_static=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) @@ -265,9 +265,9 @@ # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- -# implement the --enable-fast-install flag, and support the 'fast-install' -# and 'disable-fast-install' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], @@ -280,14 +280,14 @@ *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) @@ -304,14 +304,14 @@ [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put -the 'fast-install' option into LT_INIT's first parameter.]) +the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put -the 'disable-fast-install' option into LT_INIT's first parameter.]) +the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -321,9 +321,9 @@ # _LT_WITH_PIC([MODE]) # -------------------- -# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' +# implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. -# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], @@ -334,17 +334,19 @@ *) pic_mode=default # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" ;; esac], - [pic_mode=m4_default([$1], [default])]) + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC @@ -357,7 +359,7 @@ [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'pic-only' option into LT_INIT's first parameter.]) +put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: diff -Nru cloog-0.18.2/isl/m4/ltsugar.m4 cloog-0.18.4/isl/m4/ltsugar.m4 --- cloog-0.18.2/isl/m4/ltsugar.m4 2013-12-18 12:35:57.000000000 +0000 +++ cloog-0.18.4/isl/m4/ltsugar.m4 2014-10-02 14:14:35.000000000 +0000 @@ -1,7 +1,6 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007-2008, 2011-2013 Free Software -# Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives @@ -34,7 +33,7 @@ # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support -# Autoconf-2.59, which quotes differently. +# Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], @@ -45,7 +44,7 @@ # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different diff -Nru cloog-0.18.2/isl/m4/ltversion.m4 cloog-0.18.4/isl/m4/ltversion.m4 --- cloog-0.18.2/isl/m4/ltversion.m4 2013-12-18 12:35:57.000000000 +0000 +++ cloog-0.18.4/isl/m4/ltversion.m4 2014-10-02 14:14:36.000000000 +0000 @@ -1,6 +1,6 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +9,15 @@ # @configure_input@ -# serial 4038 ltversion.m4 +# serial 3337 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.2.418]) -m4_define([LT_PACKAGE_REVISION], [2.4.2.418]) +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.2.418' -macro_revision='2.4.2.418' +[macro_version='2.4.2' +macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff -Nru cloog-0.18.2/isl/Makefile.am cloog-0.18.4/isl/Makefile.am --- cloog-0.18.2/isl/Makefile.am 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/Makefile.am 2015-07-24 12:23:09.000000000 +0000 @@ -5,7 +5,7 @@ DIST_SUBDIRS = $(MAYBE_INTERFACE) doc ACLOCAL_AMFLAGS = -I m4 -AUTOMAKE_OPTIONS = nostdinc +AUTOMAKE_OPTIONS = nostdinc subdir-objects lib_LTLIBRARIES = libisl.la noinst_PROGRAMS = isl_test isl_polyhedron_sample isl_pip \ @@ -14,30 +14,47 @@ isl_closure isl_bound isl_codegen TESTS = isl_test codegen_test.sh pip_test.sh bound_test.sh -if HAVE_PIPLIB -ISL_PIPLIB = \ - isl_lp_piplib.c \ - isl_map_piplib.c \ - isl_sample_piplib.c \ - isl_sample_piplib.h \ - isl_piplib.c -else -ISL_PIPLIB = \ - isl_lp_no_piplib.c \ - isl_map_no_piplib.c \ - isl_sample_no_piplib.c +if IMATH_FOR_MP + +MP_SRC = \ + isl_hide_deprecated.h \ + isl_imath.c \ + isl_imath.h \ + isl_int_imath.h \ + isl_val_imath.c \ + imath_wrap/gmp_compat.h \ + imath_wrap/imath.h \ + imath_wrap/imrat.h \ + imath_wrap/wrap.h \ + imath_wrap/gmp_compat.c \ + imath_wrap/imath.c \ + imath_wrap/imrat.c + +DEPRECATED_SRC = +MP_INCLUDE_H = endif +if GMP_FOR_MP if NEED_GET_MEMORY_FUNCTIONS GET_MEMORY_FUNCTIONS=mp_get_memory_functions.c endif -INCLUDES = -I. -I$(srcdir) -I$(srcdir)/include -Iinclude/ +MP_SRC = \ + $(GET_MEMORY_FUNCTIONS) \ + isl_int_gmp.h \ + isl_gmp.c \ + isl_val_gmp.c + +DEPRECATED_SRC = isl_ast_int.c +MP_INCLUDE_H = include/isl/val_gmp.h +endif + +AM_CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)/include -Iinclude/ @MP_CPPFLAGS@ AM_CFLAGS = @WARNING_FLAGS@ libisl_la_SOURCES = \ - $(ISL_PIPLIB) \ - $(GET_MEMORY_FUNCTIONS) \ + $(MP_SRC) \ + $(DEPRECATED_SRC) \ isl_aff.c \ isl_aff_private.h \ isl_affine_hull.c \ @@ -58,6 +75,7 @@ isl_bernstein.c \ isl_bernstein.h \ isl_blk.c \ + isl_blk.h \ isl_bound.c \ isl_bound.h \ isl_coalesce.c \ @@ -67,7 +85,6 @@ isl_ctx.c \ isl_ctx_private.h \ isl_deprecated.c \ - isl_dim.c \ isl_dim_map.h \ isl_dim_map.c \ isl_equalities.c \ @@ -77,22 +94,23 @@ isl_farkas.c \ isl_flow.c \ isl_fold.c \ - isl_gmp.c \ isl_hash.c \ - isl_hmap_map_basic_set.c \ - isl_hmap_map_basic_set.h \ + isl_id_to_ast_expr.c \ + isl_id_to_pw_aff.c \ isl_ilp.c \ + isl_ilp_private.h \ isl_input.c \ isl_int.h \ isl_local_space_private.h \ isl_local_space.c \ isl_lp.c \ - isl_lp_piplib.h \ + isl_lp_private.h \ isl_map.c \ + isl_map_list.c \ isl_map_simplify.c \ isl_map_subtract.c \ isl_map_private.h \ - isl_map_piplib.h \ + isl_map_to_basic_set.c \ isl_mat.c \ isl_mat_private.h \ isl_morph.c \ @@ -103,7 +121,6 @@ isl_options.c \ isl_options_private.h \ isl_output.c \ - isl_piplib.h \ isl_point_private.h \ isl_point.c \ isl_polynomial_private.h \ @@ -120,7 +137,15 @@ isl_scan.c \ isl_scan.h \ isl_schedule.c \ + isl_schedule_band.c \ + isl_schedule_band.h \ + isl_schedule_node.c \ + isl_schedule_node_private.h \ + isl_schedule_read.c \ + isl_schedule_tree.c \ + isl_schedule_tree.h \ isl_schedule_private.h \ + isl_scheduler.c \ isl_set_list.c \ isl_sort.c \ isl_sort.h \ @@ -129,6 +154,7 @@ isl_stream.c \ isl_stream_private.h \ isl_seq.c \ + isl_seq.h \ isl_tab.c \ isl_tab.h \ isl_tab_pip.c \ @@ -138,103 +164,86 @@ isl_union_map.c \ isl_union_map_private.h \ isl_val.c \ - isl_val_gmp.c \ isl_val_private.h \ + isl_vec_private.h \ isl_vec.c \ isl_version.c \ isl_vertices_private.h \ - isl_vertices.c -EXTRA_libisl_la_SOURCES = \ - isl_lp_piplib.c \ - isl_lp_no_piplib.c \ - isl_map_piplib.c \ - isl_map_no_piplib.c \ - isl_sample_no_piplib.c \ - isl_sample_piplib.c \ - isl_sample_piplib.h \ - isl_piplib.c -libisl_la_LIBADD = @PIPLIB_LIBS@ @GMP_LIBS@ + isl_vertices.c \ + isl_yaml.h +libisl_la_LIBADD = @MP_LIBS@ libisl_la_LDFLAGS = -version-info @versioninfo@ \ - @PIPLIB_LDFLAGS@ @GMP_LDFLAGS@ -libisl_la_CPPFLAGS = $(INCLUDES) @PIPLIB_CPPFLAGS@ @GMP_CPPFLAGS@ + @MP_LDFLAGS@ -isl_test_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ -isl_test_LDFLAGS = @GMP_LDFLAGS@ -isl_test_LDADD = libisl.la @GMP_LIBS@ +isl_test_LDFLAGS = @MP_LDFLAGS@ +isl_test_LDADD = libisl.la @MP_LIBS@ -isl_polyhedron_sample_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ isl_polyhedron_sample_LDADD = libisl.la isl_polyhedron_sample_SOURCES = \ polyhedron_sample.c -isl_pip_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ -isl_pip_LDFLAGS = @GMP_LDFLAGS@ -isl_pip_LDADD = libisl.la @GMP_LIBS@ +isl_pip_LDFLAGS = @MP_LDFLAGS@ +isl_pip_LDADD = libisl.la @MP_LIBS@ isl_pip_SOURCES = \ pip.c -isl_codegen_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ -isl_codegen_LDFLAGS = @GMP_LDFLAGS@ -isl_codegen_LDADD = libisl.la @GMP_LIBS@ +isl_codegen_LDFLAGS = @MP_LDFLAGS@ +isl_codegen_LDADD = libisl.la @MP_LIBS@ isl_codegen_SOURCES = \ codegen.c -isl_bound_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ -isl_bound_LDFLAGS = @GMP_LDFLAGS@ -isl_bound_LDADD = libisl.la @GMP_LIBS@ +isl_bound_LDFLAGS = @MP_LDFLAGS@ +isl_bound_LDADD = libisl.la @MP_LIBS@ isl_bound_SOURCES = \ bound.c -isl_polyhedron_minimize_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ -isl_polyhedron_minimize_LDFLAGS = @GMP_LDFLAGS@ -isl_polyhedron_minimize_LDADD = libisl.la @GMP_LIBS@ +isl_polyhedron_minimize_LDFLAGS = @MP_LDFLAGS@ +isl_polyhedron_minimize_LDADD = libisl.la @MP_LIBS@ isl_polyhedron_minimize_SOURCES = \ polyhedron_minimize.c -isl_polytope_scan_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ isl_polytope_scan_LDADD = libisl.la isl_polytope_scan_SOURCES = \ polytope_scan.c -isl_polyhedron_detect_equalities_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ isl_polyhedron_detect_equalities_LDADD = libisl.la isl_polyhedron_detect_equalities_SOURCES = \ polyhedron_detect_equalities.c -isl_cat_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ isl_cat_LDADD = libisl.la isl_cat_SOURCES = \ cat.c -isl_closure_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ isl_closure_LDADD = libisl.la isl_closure_SOURCES = \ closure.c nodist_pkginclude_HEADERS = \ - include/isl/config.h \ include/isl/stdint.h pkginclude_HEADERS = \ + $(MP_INCLUDE_H) \ include/isl/aff.h \ include/isl/aff_type.h \ include/isl/arg.h \ include/isl/ast.h \ + include/isl/ast_type.h \ include/isl/ast_build.h \ include/isl/band.h \ - include/isl/blk.h \ include/isl/constraint.h \ include/isl/ctx.h \ - include/isl/dim.h \ include/isl/flow.h \ include/isl/id.h \ + include/isl/id_to_ast_expr.h \ + include/isl/id_to_pw_aff.h \ include/isl/ilp.h \ - include/isl/int.h \ include/isl/hash.h \ + include/isl/hmap.h \ include/isl/list.h \ include/isl/local_space.h \ include/isl/lp.h \ include/isl/mat.h \ include/isl/map.h \ + include/isl/map_to_basic_set.h \ include/isl/map_type.h \ include/isl/multi.h \ include/isl/obj.h \ @@ -244,7 +253,8 @@ include/isl/polynomial_type.h \ include/isl/printer.h \ include/isl/schedule.h \ - include/isl/seq.h \ + include/isl/schedule_node.h \ + include/isl/schedule_type.h \ include/isl/set.h \ include/isl/set_type.h \ include/isl/space.h \ @@ -254,26 +264,48 @@ include/isl/union_set.h \ include/isl/union_set_type.h \ include/isl/val.h \ - include/isl/val_gmp.h \ - include/isl/val_int.h \ include/isl/vec.h \ include/isl/version.h \ include/isl/vertices.h +deprecateddir = $(pkgincludedir)/deprecated +deprecated_HEADERS = \ + include/isl/deprecated/int.h \ + include/isl/deprecated/aff_int.h \ + include/isl/deprecated/ast_int.h \ + include/isl/deprecated/constraint_int.h \ + include/isl/deprecated/ilp_int.h \ + include/isl/deprecated/map_int.h \ + include/isl/deprecated/mat_int.h \ + include/isl/deprecated/point_int.h \ + include/isl/deprecated/polynomial_int.h \ + include/isl/deprecated/set_int.h \ + include/isl/deprecated/union_map_int.h \ + include/isl/deprecated/val_int.h \ + include/isl/deprecated/vec_int.h EXTRA_DIST = \ LICENSE \ isl_config_post.h \ basis_reduction_templ.c \ + isl_hmap_templ.c \ isl_list_templ.c \ isl_list_templ.h \ isl_map_lexopt_templ.c \ + isl_multi_macro.h \ isl_multi_templ.c \ isl_multi_templ.h \ + isl_multi_apply_templ.c \ + isl_multi_apply_set.c \ + isl_multi_apply_union_set.c \ + isl_multi_floor.c \ + isl_multi_gist.c \ + isl_multi_intersect.c \ print_templ.c \ isl_power_templ.c \ isl_pw_templ.c \ isl_union_templ.c \ isl.py \ + doc/CodingStyle \ doc/SubmittingPatches \ doc/chicago.bst \ doc/chicago.sty \ @@ -282,6 +314,12 @@ doc/mypod2latex \ doc/manual.tex \ doc/user.pod \ + imath/gmp_compat.c \ + imath/gmp_compat.h \ + imath/imath.c \ + imath/imath.h \ + imath/imrat.c \ + imath/imrat.h \ interface/all.h \ interface/isl.py.top \ test_inputs diff -Nru cloog-0.18.2/isl/Makefile.in cloog-0.18.4/isl/Makefile.in --- cloog-0.18.2/isl/Makefile.in 2013-12-18 12:36:00.000000000 +0000 +++ cloog-0.18.4/isl/Makefile.in 2015-07-24 12:29:27.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -19,6 +18,51 @@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -44,13 +88,13 @@ isl_closure$(EXEEXT) isl_bound$(EXEEXT) isl_codegen$(EXEEXT) TESTS = isl_test$(EXEEXT) codegen_test.sh pip_test.sh bound_test.sh subdir = . -DIST_COMMON = README $(am__configure_deps) $(pkginclude_HEADERS) \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/bound_test.sh.in $(srcdir)/codegen_test.sh.in \ - $(srcdir)/isl_config.h.in $(srcdir)/pip_test.sh.in \ - $(top_srcdir)/configure $(top_srcdir)/include/isl/config.h.in \ - AUTHORS ChangeLog config.guess config.sub depcomp install-sh \ - ltmain.sh missing +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/isl_config.h.in $(srcdir)/bound_test.sh.in \ + $(srcdir)/codegen_test.sh.in $(srcdir)/pip_test.sh.in depcomp \ + $(deprecated_HEADERS) $(am__pkginclude_HEADERS_DIST) \ + test-driver AUTHORS ChangeLog README compile config.guess \ + config.sub install-sh missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c___attribute__.m4 \ $(top_srcdir)/m4/ax_cc_maxopt.m4 \ @@ -59,6 +103,8 @@ $(top_srcdir)/m4/ax_create_pkgconfig_info.m4 \ $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/ax_detect_git_head.m4 \ + $(top_srcdir)/m4/ax_detect_gmp.m4 \ + $(top_srcdir)/m4/ax_detect_imath.m4 \ $(top_srcdir)/m4/ax_gcc_archflag.m4 \ $(top_srcdir)/m4/ax_gcc_warn_unused_result.m4 \ $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ @@ -72,7 +118,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = isl_config.h $(top_builddir)/include/isl/config.h +CONFIG_HEADER = isl_config.h CONFIG_CLEAN_FILES = bound_test.sh codegen_test.sh pip_test.sh CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -103,123 +149,118 @@ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ - "$(DESTDIR)$(pkgincludedir)" "$(DESTDIR)$(pkgincludedir)" + "$(DESTDIR)$(deprecateddir)" "$(DESTDIR)$(pkgincludedir)" \ + "$(DESTDIR)$(pkgincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libisl_la_DEPENDENCIES = -am__libisl_la_SOURCES_DIST = isl_lp_no_piplib.c isl_map_no_piplib.c \ - isl_sample_no_piplib.c isl_lp_piplib.c isl_map_piplib.c \ - isl_sample_piplib.c isl_sample_piplib.h isl_piplib.c \ - mp_get_memory_functions.c isl_aff.c isl_aff_private.h \ +am__libisl_la_SOURCES_DIST = mp_get_memory_functions.c isl_int_gmp.h \ + isl_gmp.c isl_val_gmp.c isl_hide_deprecated.h isl_imath.c \ + isl_imath.h isl_int_imath.h isl_val_imath.c \ + imath_wrap/gmp_compat.h imath_wrap/imath.h imath_wrap/imrat.h \ + imath_wrap/wrap.h imath_wrap/gmp_compat.c imath_wrap/imath.c \ + imath_wrap/imrat.c isl_ast_int.c isl_aff.c isl_aff_private.h \ isl_affine_hull.c isl_arg.c isl_ast.c isl_ast_private.h \ isl_ast_build.c isl_ast_build_private.h isl_ast_build_expr.c \ isl_ast_build_expr.h isl_ast_codegen.c isl_ast_graft.c \ isl_ast_graft_private.h isl_band.c isl_band_private.h \ isl_basis_reduction.h basis_reduction_tab.c isl_bernstein.c \ - isl_bernstein.h isl_blk.c isl_bound.c isl_bound.h \ + isl_bernstein.h isl_blk.c isl_blk.h isl_bound.c isl_bound.h \ isl_coalesce.c isl_constraint.c isl_constraint_private.h \ isl_convex_hull.c isl_ctx.c isl_ctx_private.h isl_deprecated.c \ - isl_dim.c isl_dim_map.h isl_dim_map.c isl_equalities.c \ - isl_equalities.h isl_factorization.c isl_factorization.h \ - isl_farkas.c isl_flow.c isl_fold.c isl_gmp.c isl_hash.c \ - isl_hmap_map_basic_set.c isl_hmap_map_basic_set.h isl_ilp.c \ - isl_input.c isl_int.h isl_local_space_private.h \ - isl_local_space.c isl_lp.c isl_lp_piplib.h isl_map.c \ - isl_map_simplify.c isl_map_subtract.c isl_map_private.h \ - isl_map_piplib.h isl_mat.c isl_mat_private.h isl_morph.c \ - isl_morph.h isl_id.c isl_id_private.h isl_obj.c isl_options.c \ - isl_options_private.h isl_output.c isl_piplib.h \ - isl_point_private.h isl_point.c isl_polynomial_private.h \ - isl_polynomial.c isl_printer_private.h isl_printer.c print.c \ - isl_range.c isl_range.h isl_reordering.c isl_reordering.h \ - isl_sample.h isl_sample.c isl_scan.c isl_scan.h isl_schedule.c \ - isl_schedule_private.h isl_set_list.c isl_sort.c isl_sort.h \ + isl_dim_map.h isl_dim_map.c isl_equalities.c isl_equalities.h \ + isl_factorization.c isl_factorization.h isl_farkas.c \ + isl_flow.c isl_fold.c isl_hash.c isl_id_to_ast_expr.c \ + isl_id_to_pw_aff.c isl_ilp.c isl_ilp_private.h isl_input.c \ + isl_int.h isl_local_space_private.h isl_local_space.c isl_lp.c \ + isl_lp_private.h isl_map.c isl_map_list.c isl_map_simplify.c \ + isl_map_subtract.c isl_map_private.h isl_map_to_basic_set.c \ + isl_mat.c isl_mat_private.h isl_morph.c isl_morph.h isl_id.c \ + isl_id_private.h isl_obj.c isl_options.c isl_options_private.h \ + isl_output.c isl_point_private.h isl_point.c \ + isl_polynomial_private.h isl_polynomial.c \ + isl_printer_private.h isl_printer.c print.c isl_range.c \ + isl_range.h isl_reordering.c isl_reordering.h isl_sample.h \ + isl_sample.c isl_scan.c isl_scan.h isl_schedule.c \ + isl_schedule_band.c isl_schedule_band.h isl_schedule_node.c \ + isl_schedule_node_private.h isl_schedule_read.c \ + isl_schedule_tree.c isl_schedule_tree.h isl_schedule_private.h \ + isl_scheduler.c isl_set_list.c isl_sort.c isl_sort.h \ isl_space.c isl_space_private.h isl_stream.c \ - isl_stream_private.h isl_seq.c isl_tab.c isl_tab.h \ + isl_stream_private.h isl_seq.c isl_seq.h isl_tab.c isl_tab.h \ isl_tab_pip.c isl_tarjan.c isl_tarjan.h \ isl_transitive_closure.c isl_union_map.c \ - isl_union_map_private.h isl_val.c isl_val_gmp.c \ - isl_val_private.h isl_vec.c isl_version.c \ - isl_vertices_private.h isl_vertices.c -@HAVE_PIPLIB_FALSE@am__objects_1 = libisl_la-isl_lp_no_piplib.lo \ -@HAVE_PIPLIB_FALSE@ libisl_la-isl_map_no_piplib.lo \ -@HAVE_PIPLIB_FALSE@ libisl_la-isl_sample_no_piplib.lo -@HAVE_PIPLIB_TRUE@am__objects_1 = libisl_la-isl_lp_piplib.lo \ -@HAVE_PIPLIB_TRUE@ libisl_la-isl_map_piplib.lo \ -@HAVE_PIPLIB_TRUE@ libisl_la-isl_sample_piplib.lo \ -@HAVE_PIPLIB_TRUE@ libisl_la-isl_piplib.lo -@NEED_GET_MEMORY_FUNCTIONS_TRUE@am__objects_2 = libisl_la-mp_get_memory_functions.lo -am_libisl_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ - libisl_la-isl_aff.lo libisl_la-isl_affine_hull.lo \ - libisl_la-isl_arg.lo libisl_la-isl_ast.lo \ - libisl_la-isl_ast_build.lo libisl_la-isl_ast_build_expr.lo \ - libisl_la-isl_ast_codegen.lo libisl_la-isl_ast_graft.lo \ - libisl_la-isl_band.lo libisl_la-basis_reduction_tab.lo \ - libisl_la-isl_bernstein.lo libisl_la-isl_blk.lo \ - libisl_la-isl_bound.lo libisl_la-isl_coalesce.lo \ - libisl_la-isl_constraint.lo libisl_la-isl_convex_hull.lo \ - libisl_la-isl_ctx.lo libisl_la-isl_deprecated.lo \ - libisl_la-isl_dim.lo libisl_la-isl_dim_map.lo \ - libisl_la-isl_equalities.lo libisl_la-isl_factorization.lo \ - libisl_la-isl_farkas.lo libisl_la-isl_flow.lo \ - libisl_la-isl_fold.lo libisl_la-isl_gmp.lo \ - libisl_la-isl_hash.lo libisl_la-isl_hmap_map_basic_set.lo \ - libisl_la-isl_ilp.lo libisl_la-isl_input.lo \ - libisl_la-isl_local_space.lo libisl_la-isl_lp.lo \ - libisl_la-isl_map.lo libisl_la-isl_map_simplify.lo \ - libisl_la-isl_map_subtract.lo libisl_la-isl_mat.lo \ - libisl_la-isl_morph.lo libisl_la-isl_id.lo \ - libisl_la-isl_obj.lo libisl_la-isl_options.lo \ - libisl_la-isl_output.lo libisl_la-isl_point.lo \ - libisl_la-isl_polynomial.lo libisl_la-isl_printer.lo \ - libisl_la-print.lo libisl_la-isl_range.lo \ - libisl_la-isl_reordering.lo libisl_la-isl_sample.lo \ - libisl_la-isl_scan.lo libisl_la-isl_schedule.lo \ - libisl_la-isl_set_list.lo libisl_la-isl_sort.lo \ - libisl_la-isl_space.lo libisl_la-isl_stream.lo \ - libisl_la-isl_seq.lo libisl_la-isl_tab.lo \ - libisl_la-isl_tab_pip.lo libisl_la-isl_tarjan.lo \ - libisl_la-isl_transitive_closure.lo libisl_la-isl_union_map.lo \ - libisl_la-isl_val.lo libisl_la-isl_val_gmp.lo \ - libisl_la-isl_vec.lo libisl_la-isl_version.lo \ - libisl_la-isl_vertices.lo + isl_union_map_private.h isl_val.c isl_val_private.h \ + isl_vec_private.h isl_vec.c isl_version.c \ + isl_vertices_private.h isl_vertices.c isl_yaml.h +@GMP_FOR_MP_TRUE@@NEED_GET_MEMORY_FUNCTIONS_TRUE@am__objects_1 = mp_get_memory_functions.lo +am__dirstamp = $(am__leading_dot)dirstamp +@GMP_FOR_MP_FALSE@@IMATH_FOR_MP_TRUE@am__objects_2 = isl_imath.lo \ +@GMP_FOR_MP_FALSE@@IMATH_FOR_MP_TRUE@ isl_val_imath.lo \ +@GMP_FOR_MP_FALSE@@IMATH_FOR_MP_TRUE@ imath_wrap/gmp_compat.lo \ +@GMP_FOR_MP_FALSE@@IMATH_FOR_MP_TRUE@ imath_wrap/imath.lo \ +@GMP_FOR_MP_FALSE@@IMATH_FOR_MP_TRUE@ imath_wrap/imrat.lo +@GMP_FOR_MP_TRUE@am__objects_2 = $(am__objects_1) isl_gmp.lo \ +@GMP_FOR_MP_TRUE@ isl_val_gmp.lo +@GMP_FOR_MP_TRUE@am__objects_3 = isl_ast_int.lo +am_libisl_la_OBJECTS = $(am__objects_2) $(am__objects_3) isl_aff.lo \ + isl_affine_hull.lo isl_arg.lo isl_ast.lo isl_ast_build.lo \ + isl_ast_build_expr.lo isl_ast_codegen.lo isl_ast_graft.lo \ + isl_band.lo basis_reduction_tab.lo isl_bernstein.lo isl_blk.lo \ + isl_bound.lo isl_coalesce.lo isl_constraint.lo \ + isl_convex_hull.lo isl_ctx.lo isl_deprecated.lo isl_dim_map.lo \ + isl_equalities.lo isl_factorization.lo isl_farkas.lo \ + isl_flow.lo isl_fold.lo isl_hash.lo isl_id_to_ast_expr.lo \ + isl_id_to_pw_aff.lo isl_ilp.lo isl_input.lo isl_local_space.lo \ + isl_lp.lo isl_map.lo isl_map_list.lo isl_map_simplify.lo \ + isl_map_subtract.lo isl_map_to_basic_set.lo isl_mat.lo \ + isl_morph.lo isl_id.lo isl_obj.lo isl_options.lo isl_output.lo \ + isl_point.lo isl_polynomial.lo isl_printer.lo print.lo \ + isl_range.lo isl_reordering.lo isl_sample.lo isl_scan.lo \ + isl_schedule.lo isl_schedule_band.lo isl_schedule_node.lo \ + isl_schedule_read.lo isl_schedule_tree.lo isl_scheduler.lo \ + isl_set_list.lo isl_sort.lo isl_space.lo isl_stream.lo \ + isl_seq.lo isl_tab.lo isl_tab_pip.lo isl_tarjan.lo \ + isl_transitive_closure.lo isl_union_map.lo isl_val.lo \ + isl_vec.lo isl_version.lo isl_vertices.lo libisl_la_OBJECTS = $(am_libisl_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = libisl_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libisl_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(noinst_PROGRAMS) -am_isl_bound_OBJECTS = isl_bound-bound.$(OBJEXT) +am_isl_bound_OBJECTS = bound.$(OBJEXT) isl_bound_OBJECTS = $(am_isl_bound_OBJECTS) isl_bound_DEPENDENCIES = libisl.la isl_bound_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(isl_bound_LDFLAGS) $(LDFLAGS) -o $@ -am_isl_cat_OBJECTS = isl_cat-cat.$(OBJEXT) +am_isl_cat_OBJECTS = cat.$(OBJEXT) isl_cat_OBJECTS = $(am_isl_cat_OBJECTS) isl_cat_DEPENDENCIES = libisl.la -am_isl_closure_OBJECTS = isl_closure-closure.$(OBJEXT) +am_isl_closure_OBJECTS = closure.$(OBJEXT) isl_closure_OBJECTS = $(am_isl_closure_OBJECTS) isl_closure_DEPENDENCIES = libisl.la -am_isl_codegen_OBJECTS = isl_codegen-codegen.$(OBJEXT) +am_isl_codegen_OBJECTS = codegen.$(OBJEXT) isl_codegen_OBJECTS = $(am_isl_codegen_OBJECTS) isl_codegen_DEPENDENCIES = libisl.la isl_codegen_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(isl_codegen_LDFLAGS) $(LDFLAGS) -o $@ -am_isl_pip_OBJECTS = isl_pip-pip.$(OBJEXT) +am_isl_pip_OBJECTS = pip.$(OBJEXT) isl_pip_OBJECTS = $(am_isl_pip_OBJECTS) isl_pip_DEPENDENCIES = libisl.la isl_pip_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(isl_pip_LDFLAGS) $(LDFLAGS) -o $@ -am_isl_polyhedron_detect_equalities_OBJECTS = isl_polyhedron_detect_equalities-polyhedron_detect_equalities.$(OBJEXT) +am_isl_polyhedron_detect_equalities_OBJECTS = \ + polyhedron_detect_equalities.$(OBJEXT) isl_polyhedron_detect_equalities_OBJECTS = \ $(am_isl_polyhedron_detect_equalities_OBJECTS) isl_polyhedron_detect_equalities_DEPENDENCIES = libisl.la -am_isl_polyhedron_minimize_OBJECTS = \ - isl_polyhedron_minimize-polyhedron_minimize.$(OBJEXT) +am_isl_polyhedron_minimize_OBJECTS = polyhedron_minimize.$(OBJEXT) isl_polyhedron_minimize_OBJECTS = \ $(am_isl_polyhedron_minimize_OBJECTS) isl_polyhedron_minimize_DEPENDENCIES = libisl.la @@ -227,20 +268,30 @@ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(isl_polyhedron_minimize_LDFLAGS) \ $(LDFLAGS) -o $@ -am_isl_polyhedron_sample_OBJECTS = \ - isl_polyhedron_sample-polyhedron_sample.$(OBJEXT) +am_isl_polyhedron_sample_OBJECTS = polyhedron_sample.$(OBJEXT) isl_polyhedron_sample_OBJECTS = $(am_isl_polyhedron_sample_OBJECTS) isl_polyhedron_sample_DEPENDENCIES = libisl.la -am_isl_polytope_scan_OBJECTS = \ - isl_polytope_scan-polytope_scan.$(OBJEXT) +am_isl_polytope_scan_OBJECTS = polytope_scan.$(OBJEXT) isl_polytope_scan_OBJECTS = $(am_isl_polytope_scan_OBJECTS) isl_polytope_scan_DEPENDENCIES = libisl.la isl_test_SOURCES = isl_test.c -isl_test_OBJECTS = isl_test-isl_test.$(OBJEXT) +isl_test_OBJECTS = isl_test.$(OBJEXT) isl_test_DEPENDENCIES = libisl.la isl_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(isl_test_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -253,53 +304,270 @@ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(libisl_la_SOURCES) $(EXTRA_libisl_la_SOURCES) \ - $(isl_bound_SOURCES) $(isl_cat_SOURCES) $(isl_closure_SOURCES) \ - $(isl_codegen_SOURCES) $(isl_pip_SOURCES) \ - $(isl_polyhedron_detect_equalities_SOURCES) \ +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libisl_la_SOURCES) $(isl_bound_SOURCES) $(isl_cat_SOURCES) \ + $(isl_closure_SOURCES) $(isl_codegen_SOURCES) \ + $(isl_pip_SOURCES) $(isl_polyhedron_detect_equalities_SOURCES) \ $(isl_polyhedron_minimize_SOURCES) \ $(isl_polyhedron_sample_SOURCES) $(isl_polytope_scan_SOURCES) \ isl_test.c -DIST_SOURCES = $(am__libisl_la_SOURCES_DIST) \ - $(EXTRA_libisl_la_SOURCES) $(isl_bound_SOURCES) \ +DIST_SOURCES = $(am__libisl_la_SOURCES_DIST) $(isl_bound_SOURCES) \ $(isl_cat_SOURCES) $(isl_closure_SOURCES) \ $(isl_codegen_SOURCES) $(isl_pip_SOURCES) \ $(isl_polyhedron_detect_equalities_SOURCES) \ $(isl_polyhedron_minimize_SOURCES) \ $(isl_polyhedron_sample_SOURCES) $(isl_polytope_scan_SOURCES) \ isl_test.c -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac DATA = $(pkgconfig_DATA) -HEADERS = $(nodist_pkginclude_HEADERS) $(pkginclude_HEADERS) +am__pkginclude_HEADERS_DIST = include/isl/val_gmp.h include/isl/aff.h \ + include/isl/aff_type.h include/isl/arg.h include/isl/ast.h \ + include/isl/ast_type.h include/isl/ast_build.h \ + include/isl/band.h include/isl/constraint.h include/isl/ctx.h \ + include/isl/flow.h include/isl/id.h \ + include/isl/id_to_ast_expr.h include/isl/id_to_pw_aff.h \ + include/isl/ilp.h include/isl/hash.h include/isl/hmap.h \ + include/isl/list.h include/isl/local_space.h include/isl/lp.h \ + include/isl/mat.h include/isl/map.h \ + include/isl/map_to_basic_set.h include/isl/map_type.h \ + include/isl/multi.h include/isl/obj.h include/isl/options.h \ + include/isl/point.h include/isl/polynomial.h \ + include/isl/polynomial_type.h include/isl/printer.h \ + include/isl/schedule.h include/isl/schedule_node.h \ + include/isl/schedule_type.h include/isl/set.h \ + include/isl/set_type.h include/isl/space.h \ + include/isl/stream.h include/isl/union_map.h \ + include/isl/union_map_type.h include/isl/union_set.h \ + include/isl/union_set_type.h include/isl/val.h \ + include/isl/vec.h include/isl/version.h include/isl/vertices.h +HEADERS = $(deprecated_HEADERS) $(nodist_pkginclude_HEADERS) \ + $(pkginclude_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir dist dist-all distcheck +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope check recheck distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)isl_config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags -am__tty_colors = \ -red=; grn=; lgn=; blu=; std= +CSCOPE = cscope +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -309,6 +577,7 @@ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi +am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ @@ -336,6 +605,7 @@ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best +DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -375,9 +645,6 @@ GIT_HEAD = @GIT_HEAD@ GIT_HEAD_ID = @GIT_HEAD_ID@ GIT_HEAD_VERSION = @GIT_HEAD_VERSION@ -GMP_CPPFLAGS = @GMP_CPPFLAGS@ -GMP_LDFLAGS = @GMP_LDFLAGS@ -GMP_LIBS = @GMP_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -396,6 +663,9 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ +MP_CPPFLAGS = @MP_CPPFLAGS@ +MP_LDFLAGS = @MP_LDFLAGS@ +MP_LIBS = @MP_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -412,9 +682,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PDFLATEX = @PDFLATEX@ PERL = @PERL@ -PIPLIB_CPPFLAGS = @PIPLIB_CPPFLAGS@ -PIPLIB_LDFLAGS = @PIPLIB_LDFLAGS@ -PIPLIB_LIBS = @PIPLIB_LIBS@ POD2HTML = @POD2HTML@ PRTDIAG = @PRTDIAG@ RANLIB = @RANLIB@ @@ -485,26 +752,38 @@ SUBDIRS = . $(MAYBE_INTERFACE) doc DIST_SUBDIRS = $(MAYBE_INTERFACE) doc ACLOCAL_AMFLAGS = -I m4 -AUTOMAKE_OPTIONS = nostdinc +AUTOMAKE_OPTIONS = nostdinc subdir-objects lib_LTLIBRARIES = libisl.la -@HAVE_PIPLIB_FALSE@ISL_PIPLIB = \ -@HAVE_PIPLIB_FALSE@ isl_lp_no_piplib.c \ -@HAVE_PIPLIB_FALSE@ isl_map_no_piplib.c \ -@HAVE_PIPLIB_FALSE@ isl_sample_no_piplib.c - -@HAVE_PIPLIB_TRUE@ISL_PIPLIB = \ -@HAVE_PIPLIB_TRUE@ isl_lp_piplib.c \ -@HAVE_PIPLIB_TRUE@ isl_map_piplib.c \ -@HAVE_PIPLIB_TRUE@ isl_sample_piplib.c \ -@HAVE_PIPLIB_TRUE@ isl_sample_piplib.h \ -@HAVE_PIPLIB_TRUE@ isl_piplib.c - -@NEED_GET_MEMORY_FUNCTIONS_TRUE@GET_MEMORY_FUNCTIONS = mp_get_memory_functions.c -INCLUDES = -I. -I$(srcdir) -I$(srcdir)/include -Iinclude/ +@GMP_FOR_MP_TRUE@MP_SRC = \ +@GMP_FOR_MP_TRUE@ $(GET_MEMORY_FUNCTIONS) \ +@GMP_FOR_MP_TRUE@ isl_int_gmp.h \ +@GMP_FOR_MP_TRUE@ isl_gmp.c \ +@GMP_FOR_MP_TRUE@ isl_val_gmp.c + +@IMATH_FOR_MP_TRUE@MP_SRC = \ +@IMATH_FOR_MP_TRUE@ isl_hide_deprecated.h \ +@IMATH_FOR_MP_TRUE@ isl_imath.c \ +@IMATH_FOR_MP_TRUE@ isl_imath.h \ +@IMATH_FOR_MP_TRUE@ isl_int_imath.h \ +@IMATH_FOR_MP_TRUE@ isl_val_imath.c \ +@IMATH_FOR_MP_TRUE@ imath_wrap/gmp_compat.h \ +@IMATH_FOR_MP_TRUE@ imath_wrap/imath.h \ +@IMATH_FOR_MP_TRUE@ imath_wrap/imrat.h \ +@IMATH_FOR_MP_TRUE@ imath_wrap/wrap.h \ +@IMATH_FOR_MP_TRUE@ imath_wrap/gmp_compat.c \ +@IMATH_FOR_MP_TRUE@ imath_wrap/imath.c \ +@IMATH_FOR_MP_TRUE@ imath_wrap/imrat.c + +@GMP_FOR_MP_TRUE@DEPRECATED_SRC = isl_ast_int.c +@IMATH_FOR_MP_TRUE@DEPRECATED_SRC = +@GMP_FOR_MP_TRUE@MP_INCLUDE_H = include/isl/val_gmp.h +@IMATH_FOR_MP_TRUE@MP_INCLUDE_H = +@GMP_FOR_MP_TRUE@@NEED_GET_MEMORY_FUNCTIONS_TRUE@GET_MEMORY_FUNCTIONS = mp_get_memory_functions.c +AM_CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)/include -Iinclude/ @MP_CPPFLAGS@ AM_CFLAGS = @WARNING_FLAGS@ libisl_la_SOURCES = \ - $(ISL_PIPLIB) \ - $(GET_MEMORY_FUNCTIONS) \ + $(MP_SRC) \ + $(DEPRECATED_SRC) \ isl_aff.c \ isl_aff_private.h \ isl_affine_hull.c \ @@ -525,6 +804,7 @@ isl_bernstein.c \ isl_bernstein.h \ isl_blk.c \ + isl_blk.h \ isl_bound.c \ isl_bound.h \ isl_coalesce.c \ @@ -534,7 +814,6 @@ isl_ctx.c \ isl_ctx_private.h \ isl_deprecated.c \ - isl_dim.c \ isl_dim_map.h \ isl_dim_map.c \ isl_equalities.c \ @@ -544,22 +823,23 @@ isl_farkas.c \ isl_flow.c \ isl_fold.c \ - isl_gmp.c \ isl_hash.c \ - isl_hmap_map_basic_set.c \ - isl_hmap_map_basic_set.h \ + isl_id_to_ast_expr.c \ + isl_id_to_pw_aff.c \ isl_ilp.c \ + isl_ilp_private.h \ isl_input.c \ isl_int.h \ isl_local_space_private.h \ isl_local_space.c \ isl_lp.c \ - isl_lp_piplib.h \ + isl_lp_private.h \ isl_map.c \ + isl_map_list.c \ isl_map_simplify.c \ isl_map_subtract.c \ isl_map_private.h \ - isl_map_piplib.h \ + isl_map_to_basic_set.c \ isl_mat.c \ isl_mat_private.h \ isl_morph.c \ @@ -570,7 +850,6 @@ isl_options.c \ isl_options_private.h \ isl_output.c \ - isl_piplib.h \ isl_point_private.h \ isl_point.c \ isl_polynomial_private.h \ @@ -587,7 +866,15 @@ isl_scan.c \ isl_scan.h \ isl_schedule.c \ + isl_schedule_band.c \ + isl_schedule_band.h \ + isl_schedule_node.c \ + isl_schedule_node_private.h \ + isl_schedule_read.c \ + isl_schedule_tree.c \ + isl_schedule_tree.h \ isl_schedule_private.h \ + isl_scheduler.c \ isl_set_list.c \ isl_sort.c \ isl_sort.h \ @@ -596,6 +883,7 @@ isl_stream.c \ isl_stream_private.h \ isl_seq.c \ + isl_seq.h \ isl_tab.c \ isl_tab.h \ isl_tab_pip.c \ @@ -605,105 +893,87 @@ isl_union_map.c \ isl_union_map_private.h \ isl_val.c \ - isl_val_gmp.c \ isl_val_private.h \ + isl_vec_private.h \ isl_vec.c \ isl_version.c \ isl_vertices_private.h \ - isl_vertices.c + isl_vertices.c \ + isl_yaml.h -EXTRA_libisl_la_SOURCES = \ - isl_lp_piplib.c \ - isl_lp_no_piplib.c \ - isl_map_piplib.c \ - isl_map_no_piplib.c \ - isl_sample_no_piplib.c \ - isl_sample_piplib.c \ - isl_sample_piplib.h \ - isl_piplib.c - -libisl_la_LIBADD = @PIPLIB_LIBS@ @GMP_LIBS@ +libisl_la_LIBADD = @MP_LIBS@ libisl_la_LDFLAGS = -version-info @versioninfo@ \ - @PIPLIB_LDFLAGS@ @GMP_LDFLAGS@ + @MP_LDFLAGS@ -libisl_la_CPPFLAGS = $(INCLUDES) @PIPLIB_CPPFLAGS@ @GMP_CPPFLAGS@ -isl_test_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ -isl_test_LDFLAGS = @GMP_LDFLAGS@ -isl_test_LDADD = libisl.la @GMP_LIBS@ -isl_polyhedron_sample_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ +isl_test_LDFLAGS = @MP_LDFLAGS@ +isl_test_LDADD = libisl.la @MP_LIBS@ isl_polyhedron_sample_LDADD = libisl.la isl_polyhedron_sample_SOURCES = \ polyhedron_sample.c -isl_pip_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ -isl_pip_LDFLAGS = @GMP_LDFLAGS@ -isl_pip_LDADD = libisl.la @GMP_LIBS@ +isl_pip_LDFLAGS = @MP_LDFLAGS@ +isl_pip_LDADD = libisl.la @MP_LIBS@ isl_pip_SOURCES = \ pip.c -isl_codegen_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ -isl_codegen_LDFLAGS = @GMP_LDFLAGS@ -isl_codegen_LDADD = libisl.la @GMP_LIBS@ +isl_codegen_LDFLAGS = @MP_LDFLAGS@ +isl_codegen_LDADD = libisl.la @MP_LIBS@ isl_codegen_SOURCES = \ codegen.c -isl_bound_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ -isl_bound_LDFLAGS = @GMP_LDFLAGS@ -isl_bound_LDADD = libisl.la @GMP_LIBS@ +isl_bound_LDFLAGS = @MP_LDFLAGS@ +isl_bound_LDADD = libisl.la @MP_LIBS@ isl_bound_SOURCES = \ bound.c -isl_polyhedron_minimize_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ -isl_polyhedron_minimize_LDFLAGS = @GMP_LDFLAGS@ -isl_polyhedron_minimize_LDADD = libisl.la @GMP_LIBS@ +isl_polyhedron_minimize_LDFLAGS = @MP_LDFLAGS@ +isl_polyhedron_minimize_LDADD = libisl.la @MP_LIBS@ isl_polyhedron_minimize_SOURCES = \ polyhedron_minimize.c -isl_polytope_scan_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ isl_polytope_scan_LDADD = libisl.la isl_polytope_scan_SOURCES = \ polytope_scan.c -isl_polyhedron_detect_equalities_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ isl_polyhedron_detect_equalities_LDADD = libisl.la isl_polyhedron_detect_equalities_SOURCES = \ polyhedron_detect_equalities.c -isl_cat_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ isl_cat_LDADD = libisl.la isl_cat_SOURCES = \ cat.c -isl_closure_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@ isl_closure_LDADD = libisl.la isl_closure_SOURCES = \ closure.c nodist_pkginclude_HEADERS = \ - include/isl/config.h \ include/isl/stdint.h pkginclude_HEADERS = \ + $(MP_INCLUDE_H) \ include/isl/aff.h \ include/isl/aff_type.h \ include/isl/arg.h \ include/isl/ast.h \ + include/isl/ast_type.h \ include/isl/ast_build.h \ include/isl/band.h \ - include/isl/blk.h \ include/isl/constraint.h \ include/isl/ctx.h \ - include/isl/dim.h \ include/isl/flow.h \ include/isl/id.h \ + include/isl/id_to_ast_expr.h \ + include/isl/id_to_pw_aff.h \ include/isl/ilp.h \ - include/isl/int.h \ include/isl/hash.h \ + include/isl/hmap.h \ include/isl/list.h \ include/isl/local_space.h \ include/isl/lp.h \ include/isl/mat.h \ include/isl/map.h \ + include/isl/map_to_basic_set.h \ include/isl/map_type.h \ include/isl/multi.h \ include/isl/obj.h \ @@ -713,7 +983,8 @@ include/isl/polynomial_type.h \ include/isl/printer.h \ include/isl/schedule.h \ - include/isl/seq.h \ + include/isl/schedule_node.h \ + include/isl/schedule_type.h \ include/isl/set.h \ include/isl/set_type.h \ include/isl/space.h \ @@ -723,26 +994,49 @@ include/isl/union_set.h \ include/isl/union_set_type.h \ include/isl/val.h \ - include/isl/val_gmp.h \ - include/isl/val_int.h \ include/isl/vec.h \ include/isl/version.h \ include/isl/vertices.h +deprecateddir = $(pkgincludedir)/deprecated +deprecated_HEADERS = \ + include/isl/deprecated/int.h \ + include/isl/deprecated/aff_int.h \ + include/isl/deprecated/ast_int.h \ + include/isl/deprecated/constraint_int.h \ + include/isl/deprecated/ilp_int.h \ + include/isl/deprecated/map_int.h \ + include/isl/deprecated/mat_int.h \ + include/isl/deprecated/point_int.h \ + include/isl/deprecated/polynomial_int.h \ + include/isl/deprecated/set_int.h \ + include/isl/deprecated/union_map_int.h \ + include/isl/deprecated/val_int.h \ + include/isl/deprecated/vec_int.h + EXTRA_DIST = \ LICENSE \ isl_config_post.h \ basis_reduction_templ.c \ + isl_hmap_templ.c \ isl_list_templ.c \ isl_list_templ.h \ isl_map_lexopt_templ.c \ + isl_multi_macro.h \ isl_multi_templ.c \ isl_multi_templ.h \ + isl_multi_apply_templ.c \ + isl_multi_apply_set.c \ + isl_multi_apply_union_set.c \ + isl_multi_floor.c \ + isl_multi_gist.c \ + isl_multi_intersect.c \ print_templ.c \ isl_power_templ.c \ isl_pw_templ.c \ isl_union_templ.c \ isl.py \ + doc/CodingStyle \ doc/SubmittingPatches \ doc/chicago.bst \ doc/chicago.sty \ @@ -751,6 +1045,12 @@ doc/mypod2latex \ doc/manual.tex \ doc/user.pod \ + imath/gmp_compat.c \ + imath/gmp_compat.h \ + imath/imath.c \ + imath/imath.h \ + imath/imrat.c \ + imath/imrat.h \ interface/all.h \ interface/isl.py.top \ test_inputs @@ -761,7 +1061,7 @@ $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: -.SUFFIXES: .c .lo .o .obj +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @@ -798,8 +1098,8 @@ $(am__aclocal_m4_deps): isl_config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/isl_config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -809,25 +1109,17 @@ rm -f stamp-h1 touch $@ -include/isl/config.h: include/isl/stamp-h2 - @if test ! -f $@; then rm -f include/isl/stamp-h2; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) include/isl/stamp-h2; else :; fi - -include/isl/stamp-h2: $(top_srcdir)/include/isl/config.h.in $(top_builddir)/config.status - @rm -f include/isl/stamp-h2 - cd $(top_builddir) && $(SHELL) ./config.status include/isl/config.h - distclean-hdr: - -rm -f isl_config.h stamp-h1 include/isl/config.h include/isl/stamp-h2 + -rm -f isl_config.h stamp-h1 bound_test.sh: $(top_builddir)/config.status $(srcdir)/bound_test.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ codegen_test.sh: $(top_builddir)/config.status $(srcdir)/codegen_test.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ pip_test.sh: $(top_builddir)/config.status $(srcdir)/pip_test.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ + install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -835,6 +1127,8 @@ else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } @@ -850,12 +1144,27 @@ clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +imath_wrap/$(am__dirstamp): + @$(MKDIR_P) imath_wrap + @: > imath_wrap/$(am__dirstamp) +imath_wrap/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) imath_wrap/$(DEPDIR) + @: > imath_wrap/$(DEPDIR)/$(am__dirstamp) +imath_wrap/gmp_compat.lo: imath_wrap/$(am__dirstamp) \ + imath_wrap/$(DEPDIR)/$(am__dirstamp) +imath_wrap/imath.lo: imath_wrap/$(am__dirstamp) \ + imath_wrap/$(DEPDIR)/$(am__dirstamp) +imath_wrap/imrat.lo: imath_wrap/$(am__dirstamp) \ + imath_wrap/$(DEPDIR)/$(am__dirstamp) + libisl.la: $(libisl_la_OBJECTS) $(libisl_la_DEPENDENCIES) $(EXTRA_libisl_la_DEPENDENCIES) $(AM_V_CCLD)$(libisl_la_LINK) -rpath $(libdir) $(libisl_la_OBJECTS) $(libisl_la_LIBADD) $(LIBS) @@ -867,811 +1176,185 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list + isl_bound$(EXEEXT): $(isl_bound_OBJECTS) $(isl_bound_DEPENDENCIES) $(EXTRA_isl_bound_DEPENDENCIES) @rm -f isl_bound$(EXEEXT) $(AM_V_CCLD)$(isl_bound_LINK) $(isl_bound_OBJECTS) $(isl_bound_LDADD) $(LIBS) + isl_cat$(EXEEXT): $(isl_cat_OBJECTS) $(isl_cat_DEPENDENCIES) $(EXTRA_isl_cat_DEPENDENCIES) @rm -f isl_cat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(isl_cat_OBJECTS) $(isl_cat_LDADD) $(LIBS) + isl_closure$(EXEEXT): $(isl_closure_OBJECTS) $(isl_closure_DEPENDENCIES) $(EXTRA_isl_closure_DEPENDENCIES) @rm -f isl_closure$(EXEEXT) $(AM_V_CCLD)$(LINK) $(isl_closure_OBJECTS) $(isl_closure_LDADD) $(LIBS) + isl_codegen$(EXEEXT): $(isl_codegen_OBJECTS) $(isl_codegen_DEPENDENCIES) $(EXTRA_isl_codegen_DEPENDENCIES) @rm -f isl_codegen$(EXEEXT) $(AM_V_CCLD)$(isl_codegen_LINK) $(isl_codegen_OBJECTS) $(isl_codegen_LDADD) $(LIBS) + isl_pip$(EXEEXT): $(isl_pip_OBJECTS) $(isl_pip_DEPENDENCIES) $(EXTRA_isl_pip_DEPENDENCIES) @rm -f isl_pip$(EXEEXT) $(AM_V_CCLD)$(isl_pip_LINK) $(isl_pip_OBJECTS) $(isl_pip_LDADD) $(LIBS) + isl_polyhedron_detect_equalities$(EXEEXT): $(isl_polyhedron_detect_equalities_OBJECTS) $(isl_polyhedron_detect_equalities_DEPENDENCIES) $(EXTRA_isl_polyhedron_detect_equalities_DEPENDENCIES) @rm -f isl_polyhedron_detect_equalities$(EXEEXT) $(AM_V_CCLD)$(LINK) $(isl_polyhedron_detect_equalities_OBJECTS) $(isl_polyhedron_detect_equalities_LDADD) $(LIBS) + isl_polyhedron_minimize$(EXEEXT): $(isl_polyhedron_minimize_OBJECTS) $(isl_polyhedron_minimize_DEPENDENCIES) $(EXTRA_isl_polyhedron_minimize_DEPENDENCIES) @rm -f isl_polyhedron_minimize$(EXEEXT) $(AM_V_CCLD)$(isl_polyhedron_minimize_LINK) $(isl_polyhedron_minimize_OBJECTS) $(isl_polyhedron_minimize_LDADD) $(LIBS) + isl_polyhedron_sample$(EXEEXT): $(isl_polyhedron_sample_OBJECTS) $(isl_polyhedron_sample_DEPENDENCIES) $(EXTRA_isl_polyhedron_sample_DEPENDENCIES) @rm -f isl_polyhedron_sample$(EXEEXT) $(AM_V_CCLD)$(LINK) $(isl_polyhedron_sample_OBJECTS) $(isl_polyhedron_sample_LDADD) $(LIBS) + isl_polytope_scan$(EXEEXT): $(isl_polytope_scan_OBJECTS) $(isl_polytope_scan_DEPENDENCIES) $(EXTRA_isl_polytope_scan_DEPENDENCIES) @rm -f isl_polytope_scan$(EXEEXT) $(AM_V_CCLD)$(LINK) $(isl_polytope_scan_OBJECTS) $(isl_polytope_scan_LDADD) $(LIBS) + isl_test$(EXEEXT): $(isl_test_OBJECTS) $(isl_test_DEPENDENCIES) $(EXTRA_isl_test_DEPENDENCIES) @rm -f isl_test$(EXEEXT) $(AM_V_CCLD)$(isl_test_LINK) $(isl_test_OBJECTS) $(isl_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) + -rm -f imath_wrap/*.$(OBJEXT) + -rm -f imath_wrap/*.lo distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_bound-bound.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_cat-cat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_closure-closure.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_codegen-codegen.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_pip-pip.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_polyhedron_detect_equalities-polyhedron_detect_equalities.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_polyhedron_minimize-polyhedron_minimize.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_polyhedron_sample-polyhedron_sample.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_polytope_scan-polytope_scan.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_test-isl_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-basis_reduction_tab.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_aff.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_affine_hull.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_arg.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_ast.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_ast_build.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_ast_build_expr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_ast_codegen.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_ast_graft.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_band.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_bernstein.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_blk.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_bound.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_coalesce.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_constraint.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_convex_hull.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_ctx.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_deprecated.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_dim.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_dim_map.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_equalities.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_factorization.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_farkas.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_flow.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_fold.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_gmp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_hash.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_hmap_map_basic_set.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_id.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_ilp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_input.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_local_space.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_lp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_lp_no_piplib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_lp_piplib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_map.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_map_no_piplib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_map_piplib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_map_simplify.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_map_subtract.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_mat.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_morph.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_obj.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_options.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_output.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_piplib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_point.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_polynomial.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_printer.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_range.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_reordering.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_sample.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_sample_no_piplib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_sample_piplib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_scan.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_schedule.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_seq.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_set_list.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_sort.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_space.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_stream.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_tab.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_tab_pip.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_tarjan.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_transitive_closure.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_union_map.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_val.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_val_gmp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_vec.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_version.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-isl_vertices.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-mp_get_memory_functions.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libisl_la-print.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basis_reduction_tab.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bound.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closure.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/codegen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_aff.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_affine_hull.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_arg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_ast.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_ast_build.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_ast_build_expr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_ast_codegen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_ast_graft.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_ast_int.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_band.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_bernstein.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_blk.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_bound.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_coalesce.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_constraint.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_convex_hull.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_ctx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_deprecated.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_dim_map.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_equalities.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_factorization.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_farkas.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_flow.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_fold.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_gmp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_hash.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_id.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_id_to_ast_expr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_id_to_pw_aff.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_ilp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_imath.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_input.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_local_space.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_lp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_map.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_map_list.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_map_simplify.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_map_subtract.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_map_to_basic_set.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_mat.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_morph.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_obj.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_options.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_output.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_point.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_polynomial.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_printer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_range.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_reordering.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_sample.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_scan.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_schedule.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_schedule_band.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_schedule_node.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_schedule_read.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_schedule_tree.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_scheduler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_seq.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_set_list.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_sort.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_space.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_stream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_tab.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_tab_pip.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_tarjan.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_transitive_closure.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_union_map.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_val.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_val_gmp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_val_imath.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_vec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_version.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_vertices.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp_get_memory_functions.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pip.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/polyhedron_detect_equalities.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/polyhedron_minimize.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/polyhedron_sample.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/polytope_scan.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@imath_wrap/$(DEPDIR)/gmp_compat.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@imath_wrap/$(DEPDIR)/imath.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@imath_wrap/$(DEPDIR)/imrat.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -libisl_la-isl_lp_no_piplib.lo: isl_lp_no_piplib.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_lp_no_piplib.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_lp_no_piplib.Tpo -c -o libisl_la-isl_lp_no_piplib.lo `test -f 'isl_lp_no_piplib.c' || echo '$(srcdir)/'`isl_lp_no_piplib.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_lp_no_piplib.Tpo $(DEPDIR)/libisl_la-isl_lp_no_piplib.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_lp_no_piplib.c' object='libisl_la-isl_lp_no_piplib.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_lp_no_piplib.lo `test -f 'isl_lp_no_piplib.c' || echo '$(srcdir)/'`isl_lp_no_piplib.c - -libisl_la-isl_map_no_piplib.lo: isl_map_no_piplib.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_map_no_piplib.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_map_no_piplib.Tpo -c -o libisl_la-isl_map_no_piplib.lo `test -f 'isl_map_no_piplib.c' || echo '$(srcdir)/'`isl_map_no_piplib.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_map_no_piplib.Tpo $(DEPDIR)/libisl_la-isl_map_no_piplib.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_map_no_piplib.c' object='libisl_la-isl_map_no_piplib.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_map_no_piplib.lo `test -f 'isl_map_no_piplib.c' || echo '$(srcdir)/'`isl_map_no_piplib.c - -libisl_la-isl_sample_no_piplib.lo: isl_sample_no_piplib.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_sample_no_piplib.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_sample_no_piplib.Tpo -c -o libisl_la-isl_sample_no_piplib.lo `test -f 'isl_sample_no_piplib.c' || echo '$(srcdir)/'`isl_sample_no_piplib.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_sample_no_piplib.Tpo $(DEPDIR)/libisl_la-isl_sample_no_piplib.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_sample_no_piplib.c' object='libisl_la-isl_sample_no_piplib.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_sample_no_piplib.lo `test -f 'isl_sample_no_piplib.c' || echo '$(srcdir)/'`isl_sample_no_piplib.c - -libisl_la-isl_lp_piplib.lo: isl_lp_piplib.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_lp_piplib.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_lp_piplib.Tpo -c -o libisl_la-isl_lp_piplib.lo `test -f 'isl_lp_piplib.c' || echo '$(srcdir)/'`isl_lp_piplib.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_lp_piplib.Tpo $(DEPDIR)/libisl_la-isl_lp_piplib.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_lp_piplib.c' object='libisl_la-isl_lp_piplib.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_lp_piplib.lo `test -f 'isl_lp_piplib.c' || echo '$(srcdir)/'`isl_lp_piplib.c - -libisl_la-isl_map_piplib.lo: isl_map_piplib.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_map_piplib.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_map_piplib.Tpo -c -o libisl_la-isl_map_piplib.lo `test -f 'isl_map_piplib.c' || echo '$(srcdir)/'`isl_map_piplib.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_map_piplib.Tpo $(DEPDIR)/libisl_la-isl_map_piplib.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_map_piplib.c' object='libisl_la-isl_map_piplib.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_map_piplib.lo `test -f 'isl_map_piplib.c' || echo '$(srcdir)/'`isl_map_piplib.c - -libisl_la-isl_sample_piplib.lo: isl_sample_piplib.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_sample_piplib.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_sample_piplib.Tpo -c -o libisl_la-isl_sample_piplib.lo `test -f 'isl_sample_piplib.c' || echo '$(srcdir)/'`isl_sample_piplib.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_sample_piplib.Tpo $(DEPDIR)/libisl_la-isl_sample_piplib.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_sample_piplib.c' object='libisl_la-isl_sample_piplib.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_sample_piplib.lo `test -f 'isl_sample_piplib.c' || echo '$(srcdir)/'`isl_sample_piplib.c - -libisl_la-isl_piplib.lo: isl_piplib.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_piplib.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_piplib.Tpo -c -o libisl_la-isl_piplib.lo `test -f 'isl_piplib.c' || echo '$(srcdir)/'`isl_piplib.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_piplib.Tpo $(DEPDIR)/libisl_la-isl_piplib.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_piplib.c' object='libisl_la-isl_piplib.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_piplib.lo `test -f 'isl_piplib.c' || echo '$(srcdir)/'`isl_piplib.c - -libisl_la-mp_get_memory_functions.lo: mp_get_memory_functions.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-mp_get_memory_functions.lo -MD -MP -MF $(DEPDIR)/libisl_la-mp_get_memory_functions.Tpo -c -o libisl_la-mp_get_memory_functions.lo `test -f 'mp_get_memory_functions.c' || echo '$(srcdir)/'`mp_get_memory_functions.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-mp_get_memory_functions.Tpo $(DEPDIR)/libisl_la-mp_get_memory_functions.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mp_get_memory_functions.c' object='libisl_la-mp_get_memory_functions.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-mp_get_memory_functions.lo `test -f 'mp_get_memory_functions.c' || echo '$(srcdir)/'`mp_get_memory_functions.c - -libisl_la-isl_aff.lo: isl_aff.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_aff.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_aff.Tpo -c -o libisl_la-isl_aff.lo `test -f 'isl_aff.c' || echo '$(srcdir)/'`isl_aff.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_aff.Tpo $(DEPDIR)/libisl_la-isl_aff.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_aff.c' object='libisl_la-isl_aff.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_aff.lo `test -f 'isl_aff.c' || echo '$(srcdir)/'`isl_aff.c - -libisl_la-isl_affine_hull.lo: isl_affine_hull.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_affine_hull.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_affine_hull.Tpo -c -o libisl_la-isl_affine_hull.lo `test -f 'isl_affine_hull.c' || echo '$(srcdir)/'`isl_affine_hull.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_affine_hull.Tpo $(DEPDIR)/libisl_la-isl_affine_hull.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_affine_hull.c' object='libisl_la-isl_affine_hull.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_affine_hull.lo `test -f 'isl_affine_hull.c' || echo '$(srcdir)/'`isl_affine_hull.c - -libisl_la-isl_arg.lo: isl_arg.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_arg.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_arg.Tpo -c -o libisl_la-isl_arg.lo `test -f 'isl_arg.c' || echo '$(srcdir)/'`isl_arg.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_arg.Tpo $(DEPDIR)/libisl_la-isl_arg.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_arg.c' object='libisl_la-isl_arg.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_arg.lo `test -f 'isl_arg.c' || echo '$(srcdir)/'`isl_arg.c - -libisl_la-isl_ast.lo: isl_ast.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_ast.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_ast.Tpo -c -o libisl_la-isl_ast.lo `test -f 'isl_ast.c' || echo '$(srcdir)/'`isl_ast.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_ast.Tpo $(DEPDIR)/libisl_la-isl_ast.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_ast.c' object='libisl_la-isl_ast.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_ast.lo `test -f 'isl_ast.c' || echo '$(srcdir)/'`isl_ast.c - -libisl_la-isl_ast_build.lo: isl_ast_build.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_ast_build.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_ast_build.Tpo -c -o libisl_la-isl_ast_build.lo `test -f 'isl_ast_build.c' || echo '$(srcdir)/'`isl_ast_build.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_ast_build.Tpo $(DEPDIR)/libisl_la-isl_ast_build.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_ast_build.c' object='libisl_la-isl_ast_build.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_ast_build.lo `test -f 'isl_ast_build.c' || echo '$(srcdir)/'`isl_ast_build.c - -libisl_la-isl_ast_build_expr.lo: isl_ast_build_expr.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_ast_build_expr.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_ast_build_expr.Tpo -c -o libisl_la-isl_ast_build_expr.lo `test -f 'isl_ast_build_expr.c' || echo '$(srcdir)/'`isl_ast_build_expr.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_ast_build_expr.Tpo $(DEPDIR)/libisl_la-isl_ast_build_expr.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_ast_build_expr.c' object='libisl_la-isl_ast_build_expr.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_ast_build_expr.lo `test -f 'isl_ast_build_expr.c' || echo '$(srcdir)/'`isl_ast_build_expr.c - -libisl_la-isl_ast_codegen.lo: isl_ast_codegen.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_ast_codegen.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_ast_codegen.Tpo -c -o libisl_la-isl_ast_codegen.lo `test -f 'isl_ast_codegen.c' || echo '$(srcdir)/'`isl_ast_codegen.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_ast_codegen.Tpo $(DEPDIR)/libisl_la-isl_ast_codegen.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_ast_codegen.c' object='libisl_la-isl_ast_codegen.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_ast_codegen.lo `test -f 'isl_ast_codegen.c' || echo '$(srcdir)/'`isl_ast_codegen.c - -libisl_la-isl_ast_graft.lo: isl_ast_graft.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_ast_graft.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_ast_graft.Tpo -c -o libisl_la-isl_ast_graft.lo `test -f 'isl_ast_graft.c' || echo '$(srcdir)/'`isl_ast_graft.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_ast_graft.Tpo $(DEPDIR)/libisl_la-isl_ast_graft.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_ast_graft.c' object='libisl_la-isl_ast_graft.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_ast_graft.lo `test -f 'isl_ast_graft.c' || echo '$(srcdir)/'`isl_ast_graft.c - -libisl_la-isl_band.lo: isl_band.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_band.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_band.Tpo -c -o libisl_la-isl_band.lo `test -f 'isl_band.c' || echo '$(srcdir)/'`isl_band.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_band.Tpo $(DEPDIR)/libisl_la-isl_band.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_band.c' object='libisl_la-isl_band.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_band.lo `test -f 'isl_band.c' || echo '$(srcdir)/'`isl_band.c - -libisl_la-basis_reduction_tab.lo: basis_reduction_tab.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-basis_reduction_tab.lo -MD -MP -MF $(DEPDIR)/libisl_la-basis_reduction_tab.Tpo -c -o libisl_la-basis_reduction_tab.lo `test -f 'basis_reduction_tab.c' || echo '$(srcdir)/'`basis_reduction_tab.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-basis_reduction_tab.Tpo $(DEPDIR)/libisl_la-basis_reduction_tab.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='basis_reduction_tab.c' object='libisl_la-basis_reduction_tab.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-basis_reduction_tab.lo `test -f 'basis_reduction_tab.c' || echo '$(srcdir)/'`basis_reduction_tab.c - -libisl_la-isl_bernstein.lo: isl_bernstein.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_bernstein.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_bernstein.Tpo -c -o libisl_la-isl_bernstein.lo `test -f 'isl_bernstein.c' || echo '$(srcdir)/'`isl_bernstein.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_bernstein.Tpo $(DEPDIR)/libisl_la-isl_bernstein.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_bernstein.c' object='libisl_la-isl_bernstein.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_bernstein.lo `test -f 'isl_bernstein.c' || echo '$(srcdir)/'`isl_bernstein.c - -libisl_la-isl_blk.lo: isl_blk.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_blk.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_blk.Tpo -c -o libisl_la-isl_blk.lo `test -f 'isl_blk.c' || echo '$(srcdir)/'`isl_blk.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_blk.Tpo $(DEPDIR)/libisl_la-isl_blk.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_blk.c' object='libisl_la-isl_blk.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_blk.lo `test -f 'isl_blk.c' || echo '$(srcdir)/'`isl_blk.c - -libisl_la-isl_bound.lo: isl_bound.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_bound.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_bound.Tpo -c -o libisl_la-isl_bound.lo `test -f 'isl_bound.c' || echo '$(srcdir)/'`isl_bound.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_bound.Tpo $(DEPDIR)/libisl_la-isl_bound.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_bound.c' object='libisl_la-isl_bound.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_bound.lo `test -f 'isl_bound.c' || echo '$(srcdir)/'`isl_bound.c - -libisl_la-isl_coalesce.lo: isl_coalesce.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_coalesce.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_coalesce.Tpo -c -o libisl_la-isl_coalesce.lo `test -f 'isl_coalesce.c' || echo '$(srcdir)/'`isl_coalesce.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_coalesce.Tpo $(DEPDIR)/libisl_la-isl_coalesce.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_coalesce.c' object='libisl_la-isl_coalesce.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_coalesce.lo `test -f 'isl_coalesce.c' || echo '$(srcdir)/'`isl_coalesce.c - -libisl_la-isl_constraint.lo: isl_constraint.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_constraint.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_constraint.Tpo -c -o libisl_la-isl_constraint.lo `test -f 'isl_constraint.c' || echo '$(srcdir)/'`isl_constraint.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_constraint.Tpo $(DEPDIR)/libisl_la-isl_constraint.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_constraint.c' object='libisl_la-isl_constraint.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_constraint.lo `test -f 'isl_constraint.c' || echo '$(srcdir)/'`isl_constraint.c - -libisl_la-isl_convex_hull.lo: isl_convex_hull.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_convex_hull.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_convex_hull.Tpo -c -o libisl_la-isl_convex_hull.lo `test -f 'isl_convex_hull.c' || echo '$(srcdir)/'`isl_convex_hull.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_convex_hull.Tpo $(DEPDIR)/libisl_la-isl_convex_hull.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_convex_hull.c' object='libisl_la-isl_convex_hull.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_convex_hull.lo `test -f 'isl_convex_hull.c' || echo '$(srcdir)/'`isl_convex_hull.c - -libisl_la-isl_ctx.lo: isl_ctx.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_ctx.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_ctx.Tpo -c -o libisl_la-isl_ctx.lo `test -f 'isl_ctx.c' || echo '$(srcdir)/'`isl_ctx.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_ctx.Tpo $(DEPDIR)/libisl_la-isl_ctx.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_ctx.c' object='libisl_la-isl_ctx.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_ctx.lo `test -f 'isl_ctx.c' || echo '$(srcdir)/'`isl_ctx.c - -libisl_la-isl_deprecated.lo: isl_deprecated.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_deprecated.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_deprecated.Tpo -c -o libisl_la-isl_deprecated.lo `test -f 'isl_deprecated.c' || echo '$(srcdir)/'`isl_deprecated.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_deprecated.Tpo $(DEPDIR)/libisl_la-isl_deprecated.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_deprecated.c' object='libisl_la-isl_deprecated.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_deprecated.lo `test -f 'isl_deprecated.c' || echo '$(srcdir)/'`isl_deprecated.c - -libisl_la-isl_dim.lo: isl_dim.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_dim.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_dim.Tpo -c -o libisl_la-isl_dim.lo `test -f 'isl_dim.c' || echo '$(srcdir)/'`isl_dim.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_dim.Tpo $(DEPDIR)/libisl_la-isl_dim.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_dim.c' object='libisl_la-isl_dim.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_dim.lo `test -f 'isl_dim.c' || echo '$(srcdir)/'`isl_dim.c - -libisl_la-isl_dim_map.lo: isl_dim_map.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_dim_map.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_dim_map.Tpo -c -o libisl_la-isl_dim_map.lo `test -f 'isl_dim_map.c' || echo '$(srcdir)/'`isl_dim_map.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_dim_map.Tpo $(DEPDIR)/libisl_la-isl_dim_map.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_dim_map.c' object='libisl_la-isl_dim_map.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_dim_map.lo `test -f 'isl_dim_map.c' || echo '$(srcdir)/'`isl_dim_map.c - -libisl_la-isl_equalities.lo: isl_equalities.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_equalities.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_equalities.Tpo -c -o libisl_la-isl_equalities.lo `test -f 'isl_equalities.c' || echo '$(srcdir)/'`isl_equalities.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_equalities.Tpo $(DEPDIR)/libisl_la-isl_equalities.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_equalities.c' object='libisl_la-isl_equalities.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_equalities.lo `test -f 'isl_equalities.c' || echo '$(srcdir)/'`isl_equalities.c - -libisl_la-isl_factorization.lo: isl_factorization.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_factorization.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_factorization.Tpo -c -o libisl_la-isl_factorization.lo `test -f 'isl_factorization.c' || echo '$(srcdir)/'`isl_factorization.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_factorization.Tpo $(DEPDIR)/libisl_la-isl_factorization.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_factorization.c' object='libisl_la-isl_factorization.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_factorization.lo `test -f 'isl_factorization.c' || echo '$(srcdir)/'`isl_factorization.c - -libisl_la-isl_farkas.lo: isl_farkas.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_farkas.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_farkas.Tpo -c -o libisl_la-isl_farkas.lo `test -f 'isl_farkas.c' || echo '$(srcdir)/'`isl_farkas.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_farkas.Tpo $(DEPDIR)/libisl_la-isl_farkas.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_farkas.c' object='libisl_la-isl_farkas.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_farkas.lo `test -f 'isl_farkas.c' || echo '$(srcdir)/'`isl_farkas.c - -libisl_la-isl_flow.lo: isl_flow.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_flow.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_flow.Tpo -c -o libisl_la-isl_flow.lo `test -f 'isl_flow.c' || echo '$(srcdir)/'`isl_flow.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_flow.Tpo $(DEPDIR)/libisl_la-isl_flow.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_flow.c' object='libisl_la-isl_flow.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_flow.lo `test -f 'isl_flow.c' || echo '$(srcdir)/'`isl_flow.c - -libisl_la-isl_fold.lo: isl_fold.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_fold.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_fold.Tpo -c -o libisl_la-isl_fold.lo `test -f 'isl_fold.c' || echo '$(srcdir)/'`isl_fold.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_fold.Tpo $(DEPDIR)/libisl_la-isl_fold.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_fold.c' object='libisl_la-isl_fold.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_fold.lo `test -f 'isl_fold.c' || echo '$(srcdir)/'`isl_fold.c - -libisl_la-isl_gmp.lo: isl_gmp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_gmp.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_gmp.Tpo -c -o libisl_la-isl_gmp.lo `test -f 'isl_gmp.c' || echo '$(srcdir)/'`isl_gmp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_gmp.Tpo $(DEPDIR)/libisl_la-isl_gmp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_gmp.c' object='libisl_la-isl_gmp.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_gmp.lo `test -f 'isl_gmp.c' || echo '$(srcdir)/'`isl_gmp.c - -libisl_la-isl_hash.lo: isl_hash.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_hash.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_hash.Tpo -c -o libisl_la-isl_hash.lo `test -f 'isl_hash.c' || echo '$(srcdir)/'`isl_hash.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_hash.Tpo $(DEPDIR)/libisl_la-isl_hash.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_hash.c' object='libisl_la-isl_hash.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_hash.lo `test -f 'isl_hash.c' || echo '$(srcdir)/'`isl_hash.c - -libisl_la-isl_hmap_map_basic_set.lo: isl_hmap_map_basic_set.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_hmap_map_basic_set.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_hmap_map_basic_set.Tpo -c -o libisl_la-isl_hmap_map_basic_set.lo `test -f 'isl_hmap_map_basic_set.c' || echo '$(srcdir)/'`isl_hmap_map_basic_set.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_hmap_map_basic_set.Tpo $(DEPDIR)/libisl_la-isl_hmap_map_basic_set.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_hmap_map_basic_set.c' object='libisl_la-isl_hmap_map_basic_set.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_hmap_map_basic_set.lo `test -f 'isl_hmap_map_basic_set.c' || echo '$(srcdir)/'`isl_hmap_map_basic_set.c - -libisl_la-isl_ilp.lo: isl_ilp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_ilp.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_ilp.Tpo -c -o libisl_la-isl_ilp.lo `test -f 'isl_ilp.c' || echo '$(srcdir)/'`isl_ilp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_ilp.Tpo $(DEPDIR)/libisl_la-isl_ilp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_ilp.c' object='libisl_la-isl_ilp.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_ilp.lo `test -f 'isl_ilp.c' || echo '$(srcdir)/'`isl_ilp.c - -libisl_la-isl_input.lo: isl_input.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_input.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_input.Tpo -c -o libisl_la-isl_input.lo `test -f 'isl_input.c' || echo '$(srcdir)/'`isl_input.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_input.Tpo $(DEPDIR)/libisl_la-isl_input.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_input.c' object='libisl_la-isl_input.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_input.lo `test -f 'isl_input.c' || echo '$(srcdir)/'`isl_input.c - -libisl_la-isl_local_space.lo: isl_local_space.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_local_space.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_local_space.Tpo -c -o libisl_la-isl_local_space.lo `test -f 'isl_local_space.c' || echo '$(srcdir)/'`isl_local_space.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_local_space.Tpo $(DEPDIR)/libisl_la-isl_local_space.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_local_space.c' object='libisl_la-isl_local_space.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_local_space.lo `test -f 'isl_local_space.c' || echo '$(srcdir)/'`isl_local_space.c - -libisl_la-isl_lp.lo: isl_lp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_lp.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_lp.Tpo -c -o libisl_la-isl_lp.lo `test -f 'isl_lp.c' || echo '$(srcdir)/'`isl_lp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_lp.Tpo $(DEPDIR)/libisl_la-isl_lp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_lp.c' object='libisl_la-isl_lp.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_lp.lo `test -f 'isl_lp.c' || echo '$(srcdir)/'`isl_lp.c - -libisl_la-isl_map.lo: isl_map.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_map.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_map.Tpo -c -o libisl_la-isl_map.lo `test -f 'isl_map.c' || echo '$(srcdir)/'`isl_map.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_map.Tpo $(DEPDIR)/libisl_la-isl_map.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_map.c' object='libisl_la-isl_map.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_map.lo `test -f 'isl_map.c' || echo '$(srcdir)/'`isl_map.c - -libisl_la-isl_map_simplify.lo: isl_map_simplify.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_map_simplify.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_map_simplify.Tpo -c -o libisl_la-isl_map_simplify.lo `test -f 'isl_map_simplify.c' || echo '$(srcdir)/'`isl_map_simplify.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_map_simplify.Tpo $(DEPDIR)/libisl_la-isl_map_simplify.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_map_simplify.c' object='libisl_la-isl_map_simplify.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_map_simplify.lo `test -f 'isl_map_simplify.c' || echo '$(srcdir)/'`isl_map_simplify.c - -libisl_la-isl_map_subtract.lo: isl_map_subtract.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_map_subtract.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_map_subtract.Tpo -c -o libisl_la-isl_map_subtract.lo `test -f 'isl_map_subtract.c' || echo '$(srcdir)/'`isl_map_subtract.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_map_subtract.Tpo $(DEPDIR)/libisl_la-isl_map_subtract.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_map_subtract.c' object='libisl_la-isl_map_subtract.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_map_subtract.lo `test -f 'isl_map_subtract.c' || echo '$(srcdir)/'`isl_map_subtract.c - -libisl_la-isl_mat.lo: isl_mat.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_mat.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_mat.Tpo -c -o libisl_la-isl_mat.lo `test -f 'isl_mat.c' || echo '$(srcdir)/'`isl_mat.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_mat.Tpo $(DEPDIR)/libisl_la-isl_mat.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_mat.c' object='libisl_la-isl_mat.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_mat.lo `test -f 'isl_mat.c' || echo '$(srcdir)/'`isl_mat.c - -libisl_la-isl_morph.lo: isl_morph.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_morph.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_morph.Tpo -c -o libisl_la-isl_morph.lo `test -f 'isl_morph.c' || echo '$(srcdir)/'`isl_morph.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_morph.Tpo $(DEPDIR)/libisl_la-isl_morph.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_morph.c' object='libisl_la-isl_morph.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_morph.lo `test -f 'isl_morph.c' || echo '$(srcdir)/'`isl_morph.c - -libisl_la-isl_id.lo: isl_id.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_id.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_id.Tpo -c -o libisl_la-isl_id.lo `test -f 'isl_id.c' || echo '$(srcdir)/'`isl_id.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_id.Tpo $(DEPDIR)/libisl_la-isl_id.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_id.c' object='libisl_la-isl_id.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_id.lo `test -f 'isl_id.c' || echo '$(srcdir)/'`isl_id.c - -libisl_la-isl_obj.lo: isl_obj.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_obj.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_obj.Tpo -c -o libisl_la-isl_obj.lo `test -f 'isl_obj.c' || echo '$(srcdir)/'`isl_obj.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_obj.Tpo $(DEPDIR)/libisl_la-isl_obj.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_obj.c' object='libisl_la-isl_obj.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_obj.lo `test -f 'isl_obj.c' || echo '$(srcdir)/'`isl_obj.c - -libisl_la-isl_options.lo: isl_options.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_options.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_options.Tpo -c -o libisl_la-isl_options.lo `test -f 'isl_options.c' || echo '$(srcdir)/'`isl_options.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_options.Tpo $(DEPDIR)/libisl_la-isl_options.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_options.c' object='libisl_la-isl_options.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_options.lo `test -f 'isl_options.c' || echo '$(srcdir)/'`isl_options.c - -libisl_la-isl_output.lo: isl_output.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_output.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_output.Tpo -c -o libisl_la-isl_output.lo `test -f 'isl_output.c' || echo '$(srcdir)/'`isl_output.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_output.Tpo $(DEPDIR)/libisl_la-isl_output.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_output.c' object='libisl_la-isl_output.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_output.lo `test -f 'isl_output.c' || echo '$(srcdir)/'`isl_output.c - -libisl_la-isl_point.lo: isl_point.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_point.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_point.Tpo -c -o libisl_la-isl_point.lo `test -f 'isl_point.c' || echo '$(srcdir)/'`isl_point.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_point.Tpo $(DEPDIR)/libisl_la-isl_point.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_point.c' object='libisl_la-isl_point.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_point.lo `test -f 'isl_point.c' || echo '$(srcdir)/'`isl_point.c - -libisl_la-isl_polynomial.lo: isl_polynomial.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_polynomial.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_polynomial.Tpo -c -o libisl_la-isl_polynomial.lo `test -f 'isl_polynomial.c' || echo '$(srcdir)/'`isl_polynomial.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_polynomial.Tpo $(DEPDIR)/libisl_la-isl_polynomial.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_polynomial.c' object='libisl_la-isl_polynomial.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_polynomial.lo `test -f 'isl_polynomial.c' || echo '$(srcdir)/'`isl_polynomial.c - -libisl_la-isl_printer.lo: isl_printer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_printer.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_printer.Tpo -c -o libisl_la-isl_printer.lo `test -f 'isl_printer.c' || echo '$(srcdir)/'`isl_printer.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_printer.Tpo $(DEPDIR)/libisl_la-isl_printer.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_printer.c' object='libisl_la-isl_printer.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_printer.lo `test -f 'isl_printer.c' || echo '$(srcdir)/'`isl_printer.c - -libisl_la-print.lo: print.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-print.lo -MD -MP -MF $(DEPDIR)/libisl_la-print.Tpo -c -o libisl_la-print.lo `test -f 'print.c' || echo '$(srcdir)/'`print.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-print.Tpo $(DEPDIR)/libisl_la-print.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print.c' object='libisl_la-print.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-print.lo `test -f 'print.c' || echo '$(srcdir)/'`print.c - -libisl_la-isl_range.lo: isl_range.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_range.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_range.Tpo -c -o libisl_la-isl_range.lo `test -f 'isl_range.c' || echo '$(srcdir)/'`isl_range.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_range.Tpo $(DEPDIR)/libisl_la-isl_range.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_range.c' object='libisl_la-isl_range.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_range.lo `test -f 'isl_range.c' || echo '$(srcdir)/'`isl_range.c - -libisl_la-isl_reordering.lo: isl_reordering.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_reordering.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_reordering.Tpo -c -o libisl_la-isl_reordering.lo `test -f 'isl_reordering.c' || echo '$(srcdir)/'`isl_reordering.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_reordering.Tpo $(DEPDIR)/libisl_la-isl_reordering.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_reordering.c' object='libisl_la-isl_reordering.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_reordering.lo `test -f 'isl_reordering.c' || echo '$(srcdir)/'`isl_reordering.c - -libisl_la-isl_sample.lo: isl_sample.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_sample.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_sample.Tpo -c -o libisl_la-isl_sample.lo `test -f 'isl_sample.c' || echo '$(srcdir)/'`isl_sample.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_sample.Tpo $(DEPDIR)/libisl_la-isl_sample.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_sample.c' object='libisl_la-isl_sample.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_sample.lo `test -f 'isl_sample.c' || echo '$(srcdir)/'`isl_sample.c - -libisl_la-isl_scan.lo: isl_scan.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_scan.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_scan.Tpo -c -o libisl_la-isl_scan.lo `test -f 'isl_scan.c' || echo '$(srcdir)/'`isl_scan.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_scan.Tpo $(DEPDIR)/libisl_la-isl_scan.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_scan.c' object='libisl_la-isl_scan.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_scan.lo `test -f 'isl_scan.c' || echo '$(srcdir)/'`isl_scan.c - -libisl_la-isl_schedule.lo: isl_schedule.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_schedule.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_schedule.Tpo -c -o libisl_la-isl_schedule.lo `test -f 'isl_schedule.c' || echo '$(srcdir)/'`isl_schedule.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_schedule.Tpo $(DEPDIR)/libisl_la-isl_schedule.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_schedule.c' object='libisl_la-isl_schedule.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_schedule.lo `test -f 'isl_schedule.c' || echo '$(srcdir)/'`isl_schedule.c - -libisl_la-isl_set_list.lo: isl_set_list.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_set_list.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_set_list.Tpo -c -o libisl_la-isl_set_list.lo `test -f 'isl_set_list.c' || echo '$(srcdir)/'`isl_set_list.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_set_list.Tpo $(DEPDIR)/libisl_la-isl_set_list.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_set_list.c' object='libisl_la-isl_set_list.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_set_list.lo `test -f 'isl_set_list.c' || echo '$(srcdir)/'`isl_set_list.c - -libisl_la-isl_sort.lo: isl_sort.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_sort.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_sort.Tpo -c -o libisl_la-isl_sort.lo `test -f 'isl_sort.c' || echo '$(srcdir)/'`isl_sort.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_sort.Tpo $(DEPDIR)/libisl_la-isl_sort.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_sort.c' object='libisl_la-isl_sort.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_sort.lo `test -f 'isl_sort.c' || echo '$(srcdir)/'`isl_sort.c - -libisl_la-isl_space.lo: isl_space.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_space.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_space.Tpo -c -o libisl_la-isl_space.lo `test -f 'isl_space.c' || echo '$(srcdir)/'`isl_space.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_space.Tpo $(DEPDIR)/libisl_la-isl_space.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_space.c' object='libisl_la-isl_space.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_space.lo `test -f 'isl_space.c' || echo '$(srcdir)/'`isl_space.c - -libisl_la-isl_stream.lo: isl_stream.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_stream.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_stream.Tpo -c -o libisl_la-isl_stream.lo `test -f 'isl_stream.c' || echo '$(srcdir)/'`isl_stream.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_stream.Tpo $(DEPDIR)/libisl_la-isl_stream.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_stream.c' object='libisl_la-isl_stream.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_stream.lo `test -f 'isl_stream.c' || echo '$(srcdir)/'`isl_stream.c - -libisl_la-isl_seq.lo: isl_seq.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_seq.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_seq.Tpo -c -o libisl_la-isl_seq.lo `test -f 'isl_seq.c' || echo '$(srcdir)/'`isl_seq.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_seq.Tpo $(DEPDIR)/libisl_la-isl_seq.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_seq.c' object='libisl_la-isl_seq.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_seq.lo `test -f 'isl_seq.c' || echo '$(srcdir)/'`isl_seq.c - -libisl_la-isl_tab.lo: isl_tab.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_tab.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_tab.Tpo -c -o libisl_la-isl_tab.lo `test -f 'isl_tab.c' || echo '$(srcdir)/'`isl_tab.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_tab.Tpo $(DEPDIR)/libisl_la-isl_tab.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_tab.c' object='libisl_la-isl_tab.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_tab.lo `test -f 'isl_tab.c' || echo '$(srcdir)/'`isl_tab.c - -libisl_la-isl_tab_pip.lo: isl_tab_pip.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_tab_pip.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_tab_pip.Tpo -c -o libisl_la-isl_tab_pip.lo `test -f 'isl_tab_pip.c' || echo '$(srcdir)/'`isl_tab_pip.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_tab_pip.Tpo $(DEPDIR)/libisl_la-isl_tab_pip.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_tab_pip.c' object='libisl_la-isl_tab_pip.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_tab_pip.lo `test -f 'isl_tab_pip.c' || echo '$(srcdir)/'`isl_tab_pip.c - -libisl_la-isl_tarjan.lo: isl_tarjan.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_tarjan.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_tarjan.Tpo -c -o libisl_la-isl_tarjan.lo `test -f 'isl_tarjan.c' || echo '$(srcdir)/'`isl_tarjan.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_tarjan.Tpo $(DEPDIR)/libisl_la-isl_tarjan.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_tarjan.c' object='libisl_la-isl_tarjan.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_tarjan.lo `test -f 'isl_tarjan.c' || echo '$(srcdir)/'`isl_tarjan.c - -libisl_la-isl_transitive_closure.lo: isl_transitive_closure.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_transitive_closure.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_transitive_closure.Tpo -c -o libisl_la-isl_transitive_closure.lo `test -f 'isl_transitive_closure.c' || echo '$(srcdir)/'`isl_transitive_closure.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_transitive_closure.Tpo $(DEPDIR)/libisl_la-isl_transitive_closure.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_transitive_closure.c' object='libisl_la-isl_transitive_closure.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_transitive_closure.lo `test -f 'isl_transitive_closure.c' || echo '$(srcdir)/'`isl_transitive_closure.c - -libisl_la-isl_union_map.lo: isl_union_map.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_union_map.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_union_map.Tpo -c -o libisl_la-isl_union_map.lo `test -f 'isl_union_map.c' || echo '$(srcdir)/'`isl_union_map.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_union_map.Tpo $(DEPDIR)/libisl_la-isl_union_map.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_union_map.c' object='libisl_la-isl_union_map.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_union_map.lo `test -f 'isl_union_map.c' || echo '$(srcdir)/'`isl_union_map.c - -libisl_la-isl_val.lo: isl_val.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_val.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_val.Tpo -c -o libisl_la-isl_val.lo `test -f 'isl_val.c' || echo '$(srcdir)/'`isl_val.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_val.Tpo $(DEPDIR)/libisl_la-isl_val.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_val.c' object='libisl_la-isl_val.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_val.lo `test -f 'isl_val.c' || echo '$(srcdir)/'`isl_val.c - -libisl_la-isl_val_gmp.lo: isl_val_gmp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_val_gmp.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_val_gmp.Tpo -c -o libisl_la-isl_val_gmp.lo `test -f 'isl_val_gmp.c' || echo '$(srcdir)/'`isl_val_gmp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_val_gmp.Tpo $(DEPDIR)/libisl_la-isl_val_gmp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_val_gmp.c' object='libisl_la-isl_val_gmp.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_val_gmp.lo `test -f 'isl_val_gmp.c' || echo '$(srcdir)/'`isl_val_gmp.c - -libisl_la-isl_vec.lo: isl_vec.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_vec.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_vec.Tpo -c -o libisl_la-isl_vec.lo `test -f 'isl_vec.c' || echo '$(srcdir)/'`isl_vec.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_vec.Tpo $(DEPDIR)/libisl_la-isl_vec.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_vec.c' object='libisl_la-isl_vec.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_vec.lo `test -f 'isl_vec.c' || echo '$(srcdir)/'`isl_vec.c - -libisl_la-isl_version.lo: isl_version.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_version.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_version.Tpo -c -o libisl_la-isl_version.lo `test -f 'isl_version.c' || echo '$(srcdir)/'`isl_version.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_version.Tpo $(DEPDIR)/libisl_la-isl_version.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_version.c' object='libisl_la-isl_version.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_version.lo `test -f 'isl_version.c' || echo '$(srcdir)/'`isl_version.c - -libisl_la-isl_vertices.lo: isl_vertices.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libisl_la-isl_vertices.lo -MD -MP -MF $(DEPDIR)/libisl_la-isl_vertices.Tpo -c -o libisl_la-isl_vertices.lo `test -f 'isl_vertices.c' || echo '$(srcdir)/'`isl_vertices.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libisl_la-isl_vertices.Tpo $(DEPDIR)/libisl_la-isl_vertices.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_vertices.c' object='libisl_la-isl_vertices.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libisl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libisl_la-isl_vertices.lo `test -f 'isl_vertices.c' || echo '$(srcdir)/'`isl_vertices.c - -isl_bound-bound.o: bound.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_bound_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_bound-bound.o -MD -MP -MF $(DEPDIR)/isl_bound-bound.Tpo -c -o isl_bound-bound.o `test -f 'bound.c' || echo '$(srcdir)/'`bound.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_bound-bound.Tpo $(DEPDIR)/isl_bound-bound.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bound.c' object='isl_bound-bound.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_bound_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_bound-bound.o `test -f 'bound.c' || echo '$(srcdir)/'`bound.c - -isl_bound-bound.obj: bound.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_bound_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_bound-bound.obj -MD -MP -MF $(DEPDIR)/isl_bound-bound.Tpo -c -o isl_bound-bound.obj `if test -f 'bound.c'; then $(CYGPATH_W) 'bound.c'; else $(CYGPATH_W) '$(srcdir)/bound.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_bound-bound.Tpo $(DEPDIR)/isl_bound-bound.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bound.c' object='isl_bound-bound.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_bound_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_bound-bound.obj `if test -f 'bound.c'; then $(CYGPATH_W) 'bound.c'; else $(CYGPATH_W) '$(srcdir)/bound.c'; fi` - -isl_cat-cat.o: cat.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_cat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_cat-cat.o -MD -MP -MF $(DEPDIR)/isl_cat-cat.Tpo -c -o isl_cat-cat.o `test -f 'cat.c' || echo '$(srcdir)/'`cat.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_cat-cat.Tpo $(DEPDIR)/isl_cat-cat.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cat.c' object='isl_cat-cat.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_cat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_cat-cat.o `test -f 'cat.c' || echo '$(srcdir)/'`cat.c - -isl_cat-cat.obj: cat.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_cat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_cat-cat.obj -MD -MP -MF $(DEPDIR)/isl_cat-cat.Tpo -c -o isl_cat-cat.obj `if test -f 'cat.c'; then $(CYGPATH_W) 'cat.c'; else $(CYGPATH_W) '$(srcdir)/cat.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_cat-cat.Tpo $(DEPDIR)/isl_cat-cat.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cat.c' object='isl_cat-cat.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_cat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_cat-cat.obj `if test -f 'cat.c'; then $(CYGPATH_W) 'cat.c'; else $(CYGPATH_W) '$(srcdir)/cat.c'; fi` - -isl_closure-closure.o: closure.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_closure_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_closure-closure.o -MD -MP -MF $(DEPDIR)/isl_closure-closure.Tpo -c -o isl_closure-closure.o `test -f 'closure.c' || echo '$(srcdir)/'`closure.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_closure-closure.Tpo $(DEPDIR)/isl_closure-closure.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='closure.c' object='isl_closure-closure.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_closure_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_closure-closure.o `test -f 'closure.c' || echo '$(srcdir)/'`closure.c - -isl_closure-closure.obj: closure.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_closure_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_closure-closure.obj -MD -MP -MF $(DEPDIR)/isl_closure-closure.Tpo -c -o isl_closure-closure.obj `if test -f 'closure.c'; then $(CYGPATH_W) 'closure.c'; else $(CYGPATH_W) '$(srcdir)/closure.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_closure-closure.Tpo $(DEPDIR)/isl_closure-closure.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='closure.c' object='isl_closure-closure.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_closure_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_closure-closure.obj `if test -f 'closure.c'; then $(CYGPATH_W) 'closure.c'; else $(CYGPATH_W) '$(srcdir)/closure.c'; fi` - -isl_codegen-codegen.o: codegen.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_codegen_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_codegen-codegen.o -MD -MP -MF $(DEPDIR)/isl_codegen-codegen.Tpo -c -o isl_codegen-codegen.o `test -f 'codegen.c' || echo '$(srcdir)/'`codegen.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_codegen-codegen.Tpo $(DEPDIR)/isl_codegen-codegen.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='codegen.c' object='isl_codegen-codegen.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_codegen_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_codegen-codegen.o `test -f 'codegen.c' || echo '$(srcdir)/'`codegen.c - -isl_codegen-codegen.obj: codegen.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_codegen_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_codegen-codegen.obj -MD -MP -MF $(DEPDIR)/isl_codegen-codegen.Tpo -c -o isl_codegen-codegen.obj `if test -f 'codegen.c'; then $(CYGPATH_W) 'codegen.c'; else $(CYGPATH_W) '$(srcdir)/codegen.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_codegen-codegen.Tpo $(DEPDIR)/isl_codegen-codegen.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='codegen.c' object='isl_codegen-codegen.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_codegen_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_codegen-codegen.obj `if test -f 'codegen.c'; then $(CYGPATH_W) 'codegen.c'; else $(CYGPATH_W) '$(srcdir)/codegen.c'; fi` - -isl_pip-pip.o: pip.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_pip_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_pip-pip.o -MD -MP -MF $(DEPDIR)/isl_pip-pip.Tpo -c -o isl_pip-pip.o `test -f 'pip.c' || echo '$(srcdir)/'`pip.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_pip-pip.Tpo $(DEPDIR)/isl_pip-pip.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pip.c' object='isl_pip-pip.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_pip_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_pip-pip.o `test -f 'pip.c' || echo '$(srcdir)/'`pip.c - -isl_pip-pip.obj: pip.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_pip_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_pip-pip.obj -MD -MP -MF $(DEPDIR)/isl_pip-pip.Tpo -c -o isl_pip-pip.obj `if test -f 'pip.c'; then $(CYGPATH_W) 'pip.c'; else $(CYGPATH_W) '$(srcdir)/pip.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_pip-pip.Tpo $(DEPDIR)/isl_pip-pip.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pip.c' object='isl_pip-pip.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_pip_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_pip-pip.obj `if test -f 'pip.c'; then $(CYGPATH_W) 'pip.c'; else $(CYGPATH_W) '$(srcdir)/pip.c'; fi` - -isl_polyhedron_detect_equalities-polyhedron_detect_equalities.o: polyhedron_detect_equalities.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_polyhedron_detect_equalities_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_polyhedron_detect_equalities-polyhedron_detect_equalities.o -MD -MP -MF $(DEPDIR)/isl_polyhedron_detect_equalities-polyhedron_detect_equalities.Tpo -c -o isl_polyhedron_detect_equalities-polyhedron_detect_equalities.o `test -f 'polyhedron_detect_equalities.c' || echo '$(srcdir)/'`polyhedron_detect_equalities.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_polyhedron_detect_equalities-polyhedron_detect_equalities.Tpo $(DEPDIR)/isl_polyhedron_detect_equalities-polyhedron_detect_equalities.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='polyhedron_detect_equalities.c' object='isl_polyhedron_detect_equalities-polyhedron_detect_equalities.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_polyhedron_detect_equalities_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_polyhedron_detect_equalities-polyhedron_detect_equalities.o `test -f 'polyhedron_detect_equalities.c' || echo '$(srcdir)/'`polyhedron_detect_equalities.c - -isl_polyhedron_detect_equalities-polyhedron_detect_equalities.obj: polyhedron_detect_equalities.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_polyhedron_detect_equalities_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_polyhedron_detect_equalities-polyhedron_detect_equalities.obj -MD -MP -MF $(DEPDIR)/isl_polyhedron_detect_equalities-polyhedron_detect_equalities.Tpo -c -o isl_polyhedron_detect_equalities-polyhedron_detect_equalities.obj `if test -f 'polyhedron_detect_equalities.c'; then $(CYGPATH_W) 'polyhedron_detect_equalities.c'; else $(CYGPATH_W) '$(srcdir)/polyhedron_detect_equalities.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_polyhedron_detect_equalities-polyhedron_detect_equalities.Tpo $(DEPDIR)/isl_polyhedron_detect_equalities-polyhedron_detect_equalities.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='polyhedron_detect_equalities.c' object='isl_polyhedron_detect_equalities-polyhedron_detect_equalities.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_polyhedron_detect_equalities_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_polyhedron_detect_equalities-polyhedron_detect_equalities.obj `if test -f 'polyhedron_detect_equalities.c'; then $(CYGPATH_W) 'polyhedron_detect_equalities.c'; else $(CYGPATH_W) '$(srcdir)/polyhedron_detect_equalities.c'; fi` - -isl_polyhedron_minimize-polyhedron_minimize.o: polyhedron_minimize.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_polyhedron_minimize_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_polyhedron_minimize-polyhedron_minimize.o -MD -MP -MF $(DEPDIR)/isl_polyhedron_minimize-polyhedron_minimize.Tpo -c -o isl_polyhedron_minimize-polyhedron_minimize.o `test -f 'polyhedron_minimize.c' || echo '$(srcdir)/'`polyhedron_minimize.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_polyhedron_minimize-polyhedron_minimize.Tpo $(DEPDIR)/isl_polyhedron_minimize-polyhedron_minimize.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='polyhedron_minimize.c' object='isl_polyhedron_minimize-polyhedron_minimize.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_polyhedron_minimize_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_polyhedron_minimize-polyhedron_minimize.o `test -f 'polyhedron_minimize.c' || echo '$(srcdir)/'`polyhedron_minimize.c - -isl_polyhedron_minimize-polyhedron_minimize.obj: polyhedron_minimize.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_polyhedron_minimize_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_polyhedron_minimize-polyhedron_minimize.obj -MD -MP -MF $(DEPDIR)/isl_polyhedron_minimize-polyhedron_minimize.Tpo -c -o isl_polyhedron_minimize-polyhedron_minimize.obj `if test -f 'polyhedron_minimize.c'; then $(CYGPATH_W) 'polyhedron_minimize.c'; else $(CYGPATH_W) '$(srcdir)/polyhedron_minimize.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_polyhedron_minimize-polyhedron_minimize.Tpo $(DEPDIR)/isl_polyhedron_minimize-polyhedron_minimize.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='polyhedron_minimize.c' object='isl_polyhedron_minimize-polyhedron_minimize.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_polyhedron_minimize_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_polyhedron_minimize-polyhedron_minimize.obj `if test -f 'polyhedron_minimize.c'; then $(CYGPATH_W) 'polyhedron_minimize.c'; else $(CYGPATH_W) '$(srcdir)/polyhedron_minimize.c'; fi` - -isl_polyhedron_sample-polyhedron_sample.o: polyhedron_sample.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_polyhedron_sample_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_polyhedron_sample-polyhedron_sample.o -MD -MP -MF $(DEPDIR)/isl_polyhedron_sample-polyhedron_sample.Tpo -c -o isl_polyhedron_sample-polyhedron_sample.o `test -f 'polyhedron_sample.c' || echo '$(srcdir)/'`polyhedron_sample.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_polyhedron_sample-polyhedron_sample.Tpo $(DEPDIR)/isl_polyhedron_sample-polyhedron_sample.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='polyhedron_sample.c' object='isl_polyhedron_sample-polyhedron_sample.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_polyhedron_sample_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_polyhedron_sample-polyhedron_sample.o `test -f 'polyhedron_sample.c' || echo '$(srcdir)/'`polyhedron_sample.c - -isl_polyhedron_sample-polyhedron_sample.obj: polyhedron_sample.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_polyhedron_sample_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_polyhedron_sample-polyhedron_sample.obj -MD -MP -MF $(DEPDIR)/isl_polyhedron_sample-polyhedron_sample.Tpo -c -o isl_polyhedron_sample-polyhedron_sample.obj `if test -f 'polyhedron_sample.c'; then $(CYGPATH_W) 'polyhedron_sample.c'; else $(CYGPATH_W) '$(srcdir)/polyhedron_sample.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_polyhedron_sample-polyhedron_sample.Tpo $(DEPDIR)/isl_polyhedron_sample-polyhedron_sample.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='polyhedron_sample.c' object='isl_polyhedron_sample-polyhedron_sample.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_polyhedron_sample_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_polyhedron_sample-polyhedron_sample.obj `if test -f 'polyhedron_sample.c'; then $(CYGPATH_W) 'polyhedron_sample.c'; else $(CYGPATH_W) '$(srcdir)/polyhedron_sample.c'; fi` - -isl_polytope_scan-polytope_scan.o: polytope_scan.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_polytope_scan_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_polytope_scan-polytope_scan.o -MD -MP -MF $(DEPDIR)/isl_polytope_scan-polytope_scan.Tpo -c -o isl_polytope_scan-polytope_scan.o `test -f 'polytope_scan.c' || echo '$(srcdir)/'`polytope_scan.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_polytope_scan-polytope_scan.Tpo $(DEPDIR)/isl_polytope_scan-polytope_scan.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='polytope_scan.c' object='isl_polytope_scan-polytope_scan.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_polytope_scan_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_polytope_scan-polytope_scan.o `test -f 'polytope_scan.c' || echo '$(srcdir)/'`polytope_scan.c - -isl_polytope_scan-polytope_scan.obj: polytope_scan.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_polytope_scan_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_polytope_scan-polytope_scan.obj -MD -MP -MF $(DEPDIR)/isl_polytope_scan-polytope_scan.Tpo -c -o isl_polytope_scan-polytope_scan.obj `if test -f 'polytope_scan.c'; then $(CYGPATH_W) 'polytope_scan.c'; else $(CYGPATH_W) '$(srcdir)/polytope_scan.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_polytope_scan-polytope_scan.Tpo $(DEPDIR)/isl_polytope_scan-polytope_scan.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='polytope_scan.c' object='isl_polytope_scan-polytope_scan.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_polytope_scan_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_polytope_scan-polytope_scan.obj `if test -f 'polytope_scan.c'; then $(CYGPATH_W) 'polytope_scan.c'; else $(CYGPATH_W) '$(srcdir)/polytope_scan.c'; fi` - -isl_test-isl_test.o: isl_test.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_test-isl_test.o -MD -MP -MF $(DEPDIR)/isl_test-isl_test.Tpo -c -o isl_test-isl_test.o `test -f 'isl_test.c' || echo '$(srcdir)/'`isl_test.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_test-isl_test.Tpo $(DEPDIR)/isl_test-isl_test.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_test.c' object='isl_test-isl_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_test-isl_test.o `test -f 'isl_test.c' || echo '$(srcdir)/'`isl_test.c - -isl_test-isl_test.obj: isl_test.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT isl_test-isl_test.obj -MD -MP -MF $(DEPDIR)/isl_test-isl_test.Tpo -c -o isl_test-isl_test.obj `if test -f 'isl_test.c'; then $(CYGPATH_W) 'isl_test.c'; else $(CYGPATH_W) '$(srcdir)/isl_test.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_test-isl_test.Tpo $(DEPDIR)/isl_test-isl_test.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isl_test.c' object='isl_test-isl_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(isl_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o isl_test-isl_test.obj `if test -f 'isl_test.c'; then $(CYGPATH_W) 'isl_test.c'; else $(CYGPATH_W) '$(srcdir)/isl_test.c'; fi` - mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs + -rm -rf imath_wrap/.libs imath_wrap/_libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) - test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -1686,10 +1369,34 @@ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +install-deprecatedHEADERS: $(deprecated_HEADERS) + @$(NORMAL_INSTALL) + @list='$(deprecated_HEADERS)'; test -n "$(deprecateddir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(deprecateddir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(deprecateddir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(deprecateddir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(deprecateddir)" || exit $$?; \ + done + +uninstall-deprecatedHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(deprecated_HEADERS)'; test -n "$(deprecateddir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(deprecateddir)'; $(am__uninstall_files_from_dir) install-nodist_pkgincludeHEADERS: $(nodist_pkginclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" @list='$(nodist_pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -1706,8 +1413,11 @@ dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -1724,22 +1434,25 @@ dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -1754,57 +1467,12 @@ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -TAGS: tags-recursive $(HEADERS) $(SOURCES) isl_config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -1820,12 +1488,7 @@ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) isl_config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -1837,15 +1500,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) isl_config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) isl_config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -1854,102 +1513,215 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files -check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; skip=0; \ - srcdir=$(srcdir); export srcdir; \ - list=' $(TESTS) '; \ - $(am__tty_colors); \ - if test -n "$$list"; then \ - for tst in $$list; do \ - if test -f ./$$tst; then dir=./; \ - elif test -f $$tst; then dir=; \ - else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xpass=`expr $$xpass + 1`; \ - failed=`expr $$failed + 1`; \ - col=$$red; res=XPASS; \ - ;; \ - *) \ - col=$$grn; res=PASS; \ - ;; \ - esac; \ - elif test $$? -ne 77; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xfail=`expr $$xfail + 1`; \ - col=$$lgn; res=XFAIL; \ - ;; \ - *) \ - failed=`expr $$failed + 1`; \ - col=$$red; res=FAIL; \ - ;; \ - esac; \ - else \ - skip=`expr $$skip + 1`; \ - col=$$blu; res=SKIP; \ - fi; \ - echo "$${col}$$res$${std}: $$tst"; \ - done; \ - if test "$$all" -eq 1; then \ - tests="test"; \ - All=""; \ - else \ - tests="tests"; \ - All="All "; \ +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ - if test "$$failed" -eq 0; then \ - if test "$$xfail" -eq 0; then \ - banner="$$All$$all $$tests passed"; \ - else \ - if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ - banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ - fi; \ - else \ - if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all $$tests failed"; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + else \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ else \ - if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ - banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ - fi; \ - dashes="$$banner"; \ - skipped=""; \ - if test "$$skip" -ne 0; then \ - if test "$$skip" -eq 1; then \ - skipped="($$skip test was not run)"; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ else \ - skipped="($$skip tests were not run)"; \ + color_start= color_end=; \ fi; \ - test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$skipped"; \ - fi; \ - report=""; \ - if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ - report="Please report to $(PACKAGE_BUGREPORT)"; \ - test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$report"; \ - fi; \ - dashes=`echo "$$dashes" | sed s/./=/g`; \ - if test "$$failed" -eq 0; then \ - col="$$grn"; \ - else \ - col="$$red"; \ - fi; \ - echo "$${col}$$dashes$${std}"; \ - echo "$${col}$$banner$${std}"; \ - test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ - test -z "$$report" || echo "$${col}$$report$${std}"; \ - echo "$${col}$$dashes$${std}"; \ - test "$$failed" -eq 0; \ - else :; fi + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +isl_test.log: isl_test$(EXEEXT) + @p='isl_test$(EXEEXT)'; \ + b='isl_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +codegen_test.sh.log: codegen_test.sh + @p='codegen_test.sh'; \ + b='codegen_test.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +pip_test.sh.log: pip_test.sh + @p='pip_test.sh'; \ + b='pip_test.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +bound_test.sh.log: bound_test.sh + @p='bound_test.sh'; \ + b='bound_test.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) $(am__remove_distdir) @@ -1985,13 +1757,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -2023,40 +1792,42 @@ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__remove_distdir) + $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__remove_distdir) - -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) + $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) + $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) + $(am__post_remove_distdir) -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another @@ -2067,8 +1838,6 @@ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ @@ -2080,18 +1849,19 @@ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -2114,7 +1884,7 @@ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 - $(am__remove_distdir) + $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' @@ -2151,7 +1921,7 @@ isl_config.h installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)" "$(DESTDIR)$(pkgincludedir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(deprecateddir)" "$(DESTDIR)$(pkgincludedir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive @@ -2174,12 +1944,17 @@ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f imath_wrap/$(DEPDIR)/$(am__dirstamp) + -rm -f imath_wrap/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -2191,7 +1966,7 @@ distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf ./$(DEPDIR) + -rm -rf ./$(DEPDIR) imath_wrap/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags @@ -2208,8 +1983,9 @@ info-am: -install-data-am: install-data-local install-nodist_pkgincludeHEADERS \ - install-pkgconfigDATA install-pkgincludeHEADERS +install-data-am: install-data-local install-deprecatedHEADERS \ + install-nodist_pkgincludeHEADERS install-pkgconfigDATA \ + install-pkgincludeHEADERS install-dvi: install-dvi-recursive @@ -2240,7 +2016,7 @@ maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf ./$(DEPDIR) + -rm -rf ./$(DEPDIR) imath_wrap/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -2257,35 +2033,36 @@ ps-am: -uninstall-am: uninstall-libLTLIBRARIES \ +uninstall-am: uninstall-deprecatedHEADERS uninstall-libLTLIBRARIES \ uninstall-nodist_pkgincludeHEADERS uninstall-pkgconfigDATA \ uninstall-pkgincludeHEADERS -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check-am \ - ctags-recursive install-am install-strip tags-recursive +.MAKE: $(am__recursive_targets) all check-am install-am install-strip -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am am--refresh check check-TESTS check-am clean \ +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-TESTS check-am clean clean-cscope \ clean-generic clean-libLTLIBRARIES clean-libtool \ - clean-noinstPROGRAMS ctags ctags-recursive dist dist-all \ - dist-bzip2 dist-gzip dist-hook dist-lzip dist-lzma dist-shar \ + clean-noinstPROGRAMS cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \ dist-tarZ dist-xz dist-zip distcheck distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ - install-data-local install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-libLTLIBRARIES install-man \ + install-data-local install-deprecatedHEADERS install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man \ install-nodist_pkgincludeHEADERS install-pdf install-pdf-am \ install-pkgconfigDATA install-pkgincludeHEADERS install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am \ - uninstall-libLTLIBRARIES uninstall-nodist_pkgincludeHEADERS \ - uninstall-pkgconfigDATA uninstall-pkgincludeHEADERS + recheck tags tags-am uninstall uninstall-am \ + uninstall-deprecatedHEADERS uninstall-libLTLIBRARIES \ + uninstall-nodist_pkgincludeHEADERS uninstall-pkgconfigDATA \ + uninstall-pkgincludeHEADERS dist-hook: diff -Nru cloog-0.18.2/isl/missing cloog-0.18.4/isl/missing --- cloog-0.18.2/isl/missing 2013-12-18 12:36:00.000000000 +0000 +++ cloog-0.18.4/isl/missing 2014-10-02 14:14:38.000000000 +0000 @@ -1,11 +1,10 @@ #! /bin/sh -# Common stub for a few missing GNU programs while installing. +# Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-01-06.13; # UTC +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,68 +25,40 @@ # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "Try '$0 --help' for more information" exit 1 fi -run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi +case $1 in -msg="missing on your system" + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; -case $1 in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - yacc create \`y.tab.[ch]', if possible, from existing .[ch] + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man -Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and -\`g' are ignored when checking the name. +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. Send bug reports to ." exit $? @@ -99,228 +70,141 @@ ;; -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac -# normalize program name to check for. -program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). This is about non-GNU programs, so use $1 not -# $program. -case $1 in - lex*|yacc*) - # Not GNU programs, they don't have --version. - ;; +# Run the given program, remember its exit status. +"$@"; st=$? - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case $program in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case $f in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; +# If it succeeded, we are done. +test $st -eq 0 && exit 0 - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te*) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison*|yacc*) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if test $# -ne 1; then - eval LASTARG=\${$#} - case $LASTARG in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if test ! -f y.tab.h; then - echo >y.tab.h - fi - if test ! -f y.tab.c; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex*|flex*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if test $# -ne 1; then - eval LASTARG=\${$#} - case $LASTARG in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if test ! -f lex.yy.c; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit $? - fi - ;; - - makeinfo*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi -exit 0 +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff -Nru cloog-0.18.2/isl/pip.c cloog-0.18.4/isl/pip.c --- cloog-0.18.2/isl/pip.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/pip.c 2015-07-24 12:23:09.000000000 +0000 @@ -16,10 +16,11 @@ #include "isl_tab.h" #include "isl_sample.h" #include "isl_scan.h" -#include -#include +#include +#include #include #include +#include #include /* The input of this program is the same as that of the "example" program @@ -198,7 +199,7 @@ * Otherwise, the optimal solution, should be equal to the result of * plugging in the value of the parameters in "sol". */ -static int scan_one(struct isl_scan_callback *callback, +static isl_stat scan_one(struct isl_scan_callback *callback, __isl_take isl_vec *sample) { struct isl_scan_pip *sp = (struct isl_scan_pip *)callback; @@ -230,7 +231,7 @@ fflush(stdout); } - return sp->n >= 1 ? 0 : -1; + return sp->n >= 1 ? isl_stat_ok : isl_stat_error; } static void check_solution(isl_basic_set *bset, isl_basic_set *context, diff -Nru cloog-0.18.2/isl/polyhedron_detect_equalities.c cloog-0.18.4/isl/polyhedron_detect_equalities.c --- cloog-0.18.2/isl/polyhedron_detect_equalities.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/polyhedron_detect_equalities.c 2015-07-24 12:23:09.000000000 +0000 @@ -13,10 +13,16 @@ { struct isl_ctx *ctx = isl_ctx_alloc(); struct isl_basic_set *bset; + isl_printer *p; bset = isl_basic_set_read_from_file(ctx, stdin); bset = isl_basic_set_detect_equalities(bset); - isl_basic_set_print(bset, stdout, 0, "", "", ISL_FORMAT_POLYLIB); + + p = isl_printer_to_file(ctx, stdout); + p = isl_printer_set_output_format(p, ISL_FORMAT_POLYLIB); + p = isl_printer_print_basic_set(p, bset); + isl_printer_free(p); + isl_basic_set_free(bset); isl_ctx_free(ctx); diff -Nru cloog-0.18.2/isl/polyhedron_minimize.c cloog-0.18.4/isl/polyhedron_minimize.c --- cloog-0.18.2/isl/polyhedron_minimize.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/polyhedron_minimize.c 2014-10-02 15:33:27.000000000 +0000 @@ -10,8 +10,9 @@ #include #include #include -#include -#include +#include +#include +#include /* The input of this program is the same as that of the "polytope_minimize" * program from the barvinok distribution. diff -Nru cloog-0.18.2/isl/polyhedron_sample.c cloog-0.18.4/isl/polyhedron_sample.c --- cloog-0.18.2/isl/polyhedron_sample.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/polyhedron_sample.c 2014-10-02 15:33:27.000000000 +0000 @@ -26,7 +26,7 @@ p = isl_printer_end_line(p); isl_printer_free(p); assert(sample); - if (sample->size > 0) + if (isl_vec_size(sample) > 0) assert(isl_basic_set_contains(bset, sample)); isl_basic_set_free(bset); isl_vec_free(sample); diff -Nru cloog-0.18.2/isl/polytope_scan.c cloog-0.18.4/isl/polytope_scan.c --- cloog-0.18.2/isl/polytope_scan.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/polytope_scan.c 2015-07-24 12:23:09.000000000 +0000 @@ -10,9 +10,10 @@ #include #include #include "isl_equalities.h" -#include +#include #include "isl_scan.h" #include +#include /* The input of this program is the same as that of the "polytope_scan" * program from the barvinok distribution. @@ -27,7 +28,7 @@ struct isl_mat *samples; }; -static int scan_samples_add_sample(struct isl_scan_callback *cb, +static isl_stat scan_samples_add_sample(struct isl_scan_callback *cb, __isl_take isl_vec *sample) { struct scan_samples *ss = (struct scan_samples *)cb; @@ -41,10 +42,10 @@ sample->el, sample->size); isl_vec_free(sample); - return 0; + return isl_stat_ok; error: isl_vec_free(sample); - return -1; + return isl_stat_error; } static struct isl_mat *isl_basic_set_scan_samples(struct isl_basic_set *bset) diff -Nru cloog-0.18.2/isl/print.c cloog-0.18.4/isl/print.c --- cloog-0.18.2/isl/print.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/print.c 2015-07-24 12:23:09.000000000 +0000 @@ -21,6 +21,9 @@ #define BASE val #include #undef BASE +#define BASE multi_val +#include +#undef BASE #define BASE space #include #undef BASE @@ -87,6 +90,12 @@ #define BASE multi_pw_aff #include #undef BASE +#define BASE union_pw_aff +#include +#undef BASE +#define BASE multi_union_pw_aff +#include +#undef BASE #define BASE point #include #undef BASE diff -Nru cloog-0.18.2/isl/README cloog-0.18.4/isl/README --- cloog-0.18.2/isl/README 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/README 2014-10-02 15:48:18.000000000 +0000 @@ -29,6 +29,11 @@ For bug reports, feature requests and questions, contact http://groups.google.com/group/isl-development +Whenever you report a bug, please mention the exact version of isl +that you are using (output of "./isl_cat --version"). If you are unable +to compile isl, then report the git version (output of "git describe") +or the version included in the name of the tarball. + If you use isl for your research, you are invited do cite the following paper and/or the paper(s) describing the specific operations you use. diff -Nru cloog-0.18.2/isl/test-driver cloog-0.18.4/isl/test-driver --- cloog-0.18.2/isl/test-driver 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test-driver 2014-10-02 14:14:39.000000000 +0000 @@ -0,0 +1,139 @@ +#! /bin/sh +# test-driver - basic testsuite driver script. + +scriptversion=2013-07-13.22; # UTC + +# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# +# This program 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 2, or (at your option) +# any later version. +# +# This program 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 this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +# Make unconditional expansion of undefined variables an error. This +# helps a lot in preventing typo-related bugs. +set -u + +usage_error () +{ + echo "$0: $*" >&2 + print_usage >&2 + exit 2 +} + +print_usage () +{ + cat <$log_file 2>&1 +estatus=$? +if test $enable_hard_errors = no && test $estatus -eq 99; then + estatus=1 +fi + +case $estatus:$expect_failure in + 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; + 0:*) col=$grn res=PASS recheck=no gcopy=no;; + 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; + 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; + *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; + *:*) col=$red res=FAIL recheck=yes gcopy=yes;; +esac + +# Report outcome to console. +echo "${col}${res}${std}: $test_name" + +# Register the test result, and other relevant metadata. +echo ":test-result: $res" > $trs_file +echo ":global-test-result: $res" >> $trs_file +echo ":recheck: $recheck" >> $trs_file +echo ":copy-in-global-log: $gcopy" >> $trs_file + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru cloog-0.18.2/isl/test_inputs/codegen/atomic3.c cloog-0.18.4/isl/test_inputs/codegen/atomic3.c --- cloog-0.18.2/isl/test_inputs/codegen/atomic3.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/atomic3.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,7 +1,8 @@ -for (int c0 = 0; c0 <= 64; c0 += 1) +for (int c0 = 0; c0 <= 64; c0 += 1) { if (c0 >= 63) { sync(); } else if (c0 >= 1) { sync(); } else sync(); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/atomic.st cloog-0.18.4/isl/test_inputs/codegen/atomic.st --- cloog-0.18.2/isl/test_inputs/codegen/atomic.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/atomic.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,4 @@ +domain: "{ a[i] : 0 <= i < 10; b[i] : 0 <= i < 10 }" +child: + schedule: "[{ a[i] -> [i]; b[i] -> [i+1] }]" + options: "{ atomic[x] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/0D-1.in cloog-0.18.4/isl/test_inputs/codegen/cloog/0D-1.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/0D-1.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/0D-1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[] -> [0] } -{ : } -{ [i] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/0D-1.st cloog-0.18.4/isl/test_inputs/codegen/cloog/0D-1.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/0D-1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/0D-1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,3 @@ +domain: "{ S1[] }" +child: + context: "{ [] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/0D-2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/0D-2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/0D-2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/0D-2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[] -> [0] : M >= 0 } -[M] -> { : } -[M] -> { [i] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/0D-2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/0D-2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/0D-2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/0D-2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,3 @@ +domain: "[M] -> { S1[] : M >= 0 }" +child: + context: "[M] -> { [] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/0D-3.in cloog-0.18.4/isl/test_inputs/codegen/cloog/0D-3.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/0D-3.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/0D-3.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[] -> [0] : M >= 0 } -[M] -> { : M >= 0 } -[M] -> { [i] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/0D-3.st cloog-0.18.4/isl/test_inputs/codegen/cloog/0D-3.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/0D-3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/0D-3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,3 @@ +domain: "[M] -> { S1[] : M >= 0 }" +child: + context: "[M] -> { [] : M >= 0 }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/1point-1.in cloog-0.18.4/isl/test_inputs/codegen/cloog/1point-1.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/1point-1.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/1point-1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[2M, M] -> [2M, M, 0] } -[M] -> { : } -[M] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/1point-1.st cloog-0.18.4/isl/test_inputs/codegen/cloog/1point-1.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/1point-1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/1point-1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[2M, M] }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/1point-2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/1point-2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/1point-2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/1point-2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S1[2M, 2 + N] -> [2M, 2 + N, 0] } -[M, N] -> { : } -[M, N] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/1point-2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/1point-2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/1point-2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/1point-2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M, N] -> { S1[2M, 2 + N] }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/4-param.c cloog-0.18.4/isl/test_inputs/codegen/cloog/4-param.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/4-param.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/4-param.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,9 +1,9 @@ { - for (int c0 = m; c0 <= min(p - 1, n); c0 += 1) + for (int c0 = m; c0 <= min(n, p - 1); c0 += 1) S1(c0); - for (int c0 = p; c0 <= min(q, m - 1); c0 += 1) + for (int c0 = p; c0 <= min(m - 1, q); c0 += 1) S2(c0); - for (int c0 = max(m, p); c0 <= min(q, n); c0 += 1) { + for (int c0 = max(m, p); c0 <= min(n, q); c0 += 1) { S1(c0); S2(c0); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/4-param.in cloog-0.18.4/isl/test_inputs/codegen/cloog/4-param.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/4-param.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/4-param.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[m, n, p, q] -> { S1[i0] -> [i0, 0] : i0 >= m and i0 <= n; S2[i0] -> [i0, 1] : i0 >= p and i0 <= q } -[m, n, p, q] -> { : } -[m, n, p, q] -> { [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/4-param.st cloog-0.18.4/isl/test_inputs/codegen/cloog/4-param.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/4-param.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/4-param.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[m, n, p, q] -> { S1[i0] : i0 >= m and i0 <= n; S2[i0] : i0 >= p and i0 <= q }" +child: + context: "[m, n, p, q] -> { [] }" + child: + schedule: "[m, n, p, q] -> [{ S2[i0] -> [(i0)]; S1[i0] -> [(i0)] }]" + options: "[m, n, p, q] -> { separate[i0] }" + child: + sequence: + - filter: "[m, n, p, q] -> { S1[i0] }" + - filter: "[m, n, p, q] -> { S2[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/backtrack.in cloog-0.18.4/isl/test_inputs/codegen/cloog/backtrack.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/backtrack.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/backtrack.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[0] -> [0, 0] } -{ : } -{ [i, j] -> atomic[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/backtrack.st cloog-0.18.4/isl/test_inputs/codegen/cloog/backtrack.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/backtrack.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/backtrack.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "{ S1[0] }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0] -> [(i0)] }]" + options: "{ separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-1.in cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-1.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-1.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[i0] -> [i0, 0] : i0 >= 0 and i0 <= 2 } -{ : } -{ [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-1.st cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-1.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "{ S1[i0] : i0 >= 0 and i0 <= 2 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0] -> [(i0)] }]" + options: "{ separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[0] -> [0, 0] } -{ : } -{ [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "{ S1[0] }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0] -> [(i0)] }]" + options: "{ separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-3.in cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-3.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-3.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-3.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0] -> [i0, 0] : i0 >= 0 and i0 <= M } -[M] -> { : M >= 0 } -[M] -> { [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-3.st cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-3.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0] : i0 >= 0 and i0 <= M }" +child: + context: "[M] -> { [] : M >= 0 }" + child: + schedule: "[M] -> [{ S1[i0] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-4.in cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-4.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-4.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-4.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0] -> [i0, 0] : i0 >= 0 and i0 <= 1 + M } -[M] -> { : M >= 0 } -[M] -> { [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-4.st cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-4.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-4.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-4.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0] : i0 >= 0 and i0 <= 1 + M }" +child: + context: "[M] -> { [] : M >= 0 }" + child: + schedule: "[M] -> [{ S1[i0] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-5.in cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-5.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-5.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-5.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[1, i1] -> [1, i1, 0] : 2i1 >= M and 2i1 <= 1 + M } -[M] -> { : } -[M] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-5.st cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-5.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-5.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-5.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[1, i1] : 2i1 >= M and 2i1 <= 1 + M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-6.c cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-6.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-6.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-6.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1 @@ +S1(-1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-6.st cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-6.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/basic-bounds-6.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/basic-bounds-6.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "{ S1[-1] }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0] -> [(i0)] }]" + options: "{ separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/block2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/block2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/block2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/block2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[i0, 1] -> [i0, 1, 6] : i0 >= 0 and i0 <= 9; S2[i0, 1] -> [i0, 1, 11] : i0 >= 0 and i0 <= 9; S3[i0, 1] -> [i0, 1, 8] : i0 >= 0 and i0 <= 9 } -{ : } -{ [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/block2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/block2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/block2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/block2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,11 @@ +domain: "{ S2[i0, 1] : i0 >= 0 and i0 <= 9; S1[i0, 1] : i0 >= 0 and i0 <= 9; S3[i0, 1] : i0 >= 0 and i0 <= 9 }" +child: + context: "{ [] }" + child: + schedule: "[{ S3[i0, i1] -> [(i0)]; S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S3[i0, i1] -> [(i1)]; S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1] }" + - filter: "{ S3[i0, i1] }" + - filter: "{ S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/block3.in cloog-0.18.4/isl/test_inputs/codegen/cloog/block3.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/block3.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/block3.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S2[] -> [1]; S3[i0] -> [i0] : i0 >= 0 and i0 <= 1; S1[] -> [0] } -{ : } -{ [i] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/block3.st cloog-0.18.4/isl/test_inputs/codegen/cloog/block3.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/block3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/block3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "{ S1[]; S3[i0] : i0 >= 0 and i0 <= 1; S2[] }" +child: + context: "{ [] }" + child: + schedule: "[{ S2[] -> [(1)]; S3[i0] -> [(i0)]; S1[] -> [(0)] }]" + options: "{ separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/block.in cloog-0.18.4/isl/test_inputs/codegen/cloog/block.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/block.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/block.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S3[i0] -> [i0, 1] : i0 >= 0 and i0 <= 1; S1[] -> [0, 0]; S2[] -> [1, 0] } -{ : } -{ [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/block.st cloog-0.18.4/isl/test_inputs/codegen/cloog/block.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/block.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/block.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "{ S1[]; S3[i0] : i0 >= 0 and i0 <= 1; S2[] }" +child: + context: "{ [] }" + child: + schedule: "[{ S2[] -> [(1)]; S3[i0] -> [(i0)]; S1[] -> [(0)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[]; S2[] }" + - filter: "{ S3[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/byu98-1-2-3.in cloog-0.18.4/isl/test_inputs/codegen/cloog/byu98-1-2-3.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/byu98-1-2-3.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/byu98-1-2-3.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[i0, i1] -> [i0, i1, 0] : i1 >= 6 - i0 and i0 >= 2 and i1 >= 3 and i1 <= 6 and i1 >= -1 + i0; S2[i0, 9 - i0] -> [i0, 9 - i0, 1] : i0 <= 8 and i0 >= 4 } -{ : } -{ [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/byu98-1-2-3.st cloog-0.18.4/isl/test_inputs/codegen/cloog/byu98-1-2-3.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/byu98-1-2-3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/byu98-1-2-3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "{ S2[i0, 9 - i0] : i0 <= 8 and i0 >= 4; S1[i0, i1] : i1 >= 6 - i0 and i0 >= 2 and i1 >= 3 and i1 <= 6 and i1 >= -1 + i0 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1] }" + - filter: "{ S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/cholesky2.c cloog-0.18.4/isl/test_inputs/codegen/cloog/cholesky2.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/cholesky2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/cholesky2.c 2015-07-24 12:23:09.000000000 +0000 @@ -6,14 +6,11 @@ } for (int c0 = 1; c0 < 3 * M - 1; c0 += 3) { S3((c0 + 2) / 3); - if (3 * M >= c0 + 8) { - for (int c1 = (c0 + 5) / 3; c1 <= M; c1 += 1) { - S6((c0 + 2) / 3, c1); - for (int c4 = (c0 + 5) / 3; c4 < c1; c4 += 1) - S5(c4, c1, (c0 + 2) / 3); - } - } else if (c0 + 5 == 3 * M) - S6(M - 1, M); + for (int c1 = (c0 + 5) / 3; c1 <= M; c1 += 1) { + S6((c0 + 2) / 3, c1); + for (int c4 = (c0 + 5) / 3; c4 < c1; c4 += 1) + S5(c4, c1, (c0 + 2) / 3); + } for (int c1 = (c0 + 5) / 3; c1 <= M; c1 += 1) S2(c1, (c0 + 2) / 3); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/cholesky2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/cholesky2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/cholesky2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/cholesky2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [3i1, i0, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= -1 + i0; S4[i0, i1] -> [0, i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M; S1[i0] -> [0, i0, 0] : i0 >= 1 and i0 <= M; S6[i0, i1] -> [-1 + 3i0, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M; S3[i0] -> [-2 + 3i0, 0, 0] : i0 >= 1 and i0 <= M; S5[i0, i1, i2] -> [-1 + 3i2, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M and i2 >= 1 and i2 <= -1 + i0 } -[M] -> { : } -[M] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/cholesky2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/cholesky2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/cholesky2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/cholesky2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M] -> { S4[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M; S5[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M and i2 >= 1 and i2 <= -1 + i0; S6[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M; S3[i0] : i0 >= 1 and i0 <= M; S2[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= -1 + i0; S1[i0] : i0 >= 1 and i0 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0] -> [(0)]; S3[i0] -> [(-2 + 3i0)]; S4[i0, i1] -> [(0)]; S5[i0, i1, i2] -> [(-1 + 3i2)]; S2[i0, i1] -> [(3i1)]; S6[i0, i1] -> [(-1 + 3i0)] }, { S1[i0] -> [(i0)]; S3[i0] -> [(0)]; S4[i0, i1] -> [(i0)]; S5[i0, i1, i2] -> [(i1)]; S2[i0, i1] -> [(i0)]; S6[i0, i1] -> [(i1)] }, { S1[i0] -> [(0)]; S3[i0] -> [(0)]; S4[i0, i1] -> [(i1)]; S5[i0, i1, i2] -> [(i2)]; S2[i0, i1] -> [(0)]; S6[i0, i1] -> [(0)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/cholesky.c cloog-0.18.4/isl/test_inputs/codegen/cloog/cholesky.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/cholesky.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/cholesky.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,12 +1,12 @@ for (int c0 = 1; c0 <= n; c0 += 1) { S1(c0); - for (int c2 = 1; c2 < c0; c2 += 1) - S2(c0, c2); + for (int c1 = 1; c1 < c0; c1 += 1) + S2(c0, c1); S3(c0); - for (int c2 = c0 + 1; c2 <= n; c2 += 1) { - S4(c0, c2); - for (int c4 = 1; c4 < c0; c4 += 1) - S5(c0, c2, c4); - S6(c0, c2); + for (int c1 = c0 + 1; c1 <= n; c1 += 1) { + S4(c0, c1); + for (int c2 = 1; c2 < c0; c2 += 1) + S5(c0, c1, c2); + S6(c0, c1); } } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/cholesky.in cloog-0.18.4/isl/test_inputs/codegen/cloog/cholesky.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/cholesky.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/cholesky.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n] -> { S1[i0] -> [i0, 1, 0, 0, 0, 0] : i0 >= 1 and i0 <= n; S2[i0, i1] -> [i0, 2, i1, 1, 0, 0] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= -1 + i0; S6[i0, i1] -> [i0, 4, i1, 3, 0, 0] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S3[i0] -> [i0, 3, 0, 0, 0, 0] : i0 >= 1 and i0 <= n; S4[i0, i1] -> [i0, 4, i1, 1, 0, 0] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S5[i0, i1, i2] -> [i0, 4, i1, 2, i2, 1] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n and i2 >= 1 and i2 <= -1 + i0 } -[n] -> { : } -[n] -> { [i, j, k, l, m, n'] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/cholesky.st cloog-0.18.4/isl/test_inputs/codegen/cloog/cholesky.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/cholesky.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/cholesky.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,26 @@ +domain: "[n] -> { S2[i0, i1] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= -1 + i0; S1[i0] : i0 >= 1 and i0 <= n; S4[i0, i1] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S5[i0, i1, i2] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n and i2 >= 1 and i2 <= -1 + i0; S6[i0, i1] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S3[i0] : i0 >= 1 and i0 <= n }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S1[i0] -> [(i0)]; S4[i0, i1] -> [(i0)]; S6[i0, i1] -> [(i0)]; S3[i0] -> [(i0)]; S5[i0, i1, i2] -> [(i0)]; S2[i0, i1] -> [(i0)] }]" + options: "[n] -> { separate[i0] }" + child: + sequence: + - filter: "[n] -> { S1[i0] }" + - filter: "[n] -> { S2[i0, i1] }" + child: + schedule: "[n] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[n] -> { separate[i0] }" + - filter: "[n] -> { S3[i0] }" + - filter: "[n] -> { S4[i0, i1]; S5[i0, i1, i2]; S6[i0, i1] }" + child: + schedule: "[n] -> [{ S4[i0, i1] -> [(i1)]; S6[i0, i1] -> [(i1)]; S5[i0, i1, i2] -> [(i1)] }]" + options: "[n] -> { separate[i0] }" + child: + sequence: + - filter: "[n] -> { S4[i0, i1] }" + - filter: "[n] -> { S5[i0, i1, i2] }" + child: + schedule: "[n] -> [{ S5[i0, i1, i2] -> [(i2)] }]" + options: "[n] -> { separate[i0] }" + - filter: "[n] -> { S6[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/christian.c cloog-0.18.4/isl/test_inputs/codegen/cloog/christian.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/christian.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/christian.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,6 +1,6 @@ for (int c0 = -N + 1; c0 <= N; c0 += 1) { - for (int c1 = max(c0 - 1, 0); c1 < min(N + c0 - 1, N); c1 += 1) - S2(c1, -c0 + c1 + 1); - for (int c1 = max(c0, 0); c1 < min(N + c0, N); c1 += 1) + for (int c1 = max(0, c0); c1 < min(N, N + c0); c1 += 1) S1(c1, -c0 + c1); + for (int c1 = max(0, c0 - 1); c1 < min(N, N + c0 - 1); c1 += 1) + S2(c1, -c0 + c1 + 1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/christian.in cloog-0.18.4/isl/test_inputs/codegen/cloog/christian.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/christian.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/christian.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[N] -> { S1[i0, i1] -> [i0 - i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N; S2[i0, i1] -> [1 + i0 - i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N } -[N] -> { : } -[N] -> { [i] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/christian.st cloog-0.18.4/isl/test_inputs/codegen/cloog/christian.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/christian.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/christian.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[N] -> { S1[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N; S2[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N }" +child: + context: "[N] -> { [] }" + child: + schedule: "[N] -> [{ S1[i0, i1] -> [(i0 - i1)]; S2[i0, i1] -> [(1 + i0 - i1)] }]" + options: "[N] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/classen2.c cloog-0.18.4/isl/test_inputs/codegen/cloog/classen2.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/classen2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/classen2.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = max(max(max(max(max(max(5 * outerTimeTileScatter, 10 * outerProcTileScatter1 - 2 * N + 2), 5 * outerProcTileScatter1 + 5 * outerProcTileScatter2 - N), 5 * outerProcTileScatter1), 10 * outerProcTileScatter2 - N + 1), 5 * outerProcTileScatter2 + 1), 4); c0 <= min(min(min(min(min(min(2 * M + 2 * N - 6, 5 * outerProcTileScatter2 + M + N), 10 * outerProcTileScatter2 + N + 3), 5 * outerProcTileScatter1 + M + 2), 5 * outerProcTileScatter1 + 5 * outerProcTileScatter2 + 5), 10 * outerProcTileScatter1 + 4), 5 * outerTimeTileScatter + 4); c0 += 1) - for (int c1 = max(max(max(max(-5 * outerProcTileScatter2 + c0 - 1, -M + c0 + 2), (c0 + 1) / 2 + 2), 5 * outerProcTileScatter2 + 1), 5 * outerProcTileScatter1); c1 <= min(min(min(min(5 * outerProcTileScatter1 + 4, 5 * outerProcTileScatter2 + N + 2), N + c0 / 2 - 1), c0), -5 * outerProcTileScatter2 + N + c0); c1 += 1) - for (int c2 = max(max(-N + c1 + 2, c0 - c1 + 3), 5 * outerProcTileScatter2); c2 <= min(min(5 * outerProcTileScatter2 + 4, N + c0 - c1), c1 - 1); c2 += 1) +for (int c0 = max(max(max(max(max(max(4, 5 * outerTimeTileScatter), 5 * outerProcTileScatter1), 5 * outerProcTileScatter2 + 1), 5 * outerProcTileScatter1 + 5 * outerProcTileScatter2 - N), 10 * outerProcTileScatter2 - N + 1), 10 * outerProcTileScatter1 - 2 * N + 2); c0 <= min(min(min(min(min(min(5 * outerTimeTileScatter + 4, 10 * outerProcTileScatter1 + 4), 5 * outerProcTileScatter1 + 5 * outerProcTileScatter2 + 5), 5 * outerProcTileScatter1 + M + 2), 2 * M + 2 * N - 6), 5 * outerProcTileScatter2 + M + N), 10 * outerProcTileScatter2 + N + 3); c0 += 1) + for (int c1 = max(max(max(max(5 * outerProcTileScatter1, 5 * outerProcTileScatter2 + 1), -5 * outerProcTileScatter2 + c0 - 1), -M + c0 + 2), (c0 + 1) / 2 + 2); c1 <= min(min(min(min(5 * outerProcTileScatter1 + 4, 5 * outerProcTileScatter2 + N + 2), -5 * outerProcTileScatter2 + N + c0), c0), N + c0 / 2 - 1); c1 += 1) + for (int c2 = max(max(5 * outerProcTileScatter2, -N + c1 + 2), c0 - c1 + 3); c2 <= min(min(5 * outerProcTileScatter2 + 4, c1 - 1), N + c0 - c1); c2 += 1) S1(c0 - c1 + 1, -c0 + c1 + c2 - 2, c1 - c2, c0, c1, c2); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/classen2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/classen2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/classen2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/classen2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[outerTimeTileScatter, outerProcTileScatter1, outerProcTileScatter2, M, N] -> { S1[i0, i1, i2, 2i0 + i1 + i2, 1 + i0 + i1 + i2, 1 + i0 + i1] -> [2i0 + i1 + i2, 1 + i0 + i1 + i2, 1 + i0 + i1] : N >= 3 and i2 <= 3 + 5outerProcTileScatter1 - i0 - i1 and i1 >= -1 + 5outerProcTileScatter2 - i0 and M >= 2 and i2 <= 4 + 5outerTimeTileScatter - 2i0 - i1 and i1 <= 3 + 5outerProcTileScatter2 - i0 and i2 >= 1 and i2 <= -2 + N and i1 >= 1 and i1 <= -2 + N and i0 >= 1 and i0 <= -1 + M and i2 >= 5outerTimeTileScatter - 2i0 - i1 and i2 >= -1 + 5outerProcTileScatter1 - i0 - i1 } -[outerTimeTileScatter, outerProcTileScatter1, outerProcTileScatter2, M, N] -> { : } -[outerTimeTileScatter, outerProcTileScatter1, outerProcTileScatter2, M, N] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/classen2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/classen2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/classen2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/classen2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[outerTimeTileScatter, outerProcTileScatter1, outerProcTileScatter2, M, N] -> { S1[compIter1, compIter2, compIter3, 2compIter1 + compIter2 + compIter3, 1 + compIter1 + compIter2 + compIter3, 1 + compIter1 + compIter2] : N >= 3 and compIter3 <= 3 + 5outerProcTileScatter1 - compIter1 - compIter2 and compIter2 >= -1 + 5outerProcTileScatter2 - compIter1 and M >= 2 and compIter3 <= 4 + 5outerTimeTileScatter - 2compIter1 - compIter2 and compIter2 <= 3 + 5outerProcTileScatter2 - compIter1 and compIter3 >= 1 and compIter3 <= -2 + N and compIter2 >= 1 and compIter2 <= -2 + N and compIter1 >= 1 and compIter1 <= -1 + M and compIter3 >= 5outerTimeTileScatter - 2compIter1 - compIter2 and compIter3 >= -1 + 5outerProcTileScatter1 - compIter1 - compIter2 }" +child: + context: "[outerTimeTileScatter, outerProcTileScatter1, outerProcTileScatter2, M, N] -> { [] }" + child: + schedule: "[outerTimeTileScatter, outerProcTileScatter1, outerProcTileScatter2, M, N] -> [{ S1[i0, i1, i2, i3, i4, i5] -> [(i3)] }, { S1[i0, i1, i2, i3, i4, i5] -> [(i4)] }, { S1[i0, i1, i2, i3, i4, i5] -> [(i5)] }]" + options: "[outerTimeTileScatter, outerProcTileScatter1, outerProcTileScatter2, M, N] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/classen.c cloog-0.18.4/isl/test_inputs/codegen/cloog/classen.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/classen.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/classen.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,11 +1,11 @@ -{ +if (m >= 1) { if (m == 1) { S1(0, 1, 1, 1); S8(0, 1); - } else if (m >= 2) { + } else { S1(0, 1, 1, 1); - S3(0, 1, 1, 2, 1, 1, 1, 2); S4(0, 1, 2, 2, 1, 1, 2, 2); + S3(0, 1, 1, 2, 1, 1, 1, 2); S2(0, 1, 1, 1, 1, 1, 2, 1); S8(0, 1); } @@ -14,48 +14,48 @@ S5(m - 2, 1, m - 1, 1, m - 1, 1, m, 1); S1(m - 1, 1, m, 1); S3(m - 1, 1, m, 2, m, 1, m, 2); - } else if (c0 >= m) { - S5(c0 - 1, -m + c0 + 2, c0, -m + c0 + 2, m - 1, -m + c0 + 2, m, -m + c0 + 2); - S6(c0 - 1, -m + c0 + 1, c0, -m + c0 + 2, m, -m + c0 + 1, m, -m + c0 + 2); - S1(c0, -m + c0 + 2, m, -m + c0 + 2); - S3(c0, -m + c0 + 2, c0 + 1, -m + c0 + 3, m, -m + c0 + 2, m, -m + c0 + 3); - } else { + } else if (m >= c0 + 2) { S5(c0 - 1, 1, c0, 1, c0, 1, c0 + 1, 1); S1(c0, 1, c0 + 1, 1); - S3(c0, 1, c0 + 1, 2, c0 + 1, 1, c0 + 1, 2); S4(c0, 1, c0 + 2, 2, c0 + 1, 1, c0 + 2, 2); S2(c0, 1, c0 + 1, 1, c0 + 1, 1, c0 + 2, 1); + S3(c0, 1, c0 + 1, 2, c0 + 1, 1, c0 + 1, 2); + } else { + S5(c0 - 1, -m + c0 + 2, c0, -m + c0 + 2, m - 1, -m + c0 + 2, m, -m + c0 + 2); + S6(c0 - 1, -m + c0 + 1, c0, -m + c0 + 2, m, -m + c0 + 1, m, -m + c0 + 2); + S1(c0, -m + c0 + 2, m, -m + c0 + 2); + S3(c0, -m + c0 + 2, c0 + 1, -m + c0 + 3, m, -m + c0 + 2, m, -m + c0 + 3); } - for (int c2 = max(2, -m + c0 + 3); c2 <= min(c0, m - 1); c2 += 1) { - S5(c0 - 1, c2, c0, c2, c0 - c2 + 1, c2, c0 - c2 + 2, c2); - S7(c0 - 1, c2 - 1, c0 + 1, c2, c0 - c2 + 2, c2 - 1, c0 - c2 + 3, c2); - S6(c0 - 1, c2 - 1, c0, c2, c0 - c2 + 2, c2 - 1, c0 - c2 + 2, c2); - S1(c0, c2, c0 - c2 + 2, c2); - S3(c0, c2, c0 + 1, c2 + 1, c0 - c2 + 2, c2, c0 - c2 + 2, c2 + 1); - S4(c0, c2, c0 + 2, c2 + 1, c0 - c2 + 2, c2, c0 - c2 + 3, c2 + 1); - S2(c0, c2, c0 + 1, c2, c0 - c2 + 2, c2, c0 - c2 + 3, c2); + for (int c1 = max(2, -m + c0 + 3); c1 <= min(m - 1, c0); c1 += 1) { + S5(c0 - 1, c1, c0, c1, c0 - c1 + 1, c1, c0 - c1 + 2, c1); + S6(c0 - 1, c1 - 1, c0, c1, c0 - c1 + 2, c1 - 1, c0 - c1 + 2, c1); + S7(c0 - 1, c1 - 1, c0 + 1, c1, c0 - c1 + 2, c1 - 1, c0 - c1 + 3, c1); + S1(c0, c1, c0 - c1 + 2, c1); + S4(c0, c1, c0 + 2, c1 + 1, c0 - c1 + 2, c1, c0 - c1 + 3, c1 + 1); + S2(c0, c1, c0 + 1, c1, c0 - c1 + 2, c1, c0 - c1 + 3, c1); + S3(c0, c1, c0 + 1, c1 + 1, c0 - c1 + 2, c1, c0 - c1 + 2, c1 + 1); } if (c0 + 1 == m) { S7(m - 2, m - 1, m, m, 1, m - 1, 2, m); S6(m - 2, m - 1, m - 1, m, 1, m - 1, 1, m); S1(m - 1, m, 1, m); S2(m - 1, m, m, m, 1, m, 2, m); - } else if (c0 >= m) { - S5(c0 - 1, m, c0, m, -m + c0 + 1, m, -m + c0 + 2, m); - S7(c0 - 1, m - 1, c0 + 1, m, -m + c0 + 2, m - 1, -m + c0 + 3, m); - S6(c0 - 1, m - 1, c0, m, -m + c0 + 2, m - 1, -m + c0 + 2, m); - S1(c0, m, -m + c0 + 2, m); - S2(c0, m, c0 + 1, m, -m + c0 + 2, m, -m + c0 + 3, m); - } else { + } else if (m >= c0 + 2) { S7(c0 - 1, c0, c0 + 1, c0 + 1, 1, c0, 2, c0 + 1); S6(c0 - 1, c0, c0, c0 + 1, 1, c0, 1, c0 + 1); S1(c0, c0 + 1, 1, c0 + 1); - S3(c0, c0 + 1, c0 + 1, c0 + 2, 1, c0 + 1, 1, c0 + 2); S4(c0, c0 + 1, c0 + 2, c0 + 2, 1, c0 + 1, 2, c0 + 2); S2(c0, c0 + 1, c0 + 1, c0 + 1, 1, c0 + 1, 2, c0 + 1); + S3(c0, c0 + 1, c0 + 1, c0 + 2, 1, c0 + 1, 1, c0 + 2); + } else { + S5(c0 - 1, m, c0, m, -m + c0 + 1, m, -m + c0 + 2, m); + S7(c0 - 1, m - 1, c0 + 1, m, -m + c0 + 2, m - 1, -m + c0 + 3, m); + S6(c0 - 1, m - 1, c0, m, -m + c0 + 2, m - 1, -m + c0 + 2, m); + S1(c0, m, -m + c0 + 2, m); + S2(c0, m, c0 + 1, m, -m + c0 + 2, m, -m + c0 + 3, m); } - for (int c8 = max(1, -m + c0 + 2); c8 <= min(c0 + 1, m); c8 += 1) - S8(c0, c8); + for (int c2 = max(1, -m + c0 + 2); c2 <= min(m, c0 + 1); c2 += 1) + S8(c0, c2); } if (m >= 2) { if (m >= 3) { @@ -76,8 +76,8 @@ S1(1, 2, 1, 2); } S2(2 * m - 3, m, 2 * m - 2, m, m - 1, m, m, m); - for (int c8 = m - 1; c8 <= m; c8 += 1) - S8(2 * m - 3, c8); + for (int c2 = m - 1; c2 <= m; c2 += 1) + S8(2 * m - 3, c2); S5(2 * m - 3, m, 2 * m - 2, m, m - 1, m, m, m); S6(2 * m - 3, m - 1, 2 * m - 2, m, m, m - 1, m, m); S1(2 * m - 2, m, m, m); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/classen.in cloog-0.18.4/isl/test_inputs/codegen/cloog/classen.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/classen.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/classen.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[m] -> { S2[i0, i1, 1 + i0, i1, 2 + i0 - i1, i1, 3 + i0 - i1, i1] -> [i0, 0, i1, 2, 2 + i0 - i1, i1, 1] : m >= 1 and i0 <= -3 + 2m and i0 >= 0 and i1 <= 1 + i0 and i1 <= m and i1 >= 3 - m + i0 and i1 >= 1; S4[i0, i1, 2 + i0, 1 + i1, 2 + i0 - i1, i1, 3 + i0 - i1, 1 + i1] -> [i0, 0, i1, 2, 2 + i0 - i1, i1, 1] : m >= 1 and i0 <= -4 + 2m and i0 >= 0 and i1 <= 1 + i0 and i1 <= -1 + m and i1 >= 3 - m + i0 and i1 >= 1; S5[i0, i1, 1 + i0, i1, 2 + i0 - i1, i1, 3 + i0 - i1, i1] -> [1 + i0, 0, i1, 0, 2 + i0 - i1, i1, 1] : m >= 1 and i0 <= -3 + 2m and i0 >= 0 and i1 <= 1 + i0 and i1 <= m and i1 >= 3 - m + i0 and i1 >= 1; S7[i0, i1, 2 + i0, 1 + i1, 2 + i0 - i1, i1, 3 + i0 - i1, 1 + i1] -> [1 + i0, 0, 1 + i1, 0, 2 + i0 - i1, i1, 1] : m >= 1 and i0 <= -4 + 2m and i0 >= 0 and i1 <= 1 + i0 and i1 <= -1 + m and i1 >= 3 - m + i0 and i1 >= 1; S6[i0, i1, 1 + i0, 1 + i1, 2 + i0 - i1, i1, 2 + i0 - i1, 1 + i1] -> [1 + i0, 0, 1 + i1, 0, 2 + i0 - i1, i1, 1] : m >= 1 and i0 <= -3 + 2m and i0 >= 0 and i1 <= 1 + i0 and i1 <= -1 + m and i1 >= 2 - m + i0 and i1 >= 1; S3[i0, i1, 1 + i0, 1 + i1, 2 + i0 - i1, i1, 2 + i0 - i1, 1 + i1] -> [i0, 0, i1, 2, 2 + i0 - i1, i1, 1] : m >= 1 and i0 <= -3 + 2m and i0 >= 0 and i1 <= 1 + i0 and i1 <= -1 + m and i1 >= 2 - m + i0 and i1 >= 1; S8[i0, i1] -> [i0, 1, 0, 0, 0, 0, 0] : i0 <= -2 + 2m and i0 >= 0 and i1 <= 1 + i0 and i1 <= m and i1 >= 2 - m + i0 and i1 >= 1; S1[i0, i1, 2 + i0 - i1, i1] -> [i0, 0, i1, 1, 0, 0, 0] : m >= 1 and i1 >= 2 - m + i0 and i1 <= 1 + i0 and i1 <= m and i1 >= 1 } -[m] -> { : m >= 0 } -[m] -> { [i, j, k, l, m', n, o] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/classen.st cloog-0.18.4/isl/test_inputs/codegen/cloog/classen.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/classen.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/classen.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,24 @@ +domain: "[m] -> { S2[coordT1, coordP1, 1 + coordT1, coordP1, 2 + coordT1 - coordP1, coordP1, 3 + coordT1 - coordP1, coordP1] : m >= 1 and coordT1 <= -3 + 2m and coordT1 >= 0 and coordP1 <= 1 + coordT1 and coordP1 <= m and coordP1 >= 3 - m + coordT1 and coordP1 >= 1; S4[coordT1, coordP1, 2 + coordT1, 1 + coordP1, 2 + coordT1 - coordP1, coordP1, 3 + coordT1 - coordP1, 1 + coordP1] : m >= 1 and coordT1 <= -4 + 2m and coordT1 >= 0 and coordP1 <= 1 + coordT1 and coordP1 <= -1 + m and coordP1 >= 3 - m + coordT1 and coordP1 >= 1; S6[coordT1, coordP1, 1 + coordT1, 1 + coordP1, 2 + coordT1 - coordP1, coordP1, 2 + coordT1 - coordP1, 1 + coordP1] : m >= 1 and coordT1 <= -3 + 2m and coordT1 >= 0 and coordP1 <= 1 + coordT1 and coordP1 <= -1 + m and coordP1 >= 2 - m + coordT1 and coordP1 >= 1; S1[coordT1, coordP1, 2 + coordT1 - coordP1, coordP1] : m >= 1 and coordP1 >= 2 - m + coordT1 and coordP1 <= 1 + coordT1 and coordP1 <= m and coordP1 >= 1; S8[coordT1, coordP1] : coordT1 <= -2 + 2m and coordT1 >= 0 and coordP1 <= 1 + coordT1 and coordP1 <= m and coordP1 >= 2 - m + coordT1 and coordP1 >= 1; S5[coordT1, coordP1, 1 + coordT1, coordP1, 2 + coordT1 - coordP1, coordP1, 3 + coordT1 - coordP1, coordP1] : m >= 1 and coordT1 <= -3 + 2m and coordT1 >= 0 and coordP1 <= 1 + coordT1 and coordP1 <= m and coordP1 >= 3 - m + coordT1 and coordP1 >= 1; S7[coordT1, coordP1, 2 + coordT1, 1 + coordP1, 2 + coordT1 - coordP1, coordP1, 3 + coordT1 - coordP1, 1 + coordP1] : m >= 1 and coordT1 <= -4 + 2m and coordT1 >= 0 and coordP1 <= 1 + coordT1 and coordP1 <= -1 + m and coordP1 >= 3 - m + coordT1 and coordP1 >= 1; S3[coordT1, coordP1, 1 + coordT1, 1 + coordP1, 2 + coordT1 - coordP1, coordP1, 2 + coordT1 - coordP1, 1 + coordP1] : m >= 1 and coordT1 <= -3 + 2m and coordT1 >= 0 and coordP1 <= 1 + coordT1 and coordP1 <= -1 + m and coordP1 >= 2 - m + coordT1 and coordP1 >= 1 }" +child: + context: "[m] -> { [] : m >= 0 }" + child: + schedule: "[m] -> [{ S7[i0, i1, i2, i3, i4, i5, i6, i7] -> [(1 + i0)]; S4[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i0)]; S8[i0, i1] -> [(i0)]; S3[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i0)]; S1[i0, i1, i2, i3] -> [(i0)]; S2[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i0)]; S5[i0, i1, i2, i3, i4, i5, i6, i7] -> [(1 + i0)]; S6[i0, i1, i2, i3, i4, i5, i6, i7] -> [(1 + i0)] }]" + options: "[m] -> { separate[i0] }" + child: + sequence: + - filter: "[m] -> { S2[i0, i1, i2, i3, i4, i5, i6, i7]; S6[i0, i1, i2, i3, i4, i5, i6, i7]; S4[i0, i1, i2, i3, i4, i5, i6, i7]; S1[i0, i1, i2, i3]; S7[i0, i1, i2, i3, i4, i5, i6, i7]; S5[i0, i1, i2, i3, i4, i5, i6, i7]; S3[i0, i1, i2, i3, i4, i5, i6, i7] }" + child: + schedule: "[m] -> [{ S7[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i3)]; S4[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i1)]; S3[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i1)]; S1[i0, i1, i2, i3] -> [(i1)]; S2[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i1)]; S5[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i3)]; S6[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i3)] }]" + options: "[m] -> { separate[i0] }" + child: + sequence: + - filter: "[m] -> { S6[i0, i1, i2, i3, i4, i5, i6, i7]; S5[i0, i1, i2, i3, i4, i5, i6, i7]; S7[i0, i1, i2, i3, i4, i5, i6, i7] }" + child: + schedule: "[m] -> [{ S7[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i4)]; S5[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i4)]; S6[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i4)] }, { S7[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i5)]; S5[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i5)]; S6[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i5)] }]" + options: "[m] -> { separate[i0] }" + - filter: "[m] -> { S1[i0, i1, i2, i3] }" + - filter: "[m] -> { S2[i0, i1, i2, i3, i4, i5, i6, i7]; S4[i0, i1, i2, i3, i4, i5, i6, i7]; S3[i0, i1, i2, i3, i4, i5, i6, i7] }" + child: + schedule: "[m] -> [{ S4[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i4)]; S3[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i4)]; S2[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i4)] }, { S4[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i5)]; S3[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i5)]; S2[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i5)] }]" + options: "[m] -> { separate[i0] }" + - filter: "[m] -> { S8[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/constant.c cloog-0.18.4/isl/test_inputs/codegen/cloog/constant.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/constant.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/constant.c 2014-10-02 15:33:27.000000000 +0000 @@ -3,7 +3,7 @@ S1(c1); S3(c1); } - for (int c1 = max(M + 1025, 0); c1 <= 1023; c1 += 1) { + for (int c1 = max(0, M + 1025); c1 <= 1023; c1 += 1) { S2(c1); S3(c1); } @@ -11,7 +11,7 @@ S4(c0); S6(c0); } - for (int c0 = max(M + 1025, 0); c0 <= 1023; c0 += 1) { + for (int c0 = max(0, M + 1025); c0 <= 1023; c0 += 1) { S5(c0); S6(c0); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/constant.in cloog-0.18.4/isl/test_inputs/codegen/cloog/constant.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/constant.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/constant.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S5[i0] -> [i0, 0, 1] : i0 >= 0 and i0 <= 1023 and i0 >= 1025 + M; S1[i0] -> [-1, i0, 0] : i0 >= 0 and i0 <= 1023 and i0 <= 1024 + M; S3[i0] -> [-1, i0, 2] : i0 >= 0 and i0 <= 1023; S2[i0] -> [-1, i0, 1] : i0 >= 0 and i0 <= 1023 and i0 >= 1025 + M; S4[i0] -> [i0, 0, 0] : i0 >= 0 and i0 <= 1023 and i0 <= 1024 + M; S6[i0] -> [i0, 0, 2] : i0 >= 0 and i0 <= 1023 } -[M] -> { : } -[M] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/constant.st cloog-0.18.4/isl/test_inputs/codegen/cloog/constant.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/constant.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/constant.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,11 @@ +domain: "[M] -> { S4[i0] : i0 >= 0 and i0 <= 1023 and i0 <= 1024 + M; S5[i0] : i0 >= 0 and i0 <= 1023 and i0 >= 1025 + M; S3[i0] : i0 >= 0 and i0 <= 1023; S2[i0] : i0 >= 0 and i0 <= 1023 and i0 >= 1025 + M; S1[i0] : i0 >= 0 and i0 <= 1023 and i0 <= 1024 + M; S6[i0] : i0 >= 0 and i0 <= 1023 }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S2[i0] -> [(-1)]; S4[i0] -> [(i0)]; S1[i0] -> [(-1)]; S3[i0] -> [(-1)]; S6[i0] -> [(i0)]; S5[i0] -> [(i0)] }, { S2[i0] -> [(i0)]; S4[i0] -> [(0)]; S1[i0] -> [(i0)]; S3[i0] -> [(i0)]; S6[i0] -> [(0)]; S5[i0] -> [(0)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S4[i0]; S1[i0] }" + - filter: "[M] -> { S5[i0]; S2[i0] }" + - filter: "[M] -> { S3[i0]; S6[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/constbound.c cloog-0.18.4/isl/test_inputs/codegen/cloog/constbound.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/constbound.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/constbound.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,8 +1,8 @@ for (int c0 = 0; c0 <= 199; c0 += 1) { - for (int c2 = 50 * c0; c2 <= 50 * c0 + 24; c2 += 1) - for (int c3 = 0; c3 <= c2; c3 += 1) - S1(c0, c2, c3); - for (int c2 = 50 * c0 + 25; c2 <= 50 * c0 + 49; c2 += 1) - for (int c3 = 0; c3 <= c2; c3 += 1) - S2(c0, c2, c3); + for (int c1 = 50 * c0; c1 <= 50 * c0 + 24; c1 += 1) + for (int c2 = 0; c2 <= c1; c2 += 1) + S1(c0, c1, c2); + for (int c1 = 50 * c0 + 25; c1 <= 50 * c0 + 49; c1 += 1) + for (int c2 = 0; c2 <= c1; c2 += 1) + S2(c0, c1, c2); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/constbound.in cloog-0.18.4/isl/test_inputs/codegen/cloog/constbound.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/constbound.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/constbound.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S2[i0, i1, i2] -> [i0, 1, i1, i2] : i1 >= 0 and i1 <= 9999 and i2 >= 0 and i2 <= i1 and i1 >= 25 + 50i0 and i1 <= 49 + 50i0; S1[i0, i1, i2] -> [i0, 0, i1, i2] : i1 >= 0 and i1 <= 9999 and i2 >= 0 and i2 <= i1 and i1 >= 50i0 and i1 <= 24 + 50i0 } -{ : } -{ [i, j, k, l] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/constbound.st cloog-0.18.4/isl/test_inputs/codegen/cloog/constbound.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/constbound.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/constbound.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,16 @@ +domain: "{ S2[i0, i1, i2] : i1 >= 0 and i1 <= 9999 and i2 >= 0 and i2 <= i1 and i1 >= 25 + 50i0 and i1 <= 49 + 50i0; S1[i0, i1, i2] : i1 >= 0 and i1 <= 9999 and i2 >= 0 and i2 <= i1 and i1 >= 50i0 and i1 <= 24 + 50i0 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1, i2] -> [(i0)]; S2[i0, i1, i2] -> [(i0)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1, i2] }" + child: + schedule: "[{ S1[i0, i1, i2] -> [(i1)] }, { S1[i0, i1, i2] -> [(i2)] }]" + options: "{ separate[i0] }" + - filter: "{ S2[i0, i1, i2] }" + child: + schedule: "[{ S2[i0, i1, i2] -> [(i1)] }, { S2[i0, i1, i2] -> [(i2)] }]" + options: "{ separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/darte.c cloog-0.18.4/isl/test_inputs/codegen/cloog/darte.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/darte.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/darte.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,12 +1,12 @@ for (int c0 = -n + 1; c0 <= n; c0 += 1) { if (c0 <= 0) for (int c2 = -c0 + 4; c2 <= 2 * n - c0 + 2; c2 += 2) - S1(1, -c0 + 1, (c0 + c2 - 2) / 2); - for (int c1 = max(c0 + 2, -c0 + 4); c1 <= min(2 * n + c0, 2 * n - c0); c1 += 2) { + S1(1, -c0 + 1, ((c0 + c2) / 2) - 1); + for (int c1 = max(c0 + 2, -c0 + 4); c1 <= min(2 * n - c0, 2 * n + c0); c1 += 2) { for (int c2 = c1 + 2; c2 <= 2 * n + c1; c2 += 2) S1((c0 + c1) / 2, (-c0 + c1) / 2, (-c1 + c2) / 2); for (int c2 = 1; c2 <= n; c2 += 1) - S2((c0 + c1 - 2) / 2, (-c0 + c1) / 2, c2); + S2(((c0 + c1) / 2) - 1, (-c0 + c1) / 2, c2); } if (c0 >= 1) for (int c2 = 1; c2 <= n; c2 += 1) diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/darte.in cloog-0.18.4/isl/test_inputs/codegen/cloog/darte.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/darte.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/darte.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n] -> { S2[i0, i1, i2] -> [1 + i0 - i1, 2 + i0 + i1, i2] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= n and i2 >= 1 and i2 <= n; S1[i0, i1, i2] -> [i0 - i1, i0 + i1, i0 + i1 + 2i2] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= n and i2 >= 1 and i2 <= n } -[n] -> { : } -[n] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/darte.st cloog-0.18.4/isl/test_inputs/codegen/cloog/darte.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/darte.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/darte.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[i0, i1, i2] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= n and i2 >= 1 and i2 <= n; S2[i0, i1, i2] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= n and i2 >= 1 and i2 <= n }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S1[i0, i1, i2] -> [(i0 - i1)]; S2[i0, i1, i2] -> [(1 + i0 - i1)] }, { S1[i0, i1, i2] -> [(i0 + i1)]; S2[i0, i1, i2] -> [(2 + i0 + i1)] }, { S1[i0, i1, i2] -> [(i0 + i1 + 2i2)]; S2[i0, i1, i2] -> [(i2)] }]" + options: "[n] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/dealII.c cloog-0.18.4/isl/test_inputs/codegen/cloog/dealII.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/dealII.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/dealII.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,12 +1,32 @@ { - for (int c0 = 0; c0 <= min(T_66, T_2 - 1); c0 += 1) { + if (T_67 == 0 && T_66 <= -1) { + S1(0); + } else if (T_2 >= 1 && T_67 >= 1 && T_66 <= -1) { + S1(0); + } else if (T_2 >= 1 && T_67 >= 1 && T_66 >= 0) { + S1(0); + S2(0); + } + for (int c0 = 1; c0 <= min(min(T_2 - 1, T_67 - 1), T_66); c0 += 1) { S1(c0); S2(c0); } - for (int c0 = T_2; c0 <= min(T_67 - 1, T_66); c0 += 1) + for (int c0 = max(1, T_66 + 1); c0 < min(T_2, T_67); c0 += 1) + S1(c0); + if (T_2 >= 1 && T_67 == 0 && T_66 >= 0) { + S1(0); + S2(0); + } + for (int c0 = max(1, T_67); c0 <= min(T_2 - 1, T_66); c0 += 1) { + S1(c0); S2(c0); - for (int c0 = max(0, T_66 + 1); c0 < T_2; c0 += 1) + } + for (int c0 = max(max(1, T_67), T_66 + 1); c0 < T_2; c0 += 1) S1(c0); - if (T_67 == 0 && T_2 == 0) + if (T_2 == 0 && T_67 >= 1 && T_66 >= 0) + S2(0); + for (int c0 = max(1, T_2); c0 <= min(T_67 - 1, T_66); c0 += 1) + S2(c0); + if (T_2 == 0 && T_67 == 0 && T_66 >= 0) S1(0); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/dealII.in cloog-0.18.4/isl/test_inputs/codegen/cloog/dealII.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/dealII.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/dealII.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[T_2, T_67, T_66] -> { S1[scat_0] -> [scat_0, 0] : (scat_0 <= -1 + T_2 and scat_0 >= 0) or (scat_0 <= -T_67 and scat_0 >= 0); S2[scat_0] -> [scat_0, 1] : (scat_0 <= -1 + T_2 and scat_0 >= 0 and scat_0 <= T_66) or (scat_0 <= -1 + T_67 and scat_0 >= 0 and scat_0 <= T_66) } -[T_2, T_67, T_66] -> { : T_2 <= 4 and T_2 >= 0 and T_67 <= 4 and T_67 >= 0 } -[T_2, T_67, T_66] -> { [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/dealII.st cloog-0.18.4/isl/test_inputs/codegen/cloog/dealII.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/dealII.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/dealII.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[T_2, T_67, T_66] -> { S1[scat_0] : (scat_0 >= 0 and scat_0 <= -1 + T_2) or (scat_0 <= -T_67 and scat_0 >= 0); S2[scat_0] : (scat_0 >= 0 and scat_0 <= T_66 and scat_0 <= -1 + T_2) or (scat_0 >= 0 and scat_0 <= T_66 and scat_0 <= -1 + T_67) }" +child: + context: "[T_2, T_67, T_66] -> { [] : T_2 <= 4 and T_2 >= 0 and T_67 <= 4 and T_67 >= 0 }" + child: + schedule: "[T_2, T_67, T_66] -> [{ S2[scat_0] -> [(scat_0)]; S1[scat_0] -> [(scat_0)] }]" + options: "[T_2, T_67, T_66] -> { separate[i0] }" + child: + sequence: + - filter: "[T_2, T_67, T_66] -> { S1[scat_0] }" + - filter: "[T_2, T_67, T_66] -> { S2[scat_0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/donotsimp.c cloog-0.18.4/isl/test_inputs/codegen/cloog/donotsimp.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/donotsimp.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/donotsimp.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,6 +1,6 @@ -for (int c1 = 1; c1 <= 10; c1 += 1) { - for (int c3 = 1; c3 <= c1; c3 += 1) - S1(c1, c3); - for (int c3 = 11; c3 <= M; c3 += 1) - S2(c1, c3); +for (int c0 = 1; c0 <= 10; c0 += 1) { + for (int c1 = 1; c1 <= c0; c1 += 1) + S1(c0, c1); + for (int c1 = 11; c1 <= M; c1 += 1) + S2(c0, c1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/donotsimp.in cloog-0.18.4/isl/test_inputs/codegen/cloog/donotsimp.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/donotsimp.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/donotsimp.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [0, i0, 0, i1, 0] : i0 >= 1 and i0 <= 10 and i1 >= 11 and i1 <= M; S1[i0, i1] -> [0, i0, 0, i1, 0] : i0 >= 1 and i0 <= 10 and i1 >= 1 and i1 <= i0 } -[M] -> { : M >= 20 } -[M] -> { [i, j, k, l, m] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/donotsimp.st cloog-0.18.4/isl/test_inputs/codegen/cloog/donotsimp.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/donotsimp.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/donotsimp.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,9 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i0 <= 10 and i1 >= 1 and i1 <= i0; S2[i0, i1] : i0 >= 1 and i0 <= 10 and i1 >= 11 and i1 <= M }" +child: + context: "[M] -> { [] : M >= 20 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/dot2.c cloog-0.18.4/isl/test_inputs/codegen/cloog/dot2.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/dot2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/dot2.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,5 +1,5 @@ { - for (int c0 = 1; c0 <= min(N, M); c0 += 1) { + for (int c0 = 1; c0 <= min(M, N); c0 += 1) { S1(c0); for (int c1 = 1; c1 <= M; c1 += 1) S2(c0, c1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/dot2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/dot2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/dot2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/dot2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S2[i0, i1] -> [i0, i1, 1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S1[i0] -> [i0, 0, 0] : i0 >= 1 and i0 <= M } -[M, N] -> { : M >= 1 and N >= 1 } -[M, N] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/dot2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/dot2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/dot2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/dot2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[M, N] -> { S1[i0] : i0 >= 1 and i0 <= M; S2[i0, i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M }" +child: + context: "[M, N] -> { [] : M >= 1 and N >= 1 }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(i0)]; S1[i0] -> [(i0)] }, { S2[i0, i1] -> [(i1)]; S1[i0] -> [(0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0] }" + - filter: "[M, N] -> { S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/dot.in cloog-0.18.4/isl/test_inputs/codegen/cloog/dot.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/dot.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/dot.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S1[0, i1] -> [0, i1, 0] : i1 <= M and N >= 0 and i1 >= 1; S2[i0, i1] -> [i0, i1, 1] : i0 >= 1 and i1 <= M and i0 <= N and i1 >= 1 } -[M, N] -> { : M >= 1 and N >= 1 } -[M, N] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/dot.st cloog-0.18.4/isl/test_inputs/codegen/cloog/dot.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/dot.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/dot.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[M, N] -> { S1[0, i1] : i1 <= M and N >= 0 and i1 >= 1; S2[i0, i1] : i0 >= 1 and i1 <= M and i0 <= N and i1 >= 1 }" +child: + context: "[M, N] -> { [] : M >= 1 and N >= 1 }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1] }" + - filter: "[M, N] -> { S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/durbin_e_s.in cloog-0.18.4/isl/test_inputs/codegen/cloog/durbin_e_s.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/durbin_e_s.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/durbin_e_s.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S5[i0, i1, 3] -> [i0, i1, 3, 4] : i1 <= -1 + i0 and i0 <= 10 and i1 >= 1; S8[i0, 0, 3] -> [i0, 0, 3, 7] : i0 >= 1 and i0 <= 9; S2[i0, -7, 0] -> [i0, -7, 0, 1] : i0 >= 2 and i0 <= 10; S3[i0, i1, 1] -> [i0, i1, 1, 2] : i1 >= -7 and i0 <= 10 and i1 <= -9 + i0; S1[10, i1, 4] -> [10, i1, 4, 0] : i1 >= 1 and i1 <= 10; S7[1, 0, 0] -> [1, 0, 0, 6]; S4[1, 0, 0] -> [1, 0, 0, 3]; S6[i0, -9 + i0, 2] -> [i0, -9 + i0, 2, 5] : i0 >= 2 and i0 <= 10 } -{ : } -{ [i, j, k, l] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/durbin_e_s.st cloog-0.18.4/isl/test_inputs/codegen/cloog/durbin_e_s.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/durbin_e_s.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/durbin_e_s.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,16 @@ +domain: "{ S2[i0, -7, 0] : i0 >= 2 and i0 <= 10; S4[1, 0, 0]; S6[i0, -9 + i0, 2] : i0 >= 2 and i0 <= 10; S1[10, i1, 4] : i1 >= 1 and i1 <= 10; S5[i0, i1, 3] : i1 <= -1 + i0 and i0 <= 10 and i1 >= 1; S7[1, 0, 0]; S8[i0, 0, 3] : i0 >= 1 and i0 <= 9; S3[i0, i1, 1] : i1 >= -7 and i0 <= 10 and i1 <= -9 + i0 }" +child: + context: "{ [] }" + child: + schedule: "[{ S6[i0, i1, i2] -> [(i0)]; S8[i0, i1, i2] -> [(i0)]; S5[i0, i1, i2] -> [(i0)]; S4[i0, i1, i2] -> [(i0)]; S7[i0, i1, i2] -> [(i0)]; S3[i0, i1, i2] -> [(i0)]; S1[i0, i1, i2] -> [(i0)]; S2[i0, i1, i2] -> [(i0)] }, { S6[i0, i1, i2] -> [(i1)]; S8[i0, i1, i2] -> [(i1)]; S5[i0, i1, i2] -> [(i1)]; S4[i0, i1, i2] -> [(i1)]; S7[i0, i1, i2] -> [(i1)]; S3[i0, i1, i2] -> [(i1)]; S1[i0, i1, i2] -> [(i1)]; S2[i0, i1, i2] -> [(i1)] }, { S6[i0, i1, i2] -> [(i2)]; S8[i0, i1, i2] -> [(i2)]; S5[i0, i1, i2] -> [(i2)]; S4[i0, i1, i2] -> [(i2)]; S7[i0, i1, i2] -> [(i2)]; S3[i0, i1, i2] -> [(i2)]; S1[i0, i1, i2] -> [(i2)]; S2[i0, i1, i2] -> [(i2)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1, i2] }" + - filter: "{ S2[i0, i1, i2] }" + - filter: "{ S3[i0, i1, i2] }" + - filter: "{ S4[i0, i1, i2] }" + - filter: "{ S5[i0, i1, i2] }" + - filter: "{ S6[i0, i1, i2] }" + - filter: "{ S7[i0, i1, i2] }" + - filter: "{ S8[i0, i1, i2] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/emploi.in cloog-0.18.4/isl/test_inputs/codegen/cloog/emploi.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/emploi.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/emploi.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[m, n] -> { S1[i0] -> [i0, 0, 0] : (i0 >= 1 and i0 <= n and i0 <= 2m) or (i0 >= 1 and i0 <= n and i0 >= m); S2[i0, i1] -> [i0, i1, 1] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= m } -[m, n] -> { : } -[m, n] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/emploi.st cloog-0.18.4/isl/test_inputs/codegen/cloog/emploi.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/emploi.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/emploi.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[m, n] -> { S1[i0] : (i0 >= 1 and i0 <= n and i0 <= 2m) or (i0 >= m and i0 >= 1 and i0 <= n); S2[i0, i1] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= m }" +child: + context: "[m, n] -> { [] }" + child: + schedule: "[m, n] -> [{ S1[i0] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0] -> [(0)]; S2[i0, i1] -> [(i1)] }]" + options: "[m, n] -> { separate[i0] }" + child: + sequence: + - filter: "[m, n] -> { S1[i0] }" + - filter: "[m, n] -> { S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/equality2.c cloog-0.18.4/isl/test_inputs/codegen/cloog/equality2.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/equality2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/equality2.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,8 +1,8 @@ for (int c0 = 1; c0 <= 10000; c0 += 1) for (int c1 = 1000; c1 <= 1016; c1 += 1) for (int c2 = 1; c2 < 2 * c1 - 1998; c2 += 1) { - if (c2 + 1999 == 2 * c1 && c1 <= 1008) + if (c1 <= 1008 && c2 + 1999 == 2 * c1) S2(c0, c1, 2 * c1 - 1999, 1, c0, 2 * c1 - 1000, 1, 2, c0, c1 - 499, 2 * c1 - 1999, c0, 2 * c1 - 1999, c1 - 999, c1 - 999); - if (c1 % 2 == 0 && c2 == 1) - S1(c0, c1, 1, 2, c0, (c1 + 2) / 2, c1 - 999, c0, c1 - 999, (c1 - 998) / 2, (c1 - 998) / 2); + if (c2 == 1 && c1 % 2 == 0) + S1(c0, c1, 1, 2, c0, (c1 / 2) + 1, c1 - 999, c0, c1 - 999, (c1 / 2) - 499, (c1 / 2) - 499); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/equality2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/equality2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/equality2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/equality2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[i0, i1, 1, 2, i0, i5, -999 + i1, i0, -999 + i1, i9, i10] -> [i0, i1, 1, 2, i0, n, -999 + i1, i0, -999 + i1, r, s, 0, 0, 0, 0, 0] : 2s = -998 + i1 and 2n = 2 + i1 and 2i10 = -998 + i1 and 2i5 = 2 + i1 and 2i9 = -998 + i1 and 2r = -998 + i1 and i0 >= 1 and i0 <= 10000 and i1 >= 1000 and i1 <= 1016; S2[i0, i1, -1999 + 2i1, 1, i0, -1000 + 2i1, 1, 2, i0, -499 + i1, -1999 + 2i1, i0, -1999 + 2i1, -999 + i1, -999 + i1] -> [i0, i1, -1999 + 2i1, 1, i0, -1000 + 2i1, 1, 2, i0, -499 + i1, -1999 + 2i1, i0, -1999 + 2i1, -999 + i1, -999 + i1, 1] : i0 >= 1 and i0 <= 10000 and i1 >= 1000 and i1 <= 1008 } -{ : } -{ [i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x] -> atomic[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/equality2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/equality2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/equality2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/equality2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "{ S1[i0, i1, 1, 2, i0, i5, -999 + i1, i0, -999 + i1, i9, i10] : 2i5 = 2 + i1 and 2i9 = -998 + i1 and 2i10 = -998 + i1 and i0 >= 1 and i0 <= 10000 and i1 >= 1000 and i1 <= 1016; S2[i0, i1, -1999 + 2i1, 1, i0, -1000 + 2i1, 1, 2, i0, -499 + i1, -1999 + 2i1, i0, -1999 + 2i1, -999 + i1, -999 + i1] : i0 >= 1 and i0 <= 10000 and i1 >= 1000 and i1 <= 1008 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i0)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i0)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i1)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i1)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i2)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i2)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i3)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i3)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i4)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i4)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i5)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i5)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i6)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i6)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i7)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i7)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i8)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i8)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i9)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i9)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i10)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i10)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(0)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i11)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(0)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i12)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(0)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i13)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(0)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i14)] }]" + options: "{ atomic[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] }" + - filter: "{ S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/equality.in cloog-0.18.4/isl/test_inputs/codegen/cloog/equality.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/equality.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/equality.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[i0, 2i0] -> [i0, 2i0, 0] : i0 >= 0 and i0 <= 5; S2[i0, 4] -> [i0, 4, 1] : i0 >= 0 and i0 <= 5 } -{ : } -{ [i, j, k] -> atomic[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/equality.st cloog-0.18.4/isl/test_inputs/codegen/cloog/equality.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/equality.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/equality.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "{ S2[i0, 4] : i0 >= 0 and i0 <= 5; S1[i0, 2i0] : i0 >= 0 and i0 <= 5 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "{ atomic[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1] }" + - filter: "{ S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/esced.in cloog-0.18.4/isl/test_inputs/codegen/cloog/esced.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/esced.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/esced.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n, m] -> { S1[i0] -> [i0, 0, 0] : i0 >= 1 and i0 <= m; S2[i0, i1] -> [i0, i1, 1] : i0 >= 1 and i0 <= m and i1 >= 1 and i1 <= n } -[n, m] -> { : } -[n, m] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/esced.st cloog-0.18.4/isl/test_inputs/codegen/cloog/esced.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/esced.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/esced.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[n, m] -> { S1[i0] : i0 >= 1 and i0 <= m; S2[i0, i1] : i0 >= 1 and i0 <= m and i1 >= 1 and i1 <= n }" +child: + context: "[n, m] -> { [] }" + child: + schedule: "[n, m] -> [{ S2[i0, i1] -> [(i0)]; S1[i0] -> [(i0)] }, { S2[i0, i1] -> [(i1)]; S1[i0] -> [(0)] }]" + options: "[n, m] -> { separate[i0] }" + child: + sequence: + - filter: "[n, m] -> { S1[i0] }" + - filter: "[n, m] -> { S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/ex1.in cloog-0.18.4/isl/test_inputs/codegen/cloog/ex1.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/ex1.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/ex1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n] -> { S2[i0, i1] -> [i0, i1, 1] : i0 >= 15 and i0 <= n and i1 >= 10 and i1 <= n; S1[i0, i1] -> [i0, i1, 0] : i0 >= 0 and i0 <= n and i1 >= 0 and i1 <= -15 + n } -[n] -> { : n >= 25 } -[n] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/ex1.st cloog-0.18.4/isl/test_inputs/codegen/cloog/ex1.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/ex1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/ex1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[n] -> { S1[i0, i1] : i0 >= 0 and i0 <= n and i1 >= 0 and i1 <= -15 + n; S2[i0, i1] : i0 >= 15 and i0 <= n and i1 >= 10 and i1 <= n }" +child: + context: "[n] -> { [] : n >= 25 }" + child: + schedule: "[n] -> [{ S2[i0, i1] -> [(i0)]; S1[i0, i1] -> [(i0)] }, { S2[i0, i1] -> [(i1)]; S1[i0, i1] -> [(i1)] }]" + options: "[n] -> { separate[i0] }" + child: + sequence: + - filter: "[n] -> { S1[i0, i1] }" + - filter: "[n] -> { S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/faber.c cloog-0.18.4/isl/test_inputs/codegen/cloog/faber.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/faber.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/faber.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,156 @@ +{ + for (int c0 = 0; c0 <= 36; c0 += 1) { + for (int c1 = -6; c1 < c0 / 14 - 5; c1 += 1) { + for (int c2 = -((-2 * c1 + 3) / 5) + 9; c2 <= c1 + 12; c2 += 1) + S6(c0, c1, c2); + for (int c2 = c1 + 24; c2 <= -2 * c1 + 24; c2 += 1) + S2(c0, c1, c2); + for (int c2 = -2 * c1 + 30; c2 <= c1 + 48; c2 += 1) + S1(c0, c1, c2); + } + for (int c1 = c0 / 14 - 5; c1 < 0; c1 += 1) { + if (c1 >= -3 && 2 * c0 >= 7 * c1 + 42) + S7(c0, c1, 6); + for (int c2 = max(c1 - (6 * c0 + 77) / 77 + 13, -((-2 * c1 + 3) / 5) + 9); c2 <= c1 + 12; c2 += 1) + S6(c0, c1, c2); + for (int c2 = c1 - (3 * c0 + 14) / 14 + 49; c2 <= c1 + 48; c2 += 1) + S1(c0, c1, c2); + } + S3(c0, 0, 0); + S10(c0, 0, 0); + for (int c2 = 1; c2 <= 5; c2 += 1) + S3(c0, 0, c2); + for (int c2 = 6; c2 <= 2 * c0 / 21 + 4; c2 += 1) { + S3(c0, 0, c2); + S7(c0, 0, c2); + } + for (int c2 = max(6, 2 * c0 / 21 + 5); c2 <= -((6 * c0 + 77) / 77) + 12; c2 += 1) + S3(c0, 0, c2); + for (int c2 = -((6 * c0 + 77) / 77) + 13; c2 <= 12; c2 += 1) { + S3(c0, 0, c2); + S6(c0, 0, c2); + } + for (int c2 = 13; c2 <= 24; c2 += 1) + S3(c0, 0, c2); + for (int c2 = -((3 * c0 + 14) / 14) + 49; c2 <= 48; c2 += 1) + S1(c0, 0, c2); + for (int c1 = 1; c1 <= 18; c1 += 1) { + for (int c2 = -8 * c1; c2 <= min(6, -8 * c1 + 24); c2 += 1) + S3(c0, c1, c2); + if (c0 <= 34 && c1 == 1) { + S3(c0, 1, 7); + } else if (c1 == 2) { + S3(c0, 2, 7); + } else if (c0 >= 35 && c1 == 1) { + S3(c0, 1, 7); + S7(c0, 1, 7); + } + for (int c2 = 8; c2 <= min(-8 * c1 + 24, c1 - (6 * c0 + 77) / 77 + 12); c2 += 1) + S3(c0, c1, c2); + if (c1 == 1) { + for (int c2 = -((6 * c0 + 77) / 77) + 14; c2 <= 13; c2 += 1) { + S3(c0, 1, c2); + S6(c0, 1, c2); + } + for (int c2 = 14; c2 <= 16; c2 += 1) + S3(c0, 1, c2); + } + for (int c2 = max(-8 * c1 + 25, c1 - (6 * c0 + 77) / 77 + 13); c2 <= c1 + 12; c2 += 1) + S6(c0, c1, c2); + for (int c2 = c1 - (3 * c0 + 14) / 14 + 49; c2 <= c1 + 48; c2 += 1) + S1(c0, c1, c2); + } + for (int c1 = 19; c1 <= 24; c1 += 1) { + for (int c2 = -8 * c1; c2 <= -8 * c1 + 24; c2 += 1) + S3(c0, c1, c2); + for (int c2 = c1 - (6 * c0 + 77) / 77 + 13; c2 <= 30; c2 += 1) + S6(c0, c1, c2); + } + } + for (int c0 = 37; c0 <= 218; c0 += 1) { + for (int c1 = (c0 + 5) / 14 - 8; c1 < min(0, c0 / 14 - 5); c1 += 1) { + if (c0 <= 46 && c1 == -3) + S7(c0, -3, 6); + if (-77 * ((-3 * c1 + 1) / 5) + 447 >= 6 * c0) + S6(c0, c1, -((-2 * c1 + 3) / 5) + 9); + for (int c2 = c1 + 24; c2 <= -2 * c1 + 24; c2 += 1) + S2(c0, c1, c2); + for (int c2 = -2 * c1 + 30; c2 <= c1 - (3 * c0 + 17) / 14 + 56; c2 += 1) + S1(c0, c1, c2); + } + if (c0 <= 148) + for (int c1 = max(0, (c0 + 5) / 14 - 8); c1 < c0 / 14 - 5; c1 += 1) { + if (c1 == 0) + S2(c0, 0, 24); + for (int c2 = max(c1 + 24, -2 * c1 + 30); c2 <= c1 - (3 * c0 + 17) / 14 + 56; c2 += 1) + S1(c0, c1, c2); + } + if (c0 >= 79 && c0 % 14 >= 9) { + for (int c2 = max((c0 - 70) / 14 + 24, (c0 - 70) / 14 - (3 * c0 + 14) / 14 + 49); c2 <= (c0 - 70) / 14 - (3 * c0 + 17) / 14 + 56; c2 += 1) + S1(c0, c0 / 14 - 5, c2); + } else if (c0 <= 69 && c0 % 14 >= 9) { + if (c0 <= 41) + S7(c0, -3, 6); + S6(c0, c0 / 14 - 5, 8); + for (int c2 = -((-c0 + 83) / 14) - (3 * c0 + 14) / 14 + 49; c2 <= -((-c0 + 83) / 14) - (3 * c0 + 17) / 14 + 56; c2 += 1) + S1(c0, c0 / 14 - 5, c2); + } + for (int c1 = (c0 + 5) / 14 - 5; c1 < 0; c1 += 1) { + if (7 * c1 + 114 >= 2 * c0) + S7(c0, c1, 6); + for (int c2 = max(8, c1 - (6 * c0 + 77) / 77 + 13); c2 <= c1 - (6 * c0 + 91) / 77 + 15; c2 += 1) + S6(c0, c1, c2); + for (int c2 = c1 - (3 * c0 + 14) / 14 + 49; c2 <= c1 - (3 * c0 + 17) / 14 + 56; c2 += 1) + S1(c0, c1, c2); + } + for (int c1 = max(0, (c0 + 5) / 14 - 5); c1 < c0 / 14 - 2; c1 += 1) { + for (int c2 = max(c1, -2 * c1 + 6); c2 <= min(min(-2 * c1 + 24, c1 - (6 * c0 + 91) / 77 + 15), (2 * c0 - 7 * c1 - 10) / 21 + 1); c2 += 1) + S9(c0, c1, c2); + if (c1 >= 1 && c1 <= 5 && 14 * c1 + 46 >= c0) + S9(c0, c1, c1 + 5); + for (int c2 = max(c1 + 6, (2 * c0 - 7 * c1 - 10) / 21 + 2); c2 <= (2 * c1 + 1) / 5 + 7; c2 += 1) { + S7(c0, c1, c2); + S9(c0, c1, c2); + } + if (c1 <= 3 && 7 * c1 + 21 * ((2 * c1 + 41) / 5) >= 2 * c0 + 12) + S9(c0, c1, (2 * c1 + 1) / 5 + 8); + for (int c2 = (2 * c1 + 1) / 5 + 9; c2 <= c1 - (6 * c0 + 91) / 77 + 15; c2 += 1) { + S6(c0, c1, c2); + S9(c0, c1, c2); + } + for (int c2 = c1 - (6 * c0 + 91) / 77 + 16; c2 <= -2 * c1 + 24; c2 += 1) + S9(c0, c1, c2); + for (int c2 = max(c1, -2 * c1 + 30); c2 <= min(c1 + 24, c1 - (3 * c0 + 17) / 14 + 47); c2 += 1) + S8(c0, c1, c2); + for (int c2 = max(c1 + 24, c1 - (3 * c0 + 14) / 14 + 49); c2 <= c1 - (3 * c0 + 17) / 14 + 56; c2 += 1) + S1(c0, c1, c2); + } + for (int c1 = c0 / 14 - 2; c1 <= 18; c1 += 1) { + for (int c2 = max(6, (c0 + 5) / 14 + 1); c2 <= min(min(c1, c0 / 14 + 3), -c1 + c1 / 2 + 18); c2 += 1) + S5(c0, c1, c2); + for (int c2 = c1 + 6; c2 <= min((2 * c1 + 1) / 5 + 7, (2 * c0 - 7 * c1 + 63) / 21 + 1); c2 += 1) + S7(c0, c1, c2); + for (int c2 = max(max(c1 + 6, c1 - (6 * c0 + 77) / 77 + 13), (2 * c1 + 1) / 5 + 9); c2 <= c1 - (6 * c0 + 91) / 77 + 15; c2 += 1) + S6(c0, c1, c2); + for (int c2 = max(c1 + (3 * c0 + 3) / 14 - 40, -c1 + (c1 + 1) / 2 + 21); c2 <= min(c1, c1 + 3 * c0 / 14 - 33); c2 += 1) + S4(c0, c1, c2); + for (int c2 = max(c1, c1 - (3 * c0 + 14) / 14 + 40); c2 <= min(c1 + 24, c1 - (3 * c0 + 17) / 14 + 47); c2 += 1) + S8(c0, c1, c2); + for (int c2 = max(c1 + 24, c1 - (3 * c0 + 14) / 14 + 49); c2 <= c1 - (3 * c0 + 17) / 14 + 56; c2 += 1) + S1(c0, c1, c2); + } + for (int c1 = 19; c1 <= 24; c1 += 1) { + for (int c2 = max(c1 - 12, (c0 + 5) / 14 + 1); c2 <= min(c0 / 14 + 3, -c1 + c1 / 2 + 18); c2 += 1) + S5(c0, c1, c2); + for (int c2 = max(max(c1 - 12, c1 + (3 * c0 + 3) / 14 - 40), -c1 + (c1 + 1) / 2 + 21); c2 <= min(c1, c1 + 3 * c0 / 14 - 33); c2 += 1) + S4(c0, c1, c2); + for (int c2 = max(c1 + 6, c1 - (6 * c0 + 77) / 77 + 13); c2 <= min(30, c1 - (6 * c0 + 91) / 77 + 15); c2 += 1) + S6(c0, c1, c2); + for (int c2 = max(c1, c1 - (3 * c0 + 14) / 14 + 40); c2 <= min(c1 + 24, c1 - (3 * c0 + 17) / 14 + 47); c2 += 1) + S8(c0, c1, c2); + } + for (int c1 = 25; c1 <= min(42, -((3 * c0 + 17) / 14) + 71); c1 += 1) + for (int c2 = max(c1 - 12, c1 + (3 * c0 + 3) / 14 - 40); c2 <= min(min(30, c1), c1 + 3 * c0 / 14 - 33); c2 += 1) + S4(c0, c1, c2); + } +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/faber.st cloog-0.18.4/isl/test_inputs/codegen/cloog/faber.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/faber.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/faber.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,18 @@ +domain: "{ S2[idx4, idx5, idx6] : 14idx5 <= -84 + idx4 and 14idx5 >= -120 + idx4 and idx6 >= 24 + idx5 and idx6 <= 48 + idx5 and idx5 >= -6 and idx5 <= 18 and idx6 <= 24 - 2idx5; S4[idx4, idx5, idx6] : 14idx6 <= -462 + 3idx4 + 14idx5 and 14idx6 >= -570 + 3idx4 + 14idx5 and idx6 <= idx5 and idx6 >= -12 + idx5 and idx6 >= 6 and idx6 <= 30 and 2idx6 >= 42 - idx5; S6[idx4, idx5, idx6] : 77idx6 >= 924 - 6idx4 + 77idx5 and 77idx6 <= 1140 - 6idx4 + 77idx5 and idx6 <= 12 + idx5 and idx6 >= 6 + idx5 and idx6 >= 6 and idx6 <= 30 and 5idx6 >= 42 + 2idx5; S1[idx4, idx5, idx6] : 14idx6 >= 672 - 3idx4 + 14idx5 and 14idx6 <= 780 - 3idx4 + 14idx5 and idx6 >= 24 + idx5 and idx6 <= 48 + idx5 and idx5 >= -6 and idx5 <= 18 and idx6 >= 30 - 2idx5; S5[idx4, idx5, idx6] : 14idx6 <= 42 + idx4 and 14idx6 >= 6 + idx4 and idx6 <= idx5 and idx6 >= -12 + idx5 and idx6 >= 6 and idx6 <= 30 and 2idx6 <= 36 - idx5; S7[idx4, idx5, idx6] : 21idx6 <= 84 + 2idx4 - 7idx5 and 21idx6 >= 12 + 2idx4 - 7idx5 and idx6 <= 12 + idx5 and idx6 >= 6 + idx5 and idx6 >= 6 and idx6 <= 30 and 5idx6 <= 36 + 2idx5; S8[idx4, idx5, idx6] : 14idx6 >= 546 - 3idx4 + 14idx5 and 14idx6 <= 654 - 3idx4 + 14idx5 and idx6 >= idx5 and idx6 <= 24 + idx5 and idx5 >= 0 and idx5 <= 24 and idx6 >= 30 - 2idx5; S3[idx4, idx5, idx6] : idx4 >= 0 and idx4 <= 36 and idx6 >= -8idx5 and idx6 <= 24 - 8idx5 and idx5 >= 0 and idx5 <= 24; S9[idx4, idx5, idx6] : 14idx5 <= -42 + idx4 and 14idx5 >= -78 + idx4 and idx6 >= idx5 and idx6 <= 24 + idx5 and idx5 >= 0 and idx5 <= 24 and idx6 <= 24 - 2idx5 and idx6 >= 6 - 2idx5; S10[idx4, idx5, idx6] : 7idx6 <= idx4 - 28idx5 and 7idx6 >= -36 + idx4 - 28idx5 and idx6 >= idx5 and idx6 <= 24 + idx5 and idx5 >= 0 and idx5 <= 24 and idx6 <= -2idx5 }" +child: + context: "{ [] }" + child: + schedule: "[{ S6[idx4, idx5, idx6] -> [(idx4)]; S8[idx4, idx5, idx6] -> [(idx4)]; S5[idx4, idx5, idx6] -> [(idx4)]; S9[idx4, idx5, idx6] -> [(idx4)]; S4[idx4, idx5, idx6] -> [(idx4)]; S10[idx4, idx5, idx6] -> [(idx4)]; S7[idx4, idx5, idx6] -> [(idx4)]; S3[idx4, idx5, idx6] -> [(idx4)]; S1[idx4, idx5, idx6] -> [(idx4)]; S2[idx4, idx5, idx6] -> [(idx4)] }, { S6[idx4, idx5, idx6] -> [(idx5)]; S8[idx4, idx5, idx6] -> [(idx5)]; S5[idx4, idx5, idx6] -> [(idx5)]; S9[idx4, idx5, idx6] -> [(idx5)]; S4[idx4, idx5, idx6] -> [(idx5)]; S10[idx4, idx5, idx6] -> [(idx5)]; S7[idx4, idx5, idx6] -> [(idx5)]; S3[idx4, idx5, idx6] -> [(idx5)]; S1[idx4, idx5, idx6] -> [(idx5)]; S2[idx4, idx5, idx6] -> [(idx5)] }, { S6[idx4, idx5, idx6] -> [(idx6)]; S8[idx4, idx5, idx6] -> [(idx6)]; S5[idx4, idx5, idx6] -> [(idx6)]; S9[idx4, idx5, idx6] -> [(idx6)]; S4[idx4, idx5, idx6] -> [(idx6)]; S10[idx4, idx5, idx6] -> [(idx6)]; S7[idx4, idx5, idx6] -> [(idx6)]; S3[idx4, idx5, idx6] -> [(idx6)]; S1[idx4, idx5, idx6] -> [(idx6)]; S2[idx4, idx5, idx6] -> [(idx6)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[idx4, idx5, idx6] }" + - filter: "{ S2[idx4, idx5, idx6] }" + - filter: "{ S3[idx4, idx5, idx6] }" + - filter: "{ S4[idx4, idx5, idx6] }" + - filter: "{ S5[idx4, idx5, idx6] }" + - filter: "{ S6[idx4, idx5, idx6] }" + - filter: "{ S7[idx4, idx5, idx6] }" + - filter: "{ S8[idx4, idx5, idx6] }" + - filter: "{ S9[idx4, idx5, idx6] }" + - filter: "{ S10[idx4, idx5, idx6] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/forwardsub-1-1-2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/forwardsub-1-1-2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/forwardsub-1-1-2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/forwardsub-1-1-2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [i0, i1, 1] : i1 <= -1 + i0 and i1 >= 2 and i0 <= M; S4[i0, i0] -> [i0, i0, 3] : M >= 3 and i0 <= M and i0 >= 2; S1[i0, 1] -> [i0, 1, 0] : M >= 3 and i0 <= M and i0 >= 2; S3[1, 1] -> [1, 1, 2] : M >= 3 } -[M] -> { : M >= 3 } -[M] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/forwardsub-1-1-2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/forwardsub-1-1-2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/forwardsub-1-1-2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/forwardsub-1-1-2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,12 @@ +domain: "[M] -> { S4[i0, i0] : M >= 3 and i0 <= M and i0 >= 2; S1[i0, 1] : M >= 3 and i0 <= M and i0 >= 2; S3[1, 1] : M >= 3; S2[i0, i1] : i1 <= -1 + i0 and i1 >= 2 and i0 <= M }" +child: + context: "[M] -> { [] : M >= 3 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)]; S4[i0, i1] -> [(i0)]; S3[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S4[i0, i1] -> [(i1)]; S3[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + - filter: "[M] -> { S2[i0, i1] }" + - filter: "[M] -> { S3[i0, i1] }" + - filter: "[M] -> { S4[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/forwardsub-2-1-2-3.in cloog-0.18.4/isl/test_inputs/codegen/cloog/forwardsub-2-1-2-3.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/forwardsub-2-1-2-3.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/forwardsub-2-1-2-3.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[1, 1, i2] -> [1, 1, i2, 0] : M >= 3 and i2 <= M and i2 >= 2; S2[i0, 1, i2] -> [i0, 1, i2, 1] : i2 >= 1 + i0 and i0 >= 2 and i2 <= M; S4[i0, 0] -> [i0, 0, 0, 3] : i0 >= 2 and M >= 3 and i0 <= M; S3[1, 0] -> [1, 0, 0, 2] : M >= 3 } -[M] -> { : M >= 3 } -[M] -> { [i, j, k, l] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/forwardsub-2-1-2-3.st cloog-0.18.4/isl/test_inputs/codegen/cloog/forwardsub-2-1-2-3.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/forwardsub-2-1-2-3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/forwardsub-2-1-2-3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,12 @@ +domain: "[M] -> { S4[i0, 0] : i0 >= 2 and M >= 3 and i0 <= M; S3[1, 0] : M >= 3; S2[i0, 1, i2] : i2 >= 1 + i0 and i0 >= 2 and i2 <= M; S1[1, 1, i2] : M >= 3 and i2 <= M and i2 >= 2 }" +child: + context: "[M] -> { [] : M >= 3 }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i0)]; S4[i0, i1] -> [(i0)]; S3[i0, i1] -> [(i0)]; S2[i0, i1, i2] -> [(i0)] }, { S1[i0, i1, i2] -> [(i1)]; S4[i0, i1] -> [(i1)]; S3[i0, i1] -> [(i1)]; S2[i0, i1, i2] -> [(i1)] }, { S1[i0, i1, i2] -> [(i2)]; S4[i0, i1] -> [(0)]; S3[i0, i1] -> [(0)]; S2[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1, i2] }" + - filter: "[M] -> { S2[i0, i1, i2] }" + - filter: "[M] -> { S3[i0, i1] }" + - filter: "[M] -> { S4[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/forwardsub-3-1-2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/forwardsub-3-1-2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/forwardsub-3-1-2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/forwardsub-3-1-2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [i0, i1, 1] : 2i1 <= -1 + i0 and i1 >= 2 and i1 >= -M + i0; S4[i0, i1] -> [i0, j, 3] : 2j = i0 and 2i1 = i0 and M >= 3 and i0 <= 2M and i0 >= 4; S1[i0, 1] -> [i0, 1, 0] : M >= 3 and i0 <= 1 + M and i0 >= 3; S3[2, 1] -> [2, 1, 2] : M >= 3 } -[M] -> { : M >= 3 } -[M] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/forwardsub-3-1-2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/forwardsub-3-1-2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/forwardsub-3-1-2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/forwardsub-3-1-2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,12 @@ +domain: "[M] -> { S4[i0, i1] : 2i1 = i0 and M >= 3 and i0 <= 2M and i0 >= 4; S1[i0, 1] : M >= 3 and i0 <= 1 + M and i0 >= 3; S3[2, 1] : M >= 3; S2[i0, i1] : 2i1 <= -1 + i0 and i1 >= 2 and i1 >= -M + i0 }" +child: + context: "[M] -> { [] : M >= 3 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)]; S4[i0, i1] -> [(i0)]; S3[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S4[i0, i1] -> [(i1)]; S3[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + - filter: "[M] -> { S2[i0, i1] }" + - filter: "[M] -> { S3[i0, i1] }" + - filter: "[M] -> { S4[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/gauss.c cloog-0.18.4/isl/test_inputs/codegen/cloog/gauss.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/gauss.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/gauss.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,7 +1,7 @@ for (int c0 = 1; c0 < M; c0 += 1) for (int c1 = c0 + 1; c1 <= M; c1 += 1) { - for (int c3 = c0 + 1; c3 <= M; c3 += 1) - S2(c0, c3, c1); for (int c3 = 1; c3 < c0; c3 += 1) S1(c0, c3, c1); + for (int c3 = c0 + 1; c3 <= M; c3 += 1) + S2(c0, c3, c1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/gauss.in cloog-0.18.4/isl/test_inputs/codegen/cloog/gauss.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/gauss.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/gauss.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1, i2] -> [i0, i2] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= -1 + i0 and i2 >= 1 + i0 and i2 <= M; S2[i0, i1, i2] -> [i0, i2] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M and i2 >= 1 + i0 and i2 <= M } -[M] -> { : } -[M] -> { [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/gauss.st cloog-0.18.4/isl/test_inputs/codegen/cloog/gauss.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/gauss.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/gauss.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M] -> { S2[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M and i2 >= 1 + i0 and i2 <= M; S1[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= -1 + i0 and i2 >= 1 + i0 and i2 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i0)]; S2[i0, i1, i2] -> [(i0)] }, { S1[i0, i1, i2] -> [(i2)]; S2[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/gesced2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/gesced2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/gesced2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/gesced2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1] -> [i0, i1] : i0 >= 1 and i0 <= M and i1 >= 5 and i1 <= -10 + M; S2[i0, i1] -> [i1, i0 - i1] : i0 >= 1 and i0 <= M and i1 >= 5 and i1 <= -10 + M } -[M] -> { : M >= 16 } -[M] -> { [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/gesced2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/gesced2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/gesced2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/gesced2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 5 and i1 <= -10 + M; S2[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 5 and i1 <= -10 + M }" +child: + context: "[M] -> { [] : M >= 16 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i1)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i0 - i1)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/gesced3.in cloog-0.18.4/isl/test_inputs/codegen/cloog/gesced3.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/gesced3.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/gesced3.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S2[i0] -> [2M + i0] : i0 >= 1 and i0 <= N; S1[i0] -> [M + i0] : i0 >= 1 and i0 <= N } -[M, N] -> { : N >= M and M >= 2 } -[M, N] -> { [i] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/gesced3.st cloog-0.18.4/isl/test_inputs/codegen/cloog/gesced3.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/gesced3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/gesced3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M, N] -> { S1[i0] : i0 >= 1 and i0 <= N; S2[i0] : i0 >= 1 and i0 <= N }" +child: + context: "[M, N] -> { [] : N >= M and M >= 2 }" + child: + schedule: "[M, N] -> [{ S2[i0] -> [(2M + i0)]; S1[i0] -> [(M + i0)] }]" + options: "[M, N] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/gesced.in cloog-0.18.4/isl/test_inputs/codegen/cloog/gesced.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/gesced.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/gesced.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S3[i0, i1] -> [2N + i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S2[i0, i1] -> [N + i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S1[i0] -> [i0] : i0 >= 1 and i0 <= N } -[M, N] -> { : N <= M and M >= 2 and N >= 2 } -[M, N] -> { [i] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/gesced.st cloog-0.18.4/isl/test_inputs/codegen/cloog/gesced.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/gesced.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/gesced.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M, N] -> { S3[i0, i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S1[i0] : i0 >= 1 and i0 <= N; S2[i0, i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M }" +child: + context: "[M, N] -> { [] : N <= M and M >= 2 and N >= 2 }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(N + i1)]; S3[i0, i1] -> [(2N + i1)]; S1[i0] -> [(i0)] }]" + options: "[M, N] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/guide.in cloog-0.18.4/isl/test_inputs/codegen/cloog/guide.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/guide.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/guide.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0] -> [i0, 0] : (i0 >= 1 and i0 <= N and i0 <= 2M) or (i0 >= 1 and i0 <= N and i0 >= M); S2[i0] -> [i0, 1] : i0 >= 1 + N and i0 <= 2N } -[M, N] -> { : } -[M, N] -> { [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/guide.st cloog-0.18.4/isl/test_inputs/codegen/cloog/guide.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/guide.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/guide.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[M, N] -> { S1[i0] : (i0 >= 1 and i0 <= N and i0 <= 2M) or (i0 >= M and i0 >= 1 and i0 <= N); S2[i0] : i0 >= 1 + N and i0 <= 2N }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S2[i0] -> [(i0)]; S1[i0] -> [(i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0] }" + - filter: "[M, N] -> { S2[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/iftest2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/iftest2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/iftest2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/iftest2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0, i1] -> [i0, i1, 0] : (i0 >= 1 and i0 <= N and i0 >= M and i1 >= 1 and i1 <= M) or (i0 >= 1 and i0 <= N and i0 <= 2M and i1 >= 1 and i1 <= M) } -[M, N] -> { : } -[M, N] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/iftest2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/iftest2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/iftest2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/iftest2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M, N] -> { S1[i0, i1] : (i0 >= M and i0 <= N and i1 >= 1 and i1 <= M) or (i0 >= 1 and i0 <= N and i0 <= 2M and i1 >= 1 and i1 <= M) }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/iftest.in cloog-0.18.4/isl/test_inputs/codegen/cloog/iftest.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/iftest.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/iftest.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[m, n] -> { S1[i0] -> [i0, 0] : (i0 >= 1 and i0 <= n and i0 >= m) or (i0 >= 1 and i0 <= n and i0 <= 2m) } -[m, n] -> { : } -[m, n] -> { [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/iftest.st cloog-0.18.4/isl/test_inputs/codegen/cloog/iftest.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/iftest.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/iftest.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[m, n] -> { S1[i0] : (i0 >= m and i0 >= 1 and i0 <= n) or (i0 >= 1 and i0 <= n and i0 <= 2m) }" +child: + context: "[m, n] -> { [] }" + child: + schedule: "[m, n] -> [{ S1[i0] -> [(i0)] }]" + options: "[m, n] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/infinite2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/infinite2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/infinite2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/infinite2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S2[i0, i1] -> [i0, i1, 1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S1[i0] -> [i0, 0, 0] : i0 >= 1 } -[M, N] -> { : M >= 1 and N >= 1 } -[M, N] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/infinite2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/infinite2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/infinite2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/infinite2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[M, N] -> { S1[i0] : i0 >= 1; S2[i0, i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M }" +child: + context: "[M, N] -> { [] : M >= 1 and N >= 1 }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(i0)]; S1[i0] -> [(i0)] }, { S2[i0, i1] -> [(i1)]; S1[i0] -> [(0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0] }" + - filter: "[M, N] -> { S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/jacobi-shared.c cloog-0.18.4/isl/test_inputs/codegen/cloog/jacobi-shared.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/jacobi-shared.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/jacobi-shared.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,3 +1,3 @@ -if (2 * floord(h0 - 1, 2) + 1 == h0 && g2 + 29 >= (g2 - t1 + 32) % 32 && ((g2 - t1 + 32) % 32) + N >= g2 + 33) - for (int c0 = max(((g1 + t0 + 13) % 16) - g1 + 3, ((t0 + 15) % 16) + 1); c0 <= min(32, N - g1 - 1); c0 += 16) +if (((t1 + 31) % 32) + g2 >= 2 && N >= ((t1 + 31) % 32) + g2 + 2 && (h0 - 1) % 2 == 0) + for (int c0 = max(((t0 + 15) % 16) + 1, ((g1 + t0 + 13) % 16) - g1 + 3); c0 <= min(32, N - g1 - 1); c0 += 16) S1(g1 + c0 - 1, ((t1 + 31) % 32) + g2); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/jacobi-shared.in cloog-0.18.4/isl/test_inputs/codegen/cloog/jacobi-shared.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/jacobi-shared.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/jacobi-shared.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[T, N, h0, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { S1[i0, i1] -> [1 - g1 + i0, 1 - g2 + i1, t0, t1] : exists (e0 = [(-1 + h0)/2], e1 = [(-2016b0 - g1)/2048], e2 = [(-992b1 - g2)/1024], e3 = [(-1 + t0 - i0)/16], e4 = [(-1 + t1 - i1)/32]: g0 = h0 and 2e0 = -1 + h0 and 2048e1 = -2016b0 - g1 and 1024e2 = -992b1 - g2 and 16e3 = -1 + t0 - i0 and 32e4 = -1 + t1 - i1 and h0 >= 1 and h0 <= -1 + 2T and i0 >= 2 and i0 <= -2 + N and i1 >= 2 and i1 <= -2 + N and b1 <= 31 and b1 >= 0 and b0 <= 63 and b0 >= 0 and i1 <= 31 + g2 and i1 >= g2 and N >= 4 and i0 >= g1 and i0 <= 31 + g1 and g2 <= -2 + N and g2 >= -29 and g1 <= -2 + N and g1 >= -29 and g1 >= 32b0 and g2 >= 32b1 and 32b0 <= -2 + N and 32b1 <= -2 + N and t0 >= 0 and t0 <= 15 and t1 >= 0 and t1 <= 31) } -[T, N, h0, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { : exists (e0 = [(-32b0 + g1)/2048], e1 = [(-32b1 + g2)/1024]: g0 = h0 and 2048e0 = -32b0 + g1 and 1024e1 = -32b1 + g2 and g2 <= -2 + N and g2 >= -29 and g1 <= -2 + N and g1 >= -29 and b1 >= 0 and b1 <= 31 and b0 <= 63 and 32b1 <= -2 + N and 32b0 <= -2 + N and b0 >= 0 and N >= 4 and h0 >= 0 and h0 <= -1 + 2T and g2 >= 32b1 and g1 >= 32b0 and t0 >= 0 and t0 <= 15 and t1 >= 0 and t1 <= 31) } -[T, N, h0, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { [i, j, k, l] -> separate[x] : x >= 3 } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/jacobi-shared.st cloog-0.18.4/isl/test_inputs/codegen/cloog/jacobi-shared.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/jacobi-shared.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/jacobi-shared.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[T, N, h0, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { S1[i0, i1] : exists (e0 = floor((-1 + h0)/2), e1 = floor((-32b0 + g1)/2048), e2 = floor((-32b1 + g2)/1024), e3 = floor((-15 - t0 + i0)/16), e4 = floor((-31 - t1 + i1)/32): g0 = h0 and 2e0 = -1 + h0 and 2048e1 = -32b0 + g1 and 1024e2 = -32b1 + g2 and 16e3 = -15 - t0 + i0 and 32e4 = -31 - t1 + i1 and h0 >= 1 and h0 <= -1 + 2T and i0 >= 2 and i0 <= -2 + N and i1 >= 2 and i1 <= -2 + N and b1 <= 31 and b1 >= 0 and b0 <= 63 and b0 >= 0 and i1 <= 31 + g2 and i1 >= g2 and N >= 4 and i0 >= g1 and i0 <= 31 + g1 and g2 <= -2 + N and g2 >= -29 and g1 <= -2 + N and g1 >= -29 and g1 >= 32b0 and g2 >= 32b1 and 32b0 <= -2 + N and 32b1 <= -2 + N and t0 >= 0 and t0 <= 15 and t1 >= 0 and t1 <= 31) }" +child: + context: "[T, N, h0, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { [] : exists (e0 = floor((-32b0 + g1)/2048), e1 = floor((-32b1 + g2)/1024): g0 = h0 and 2048e0 = -32b0 + g1 and 1024e1 = -32b1 + g2 and g2 <= -2 + N and g2 >= -29 and g1 <= -2 + N and g1 >= -29 and b1 >= 0 and b1 <= 31 and b0 <= 63 and 32b1 <= -2 + N and 32b0 <= -2 + N and b0 >= 0 and N >= 4 and h0 >= 0 and h0 <= -1 + 2T and g2 >= 32b1 and g1 >= 32b0 and t0 >= 0 and t0 <= 15 and t1 >= 0 and t1 <= 31) }" + child: + schedule: "[T, N, h0, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> [{ S1[i0, i1] -> [(1 - g1 + i0)] }, { S1[i0, i1] -> [(1 - g2 + i1)] }, { S1[i0, i1] -> [(t0)] }, { S1[i0, i1] -> [(t1)] }]" + options: "[T, N, h0, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { separate[x] : x >= 3 }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/largeur.in cloog-0.18.4/isl/test_inputs/codegen/cloog/largeur.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/largeur.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/largeur.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1] -> [i1, i0] : i0 >= 1 and i0 <= M and i1 >= i0 and i1 <= M } -[M] -> { : M >= 0 } -[M] -> { [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/largeur.st cloog-0.18.4/isl/test_inputs/codegen/cloog/largeur.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/largeur.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/largeur.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i0 <= M and i1 >= i0 and i1 <= M }" +child: + context: "[M] -> { [] : M >= 0 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i1)] }, { S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.c cloog-0.18.4/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.c 2015-07-24 12:23:09.000000000 +0000 @@ -13,7 +13,7 @@ } for (int c0 = N + 2; c0 < 2 * M - N - 1; c0 += 1) { S7(c0, -N + (N + c0 + 1) / 2 - 1); - if ((-N + c0) % 2 == 0) { + if ((N - c0) % 2 == 0) { S5(c0, (-N + c0) / 2); S8(c0, (-N + c0) / 2); } @@ -21,7 +21,7 @@ S6(c0, c1); S8(c0, c1); } - if ((-N + c0) % 2 == 0) { + if ((N - c0) % 2 == 0) { S4(c0, (N + c0) / 2); S8(c0, (N + c0) / 2); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.in cloog-0.18.4/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S8[i0, i1] -> [i0, i1, 7] : i0 >= 1 + N and 2i1 <= N + i0 and 2i1 >= -N + i0 and i0 <= -2 + 2M - N and N <= -2 + M and N >= 1; S1[0, 0] -> [0, 0, 0] : N <= -2 + M and N >= 1; S5[i0, i1] -> [i0, j, 4] : 2j = -N + i0 and 2i1 = -N + i0 and i0 >= 2 + N and i0 <= -2 + 2M - N and N >= 1; S7[i0, i1] -> [i0, i1, 6] : i0 >= 1 + N and 2i1 <= -1 - N + i0 and i0 <= -2 + 2M - N and 2i1 >= -2 - N + i0 and N <= -2 + M and N >= 1; S2[i0, 0] -> [i0, 0, 1] : i0 >= 1 and i0 <= N and N <= -2 + M; S3[i0, i0] -> [i0, i0, 2] : i0 >= 1 and i0 <= N and N <= -2 + M; S4[i0, i1] -> [i0, j, 3] : 2j = N + i0 and 2i1 = N + i0 and i0 >= 2 + N and i0 <= -2 + 2M - N and N >= 1; S6[i0, i1] -> [i0, i1, 5] : 2i1 <= -1 + N + i0 and i1 <= -1 + i0 and i1 >= 1 - M + i0 and 2i1 >= 1 - N + i0 and i1 >= 1 and i1 <= -1 + M and N <= -2 + M } -[M, N] -> { : N <= -2 + M and N >= 1 } -[M, N] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.st cloog-0.18.4/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,16 @@ +domain: "[M, N] -> { S5[i0, i1] : 2i1 = -N + i0 and i0 >= 2 + N and i0 <= -2 + 2M - N and N >= 1; S3[i0, i0] : i0 >= 1 and i0 <= N and N <= -2 + M; S7[i0, i1] : i0 >= 1 + N and 2i1 <= -1 - N + i0 and i0 <= -2 + 2M - N and 2i1 >= -2 - N + i0 and N <= -2 + M and N >= 1; S6[i0, i1] : 2i1 <= -1 + N + i0 and i1 <= -1 + i0 and i1 >= 1 - M + i0 and 2i1 >= 1 - N + i0 and i1 >= 1 and i1 <= -1 + M and N <= -2 + M; S1[0, 0] : N <= -2 + M and N >= 1; S2[i0, 0] : i0 >= 1 and i0 <= N and N <= -2 + M; S4[i0, i1] : 2i1 = N + i0 and i0 >= 2 + N and i0 <= -2 + 2M - N and N >= 1; S8[i0, i1] : i0 >= 1 + N and 2i1 <= N + i0 and 2i1 >= -N + i0 and i0 <= -2 + 2M - N and N <= -2 + M and N >= 1 }" +child: + context: "[M, N] -> { [] : N <= -2 + M and N >= 1 }" + child: + schedule: "[M, N] -> [{ S7[i0, i1] -> [(i0)]; S5[i0, i1] -> [(i0)]; S1[i0, i1] -> [(i0)]; S3[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)]; S4[i0, i1] -> [(i0)]; S8[i0, i1] -> [(i0)]; S6[i0, i1] -> [(i0)] }, { S7[i0, i1] -> [(i1)]; S5[i0, i1] -> [(i1)]; S1[i0, i1] -> [(i1)]; S3[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)]; S4[i0, i1] -> [(i1)]; S8[i0, i1] -> [(i1)]; S6[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1] }" + - filter: "[M, N] -> { S2[i0, i1] }" + - filter: "[M, N] -> { S3[i0, i1] }" + - filter: "[M, N] -> { S4[i0, i1] }" + - filter: "[M, N] -> { S5[i0, i1] }" + - filter: "[M, N] -> { S6[i0, i1] }" + - filter: "[M, N] -> { S7[i0, i1] }" + - filter: "[M, N] -> { S8[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/lex.in cloog-0.18.4/isl/test_inputs/codegen/cloog/lex.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/lex.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/lex.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S2[i0] -> [i0, -1, 0] : i0 >= 0 and i0 <= 10; S1[i0] -> [i0, 0, 0] : i0 >= 0 and i0 <= 10 } -{ : } -{ [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/lex.st cloog-0.18.4/isl/test_inputs/codegen/cloog/lex.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/lex.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/lex.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "{ S1[i0] : i0 >= 0 and i0 <= 10; S2[i0] : i0 >= 0 and i0 <= 10 }" +child: + context: "{ [] }" + child: + schedule: "[{ S2[i0] -> [(i0)]; S1[i0] -> [(i0)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S2[i0] }" + - filter: "{ S1[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/lineality-1-2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/lineality-1-2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/lineality-1-2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/lineality-1-2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i0] -> [i0, i0, 1] : i0 >= 1 and i0 <= M; S1[i0, i1] -> [i0, i1, 0] : i0 >= 1 and i1 >= 1 and i0 <= M and i1 <= M } -[M] -> { : M >= 2 } -[M] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/lineality-1-2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/lineality-1-2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/lineality-1-2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/lineality-1-2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i1 >= 1 and i0 <= M and i1 <= M; S2[i0, i0] : i0 >= 1 and i0 <= M }" +child: + context: "[M] -> { [] : M >= 2 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + - filter: "[M] -> { S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/lineality-2-1-2.c cloog-0.18.4/isl/test_inputs/codegen/cloog/lineality-2-1-2.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/lineality-2-1-2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/lineality-2-1-2.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,12 +1,12 @@ for (int c0 = 1; c0 <= M; c0 += 1) { for (int c1 = 1; c1 <= min(M, c0 + 1); c1 += 1) S1(c0, c1); - if (c0 + 1 >= M) { - S2(c0, c0 + 2); - } else { + if (M >= c0 + 2) { S1(c0, c0 + 2); S2(c0, c0 + 2); } for (int c1 = c0 + 3; c1 <= M; c1 += 1) S1(c0, c1); + if (c0 + 1 >= M) + S2(c0, c0 + 2); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/lineality-2-1-2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/lineality-2-1-2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/lineality-2-1-2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/lineality-2-1-2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S2[i0, 2 + i0] -> [i0, 2 + i0, 1] : i0 >= 1 and i0 <= M; S1[i0, i1] -> [i0, i1, 0] : i0 >= 1 and i1 >= 1 and i0 <= M and i1 <= M } -[M] -> { : M >= 2 } -[M] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/lineality-2-1-2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/lineality-2-1-2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/lineality-2-1-2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/lineality-2-1-2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i1 >= 1 and i0 <= M and i1 <= M; S2[i0, 2 + i0] : i0 >= 1 and i0 <= M }" +child: + context: "[M] -> { [] : M >= 2 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + - filter: "[M] -> { S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/logo.in cloog-0.18.4/isl/test_inputs/codegen/cloog/logo.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/logo.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/logo.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [i0, i1, 1] : i0 >= 2 and i0 <= 6 and i1 >= 0 and i1 <= 4; S1[i0, i1] -> [i0, i1, 0] : i0 >= 1 and i1 <= 7 and i1 >= -1 + i0 } -[M] -> { : } -[M] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/logopar.in cloog-0.18.4/isl/test_inputs/codegen/cloog/logopar.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/logopar.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/logopar.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[m, n] -> { S1[i0, i1] -> [i0, i1, 0] : i0 >= 1 and i1 <= m and i1 >= -1 + i0; S2[i0, i1] -> [i0, i1, 1] : i0 >= 2 and i0 <= n and i1 >= 0 and i1 <= n } -[m, n] -> { : n <= m and m >= 0 and n >= 2 } -[m, n] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/logopar.st cloog-0.18.4/isl/test_inputs/codegen/cloog/logopar.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/logopar.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/logopar.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[m, n] -> { S1[i0, i1] : i0 >= 1 and i1 <= m and i1 >= -1 + i0; S2[i0, i1] : i0 >= 2 and i0 <= n and i1 >= 0 and i1 <= n }" +child: + context: "[m, n] -> { [] : n <= m and m >= 0 and n >= 2 }" + child: + schedule: "[m, n] -> [{ S2[i0, i1] -> [(i0)]; S1[i0, i1] -> [(i0)] }, { S2[i0, i1] -> [(i1)]; S1[i0, i1] -> [(i1)] }]" + options: "[m, n] -> { separate[i0] }" + child: + sequence: + - filter: "[m, n] -> { S1[i0, i1] }" + - filter: "[m, n] -> { S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/logo.st cloog-0.18.4/isl/test_inputs/codegen/cloog/logo.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/logo.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/logo.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i1 <= 7 and i1 >= -1 + i0; S2[i0, i1] : i0 >= 2 and i0 <= 6 and i1 >= 0 and i1 <= 4 }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + - filter: "[M] -> { S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/lu2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/lu2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/lu2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/lu2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n] -> { S1[i0, n, i0, i3] -> [i0, n, i0, i3, 0, 0] : i0 >= 1 and i0 <= n and i3 >= 1 + i0 and i3 <= n; S2[i0, i1, i2, i1, i0] -> [i0, i1, i2, i1, i0, 1] : i2 >= 1 and i2 <= n and i2 <= -1 + i1 and i1 <= n and i2 <= -1 + i0 and i0 <= n } -[n] -> { : } -[n] -> { [i, j, k, l, m, n'] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/lu2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/lu2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/lu2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/lu2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[n] -> { S2[i0, i1, i2, i1, i0] : i2 >= 1 and i2 <= n and i2 <= -1 + i1 and i1 <= n and i2 <= -1 + i0 and i0 <= n; S1[i0, n, i0, i3] : i0 >= 1 and i0 <= n and i3 >= 1 + i0 and i3 <= n }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S2[i0, i1, i2, i3, i4] -> [(i0)]; S1[i0, i1, i2, i3] -> [(i0)] }, { S2[i0, i1, i2, i3, i4] -> [(i1)]; S1[i0, i1, i2, i3] -> [(i1)] }, { S2[i0, i1, i2, i3, i4] -> [(i2)]; S1[i0, i1, i2, i3] -> [(i2)] }, { S2[i0, i1, i2, i3, i4] -> [(i3)]; S1[i0, i1, i2, i3] -> [(i3)] }, { S2[i0, i1, i2, i3, i4] -> [(i4)]; S1[i0, i1, i2, i3] -> [(0)] }]" + options: "[n] -> { separate[i0] }" + child: + sequence: + - filter: "[n] -> { S1[i0, i1, i2, i3] }" + - filter: "[n] -> { S2[i0, i1, i2, i3, i4] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/lu.in cloog-0.18.4/isl/test_inputs/codegen/cloog/lu.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/lu.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/lu.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n] -> { S2[i0, i1, i2] -> [i2, i1] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n and i2 >= 1 + i0 and i2 <= n; S1[i0, i1] -> [i0, n] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n } -[n] -> { : } -[n] -> { [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/lu.st cloog-0.18.4/isl/test_inputs/codegen/cloog/lu.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/lu.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/lu.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[i0, i1] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S2[i0, i1, i2] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n and i2 >= 1 + i0 and i2 <= n }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S2[i0, i1, i2] -> [(i2)]; S1[i0, i1] -> [(i0)] }, { S2[i0, i1, i2] -> [(i1)]; S1[i0, i1] -> [(n)] }]" + options: "[n] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/lux.in cloog-0.18.4/isl/test_inputs/codegen/cloog/lux.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/lux.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/lux.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i0, M, i3] -> [i0, i0, M, i3, 0, 0] : i0 >= 1 and i0 <= M and i3 >= 1 + i0 and i3 <= M; S2[i0, i1, i2, i2, i0] -> [i0, i1, i2, i2, i0, 1] : i1 >= 1 and i1 <= M and i2 >= 1 + i1 and i2 <= M and i1 <= -1 + i0 and i0 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m, n] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/lux.st cloog-0.18.4/isl/test_inputs/codegen/cloog/lux.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/lux.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/lux.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[M] -> { S1[i0, i0, M, i3] : i0 >= 1 and i0 <= M and i3 >= 1 + i0 and i3 <= M; S2[i0, i1, i2, i2, i0] : i1 >= 1 and i1 <= M and i2 >= 1 + i1 and i2 <= M and i1 <= -1 + i0 and i0 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i0)]; S2[i0, i1, i2, i3, i4] -> [(i0)] }, { S1[i0, i1, i2, i3] -> [(i1)]; S2[i0, i1, i2, i3, i4] -> [(i1)] }, { S1[i0, i1, i2, i3] -> [(i2)]; S2[i0, i1, i2, i3, i4] -> [(i2)] }, { S1[i0, i1, i2, i3] -> [(i3)]; S2[i0, i1, i2, i3, i4] -> [(i3)] }, { S1[i0, i1, i2, i3] -> [(0)]; S2[i0, i1, i2, i3, i4] -> [(i4)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1, i2, i3] }" + - filter: "[M] -> { S2[i0, i1, i2, i3, i4] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/merge.in cloog-0.18.4/isl/test_inputs/codegen/cloog/merge.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/merge.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/merge.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S3[i0] -> [i0, 2] : i0 >= 0 and i0 <= 10; S2[i0] -> [i0, 1] : i0 >= 2 and i0 <= 10; S1[0] -> [0, 0] } -{ : } -{ [i, j] -> atomic[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/merge.st cloog-0.18.4/isl/test_inputs/codegen/cloog/merge.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/merge.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/merge.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,11 @@ +domain: "{ S3[i0] : i0 >= 0 and i0 <= 10; S1[0]; S2[i0] : i0 >= 2 and i0 <= 10 }" +child: + context: "{ [] }" + child: + schedule: "[{ S2[i0] -> [(i0)]; S3[i0] -> [(i0)]; S1[i0] -> [(i0)] }]" + options: "{ atomic[i0] }" + child: + sequence: + - filter: "{ S1[i0] }" + - filter: "{ S2[i0] }" + - filter: "{ S3[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/min-1-1.c cloog-0.18.4/isl/test_inputs/codegen/cloog/min-1-1.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/min-1-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/min-1-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,3 +1,3 @@ for (int c0 = 1; c0 <= N; c0 += 1) - for (int c1 = 0; c1 <= min(min(N - c0, c0), M); c1 += 1) + for (int c1 = 0; c1 <= min(min(M, c0), N - c0); c1 += 1) S1(c0, c1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/min-1-1.in cloog-0.18.4/isl/test_inputs/codegen/cloog/min-1-1.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/min-1-1.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/min-1-1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0, i1] -> [i0, i1, 0] : i0 >= 1 and i1 >= 0 and i1 <= M and i1 <= i0 and i1 <= N - i0 } -[M, N] -> { : } -[M, N] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/min-1-1.st cloog-0.18.4/isl/test_inputs/codegen/cloog/min-1-1.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/min-1-1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/min-1-1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M, N] -> { S1[i0, i1] : i0 >= 1 and i1 >= 0 and i1 <= M and i1 <= i0 and i1 <= N - i0 }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/min-2-1.c cloog-0.18.4/isl/test_inputs/codegen/cloog/min-2-1.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/min-2-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/min-2-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ for (int c0 = 1; c0 <= N; c0 += 1) - for (int c1 = 0; c1 <= min(min(N - c0, c0), M); c1 += 1) - for (int c2 = 0; c2 <= min(min(M, N - c0), c0); c2 += 1) + for (int c1 = 0; c1 <= min(min(M, c0), N - c0); c1 += 1) + for (int c2 = 0; c2 <= min(min(M, c0), N - c0); c2 += 1) S1(c0, c1, c2); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/min-2-1.in cloog-0.18.4/isl/test_inputs/codegen/cloog/min-2-1.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/min-2-1.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/min-2-1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0, i1, i2] -> [i0, i1, i2, 0] : i0 >= 1 and i1 >= 0 and i1 <= M and i1 <= i0 and i1 <= N - i0 and i2 >= 0 and i2 <= M and i2 <= i0 and i2 <= N - i0 } -[M, N] -> { : } -[M, N] -> { [i, j, k, l] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/min-2-1.st cloog-0.18.4/isl/test_inputs/codegen/cloog/min-2-1.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/min-2-1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/min-2-1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M, N] -> { S1[i0, i1, i2] : i0 >= 1 and i1 >= 0 and i1 <= M and i1 <= i0 and i1 <= N - i0 and i2 >= 0 and i2 <= M and i2 <= i0 and i2 <= N - i0 }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2] -> [(i0)] }, { S1[i0, i1, i2] -> [(i1)] }, { S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/min-3-1.c cloog-0.18.4/isl/test_inputs/codegen/cloog/min-3-1.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/min-3-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/min-3-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,3 +1,3 @@ -for (int c0 = 0; c0 <= min(M, 10); c0 += 1) - for (int c1 = 0; c1 <= min(M, 10); c1 += 1) +for (int c0 = 0; c0 <= min(10, M); c0 += 1) + for (int c1 = 0; c1 <= min(10, M); c1 += 1) S1(c0, c1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/min-3-1.in cloog-0.18.4/isl/test_inputs/codegen/cloog/min-3-1.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/min-3-1.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/min-3-1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1] -> [i0, i1, 0] : i0 >= 0 and i0 <= M and i0 <= 10 and i1 >= 0 and i1 <= M and i1 <= 10 } -[M] -> { : M >= 0 } -[M] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/min-3-1.st cloog-0.18.4/isl/test_inputs/codegen/cloog/min-3-1.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/min-3-1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/min-3-1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 0 and i0 <= M and i0 <= 10 and i1 >= 0 and i1 <= M and i1 <= 10 }" +child: + context: "[M] -> { [] : M >= 0 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/min-4-1.c cloog-0.18.4/isl/test_inputs/codegen/cloog/min-4-1.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/min-4-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/min-4-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,2 +1,2 @@ -for (int c0 = max(-N, -M); c0 <= min(O, N); c0 += 1) +for (int c0 = max(-M, -N); c0 <= min(N, O); c0 += 1) S1(c0); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/min-4-1.in cloog-0.18.4/isl/test_inputs/codegen/cloog/min-4-1.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/min-4-1.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/min-4-1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N, O] -> { S1[i0] -> [i0, 0] : i0 >= -M and i0 >= -N and i0 <= N and i0 <= O } -[M, N, O] -> { : } -[M, N, O] -> { [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/min-4-1.st cloog-0.18.4/isl/test_inputs/codegen/cloog/min-4-1.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/min-4-1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/min-4-1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M, N, O] -> { S1[i0] : i0 >= -M and i0 >= -N and i0 <= N and i0 <= O }" +child: + context: "[M, N, O] -> { [] }" + child: + schedule: "[M, N, O] -> [{ S1[i0] -> [(i0)] }]" + options: "[M, N, O] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/mod2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/mod2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/mod2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/mod2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[i] -> [i, 0] : exists (e0 = [(i)/3]: i >= 0 and i <= 3 and 3e0 <= i and 3e0 >= -1 + i) } -{ : } -{ [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/mod2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/mod2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/mod2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/mod2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "{ S1[i] : exists (e0 = floor((1 + i)/3): 3e0 <= i and 3e0 >= -1 + i and i >= 0 and i <= 3) }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i] -> [(i)] }]" + options: "{ separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/mod3.c cloog-0.18.4/isl/test_inputs/codegen/cloog/mod3.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/mod3.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/mod3.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = max(32 * h0 - 1991, 0); c0 <= min(999, 32 * h0 + 31); c0 += 1) +for (int c0 = max(0, 32 * h0 - 1991); c0 <= min(999, 32 * h0 + 31); c0 += 1) if ((32 * h0 - c0 + 32) % 64 >= 1) for (int c1 = 0; c1 <= 999; c1 += 1) S1(c0, c1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/mod3.in cloog-0.18.4/isl/test_inputs/codegen/cloog/mod3.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/mod3.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/mod3.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[h0] -> { S1[i0, i1] -> [i0, i1, 0] : exists (e0 = [(32 + 32h0 - i0)/64]: i0 >= 0 and i0 <= 999 and i0 >= -2015 + 32h0 and 32e0 >= -999 + 32h0 - i0 and i1 >= 0 and i1 <= 999 and 64e0 >= -31 + 32h0 - i0 and 64e0 <= 31 + 32h0 - i0 and i0 <= 32 + 32h0) } -[h0] -> { : h0 <= 93 and h0 >= 0 } -[h0] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/mod3.st cloog-0.18.4/isl/test_inputs/codegen/cloog/mod3.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/mod3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/mod3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[h0] -> { S1[i0, i1] : exists (e0 = floor((32 + 32h0 - i0)/64): 64e0 <= 31 + 32h0 - i0 and 64e0 >= -31 + 32h0 - i0 and i0 >= 0 and i0 <= 999 and i0 >= -2015 + 32h0 and 32e0 >= -999 + 32h0 - i0 and i1 >= 0 and i1 <= 999 and i0 <= 32 + 32h0) }" +child: + context: "[h0] -> { [] : h0 <= 93 and h0 >= 0 }" + child: + schedule: "[h0] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[h0] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/mod4.in cloog-0.18.4/isl/test_inputs/codegen/cloog/mod4.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/mod4.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/mod4.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S2[j, div41, div42, 2, mod6_a] -> [j, div41, k, 2, m, 1] : 3k = 1 + j and 3div42 = 1 + j and 3m = -2 + j and 3mod6_a = -2 + j and 3div41 >= 1 + j and 3div41 <= 2 + j and j >= 1 and j <= 10; S1[j, div41, div42, 2, mod6_a] -> [j, div41, div42, 2, m, 0] : 3m = -2 + j and 3mod6_a = -2 + j and j >= 1 and j <= 10 and 3div41 >= j and 3div42 >= -1 + j and 3div42 <= 1 + j and 3div41 <= 2 + j; S3[j, div41, div42, 2, mod6_a] -> [j, div41, div42, 2, m, 2] : 3m = -2 + j and 3mod6_a = -2 + j and j >= 1 and j <= 10 and 3div41 >= j and 3div42 >= -1 + j and 3div42 <= 1 + j and 3div41 <= 2 + j } -{ : } -{ [i, j, k, l, m, n] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/mod4.st cloog-0.18.4/isl/test_inputs/codegen/cloog/mod4.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/mod4.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/mod4.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,11 @@ +domain: "{ S1[j, div41, div42, 2, mod6_a] : 3mod6_a = -2 + j and j >= 1 and j <= 10 and 3div41 >= j and 3div42 >= -1 + j and 3div42 <= 1 + j and 3div41 <= 2 + j; S2[j, div41, div42, 2, mod6_a] : 3div42 = 1 + j and 3mod6_a = -2 + j and 3div41 >= 1 + j and 3div41 <= 2 + j and j >= 1 and j <= 10; S3[j, div41, div42, 2, mod6_a] : 3mod6_a = -2 + j and j >= 1 and j <= 10 and 3div41 >= j and 3div42 >= -1 + j and 3div42 <= 1 + j and 3div41 <= 2 + j }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[j, div41, div42, mod6, mod6_a] -> [(j)]; S3[j, div41, div42, mod6, mod6_a] -> [(j)]; S2[j, div41, div42, mod6, mod6_a] -> [(j)] }, { S1[j, div41, div42, mod6, mod6_a] -> [(div41)]; S3[j, div41, div42, mod6, mod6_a] -> [(div41)]; S2[j, div41, div42, mod6, mod6_a] -> [(div41)] }, { S1[j, div41, div42, mod6, mod6_a] -> [(div42)]; S3[j, div41, div42, mod6, mod6_a] -> [(div42)]; S2[j, div41, div42, mod6, mod6_a] -> [(div42)] }, { S1[j, div41, div42, mod6, mod6_a] -> [(mod6)]; S3[j, div41, div42, mod6, mod6_a] -> [(mod6)]; S2[j, div41, div42, mod6, mod6_a] -> [(mod6)] }, { S1[j, div41, div42, mod6, mod6_a] -> [(mod6_a)]; S3[j, div41, div42, mod6, mod6_a] -> [(mod6_a)]; S2[j, div41, div42, mod6, mod6_a] -> [(mod6_a)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[j, div41, div42, mod6, mod6_a] }" + - filter: "{ S2[j, div41, div42, mod6, mod6_a] }" + - filter: "{ S3[j, div41, div42, mod6, mod6_a] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/mode.c cloog-0.18.4/isl/test_inputs/codegen/cloog/mode.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/mode.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/mode.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,5 +1,5 @@ for (int c0 = 0; c0 <= M; c0 += 1) { - for (int c1 = 0; c1 <= min(c0, N); c1 += 1) { + for (int c1 = 0; c1 <= min(N, c0); c1 += 1) { S1(c0, c1); S2(c0, c1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/mode.in cloog-0.18.4/isl/test_inputs/codegen/cloog/mode.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/mode.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/mode.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0, i1] -> [i0, i1, 0] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= i0; S2[i0, i1] -> [i0, i1, 1] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= N } -[M, N] -> { : } -[M, N] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/mode.st cloog-0.18.4/isl/test_inputs/codegen/cloog/mode.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/mode.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/mode.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[M, N] -> { S1[i0, i1] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= i0; S2[i0, i1] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= N }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1] }" + - filter: "[M, N] -> { S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/mod.in cloog-0.18.4/isl/test_inputs/codegen/cloog/mod.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/mod.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/mod.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[i0] -> [i0, 0] : exists (e0 = [(1 + i0)/3]: i0 >= 0 and i0 <= 3 and 3e0 <= i0 and 3e0 >= -1 + i0) } -{ : } -{ [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/mod.st cloog-0.18.4/isl/test_inputs/codegen/cloog/mod.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/mod.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/mod.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "{ S1[i0] : exists (e0 = floor((1 + i0)/3): 3e0 <= i0 and 3e0 >= -1 + i0 and i0 >= 0 and i0 <= 3) }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0] -> [(i0)] }]" + options: "{ separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/multi-mm-1.in cloog-0.18.4/isl/test_inputs/codegen/cloog/multi-mm-1.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/multi-mm-1.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/multi-mm-1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0, i1] -> [i0, i1, 0] : i1 >= 0 and i1 <= i0 and i0 <= M; S2[i0, i1] -> [i0, i1, 1] : i1 >= 0 and i1 <= i0 and i0 <= M and i1 <= N } -[M, N] -> { : N <= M and N >= 1 } -[M, N] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/multi-mm-1.st cloog-0.18.4/isl/test_inputs/codegen/cloog/multi-mm-1.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/multi-mm-1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/multi-mm-1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[M, N] -> { S1[i0, i1] : i1 >= 0 and i1 <= i0 and i0 <= M; S2[i0, i1] : i1 >= 0 and i1 <= i0 and i0 <= M and i1 <= N }" +child: + context: "[M, N] -> { [] : N <= M and N >= 1 }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1] }" + - filter: "[M, N] -> { S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/multi-stride2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/multi-stride2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/multi-stride2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/multi-stride2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[i0, i1, i2] -> [i0, j, k, 0] : 2i1 = -1 + i0 and 2j = -1 + i0 and 3k = -2 + i0 and 3i2 = -2 + i0 and i0 >= 0 and i0 <= 100 } -{ : } -{ [i, j, k, l] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/multi-stride2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/multi-stride2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/multi-stride2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/multi-stride2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "{ S1[i0, i1, i2] : 2i1 = -1 + i0 and 3i2 = -2 + i0 and i0 >= 0 and i0 <= 100 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1, i2] -> [(i0)] }, { S1[i0, i1, i2] -> [(i1)] }, { S1[i0, i1, i2] -> [(i2)] }]" + options: "{ separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/multi-stride.in cloog-0.18.4/isl/test_inputs/codegen/cloog/multi-stride.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/multi-stride.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/multi-stride.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[i0, i1, i2] -> [i0, j, k, 0] : 2i1 = -1 + i0 and 2j = -1 + i0 and 6k = -2 + i0 and 6i2 = -2 + i0 and i0 >= 0 and i0 <= 100 } -{ : } -{ [i, j, k, l] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/multi-stride.st cloog-0.18.4/isl/test_inputs/codegen/cloog/multi-stride.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/multi-stride.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/multi-stride.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "{ S1[i0, i1, i2] : 2i1 = -1 + i0 and 6i2 = -2 + i0 and i0 >= 0 and i0 <= 100 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1, i2] -> [(i0)] }, { S1[i0, i1, i2] -> [(i1)] }, { S1[i0, i1, i2] -> [(i2)] }]" + options: "{ separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/mxm-shared.c cloog-0.18.4/isl/test_inputs/codegen/cloog/mxm-shared.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/mxm-shared.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/mxm-shared.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,6 +1,3 @@ -if (g4 == 0 && t1 <= 7 && N >= g0 + t1 + 1) { - for (int c0 = t0; c0 <= min(N - g1 - 1, 127); c0 += 16) - S1(g0 + t1, g1 + c0); -} else if (g4 % 4 == 0 && N >= g0 + t1 + 1 && t1 <= 7 && g4 >= 4) - for (int c0 = t0; c0 <= min(N - g1 - 1, 127); c0 += 16) +if (N >= g0 + t1 + 1 && t1 <= 7 && g4 % 4 == 0) + for (int c0 = t0; c0 <= min(127, N - g1 - 1); c0 += 16) S1(g0 + t1, g1 + c0); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/mxm-shared.in cloog-0.18.4/isl/test_inputs/codegen/cloog/mxm-shared.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/mxm-shared.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/mxm-shared.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[N, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { S1[g0 + t1, i1] -> [-g1 + i1, t1, t0, t1] : (exists (e0 = [(-g1)/128], e1 = [(128b1 + 31g1)/4096], e2 = [(t0 - i1)/16], e3 = [(-120b0 - g0)/128]: g4 = 0 and g2 = 8b0 and g3 = 128b1 and 128e0 = -g1 and 4096e1 = 128b1 + 31g1 and 16e2 = t0 - i1 and 128e3 = -120b0 - g0 and g1 >= 128b1 and t1 <= -1 + N - g0 and g0 >= 8b0 and i1 <= -1 + N and b0 <= 15 and b0 >= 0 and b1 <= 31 and b1 >= 0 and i1 <= 127 + g1 and t1 >= 0 and t1 <= 7 and i1 >= g1 and t0 >= 0 and t0 <= 15)) or (exists (e0 = [(-g1)/128], e1 = [(128b1 + 31g1)/4096], e2 = [(t0 - i1)/16], e3 = [(-120b0 - g0)/128]: g4 = 0 and g2 = 8b0 and g3 = 128b1 and 128e0 = -g1 and 4096e1 = 128b1 + 31g1 and 16e2 = t0 - i1 and 128e3 = -120b0 - g0 and g1 >= 128b1 and t1 <= -1 + N - g0 and g0 >= 8b0 and i1 <= -1 + N and b0 <= 15 and b0 >= 0 and b1 <= 31 and b1 >= 0 and i1 <= 127 + g1 and t1 >= 0 and t1 <= 7 and i1 >= g1 and t0 >= 0 and t0 <= 15 and N >= 1)) or (exists (e0 = [(-g1)/128], e1 = [(128b1 + 31g1)/4096], e2 = [(t0 - i1)/16], e3 = [(-120b0 - g0)/128]: g4 = 0 and g2 = 8b0 and g3 = 128b1 and 128e0 = -g1 and 4096e1 = 128b1 + 31g1 and 16e2 = t0 - i1 and 128e3 = -120b0 - g0 and g0 >= 8b0 and t1 <= -1 + N - g0 and g1 >= 128b1 and i1 <= -1 + N and N >= 1 and t1 <= 7 and b1 <= 31 and b1 >= 0 and b0 <= 15 and b0 >= 0 and t0 <= 15 and i1 <= 127 + g1 and i1 >= g1 and t1 >= 0 and t0 >= 0)); S1[g0 + t1, i1] -> [-g1 + i1, t1, t0, t1] : exists (e0 = [(g4)/4], e1 = [(-g1)/128], e2 = [(128b1 + 31g1)/4096], e3 = [(t0 - i1)/16], e4 = [(-120b0 - g0)/128]: g3 = 128b1 and g2 = 8b0 and 4e0 = g4 and 128e1 = -g1 and 4096e2 = 128b1 + 31g1 and 16e3 = t0 - i1 and 128e4 = -120b0 - g0 and g0 >= 8b0 and t1 <= -1 + N - g0 and g1 >= 128b1 and i1 <= -1 + N and g4 <= -1 + N and t1 <= 7 and b1 <= 31 and b1 >= 0 and b0 <= 15 and b0 >= 0 and g4 >= 0 and i1 <= 127 + g1 and i1 >= g1 and t1 >= 0 and t0 >= 0 and t0 <= 15) } -[N, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { : exists (e0 = [(g0)/8], e1 = [(-128b1 + g1)/4096], e2 = [(8b0 - g0)/128]: g2 = 8b0 and g3 = 128b1 and 8e0 = g0 and 4096e1 = -128b1 + g1 and 128e2 = 8b0 - g0 and b0 >= 0 and g4 <= -1 + N and b0 <= 15 and g1 <= -1 + N and g4 >= 0 and b1 <= 31 and g0 <= -1 + N and g1 >= 128b1 and b1 >= 0 and g0 >= 8b0 and t0 >= 0 and t0 <= 15 and t1 >= 0 and t1 <= 15) } -[N, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { [i, j, k, l] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/mxm-shared.st cloog-0.18.4/isl/test_inputs/codegen/cloog/mxm-shared.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/mxm-shared.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/mxm-shared.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[N, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { S1[g0 + t1, i1] : (exists (e0 = floor((g1)/128), e1 = floor((128b1 - g1)/4096), e2 = floor((-8b0 + g0)/128), e3 = floor((-t0 + i1)/16): g3 = 128b1 and g4 = 0 and g2 = 8b0 and 128e0 = g1 and 4096e1 = 128b1 - g1 and 128e2 = -8b0 + g0 and 16e3 = -t0 + i1 and b0 <= 15 and b0 >= 0 and b1 <= 31 and b1 >= 0 and g0 >= 8b0 and g1 >= 128b1 and t0 <= 15 and t0 >= 0 and t1 <= 7 and t1 >= 0 and t1 <= -1 + N - g0 and i1 >= g1 and i1 <= 127 + g1 and i1 <= -1 + N)) or (exists (e0 = floor((g1)/128), e1 = floor((128b1 - g1)/4096), e2 = floor((g4)/4), e3 = floor((-8b0 + g0)/128), e4 = floor((-t0 + i1)/16): g3 = 128b1 and g2 = 8b0 and 128e0 = g1 and 4096e1 = 128b1 - g1 and 4e2 = g4 and 128e3 = -8b0 + g0 and 16e4 = -t0 + i1 and b0 <= 15 and b0 >= 0 and b1 <= 31 and b1 >= 0 and g0 >= 8b0 and g1 >= 128b1 and g4 >= 0 and g4 <= -1 + N and t0 <= 15 and t0 >= 0 and t1 <= 7 and t1 >= 0 and t1 <= -1 + N - g0 and i1 >= g1 and i1 <= 127 + g1 and i1 <= -1 + N)) }" +child: + context: "[N, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { [] : exists (e0 = floor((g0)/8), e1 = floor((-128b1 + g1)/4096), e2 = floor((8b0 - g0)/128): g2 = 8b0 and g3 = 128b1 and 8e0 = g0 and 4096e1 = -128b1 + g1 and 128e2 = 8b0 - g0 and b0 >= 0 and g4 <= -1 + N and b0 <= 15 and g1 <= -1 + N and g4 >= 0 and b1 <= 31 and g0 <= -1 + N and g1 >= 128b1 and b1 >= 0 and g0 >= 8b0 and t0 >= 0 and t0 <= 15 and t1 >= 0 and t1 <= 15) }" + child: + schedule: "[N, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> [{ S1[i0, i1] -> [(-g1 + i1)] }, { S1[i0, i1] -> [(t1)] }, { S1[i0, i1] -> [(t0)] }, { S1[i0, i1] -> [(t1)] }]" + options: "[N, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/no_lindep.in cloog-0.18.4/isl/test_inputs/codegen/cloog/no_lindep.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/no_lindep.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/no_lindep.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S1[2 + N] -> [1 + M, N] } -[M, N] -> { : } -[M, N] -> { [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/no_lindep.st cloog-0.18.4/isl/test_inputs/codegen/cloog/no_lindep.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/no_lindep.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/no_lindep.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M, N] -> { S1[2 + N] }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0] -> [(1 + M)] }, { S1[i0] -> [(N)] }]" + options: "[M, N] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_basic1.in cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_basic1.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_basic1.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_basic1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1] -> [i0, j, 0] : 2j = i0 and 2i1 = i0 and i0 >= 0 and i0 <= M } -[M] -> { : } -[M] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_basic1.st cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_basic1.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_basic1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_basic1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0, i1] : 2i1 = i0 and i0 >= 0 and i0 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_basic2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_basic2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_basic2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_basic2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n] -> { S2[i0, i1] -> [i0, j, 1] : 4j = i0 and 4i1 = i0 and i0 >= 1 and i0 <= n; S1[i0, i1] -> [i0, j, 0] : 2j = i0 and 2i1 = i0 and i0 >= 1 and i0 <= n } -[n] -> { : n >= 2 } -[n] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_basic2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_basic2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_basic2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_basic2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[n] -> { S1[i0, i1] : 2i1 = i0 and i0 >= 1 and i0 <= n; S2[i0, i1] : 4i1 = i0 and i0 >= 1 and i0 <= n }" +child: + context: "[n] -> { [] : n >= 2 }" + child: + schedule: "[n] -> [{ S2[i0, i1] -> [(i0)]; S1[i0, i1] -> [(i0)] }, { S2[i0, i1] -> [(i1)]; S1[i0, i1] -> [(i1)] }]" + options: "[n] -> { separate[i0] }" + child: + sequence: + - filter: "[n] -> { S1[i0, i1] }" + - filter: "[n] -> { S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_complex1.c cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_complex1.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_complex1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_complex1.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,3 +1,3 @@ for (int c0 = 0; c0 <= 5 * n; c0 += 1) - for (int c1 = max(2 * floord(c0 - 1, 3) + 2, -((n + c0 + 1) % 2) - n + c0 + 1); c1 <= min(c0, n + c0 - (n + c0 + 2) / 3); c1 += 2) - S1((-2 * c0 + 3 * c1) / 2, c0 - c1); + for (int c1 = max(-((5 * n - c0 + 1) % 2) - n + c0 + 1, 2 * ((c0 + 2) / 3)); c1 <= min(c0, n + c0 - (n + c0 + 2) / 3); c1 += 2) + S1((3 * c1 / 2) - c0, c0 - c1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_complex1.in cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_complex1.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_complex1.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_complex1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n] -> { S1[i0, i1] -> [2i0 + 3i1, 2i0 + 2i1] : i0 >= 0 and i0 <= n and i1 >= 0 and i1 <= n } -[n] -> { : } -[n] -> { [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_complex1.st cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_complex1.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_complex1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_complex1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[i0, i1] : i0 >= 0 and i0 <= n and i1 >= 0 and i1 <= n }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S1[i0, i1] -> [(2i0 + 3i1)] }, { S1[i0, i1] -> [(2i0 + 2i1)] }]" + options: "[n] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_lcpc.c cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_lcpc.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_lcpc.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_lcpc.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,5 +1,5 @@ { - for (int c0 = 1; c0 <= 5; c0 += 2) { + for (int c0 = 1; c0 <= 6; c0 += 2) { for (int c2 = 1; c2 <= c0; c2 += 1) { S1(c0, (c0 - 1) / 2, c2); S2(c0, (c0 - 1) / 2, c2); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_lcpc.in cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_lcpc.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_lcpc.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_lcpc.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[m, n, p] -> { S1[i, k, j] -> [i, j', j, 0] : 2k = -1 + i and 2j' = -1 + i and i >= 1 and i <= m and j >= 1 and j <= p; S2[i, k, j] -> [i, j', j, 1] : 2k = -1 + i and 2j' = -1 + i and i >= 1 and i <= n and j >= 1 and j <= i } -[m, n, p] -> { : n = 6 and m >= 7 and p >= 7 } -[m, n, p] -> { [i, j, k, l] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_lcpc.st cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_lcpc.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/nul_lcpc.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/nul_lcpc.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[m, n, p] -> { S1[i, k, j] : 2k = -1 + i and i >= 1 and i <= m and j >= 1 and j <= p; S2[i, k, j] : 2k = -1 + i and i >= 1 and i <= n and j >= 1 and j <= i }" +child: + context: "[m, n, p] -> { [] : n = 6 and m >= 7 and p >= 7 }" + child: + schedule: "[m, n, p] -> [{ S1[i, k, j] -> [(i)]; S2[i, k, j] -> [(i)] }, { S1[i, k, j] -> [(k)]; S2[i, k, j] -> [(k)] }, { S1[i, k, j] -> [(j)]; S2[i, k, j] -> [(j)] }]" + options: "[m, n, p] -> { separate[i0] }" + child: + sequence: + - filter: "[m, n, p] -> { S1[i, k, j] }" + - filter: "[m, n, p] -> { S2[i, k, j] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/orc.c cloog-0.18.4/isl/test_inputs/codegen/cloog/orc.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/orc.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/orc.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,16 +1,16 @@ { - for (int c1 = 0; c1 <= 2; c1 += 1) { - S1(c1); - for (int c2 = 0; c2 <= -c1 + 11; c2 += 1) { - S2(c1, c2); - S3(c1, c2); + for (int c0 = 0; c0 <= 2; c0 += 1) { + S1(c0); + for (int c1 = 0; c1 <= -c0 + 11; c1 += 1) { + S2(c0, c1); + S3(c0, c1); } - S4(c1); + S4(c0); } - for (int c1 = 0; c1 <= 14; c1 += 1) { - S5(c1); - for (int c2 = 0; c2 <= 9; c2 += 1) - S6(c1, c2); - S7(c1); + for (int c0 = 0; c0 <= 14; c0 += 1) { + S5(c0); + for (int c1 = 0; c1 <= 9; c1 += 1) + S6(c0, c1); + S7(c0); } } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/orc.in cloog-0.18.4/isl/test_inputs/codegen/cloog/orc.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/orc.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/orc.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S2[i0, i1] -> [0, 1 + 3i0, 2i1] : i0 >= 0 and i0 <= 2 and i1 >= 0 and i1 <= 11 - i0; S4[i0] -> [0, 2 + 3i0, 0] : i0 >= 0 and i0 <= 2; S5[i0] -> [2, 3i0, 0] : i0 >= 0 and i0 <= 14; S6[i0, i1] -> [2, 1 + 3i0, i1] : i0 >= 0 and i0 <= 14 and i1 >= 0 and i1 <= 9; S1[i0] -> [0, 3i0, 0] : i0 >= 0 and i0 <= 2; S7[i0] -> [2, 2 + 3i0, 0] : i0 >= 0 and i0 <= 14; S3[i0, i1] -> [0, 1 + 3i0, 1 + 2i1] : i0 >= 0 and i0 <= 2 and i1 >= 0 and i1 <= 11 - i0 } -{ : } -{ [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/orc.st cloog-0.18.4/isl/test_inputs/codegen/cloog/orc.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/orc.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/orc.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,13 @@ +domain: "{ S5[i] : i >= 0 and i <= 14; S6[i, j] : i >= 0 and i <= 14 and j >= 0 and j <= 9; S7[i] : i >= 0 and i <= 14; S4[i] : i >= 0 and i <= 2; S2[i, j] : i >= 0 and i <= 2 and j >= 0 and j <= 11 - i; S1[i] : i >= 0 and i <= 2; S3[i, j] : i >= 0 and i <= 2 and j >= 0 and j <= 11 - i }" +child: + context: "{ [] }" + child: + sequence: + - filter: "{ S4[i0]; S2[i0, i1]; S1[i0]; S3[i0, i1] }" + child: + schedule: "[{ S3[i0, i1] -> [(1 + 3i0)]; S2[i0, i1] -> [(1 + 3i0)]; S1[i0] -> [(3i0)]; S4[i0] -> [(2 + 3i0)] }, { S3[i0, i1] -> [(1 + 2i1)]; S2[i0, i1] -> [(2i1)]; S1[i0] -> [(0)]; S4[i0] -> [(0)] }]" + options: "{ separate[i0] }" + - filter: "{ S5[i0]; S6[i0, i1]; S7[i0] }" + child: + schedule: "[{ S6[i0, i1] -> [(1 + 3i0)]; S7[i0] -> [(2 + 3i0)]; S5[i0] -> [(3i0)] }, { S6[i0, i1] -> [(i1)]; S7[i0] -> [(0)]; S5[i0] -> [(0)] }]" + options: "{ separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/otl.c cloog-0.18.4/isl/test_inputs/codegen/cloog/otl.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/otl.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/otl.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,7 +1,7 @@ if (M >= 3 && N >= 4) for (int c0 = 1; c0 < (2 * M + 2 * N - 2) / 5; c0 += 1) - for (int c1 = max(c0 - (M + 2) / 5, (c0 + 1) / 2); c1 <= min(min((2 * N + 5 * c0 + 1) / 10, c0), (M + 2 * N) / 5 - 1); c1 += 1) - for (int c2 = max(max(max(max(c0 - (M + N + 4) / 5 + 1, c1 - (N + 6) / 5 + 1), floord(-N + 5 * c0 - 3, 10) + 1), 0), c0 - c1 - 1); c2 <= min(min(min((M + N - 2) / 5, (N + 5 * c0 + 3) / 10), c0 - c1 + (N - 1) / 5 + 1), c1); c2 += 1) - for (int c3 = max(max(max(2 * c1 - (2 * N + 5) / 5 + 1, 2 * c2 - (N + 2) / 5), c1 + c2 - (N + 3) / 5), c0); c3 <= min(min(min(min(min(c1 + (M - 2) / 5 + 1, 2 * c2 + (N - 2) / 5 + 1), c0 + 1), c1 + c2 + 1), (2 * M + 2 * N - 1) / 5 - 1), c2 + (M + N) / 5); c3 += 1) - for (int c4 = max(max(max(max(c0 - c2, c3 - (M + 2) / 5), c0 - (M + 6) / 5 + 1), (c3 + 1) / 2), c1); c4 <= min(min(min(min(min(min(min((M + 2 * N + 1) / 5 - 1, (2 * N + 5 * c0 + 3) / 10), (2 * N + 5 * c3 + 2) / 10), c0 - c2 + N / 5 + 1), c2 + (N + 2) / 5), -c2 + c3 + (N - 1) / 5 + 1), c0), c1 + 1); c4 += 1) + for (int c1 = max(c0 - (M + 2) / 5, (c0 + 1) / 2); c1 <= min(min(c0, (M + 2 * N) / 5 - 1), (2 * N + 5 * c0 + 1) / 10); c1 += 1) + for (int c2 = max(max(max(max(0, c0 - c1 - 1), c1 - (N + 6) / 5 + 1), c0 - (M + N + 4) / 5 + 1), floord(-N + 5 * c0 - 3, 10) + 1); c2 <= min(min(min(c1, (M + N - 2) / 5), c0 - c1 + (N - 1) / 5 + 1), (N + 5 * c0 + 3) / 10); c2 += 1) + for (int c3 = max(max(max(c0, 2 * c1 - (2 * N + 5) / 5 + 1), c1 + c2 - (N + 3) / 5), 2 * c2 - (N + 2) / 5); c3 <= min(min(min(min(min(c0 + 1, c1 + c2 + 1), c1 + (M - 2) / 5 + 1), 2 * c2 + (N - 2) / 5 + 1), (2 * M + 2 * N - 1) / 5 - 1), c2 + (M + N) / 5); c3 += 1) + for (int c4 = max(max(max(max(c1, c0 - c2), c0 - (M + 6) / 5 + 1), c3 - (M + 2) / 5), (c3 + 1) / 2); c4 <= min(min(min(min(min(min(min(c0, c1 + 1), -c2 + c3 + (N - 1) / 5 + 1), c0 - c2 + N / 5 + 1), (M + 2 * N + 1) / 5 - 1), c2 + (N + 2) / 5), (2 * N + 5 * c0 + 3) / 10), (2 * N + 5 * c3 + 2) / 10); c4 += 1) S1(c0, c1, c2, c3, c4, c2); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/otl.in cloog-0.18.4/isl/test_inputs/codegen/cloog/otl.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/otl.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/otl.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0, i1, i2, i3, i4, i2] -> [i0, i1, i2, i3, i4, i2] : 5i0 <= -7 + 2M + 2N and i4 >= i0 - i2 and 10i2 >= -2 - N + 5i0 and i2 >= -1 + i0 - i1 and 2i4 >= i0 and i0 >= 1 and i1 >= 1 and 2i1 >= i0 and i2 >= 0 and 5i2 >= 1 - M - N + 5i0 and 5i4 >= -1 - M + 5i0 and i3 >= i0 and 5i1 >= -2 - M + 5i0 and i3 >= 1 and 5i3 >= -3 - N + 5i1 + 5i2 and 5i2 <= 4 + N + 5i0 - 5i1 and i4 >= 1 and i2 <= i0 and 5i3 >= -2N + 10i1 and 5i1 <= -5 + M + 2N and 10i1 <= 1 + 2N + 5i0 and 5i2 >= -1 - N + 5i1 and i4 >= i1 and i3 >= i1 and i2 <= i1 and i1 <= i0 and 5i4 <= 4 + N - 5i2 + 5i3 and 5i4 <= 5 + N + 5i0 - 5i2 and 5i3 >= -2 - N + 10i2 and 5i2 <= -2 + M + N and 10i2 <= 3 + N + 5i0 and N >= 4 and i4 >= i2 and i3 >= i2 and M >= 3 and i4 <= i0 and 5i3 <= -6 + 2M + 2N and i4 >= -1 - i2 + i3 and 5i3 <= 3 + N + 10i2 and i3 <= 1 + i1 + i2 and i4 <= 1 + i1 and 2i4 >= i3 and 5i4 <= 2 + N + 5i2 and i3 <= 1 + 2i1 and i4 <= i3 and 5i3 <= M + N + 5i2 and 5i4 >= -2 - M + 5i3 and 10i4 <= 3 + 2N + 5i0 and i3 <= 1 + i0 and 5i3 <= 3 + M + 5i1 and 5i4 <= -4 + M + 2N and 10i4 <= 2 + 2N + 5i3 } -[M, N] -> { : M >= 1 and N >= 1 } -[M, N] -> { [i, j, k, l, m, n] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/otl.st cloog-0.18.4/isl/test_inputs/codegen/cloog/otl.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/otl.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/otl.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M, N] -> { S1[outerTimeTileIter, outerProcTileIter1, outerProcTileIter2, innerTimeTileIter, innerProcTileIter1, outerProcTileIter2] : 5outerTimeTileIter <= -7 + 2M + 2N and innerProcTileIter1 >= outerTimeTileIter - outerProcTileIter2 and 10outerProcTileIter2 >= -2 - N + 5outerTimeTileIter and outerProcTileIter2 >= -1 + outerTimeTileIter - outerProcTileIter1 and 2innerProcTileIter1 >= outerTimeTileIter and outerTimeTileIter >= 1 and outerProcTileIter1 >= 1 and 2outerProcTileIter1 >= outerTimeTileIter and outerProcTileIter2 >= 0 and 5outerProcTileIter2 >= 1 - M - N + 5outerTimeTileIter and 5innerProcTileIter1 >= -1 - M + 5outerTimeTileIter and innerTimeTileIter >= outerTimeTileIter and 5outerProcTileIter1 >= -2 - M + 5outerTimeTileIter and innerTimeTileIter >= 1 and 5innerTimeTileIter >= -3 - N + 5outerProcTileIter1 + 5outerProcTileIter2 and 5outerProcTileIter2 <= 4 + N + 5outerTimeTileIter - 5outerProcTileIter1 and innerProcTileIter1 >= 1 and outerProcTileIter2 <= outerTimeTileIter and 5innerTimeTileIter >= -2N + 10outerProcTileIter1 and 5outerProcTileIter1 <= -5 + M + 2N and 10outerProcTileIter1 <= 1 + 2N + 5outerTimeTileIter and 5outerProcTileIter2 >= -1 - N + 5outerProcTileIter1 and innerProcTileIter1 >= outerProcTileIter1 and innerTimeTileIter >= outerProcTileIter1 and outerProcTileIter2 <= outerProcTileIter1 and outerProcTileIter1 <= outerTimeTileIter and 5innerProcTileIter1 <= 4 + N - 5outerProcTileIter2 + 5innerTimeTileIter and 5innerProcTileIter1 <= 5 + N + 5outerTimeTileIter - 5outerProcTileIter2 and 5innerTimeTileIter >= -2 - N + 10outerProcTileIter2 and 5outerProcTileIter2 <= -2 + M + N and 10outerProcTileIter2 <= 3 + N + 5outerTimeTileIter and N >= 4 and innerProcTileIter1 >= outerProcTileIter2 and innerTimeTileIter >= outerProcTileIter2 and M >= 3 and innerProcTileIter1 <= outerTimeTileIter and 5innerTimeTileIter <= -6 + 2M + 2N and innerProcTileIter1 >= -1 - outerProcTileIter2 + innerTimeTileIter and 5innerTimeTileIter <= 3 + N + 10outerProcTileIter2 and innerTimeTileIter <= 1 + outerProcTileIter1 + outerProcTileIter2 and innerProcTileIter1 <= 1 + outerProcTileIter1 and 2innerProcTileIter1 >= innerTimeTileIter and 5innerProcTileIter1 <= 2 + N + 5outerProcTileIter2 and innerTimeTileIter <= 1 + 2outerProcTileIter1 and innerProcTileIter1 <= innerTimeTileIter and 5innerTimeTileIter <= M + N + 5outerProcTileIter2 and 5innerProcTileIter1 >= -2 - M + 5innerTimeTileIter and 10innerProcTileIter1 <= 3 + 2N + 5outerTimeTileIter and innerTimeTileIter <= 1 + outerTimeTileIter and 5innerTimeTileIter <= 3 + M + 5outerProcTileIter1 and 5innerProcTileIter1 <= -4 + M + 2N and 10innerProcTileIter1 <= 2 + 2N + 5innerTimeTileIter }" +child: + context: "[M, N] -> { [] : M >= 1 and N >= 1 }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2, i3, i4, i5] -> [(i0)] }, { S1[i0, i1, i2, i3, i4, i5] -> [(i1)] }, { S1[i0, i1, i2, i3, i4, i5] -> [(i2)] }, { S1[i0, i1, i2, i3, i4, i5] -> [(i3)] }, { S1[i0, i1, i2, i3, i4, i5] -> [(i4)] }, { S1[i0, i1, i2, i3, i4, i5] -> [(i5)] }]" + options: "[M, N] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/param-split.c cloog-0.18.4/isl/test_inputs/codegen/cloog/param-split.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/param-split.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/param-split.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = 0; c0 <= (M >= 0 ? M : 0); c0 += 1) { +for (int c0 = 0; c0 <= (M <= 0 ? 0 : M); c0 += 1) { if (M >= c0) S1(c0); if (c0 == 0) diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/param-split.in cloog-0.18.4/isl/test_inputs/codegen/cloog/param-split.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/param-split.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/param-split.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0] -> [i0, 0] : i0 >= 0 and i0 <= M; S2[0] -> [0, 1] } -[M] -> { : } -[M] -> { [i, j] -> atomic[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/param-split.st cloog-0.18.4/isl/test_inputs/codegen/cloog/param-split.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/param-split.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/param-split.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[M] -> { S2[0]; S1[i0] : i0 >= 0 and i0 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S2[i0] -> [(i0)]; S1[i0] -> [(i0)] }]" + options: "[M] -> { atomic[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0] }" + - filter: "[M] -> { S2[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/pouchet.c cloog-0.18.4/isl/test_inputs/codegen/cloog/pouchet.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/pouchet.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/pouchet.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,5 +1,5 @@ for (int c0 = 1; c0 <= floord(Ny, 2) + 2; c0 += 1) - for (int c1 = max(c0 / 2 + 1, c0 - 1); c1 <= min(c0, (Ny + 2 * c0) / 4); c1 += 1) + for (int c1 = max(c0 - 1, c0 / 2 + 1); c1 <= min(c0, (Ny + 2 * c0) / 4); c1 += 1) { if (Ny + 2 * c0 >= 4 * c1 + 1) { for (int c2 = 1; c2 <= 2; c2 += 1) { S1(c0 - c1, c1, 2 * c0 - 2 * c1, -2 * c0 + 4 * c1, c2); @@ -7,4 +7,5 @@ } } else for (int c2 = 1; c2 <= 2; c2 += 1) - S2((-Ny + 2 * c0) / 4, (Ny + 2 * c0) / 4, (-Ny + 2 * c0) / 2, Ny - 1, c2); + S2((-Ny + 2 * c0) / 4, (Ny + 2 * c0) / 4, (-Ny / 2) + c0, Ny - 1, c2); + } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/pouchet.in cloog-0.18.4/isl/test_inputs/codegen/cloog/pouchet.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/pouchet.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/pouchet.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[Ny] -> { S1[i0, i1, 2i0, -2i0 + 2i1, i4] -> [i0 + i1, i1, i4, 2i0, -2i0 + 2i1, i4] : i0 >= 0 and i0 <= 1 and i1 >= 1 + i0 and 2i1 <= -1 + Ny + 2i0 and i4 >= 1 and i4 <= 2; S2[i0, i1, 2i0, -1 - 2i0 + 2i1, i4] -> [i0 + i1, i1, i4, 2i0, -2i0 + 2i1, 1 + i4] : i0 >= 0 and i0 <= 1 and i1 >= 1 + i0 and 2i1 <= Ny + 2i0 and i4 >= 1 and i4 <= 2 } -[Ny] -> { : } -[Ny] -> { [i, j, k, l, m, n] -> separate[x] : x >= 2 } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/pouchet.st cloog-0.18.4/isl/test_inputs/codegen/cloog/pouchet.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/pouchet.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/pouchet.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[Ny] -> { S1[i0, i1, 2i0, -2i0 + 2i1, i4] : i0 >= 0 and i0 <= 1 and i1 >= 1 + i0 and 2i1 <= -1 + Ny + 2i0 and i4 >= 1 and i4 <= 2; S2[i0, i1, 2i0, -1 - 2i0 + 2i1, i4] : i0 >= 0 and i0 <= 1 and i1 >= 1 + i0 and 2i1 <= Ny + 2i0 and i4 >= 1 and i4 <= 2 }" +child: + context: "[Ny] -> { [] }" + child: + schedule: "[Ny] -> [{ S1[i0, i1, i2, i3, i4] -> [(i0 + i1)]; S2[i0, i1, i2, i3, i4] -> [(i0 + i1)] }, { S1[i0, i1, i2, i3, i4] -> [(i1)]; S2[i0, i1, i2, i3, i4] -> [(i1)] }, { S1[i0, i1, i2, i3, i4] -> [(i4)]; S2[i0, i1, i2, i3, i4] -> [(i4)] }, { S1[i0, i1, i2, i3, i4] -> [(i2)]; S2[i0, i1, i2, i3, i4] -> [(i2)] }, { S1[i0, i1, i2, i3, i4] -> [(i3)]; S2[i0, i1, i2, i3, i4] -> [(1 + i3)] }, { S1[i0, i1, i2, i3, i4] -> [(i4)]; S2[i0, i1, i2, i3, i4] -> [(1 + i4)] }]" + options: "[Ny] -> { separate[x] : x >= 2 }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/rectangle.c cloog-0.18.4/isl/test_inputs/codegen/cloog/rectangle.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/rectangle.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/rectangle.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,3 +1,3 @@ for (int c0 = 0; c0 <= 2 * n; c0 += 1) - for (int c1 = max(0, -n + c0); c1 <= min(c0, n); c1 += 1) + for (int c1 = max(0, -n + c0); c1 <= min(n, c0); c1 += 1) S1(c1, c0 - c1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/rectangle.in cloog-0.18.4/isl/test_inputs/codegen/cloog/rectangle.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/rectangle.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/rectangle.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n] -> { S1[i0, i1] -> [i0 + i1] : i0 >= 0 and i0 <= n and i1 >= 0 and i1 <= n } -[n] -> { : n >= 0 } -[n] -> { [i] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/rectangle.st cloog-0.18.4/isl/test_inputs/codegen/cloog/rectangle.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/rectangle.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/rectangle.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[i0, i1] : i0 >= 0 and i0 <= n and i1 >= 0 and i1 <= n }" +child: + context: "[n] -> { [] : n >= 0 }" + child: + schedule: "[n] -> [{ S1[i0, i1] -> [(i0 + i1)] }]" + options: "[n] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-bastoul3.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-bastoul3.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-bastoul3.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-bastoul3.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[i0, i1, i2] -> [i0, i1, k, 0] : 2k = i0 - i1 and 2i2 = i0 - i1 and i1 >= 1 and i1 <= 3 and i1 <= -2 + i0 and i1 >= -6 + i0 } -{ : } -{ [i, j, k, l] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-bastoul3.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-bastoul3.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-bastoul3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-bastoul3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "{ S1[i0, i1, i2] : 2i2 = i0 - i1 and i1 >= 1 and i1 <= 3 and i1 <= -2 + i0 and i1 >= -6 + i0 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1, i2] -> [(i0)] }, { S1[i0, i1, i2] -> [(i1)] }, { S1[i0, i1, i2] -> [(i2)] }]" + options: "{ separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-cholesky2.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-cholesky2.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-cholesky2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-cholesky2.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,9 +1,9 @@ -for (int c1 = 2; c1 < 3 * M; c1 += 1) { - if ((c1 - 2) % 3 == 0) - S1((c1 + 1) / 3); - for (int c3 = (c1 + 1) / 3 + 1; c3 <= min(c1 - 2, M); c3 += 1) - for (int c5 = -c3 + (c1 + c3 + 1) / 2 + 1; c5 <= min(c1 - c3, c3); c5 += 1) - S3(c1 - c3 - c5 + 1, c3, c5); - for (int c3 = -c1 + 2 * ((2 * c1 + 1) / 3) + 2; c3 <= min(c1, M); c3 += 2) - S2((c1 - c3 + 2) / 2, c3); +for (int c0 = 2; c0 < 3 * M; c0 += 1) { + if ((c0 - 2) % 3 == 0) + S1((c0 + 1) / 3); + for (int c1 = (c0 + 1) / 3 + 1; c1 <= min(M, c0 - 2); c1 += 1) + for (int c2 = -c1 + (c0 + c1 + 1) / 2 + 1; c2 <= min(c1, c0 - c1); c2 += 1) + S3(c0 - c1 - c2 + 1, c1, c2); + for (int c1 = -c0 + 2 * ((2 * c0 + 1) / 3) + 2; c1 <= min(M, c0); c1 += 2) + S2(((c0 - c1) / 2) + 1, c1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-cholesky2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-cholesky2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-cholesky2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-cholesky2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S3[i0, i1, i2] -> [0, -1 + i0 + i1 + i2, 1, i1, 1, i2, 0] : i0 >= 1 and i1 <= M and i2 >= 1 + i0 and i2 <= i1; S2[i0, i1] -> [0, -2 + 2i0 + i1, 2, i1, 0, 0, 0] : i0 >= 1 and i1 >= 1 + i0 and i1 <= M; S1[i0] -> [0, -1 + 3i0, 0, 0, 0, 0, 0] : i0 >= 1 and i0 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-cholesky2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-cholesky2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-cholesky2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-cholesky2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,20 @@ +domain: "[M] -> { S3[i0, i1, i2] : i0 >= 1 and i1 <= M and i2 >= 1 + i0 and i2 <= i1; S2[i0, i1] : i0 >= 1 and i1 >= 1 + i0 and i1 <= M; S1[i0] : i0 >= 1 and i0 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0] -> [(-1 + 3i0)]; S3[i0, i1, i2] -> [(-1 + i0 + i1 + i2)]; S2[i0, i1] -> [(-2 + 2i0 + i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0] }" + - filter: "[M] -> { S3[i0, i1, i2] }" + child: + schedule: "[M] -> [{ S3[i0, i1, i2] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S3[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-fusion1.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-fusion1.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-fusion1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-fusion1.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,8 +1,8 @@ { - for (int c1 = 0; c1 <= M; c1 += 1) - S1(c1); - for (int c1 = 1; c1 <= M; c1 += 1) - S2(c1); - for (int c1 = 0; c1 <= M; c1 += 1) - S3(c1); + for (int c0 = 0; c0 <= M; c0 += 1) + S1(c0); + for (int c0 = 1; c0 <= M; c0 += 1) + S2(c0); + for (int c0 = 0; c0 <= M; c0 += 1) + S3(c0); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-fusion1.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-fusion1.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-fusion1.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-fusion1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0] -> [0, i0, 0] : i0 >= 0 and i0 <= M; S3[i0] -> [2, i0, 0] : i0 >= 0 and i0 <= M; S2[i0] -> [1, i0, 0] : i0 >= 1 and i0 <= M } -[M] -> { : M >= 1 } -[M] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-fusion1.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-fusion1.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-fusion1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-fusion1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,17 @@ +domain: "[M] -> { S3[i0] : i0 >= 0 and i0 <= M; S2[i0] : i0 >= 1 and i0 <= M; S1[i0] : i0 >= 0 and i0 <= M }" +child: + context: "[M] -> { [] : M >= 1 }" + child: + sequence: + - filter: "[M] -> { S1[i0] }" + child: + schedule: "[M] -> [{ S1[i0] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0] }" + child: + schedule: "[M] -> [{ S2[i0] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S3[i0] }" + child: + schedule: "[M] -> [{ S3[i0] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-fusion2.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-fusion2.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-fusion2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-fusion2.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,12 +1,12 @@ if (N >= 1) { - for (int c3 = 1; c3 <= M; c3 += 1) - S1(1, c3); - for (int c1 = 2; c1 <= N; c1 += 1) { - for (int c3 = 1; c3 <= M; c3 += 1) - S2(c1 - 1, c3); - for (int c3 = 1; c3 <= M; c3 += 1) - S1(c1, c3); + for (int c1 = 1; c1 <= M; c1 += 1) + S1(1, c1); + for (int c0 = 2; c0 <= N; c0 += 1) { + for (int c1 = 1; c1 <= M; c1 += 1) + S2(c0 - 1, c1); + for (int c1 = 1; c1 <= M; c1 += 1) + S1(c0, c1); } - for (int c3 = 1; c3 <= M; c3 += 1) - S2(N, c3); + for (int c1 = 1; c1 <= M; c1 += 1) + S2(N, c1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-fusion2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-fusion2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-fusion2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-fusion2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S2[i0, i1] -> [0, 1 + i0, 0, i1, 0] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S1[i0, i1] -> [0, i0, 1, i1, 0] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M } -[M, N] -> { : } -[M, N] -> { [i, j, k, l, m] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-fusion2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-fusion2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-fusion2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-fusion2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,16 @@ +domain: "[M, N] -> { S1[i0, i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S2[i0, i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(1 + i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S2[i0, i1] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S1[i0, i1] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-jacobi2.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-jacobi2.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-jacobi2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-jacobi2.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,3 +1,3 @@ -for (int c1 = 0; c1 < M; c1 += 1) - for (int c3 = 0; c3 < M; c3 += 1) - S1(c1, c3); +for (int c0 = 0; c0 < M; c0 += 1) + for (int c1 = 0; c1 < M; c1 += 1) + S1(c0, c1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-jacobi2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-jacobi2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-jacobi2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-jacobi2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1] -> [0, i0, 0, i1, 0] : i0 >= 0 and i0 <= -1 + M and i1 >= 0 and i1 <= -1 + M } -[M] -> { : M >= 1 } -[M] -> { [i, j, k, l, m] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-jacobi2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-jacobi2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-jacobi2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-jacobi2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,9 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 0 and i0 <= -1 + M and i1 >= 0 and i1 <= -1 + M }" +child: + context: "[M] -> { [] : M >= 1 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-jacobi3.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-jacobi3.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-jacobi3.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-jacobi3.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,8 +1,8 @@ -for (int c1 = 1; c1 <= M; c1 += 1) { - for (int c3 = 2; c3 < N; c3 += 1) - for (int c5 = 2; c5 < N; c5 += 1) - S1(c1, c3, c5); - for (int c3 = 2; c3 < N; c3 += 1) - for (int c5 = 2; c5 < N; c5 += 1) - S2(c1, c3, c5); +for (int c0 = 1; c0 <= M; c0 += 1) { + for (int c2 = 2; c2 < N; c2 += 1) + for (int c3 = 2; c3 < N; c3 += 1) + S1(c0, c2, c3); + for (int c2 = 2; c2 < N; c2 += 1) + for (int c3 = 2; c3 < N; c3 += 1) + S2(c0, c2, c3); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-jacobi3.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-jacobi3.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-jacobi3.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-jacobi3.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S2[i0, i1, i2] -> [0, 1 + 2i0, 1, i1, 0, i2, 0] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + N; S1[i0, i1, i2] -> [0, 2i0, 0, i1, 0, i2, 0] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + N } -[M, N] -> { : } -[M, N] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-jacobi3.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-jacobi3.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-jacobi3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-jacobi3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,22 @@ +domain: "[M, N] -> { S2[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + N; S1[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + N }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2] -> [(2i0)]; S2[i0, i1, i2] -> [(1 + 2i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1, i2] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S2[i0, i1, i2] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1, i2] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1, i2] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,10 +1,10 @@ -for (int c1 = -99; c1 <= 100; c1 += 1) { - if (c1 <= 0) - S1(1, -c1 + 1); - for (int c3 = max(-2 * c1 + 3, 1); c3 <= min(-2 * c1 + 199, 199); c3 += 2) { - S2((2 * c1 + c3 - 1) / 2, (c3 + 1) / 2); - S1((2 * c1 + c3 + 1) / 2, (c3 + 1) / 2); +for (int c0 = -99; c0 <= 100; c0 += 1) { + if (c0 >= 1) + S2(c0, 1); + for (int c1 = max(1, -c0 + 1); c1 <= min(99, -c0 + 100); c1 += 1) { + S1(c0 + c1, c1); + S2(c0 + c1, c1 + 1); } - if (c1 >= 1) - S2(100, -c1 + 101); + if (c0 <= 0) + S1(c0 + 100, 100); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S2[i0, i1] -> [0, 1 + i0 - i1, 0, -1 + 2i1, 1] : i0 >= 1 and i0 <= 100 and i1 >= 1 and i1 <= 100; S1[i0, i1] -> [0, i0 - i1, 0, 2i1, 0] : i0 >= 1 and i0 <= 100 and i1 >= 1 and i1 <= 100 } -{ : } -{ [i, j, k, l, m] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,13 @@ +domain: "{ S2[i0, i1] : i0 >= 1 and i0 <= 100 and i1 >= 1 and i1 <= 100; S1[i0, i1] : i0 >= 1 and i0 <= 100 and i1 >= 1 and i1 <= 100 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1] -> [(i0 - i1)]; S2[i0, i1] -> [(1 + i0 - i1)] }]" + options: "{ separate[i0] }" + child: + schedule: "[{ S1[i0, i1] -> [(2i1)]; S2[i0, i1] -> [(-1 + 2i1)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1] }" + - filter: "{ S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,10 +1,10 @@ { - for (int c1 = 1; c1 <= M; c1 += 1) - S1(c1); - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 2; c3 <= N; c3 += 1) - S2(c1, c3); - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 < N; c3 += 1) - S3(c1, c3); + for (int c0 = 1; c0 <= M; c0 += 1) + S1(c0); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 2; c1 <= N; c1 += 1) + S2(c0, c1); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 < N; c1 += 1) + S3(c0, c1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0] -> [0, i0, 0, 0, 0] : i0 >= 1 and i0 <= M; S2[i0, i1] -> [1, i0, 1, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= N; S3[i0, i1] -> [2, i0, 2, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= -1 + N } -[M, N] -> { : M >= 1 and N >= 1 } -[M, N] -> { [i, j, k, l, m] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,23 @@ +domain: "[M, N] -> { S3[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= -1 + N; S1[i0] : i0 >= 1 and i0 <= M; S2[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= N }" +child: + context: "[M, N] -> { [] : M >= 1 and N >= 1 }" + child: + sequence: + - filter: "[M, N] -> { S1[i0] }" + child: + schedule: "[M, N] -> [{ S1[i0] -> [(i0)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S2[i0, i1] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S3[i0, i1] }" + child: + schedule: "[M, N] -> [{ S3[i0, i1] -> [(i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S3[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,11 +1,11 @@ -for (int c1 = 5; c1 <= 5 * M; c1 += 1) { - for (int c3 = max(2, floord(-M + c1, 4)); c3 < min((c1 + 1) / 3 - 2, M); c3 += 1) - for (int c5 = max(-M - c3 + (M + c1) / 2 - 2, 1); c5 < min(-2 * c3 + (c1 + c3) / 2 - 2, c3); c5 += 1) - S1(c1 - 2 * c3 - 2 * c5 - 5, c3, c5); - for (int c3 = max(1, floord(-M + c1, 4)); c3 < (c1 + 1) / 5; c3 += 1) - S2(c1 - 4 * c3 - 3, c3); - if (c1 % 5 == 0) - S4(c1 / 5); - for (int c3 = max(-((c1 - 1) % 3) + 3, -3 * M - c1 + 3 * ((M + c1) / 2) + 1); c3 < (c1 + 1) / 5; c3 += 3) - S3((c1 - 2 * c3 - 1) / 3, c3); +for (int c0 = 5; c0 <= 5 * M; c0 += 1) { + for (int c1 = max(2, floord(-M + c0, 4)); c1 < min(-((5 * M - c0 + 1) % 2) + M, (c0 + 1) / 3 - 2); c1 += 1) + for (int c2 = max(1, -M - c1 + (M + c0) / 2 - 2); c2 < min(c1, -2 * c1 + (c0 + c1) / 2 - 2); c2 += 1) + S1(c0 - 2 * c1 - 2 * c2 - 5, c1, c2); + for (int c1 = max(1, floord(-M + c0, 4)); c1 < (c0 + 1) / 5; c1 += 1) + S2(c0 - 4 * c1 - 3, c1); + if (c0 % 5 == 0) + S4(c0 / 5); + for (int c1 = max(-3 * M - c0 + 3 * ((M + c0) / 2) + 1, -((c0 - 1) % 3) + 3); c1 < (c0 + 1) / 5; c1 += 3) + S3((c0 - 2 * c1 - 1) / 3, c1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1, i2] -> [0, 5 + i0 + 2i1 + 2i2, 0, i1, 0, i2, 0] : i0 <= M and i1 <= -1 + i0 and i2 >= 1 and i2 <= -1 + i1; S3[i0, i1] -> [0, 1 + 3i0 + 2i1, 2, i1, 0, 0, 0] : i0 <= M and i1 >= 1 and i1 <= -1 + i0; S2[i0, i1] -> [0, 3 + i0 + 4i1, 1, i1, 1, 0, 0] : i0 <= M and i1 >= 1 and i1 <= -1 + i0; S4[i0] -> [0, 5i0, 2, 0, 0, 0, 0] : i0 >= 1 and i0 <= M } -[M] -> { : M >= 1 } -[M] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,23 @@ +domain: "[M] -> { S4[i0] : i0 >= 1 and i0 <= M; S3[i0, i1] : i0 <= M and i1 >= 1 and i1 <= -1 + i0; S2[i0, i1] : i0 <= M and i1 >= 1 and i1 <= -1 + i0; S1[i0, i1, i2] : i0 <= M and i1 <= -1 + i0 and i2 >= 1 and i2 <= -1 + i1 }" +child: + context: "[M] -> { [] : M >= 1 }" + child: + schedule: "[M] -> [{ S4[i0] -> [(5i0)]; S1[i0, i1, i2] -> [(5 + i0 + 2i1 + 2i2)]; S3[i0, i1] -> [(1 + 3i0 + 2i1)]; S2[i0, i1] -> [(3 + i0 + 4i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1, i2] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S4[i0]; S3[i0, i1] }" + child: + schedule: "[M] -> [{ S4[i0] -> [(0)]; S3[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,10 +1,10 @@ -for (int c1 = 1; c1 < 2 * M - 1; c1 += 1) { - for (int c3 = max(-c1 + 1, -M + 1); c3 < 0; c3 += 1) { - for (int c7 = max(-M + c1 + 1, 1); c7 <= min(M - 1, c1 + c3); c7 += 1) - S1(c7, c1 + c3 - c7, -c3); - for (int c5 = max(-M + c1 + 1, -c3); c5 < min(M, c1); c5 += 1) - S2(c1 - c5, c3 + c5, c5); +for (int c0 = 1; c0 < 2 * M - 1; c0 += 1) { + for (int c1 = max(-M + 1, -c0 + 1); c1 < 0; c1 += 1) { + for (int c3 = max(1, -M + c0 + 1); c3 <= min(M - 1, c0 + c1); c3 += 1) + S1(c3, c0 + c1 - c3, -c1); + for (int c2 = max(-M + c0 + 1, -c1); c2 < min(M, c0); c2 += 1) + S2(c0 - c2, c1 + c2, c2); } - for (int c7 = max(1, -M + c1 + 1); c7 <= min(c1, M - 1); c7 += 1) - S1(c7, c1 - c7, 0); + for (int c3 = max(1, -M + c0 + 1); c3 <= min(M - 1, c0); c3 += 1) + S1(c3, c0 - c3, 0); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1, i2] -> [0, i0 + i1 + i2, 0, -i2, 0, i2, 0] : i0 >= 1 and i0 <= -1 + M and i1 >= 0 and i2 >= 0 and i2 <= -1 + M - i1; S2[i0, i1, i2] -> [0, i0 + i2, 0, i1 - i2, 1, i2, 0] : i0 >= 1 and i0 <= -1 + M and i1 >= 0 and i2 >= 1 + i1 and i2 <= -1 + M } -[M] -> { : } -[M] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,19 @@ +domain: "[M] -> { S2[i0, i1, i2] : i0 >= 1 and i0 <= -1 + M and i1 >= 0 and i2 >= 1 + i1 and i2 <= -1 + M; S1[i0, i1, i2] : i0 >= 1 and i0 <= -1 + M and i1 >= 0 and i2 >= 0 and i2 <= -1 + M - i1 }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i0 + i1 + i2)]; S2[i0, i1, i2] -> [(i0 + i2)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(-i2)]; S2[i0, i1, i2] -> [(i1 - i2)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1, i2] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1, i2] }" + child: + schedule: "[M] -> [{ S2[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,11 +1,11 @@ { - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S1(c1, c3); - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S2(c1, c3); - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S3(c1, c3); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S1(c0, c1); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S2(c0, c1); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S3(c0, c1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [1, i0, 0, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S1[i0, i1] -> [0, i0, 0, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S3[i0, i1] -> [2, i0, 0, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,26 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S3[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S2[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M }" +child: + context: "[M] -> { [] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S3[i0, i1] }" + child: + schedule: "[M] -> [{ S3[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S3[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,8 +1,8 @@ { - for (int c1 = 0; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S1(c1, c3); - for (int c1 = 0; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S2(c3, c1); + for (int c0 = 0; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S1(c0, c1); + for (int c0 = 0; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S2(c1, c0); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [1, i1, 0, i0, 0] : i0 >= 1 and i0 <= M and i1 >= 0 and i1 <= M; S1[i0, i1] -> [0, i0, 0, i1, 0] : i0 >= 0 and i0 <= M and i1 >= 1 and i1 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,19 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 0 and i0 <= M and i1 >= 1 and i1 <= M; S2[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 0 and i1 <= M }" +child: + context: "[M] -> { [] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,17 +1,17 @@ -if (N >= 0 && M >= 0) - for (int c1 = -4; c1 <= 3 * M + N; c1 += 1) { - if (c1 >= 3 * M) { - S2(M, -3 * M + c1); - } else if (3 * floord(c1 - 2, 3) + 2 == c1 && c1 >= -1 && 3 * M >= c1 + 4) - S1((c1 + 4) / 3, 0); - for (int c3 = max(-3 * M + c1 + 3, c1 + 3 * floord(-c1 - 1, 3) + 3); c3 <= min(N - 1, c1); c3 += 3) { - S2((c1 - c3) / 3, c3); - S1((c1 - c3 + 3) / 3, c3 + 1); +if (M >= 0 && N >= 0) + for (int c0 = -4; c0 <= 3 * M + N; c0 += 1) { + if (c0 >= 0 && 3 * M + 1 >= c0 && (c0 + 1) % 3 >= 1 && N + 1 >= (c0 + 1) % 3) + S2((c0 + 1) / 3, ((c0 + 1) % 3) - 1); + for (int c1 = max(-3 * M + c0 - 2, (c0 + 4) % 3); c1 <= min(min(N - 2, c0 - 2), -3 * M + c0 + 3); c1 += 3) + S2((c0 - c1 - 2) / 3, c1 + 2); + for (int c1 = max(-3 * M + c0 + 4, (c0 + 4) % 3); c1 < min(N - 1, c0 - 1); c1 += 3) { + S1((c0 - c1 + 4) / 3, c1); + S2((c0 - c1 - 2) / 3, c1 + 2); } - if (N + 3 * floord(-N + c1, 3) == c1 && 3 * M + N >= c1 + 3 && c1 >= N) { - S2((-N + c1) / 3, N); - } else if (N >= c1 + 4) - S1(0, c1 + 4); - for (int c3 = max(-3 * M + c1, c1 + 3 * floord(-c1 - 1, 3) + 3); c3 <= min(N, c1); c3 += 3) - S3((c1 - c3) / 3, c3); + if (3 * M + N >= c0 + 4 && c0 >= N + 1 && ((-N + c0) % 3) + N >= 2 && (-N + c0) % 3 >= 1) + S1((-N + c0 + 3) / 3 + 1, ((-N + c0) % 3) + N - 2); + for (int c1 = max(max(c0 + 1, -3 * M + c0 + 4), (c0 + 4) % 3); c1 <= min(N, c0 + 4); c1 += 3) + S1((c0 - c1 + 4) / 3, c1); + for (int c1 = max(-3 * M + c0, (c0 + 6) % 3); c1 <= min(N, c0); c1 += 3) + S3((c0 - c1) / 3, c1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S2[i0, i1] -> [0, 3i0 + i1, 0, i1, 0] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= N; S3[i0, i1] -> [0, 3i0 + i1, 1, i1, 0] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= N; S1[i0, i1] -> [0, -4 + 3i0 + i1, 0, i1, 0] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= N } -[M, N] -> { : } -[M, N] -> { [i, j, k, l, m] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,16 @@ +domain: "[M, N] -> { S3[i0, i1] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= N; S1[i0, i1] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= N; S2[i0, i1] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= N }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(-4 + 3i0 + i1)]; S2[i0, i1] -> [(3i0 + i1)]; S3[i0, i1] -> [(3i0 + i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1]; S2[i0, i1] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S3[i0, i1] }" + child: + schedule: "[M, N] -> [{ S3[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner3.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner3.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner3.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner3.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 2; c3 <= M + c1; c3 += 1) - for (int c5 = max(-c1 + c3, 1); c5 <= min(M, c3 - 1); c5 += 1) - S1(c1, c5, c3 - c5); +for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 2; c1 <= M + c0; c1 += 1) + for (int c2 = max(1, -c0 + c1); c2 <= min(M, c1 - 1); c2 += 1) + S1(c0, c2, c1 - c2); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner3.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner3.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner3.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner3.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1, i2] -> [0, i0, 0, i1 + i2, 0, i1, 0] : i0 <= M and i1 >= 1 and i1 <= M and i2 >= 1 and i2 <= i0 } -[M] -> { : } -[M] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner3.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner3.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,12 @@ +domain: "[M] -> { S1[i0, i1, i2] : i0 <= M and i1 >= 1 and i1 <= M and i2 >= 1 and i2 <= i0 }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i1 + i2)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner4.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner4.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner4.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner4.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,5 +1,5 @@ -for (int c1 = 2; c1 <= 2 * M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - for (int c5 = 1; c5 <= M; c5 += 1) - for (int c7 = max(1, -M + c1); c7 <= min(c1 - 1, M); c7 += 1) - S1(c5, c3, c7, c1 - c7); +for (int c0 = 2; c0 <= 2 * M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + for (int c2 = 1; c2 <= M; c2 += 1) + for (int c3 = max(1, -M + c0); c3 <= min(M, c0 - 1); c3 += 1) + S1(c2, c1, c3, c0 - c3); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner4.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner4.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner4.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner4.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1, i2, i3] -> [0, i2 + i3, 0, i1, 0, i0, 0, i2, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M and i2 >= 1 and i2 <= M and i3 >= 1 and i3 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m, n, o, p, q] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner4.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner4.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner4.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner4.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,15 @@ +domain: "[M] -> { S1[i0, i1, i2, i3] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M and i2 >= 1 and i2 <= M and i3 >= 1 and i3 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i2 + i3)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner5.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner5.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner5.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner5.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,5 +1,5 @@ -for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - for (int c5 = 1; c5 <= M; c5 += 1) - for (int c7 = 1; c7 <= M; c7 += 1) - S1(c3, c5, c1, c7); +for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + for (int c2 = 1; c2 <= M; c2 += 1) + for (int c3 = 1; c3 <= M; c3 += 1) + S1(c1, c2, c0, c3); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner5.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner5.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner5.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner5.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1, i2, i3] -> [0, i2, 0, i0, 0, i1, 0, i3, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M and i2 >= 1 and i2 <= M and i3 >= 1 and i3 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m, n, o, p, q] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner5.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner5.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-loechner5.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-loechner5.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,15 @@ +domain: "[M] -> { S1[i0, i1, i2, i3] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M and i2 >= 1 and i2 <= M and i3 >= 1 and i3 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i3)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-long.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-long.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-long.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-long.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,14 @@ +for (int c0 = 1; c0 < O; c0 += 1) { + for (int c1 = Q; c1 < N; c1 += 1) { + for (int c2 = P; c2 < M; c2 += 1) + S1(c0, c1, c2); + for (int c2 = 1; c2 < M; c2 += 1) + S2(c0, c1, c2); + } + for (int c1 = 1; c1 < N; c1 += 1) { + for (int c2 = P; c2 < M; c2 += 1) + S3(c0, c1, c2); + for (int c2 = 1; c2 < M; c2 += 1) + S4(c0, c1, c2); + } +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-long.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-long.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-long.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-long.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,36 @@ +domain: "[M, N, O, P, Q, R, S, T, U] -> { S1[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= P and i2 <= -1 + M; S3[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= P and i2 <= -1 + M; S4[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S2[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M }" +child: + context: "[M, N, O, P, Q, R, S, T, U] -> { [] : M >= 10 and N >= 10 and O >= 10 and P >= 1 and P <= 2 and Q >= 1 and Q <= 2 and R >= 1 and R <= 2 and S >= 0 and S <= 1 and T >= 0 and T <= 1 and U >= 0 and U <= 1 }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i0)]; S2[i0, i1, i2] -> [(i0)]; S1[i0, i1, i2] -> [(i0)]; S3[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S1[i0, i1, i2]; S2[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S2[i0, i1, i2] -> [(i1)]; S1[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S1[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S2[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S2[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S3[i0, i1, i2]; S4[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i1)]; S3[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S3[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S3[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S4[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,18 +1,18 @@ { - for (int c1 = 1; c1 < O; c1 += 1) - for (int c3 = Q; c3 < N; c3 += 1) - for (int c5 = P; c5 < M; c5 += 1) - S1(c1, c3, c5); - for (int c1 = 1; c1 < O; c1 += 1) - for (int c3 = Q; c3 < N; c3 += 1) - for (int c5 = 1; c5 < M; c5 += 1) - S2(c1, c3, c5); - for (int c1 = 1; c1 < O; c1 += 1) - for (int c3 = 1; c3 < N; c3 += 1) - for (int c5 = P; c5 < M; c5 += 1) - S3(c1, c3, c5); - for (int c1 = 1; c1 < O; c1 += 1) - for (int c3 = 1; c3 < N; c3 += 1) - for (int c5 = 1; c5 < M; c5 += 1) - S4(c1, c3, c5); + for (int c0 = 1; c0 < O; c0 += 1) + for (int c1 = Q; c1 < N; c1 += 1) + for (int c2 = P; c2 < M; c2 += 1) + S1(c0, c1, c2); + for (int c0 = 1; c0 < O; c0 += 1) + for (int c1 = Q; c1 < N; c1 += 1) + for (int c2 = 1; c2 < M; c2 += 1) + S2(c0, c1, c2); + for (int c0 = 1; c0 < O; c0 += 1) + for (int c1 = 1; c1 < N; c1 += 1) + for (int c2 = P; c2 < M; c2 += 1) + S3(c0, c1, c2); + for (int c0 = 1; c0 < O; c0 += 1) + for (int c1 = 1; c1 < N; c1 += 1) + for (int c2 = 1; c2 < M; c2 += 1) + S4(c0, c1, c2); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N, O, P, Q, R, S, T, U] -> { S1[i0, i1, i2] -> [0, i0, 0, i1, 0, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= P and i2 <= -1 + M; S4[i0, i1, i2] -> [3, i0, 1, i1, 1, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S2[i0, i1, i2] -> [1, i0, 0, i1, 1, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S3[i0, i1, i2] -> [2, i0, 1, i1, 0, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= P and i2 <= -1 + M } -[M, N, O, P, Q, R, S, T, U] -> { : } -[M, N, O, P, Q, R, S, T, U] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,45 @@ +domain: "[M, N, O, P, Q, R, S, T, U] -> { S1[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= P and i2 <= -1 + M; S3[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= P and i2 <= -1 + M; S4[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S2[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M }" +child: + context: "[M, N, O, P, Q, R, S, T, U] -> { [] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S1[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S1[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S1[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S2[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S2[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S2[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S2[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S3[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S3[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S3[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S3[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S4[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-interp.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-interp.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-interp.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-interp.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,85 +1,85 @@ { if (N >= 2) - for (int c1 = 1; c1 < O; c1 += 1) { - for (int c5 = 1; c5 <= M; c5 += 1) - S1(c1, 1, c5); - for (int c5 = 1; c5 < M; c5 += 1) { - S6(c1, 1, c5); - S7(c1, 1, c5); + for (int c0 = 1; c0 < O; c0 += 1) { + for (int c3 = 1; c3 <= M; c3 += 1) + S1(c0, 1, c3); + for (int c3 = 1; c3 < M; c3 += 1) { + S6(c0, 1, c3); + S7(c0, 1, c3); } if (N >= 3) { - for (int c5 = 1; c5 <= M; c5 += 1) - S3(c1, 1, c5); - for (int c5 = 1; c5 <= M; c5 += 1) - S1(c1, 2, c5); - for (int c5 = 1; c5 < M; c5 += 1) { - S6(c1, 2, c5); - S7(c1, 2, c5); + for (int c3 = 1; c3 <= M; c3 += 1) + S3(c0, 1, c3); + for (int c3 = 1; c3 <= M; c3 += 1) + S1(c0, 2, c3); + for (int c3 = 1; c3 < M; c3 += 1) { + S6(c0, 2, c3); + S7(c0, 2, c3); } - for (int c5 = 1; c5 < M; c5 += 1) - S11(c1, 1, c5); + for (int c3 = 1; c3 < M; c3 += 1) + S11(c0, 1, c3); } else { - for (int c5 = 1; c5 <= M; c5 += 1) - S3(c1, 1, c5); - for (int c5 = 1; c5 < M; c5 += 1) - S11(c1, 1, c5); + for (int c3 = 1; c3 <= M; c3 += 1) + S3(c0, 1, c3); + for (int c3 = 1; c3 < M; c3 += 1) + S11(c0, 1, c3); } - for (int c3 = 3; c3 < 2 * N - 4; c3 += 2) { - for (int c5 = 1; c5 < M; c5 += 1) - S10(c1, (c3 - 1) / 2, c5); - for (int c5 = 1; c5 <= M; c5 += 1) - S3(c1, (c3 + 1) / 2, c5); - for (int c5 = 1; c5 <= M; c5 += 1) - S1(c1, (c3 + 3) / 2, c5); - for (int c5 = 1; c5 < M; c5 += 1) { - S6(c1, (c3 + 3) / 2, c5); - S7(c1, (c3 + 3) / 2, c5); + for (int c1 = 3; c1 < 2 * N - 4; c1 += 2) { + for (int c3 = 1; c3 < M; c3 += 1) + S10(c0, (c1 - 1) / 2, c3); + for (int c3 = 1; c3 <= M; c3 += 1) + S3(c0, (c1 + 1) / 2, c3); + for (int c3 = 1; c3 <= M; c3 += 1) + S1(c0, (c1 + 3) / 2, c3); + for (int c3 = 1; c3 < M; c3 += 1) { + S6(c0, (c1 + 3) / 2, c3); + S7(c0, (c1 + 3) / 2, c3); } - for (int c5 = 1; c5 < M; c5 += 1) - S11(c1, (c3 + 1) / 2, c5); + for (int c3 = 1; c3 < M; c3 += 1) + S11(c0, (c1 + 1) / 2, c3); } if (N >= 3) { - for (int c5 = 1; c5 < M; c5 += 1) - S10(c1, N - 2, c5); - for (int c5 = 1; c5 <= M; c5 += 1) - S3(c1, N - 1, c5); - for (int c5 = 1; c5 < M; c5 += 1) - S11(c1, N - 1, c5); + for (int c3 = 1; c3 < M; c3 += 1) + S10(c0, N - 2, c3); + for (int c3 = 1; c3 <= M; c3 += 1) + S3(c0, N - 1, c3); + for (int c3 = 1; c3 < M; c3 += 1) + S11(c0, N - 1, c3); } - for (int c5 = 1; c5 < M; c5 += 1) - S10(c1, N - 1, c5); + for (int c3 = 1; c3 < M; c3 += 1) + S10(c0, N - 1, c3); } - for (int c1 = 1; c1 < O; c1 += 1) - for (int c3 = 1; c3 < N; c3 += 1) { - for (int c5 = 1; c5 <= M; c5 += 1) - S2(c1, c3, c5); - for (int c5 = 1; c5 < M; c5 += 1) - S8(c1, c3, c5); - for (int c5 = 1; c5 < M; c5 += 1) - S9(c1, c3, c5); + for (int c0 = 1; c0 < O; c0 += 1) + for (int c1 = 1; c1 < N; c1 += 1) { + for (int c3 = 1; c3 <= M; c3 += 1) + S2(c0, c1, c3); + for (int c3 = 1; c3 < M; c3 += 1) + S8(c0, c1, c3); + for (int c3 = 1; c3 < M; c3 += 1) + S9(c0, c1, c3); } - for (int c1 = 1; c1 < O; c1 += 1) - for (int c3 = 1; c3 < N; c3 += 1) - for (int c5 = 1; c5 < M; c5 += 1) - S4(c1, c3, c5); - for (int c1 = 1; c1 < O; c1 += 1) - for (int c3 = 1; c3 < N; c3 += 1) - for (int c5 = 1; c5 < M; c5 += 1) - S5(c1, c3, c5); - for (int c1 = R; c1 < O; c1 += 1) - for (int c3 = Q; c3 < N; c3 += 1) - for (int c5 = P; c5 < M; c5 += 1) - S12(c1, c3, c5); - for (int c1 = R; c1 < O; c1 += 1) - for (int c3 = Q; c3 < N; c3 += 1) - for (int c5 = 1; c5 < M; c5 += 1) - S13(c1, c3, c5); - for (int c1 = R; c1 < O; c1 += 1) - for (int c3 = 1; c3 < N; c3 += 1) - for (int c5 = P; c5 < M; c5 += 1) - S14(c1, c3, c5); - for (int c1 = R; c1 < O; c1 += 1) - for (int c3 = 1; c3 < N; c3 += 1) - for (int c5 = 1; c5 < M; c5 += 1) - S15(c1, c3, c5); + for (int c0 = 1; c0 < O; c0 += 1) + for (int c1 = 1; c1 < N; c1 += 1) + for (int c2 = 1; c2 < M; c2 += 1) + S4(c0, c1, c2); + for (int c0 = 1; c0 < O; c0 += 1) + for (int c1 = 1; c1 < N; c1 += 1) + for (int c2 = 1; c2 < M; c2 += 1) + S5(c0, c1, c2); + for (int c0 = R; c0 < O; c0 += 1) + for (int c1 = Q; c1 < N; c1 += 1) + for (int c2 = P; c2 < M; c2 += 1) + S12(c0, c1, c2); + for (int c0 = R; c0 < O; c0 += 1) + for (int c1 = Q; c1 < N; c1 += 1) + for (int c2 = 1; c2 < M; c2 += 1) + S13(c0, c1, c2); + for (int c0 = R; c0 < O; c0 += 1) + for (int c1 = 1; c1 < N; c1 += 1) + for (int c2 = P; c2 < M; c2 += 1) + S14(c0, c1, c2); + for (int c0 = R; c0 < O; c0 += 1) + for (int c1 = 1; c1 < N; c1 += 1) + for (int c2 = 1; c2 < M; c2 += 1) + S15(c0, c1, c2); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-interp.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-interp.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-interp.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-interp.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N, O, P, Q, R, S, T, U] -> { S8[i0, i1, i2] -> [1, i0, 0, 2i1, 1, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S11[i0, i1, i2] -> [0, i0, 0, 2i1, 4, i2, 1] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S6[i0, i1, i2] -> [0, i0, 0, -2 + 2i1, 2, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S9[i0, i1, i2] -> [1, i0, 0, 1 + 2i1, 3, i2, 1] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S1[i0, i1, i2] -> [0, i0, 0, -3 + 2i1, 2, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S4[i0, i1, i2] -> [2, i0, 0, i1, 1, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S2[i0, i1, i2] -> [1, i0, 0, 2i1, 0, i2, 1] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S7[i0, i1, i2] -> [0, i0, 0, -2 + 2i1, 2, i2, 1] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S10[i0, i1, i2] -> [0, i0, 0, 1 + 2i1, 0, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S3[i0, i1, i2] -> [0, i0, 0, -1 + 2i1, 1, i2, 2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S15[i0, i1, i2] -> [7, i0, 1, i1, 1, i2, 0] : i0 >= R and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S5[i0, i1, i2] -> [3, i0, 0, i1, 1, i2, 1] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S13[i0, i1, i2] -> [5, i0, 0, i1, 1, i2, 0] : i0 >= R and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S12[i0, i1, i2] -> [4, i0, 0, i1, 0, i2, 0] : i0 >= R and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= P and i2 <= -1 + M; S14[i0, i1, i2] -> [6, i0, 1, i1, 0, i2, 0] : i0 >= R and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= P and i2 <= -1 + M } -[M, N, O, P, Q, R, S, T, U] -> { : } -[M, N, O, P, Q, R, S, T, U] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-interp.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-interp.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-interp.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-interp.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,115 @@ +domain: "[M, N, O, P, Q, R, S, T, U] -> { S8[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S12[i0, i1, i2] : i0 >= R and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= P and i2 <= -1 + M; S5[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S10[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S6[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S1[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S3[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S4[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S15[i0, i1, i2] : i0 >= R and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S11[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S2[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S7[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S9[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S14[i0, i1, i2] : i0 >= R and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= P and i2 <= -1 + M; S13[i0, i1, i2] : i0 >= R and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M }" +child: + context: "[M, N, O, P, Q, R, S, T, U] -> { [] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S10[i0, i1, i2]; S6[i0, i1, i2]; S3[i0, i1, i2]; S1[i0, i1, i2]; S11[i0, i1, i2]; S7[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S11[i0, i1, i2] -> [(i0)]; S1[i0, i1, i2] -> [(i0)]; S6[i0, i1, i2] -> [(i0)]; S10[i0, i1, i2] -> [(i0)]; S3[i0, i1, i2] -> [(i0)]; S7[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S11[i0, i1, i2] -> [(2i1)]; S1[i0, i1, i2] -> [(-3 + 2i1)]; S6[i0, i1, i2] -> [(-2 + 2i1)]; S10[i0, i1, i2] -> [(1 + 2i1)]; S3[i0, i1, i2] -> [(-1 + 2i1)]; S7[i0, i1, i2] -> [(-2 + 2i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S10[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S10[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S3[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S3[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S6[i0, i1, i2]; S1[i0, i1, i2]; S7[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S1[i0, i1, i2] -> [(i2)]; S6[i0, i1, i2] -> [(i2)]; S7[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S6[i0, i1, i2]; S1[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S7[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S11[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S11[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S2[i0, i1, i2]; S9[i0, i1, i2]; S8[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S2[i0, i1, i2] -> [(i0)]; S8[i0, i1, i2] -> [(i0)]; S9[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S2[i0, i1, i2] -> [(2i1)]; S8[i0, i1, i2] -> [(2i1)]; S9[i0, i1, i2] -> [(1 + 2i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S2[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S2[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S8[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S8[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S9[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S9[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S4[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S5[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S5[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S5[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S5[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S12[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S12[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S12[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S12[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S13[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S13[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S13[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S13[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S14[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S14[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S14[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S14[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S15[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S15[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S15[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S15[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,9 +1,9 @@ -for (int c1 = 2; c1 < O; c1 += 1) - for (int c3 = 3; c3 < 2 * N - 2; c3 += 2) { - for (int c5 = 1; c5 <= M; c5 += 1) { - S1(c1, (c3 + 1) / 2, c5); - S2(c1, (c3 + 1) / 2, c5); +for (int c0 = 2; c0 < O; c0 += 1) + for (int c1 = 3; c1 < 2 * N - 2; c1 += 2) { + for (int c3 = 1; c3 <= M; c3 += 1) { + S1(c0, (c1 + 1) / 2, c3); + S2(c0, (c1 + 1) / 2, c3); } - for (int c5 = 2; c5 < M; c5 += 1) - S3(c1, (c3 + 1) / 2, c5); + for (int c3 = 2; c3 < M; c3 += 1) + S3(c0, (c1 + 1) / 2, c3); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N, O] -> { S1[i0, i1, i2] -> [0, i0, 0, -1 + 2i1, 0, i2, 0] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S2[i0, i1, i2] -> [0, i0, 0, -1 + 2i1, 0, i2, 1] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S3[i0, i1, i2] -> [0, i0, 0, 2i1, 1, i2, 0] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M } -[M, N, O] -> { : } -[M, N, O] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,23 @@ +domain: "[M, N, O] -> { S3[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M; S2[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S1[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 1 and i2 <= M }" +child: + context: "[M, N, O] -> { [] }" + child: + schedule: "[M, N, O] -> [{ S3[i0, i1, i2] -> [(i0)]; S2[i0, i1, i2] -> [(i0)]; S1[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O] -> { separate[i0] }" + child: + schedule: "[M, N, O] -> [{ S3[i0, i1, i2] -> [(2i1)]; S2[i0, i1, i2] -> [(-1 + 2i1)]; S1[i0, i1, i2] -> [(-1 + 2i1)] }]" + options: "[M, N, O] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O] -> { S2[i0, i1, i2]; S1[i0, i1, i2] }" + child: + schedule: "[M, N, O] -> [{ S2[i0, i1, i2] -> [(i2)]; S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O] -> { S1[i0, i1, i2] }" + - filter: "[M, N, O] -> { S2[i0, i1, i2] }" + - filter: "[M, N, O] -> { S3[i0, i1, i2] }" + child: + schedule: "[M, N, O] -> [{ S3[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-resid.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-resid.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-resid.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-resid.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,9 +1,9 @@ -for (int c1 = 2; c1 < O; c1 += 1) - for (int c3 = 3; c3 < 2 * N - 2; c3 += 2) { - for (int c5 = 1; c5 <= M; c5 += 1) { - S1(c1, (c3 + 1) / 2, c5); - S2(c1, (c3 + 1) / 2, c5); +for (int c0 = 2; c0 < O; c0 += 1) + for (int c1 = 3; c1 < 2 * N - 2; c1 += 2) { + for (int c3 = 1; c3 <= M; c3 += 1) { + S1(c0, (c1 + 1) / 2, c3); + S2(c0, (c1 + 1) / 2, c3); } - for (int c5 = 2; c5 < M; c5 += 1) - S3(c1, (c3 + 1) / 2, c5); + for (int c3 = 2; c3 < M; c3 += 1) + S3(c0, (c1 + 1) / 2, c3); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-resid.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-resid.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-resid.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-resid.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N, O] -> { S1[i0, i1, i2] -> [0, i0, 0, -1 + 2i1, 0, i2, 0] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S2[i0, i1, i2] -> [0, i0, 0, -1 + 2i1, 0, i2, 1] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S3[i0, i1, i2] -> [0, i0, 0, 2i1, 1, i2, 0] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M } -[M, N, O] -> { : } -[M, N, O] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-resid.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-resid.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-resid.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-resid.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,23 @@ +domain: "[M, N, O] -> { S3[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M; S2[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S1[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 1 and i2 <= M }" +child: + context: "[M, N, O] -> { [] }" + child: + schedule: "[M, N, O] -> [{ S3[i0, i1, i2] -> [(i0)]; S2[i0, i1, i2] -> [(i0)]; S1[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O] -> { separate[i0] }" + child: + schedule: "[M, N, O] -> [{ S3[i0, i1, i2] -> [(2i1)]; S2[i0, i1, i2] -> [(-1 + 2i1)]; S1[i0, i1, i2] -> [(-1 + 2i1)] }]" + options: "[M, N, O] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O] -> { S2[i0, i1, i2]; S1[i0, i1, i2] }" + child: + schedule: "[M, N, O] -> [{ S2[i0, i1, i2] -> [(i2)]; S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O] -> { S1[i0, i1, i2] }" + - filter: "[M, N, O] -> { S2[i0, i1, i2] }" + - filter: "[M, N, O] -> { S3[i0, i1, i2] }" + child: + schedule: "[M, N, O] -> [{ S3[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,33 +1,35 @@ if (M >= 2 && N >= 3) - for (int c1 = 2; c1 < O; c1 += 1) { - for (int c5 = 2; c5 <= M; c5 += 1) - S1(c1, 2, c5); - for (int c3 = 3; c3 < N; c3 += 1) { - for (int c5 = 2; c5 <= M; c5 += 1) - S2(c1, c3 - 1, c5); + for (int c0 = 2; c0 < O; c0 += 1) { + for (int c2 = 2; c2 <= M; c2 += 1) + S1(c0, 2, c2); + for (int c1 = 3; c1 < N; c1 += 1) { + for (int c2 = 2; c2 <= M; c2 += 1) + S2(c0, c1 - 1, c2); + if (M >= 3) + S4(c0, c1 - 1, 2); + for (int c2 = 2; c2 < M - 1; c2 += 1) { + S3(c0, c1 - 1, c2); + S5(c0, c1 - 1, c2); + S4(c0, c1 - 1, c2 + 1); + } if (M >= 3) { - S4(c1, c3 - 1, 2); - for (int c5 = 2; c5 < M - 1; c5 += 1) { - S3(c1, c3 - 1, c5); - S5(c1, c3 - 1, c5); - S4(c1, c3 - 1, c5 + 1); - } - S3(c1, c3 - 1, M - 1); - S5(c1, c3 - 1, M - 1); + S3(c0, c1 - 1, M - 1); + S5(c0, c1 - 1, M - 1); } - for (int c5 = 2; c5 <= M; c5 += 1) - S1(c1, c3, c5); + for (int c2 = 2; c2 <= M; c2 += 1) + S1(c0, c1, c2); + } + for (int c2 = 2; c2 <= M; c2 += 1) + S2(c0, N - 1, c2); + if (M >= 3) + S4(c0, N - 1, 2); + for (int c2 = 2; c2 < M - 1; c2 += 1) { + S3(c0, N - 1, c2); + S5(c0, N - 1, c2); + S4(c0, N - 1, c2 + 1); } - for (int c5 = 2; c5 <= M; c5 += 1) - S2(c1, N - 1, c5); if (M >= 3) { - S4(c1, N - 1, 2); - for (int c5 = 2; c5 < M - 1; c5 += 1) { - S3(c1, N - 1, c5); - S5(c1, N - 1, c5); - S4(c1, N - 1, c5 + 1); - } - S3(c1, N - 1, M - 1); - S5(c1, N - 1, M - 1); + S3(c0, N - 1, M - 1); + S5(c0, N - 1, M - 1); } } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N, O, P, Q, R] -> { S1[i0, i1, i2] -> [0, i0, 0, i1, 2, i2, 0] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= M; S4[i0, i1, i2] -> [0, i0, 0, 1 + i1, 1, -1 + i2, 2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M; S3[i0, i1, i2] -> [0, i0, 0, 1 + i1, 1, i2, 0] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M; S5[i0, i1, i2] -> [0, i0, 0, 1 + i1, 1, i2, 1] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M; S2[i0, i1, i2] -> [0, i0, 0, 1 + i1, 0, i2, 1] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= M } -[M, N, O, P, Q, R] -> { : } -[M, N, O, P, Q, R] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,28 @@ +domain: "[M, N, O, P, Q, R] -> { S2[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= M; S4[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M; S1[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= M; S5[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M; S3[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M }" +child: + context: "[M, N, O, P, Q, R] -> { [] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S5[i0, i1, i2] -> [(i0)]; S3[i0, i1, i2] -> [(i0)]; S4[i0, i1, i2] -> [(i0)]; S1[i0, i1, i2] -> [(i0)]; S2[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S5[i0, i1, i2] -> [(1 + i1)]; S3[i0, i1, i2] -> [(1 + i1)]; S4[i0, i1, i2] -> [(1 + i1)]; S1[i0, i1, i2] -> [(i1)]; S2[i0, i1, i2] -> [(1 + i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S2[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S2[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S4[i0, i1, i2]; S5[i0, i1, i2]; S3[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S5[i0, i1, i2] -> [(i2)]; S3[i0, i1, i2] -> [(i2)]; S4[i0, i1, i2] -> [(-1 + i2)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S3[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S5[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S4[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S1[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali1.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali1.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali1.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,7 +1,7 @@ -for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 < 2 * N; c3 += 1) { - for (int c5 = max(1, -N + c3); c5 < (c3 + 1) / 2; c5 += 1) - S1(c1, c3 - c5, c5); - if ((c3 - 1) % 2 == 0) - S2(c1, (c3 + 1) / 2); +for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 < 2 * N; c1 += 1) { + for (int c2 = max(1, -N + c1); c2 < (c1 + 1) / 2; c2 += 1) + S1(c0, c1 - c2, c2); + if ((c1 - 1) % 2 == 0) + S2(c0, (c1 + 1) / 2); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali1.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali1.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali1.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0, i1, i2] -> [0, i0, 0, i1 + i2, 0, i2, 0] : i0 >= 1 and i0 <= M and i1 <= N and i2 >= 1 and i2 <= -1 + i1; S2[i0, i1] -> [0, i0, 0, -1 + 2i1, 1, 0, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= N } -[M, N] -> { : } -[M, N] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali1.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali1.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,16 @@ +domain: "[M, N] -> { S2[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= N; S1[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 <= N and i2 >= 1 and i2 <= -1 + i1 }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(i0)]; S1[i0, i1, i2] -> [(i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(-1 + 2i1)]; S1[i0, i1, i2] -> [(i1 + i2)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1, i2] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali2.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali2.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali2.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,8 +1,8 @@ { - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S1(c1, c3); - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S2(c1, c3); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S1(c0, c1); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S2(c0, c1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [1, i0, 1, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S1[i0, i1] -> [0, i0, 0, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,19 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S2[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M }" +child: + context: "[M] -> { [] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali3.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali3.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali3.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali3.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,9 +1,9 @@ { - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S1(c1, c3); - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - for (int c5 = 1; c5 <= M; c5 += 1) - S2(c1, c3, c5); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S1(c0, c1); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + for (int c2 = 1; c2 <= M; c2 += 1) + S2(c0, c1, c2); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali3.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali3.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali3.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali3.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1, i2] -> [1, i0, 0, i1, 1, i2, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M and i2 >= 1 and i2 <= M; S1[i0, i1] -> [0, i0, 0, i1, 0, 0, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali3.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali3.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,22 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S2[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M and i2 >= 1 and i2 <= M }" +child: + context: "[M] -> { [] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1, i2] }" + child: + schedule: "[M] -> [{ S2[i0, i1, i2] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S2[i0, i1, i2] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S2[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali4.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali4.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali4.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali4.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,8 +1,8 @@ { - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S1(c1, c3); - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S2(c1, c3); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S1(c0, c1); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S2(c0, c1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali4.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali4.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali4.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali4.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [1, i0, 0, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S1[i0, i1] -> [0, i0, 0, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M } -[M] -> { : M >= 2 } -[M] -> { [i, j, k, l, m] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali4.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali4.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali4.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali4.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,19 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S2[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M }" +child: + context: "[M] -> { [] : M >= 2 }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali5.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali5.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali5.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali5.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,10 +1,10 @@ -for (int c1 = 3; c1 < 2 * M; c1 += 1) { - for (int c3 = c1 / 2 + 2; c3 <= M; c3 += 1) - for (int c7 = c1 / 2 + 1; c7 < min(c1, c3); c7 += 1) - S1(c7, c1 - c7, c3); - for (int c3 = max(1, -M + c1); c3 < (c1 + 1) / 2; c3 += 1) - S2(c1 - c3, c3); - for (int c3 = c1 / 2 + 2; c3 <= M; c3 += 1) - for (int c7 = c1 / 2 + 1; c7 < min(c1, c3); c7 += 1) - S3(c7, c1 - c7, c3); +for (int c0 = 3; c0 < 2 * M; c0 += 1) { + for (int c1 = c0 / 2 + 2; c1 <= M; c1 += 1) + for (int c3 = c0 / 2 + 1; c3 < min(c0, c1); c3 += 1) + S1(c3, c0 - c3, c1); + for (int c1 = max(1, -M + c0); c1 < (c0 + 1) / 2; c1 += 1) + S2(c0 - c1, c1); + for (int c1 = c0 / 2 + 2; c1 <= M; c1 += 1) + for (int c3 = c0 / 2 + 1; c3 < min(c0, c1); c3 += 1) + S3(c3, c0 - c3, c1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali5.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali5.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali5.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali5.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1, i2] -> [0, i0 + i1, 0, i2, 0, i2, 0] : i1 >= 1 and i1 <= -1 + i0 and i2 >= 1 + i0 and i2 <= M; S3[i0, i1, i2] -> [0, i0 + i1, 2, i2, 2, i2, 0] : i1 >= 1 and i1 <= -1 + i0 and i2 >= 1 + i0 and i2 <= M; S2[i0, i1] -> [0, i0 + i1, 1, i1, 1, 0, 0] : i0 <= M and i1 >= 1 and i1 <= -1 + i0 } -[M] -> { : } -[M] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali5.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali5.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali5.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali5.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,26 @@ +domain: "[M] -> { S3[i0, i1, i2] : i1 >= 1 and i1 <= -1 + i0 and i2 >= 1 + i0 and i2 <= M; S2[i0, i1] : i0 <= M and i1 >= 1 and i1 <= -1 + i0; S1[i0, i1, i2] : i1 >= 1 and i1 <= -1 + i0 and i2 >= 1 + i0 and i2 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i0 + i1)]; S3[i0, i1, i2] -> [(i0 + i1)]; S2[i0, i1] -> [(i0 + i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1, i2] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S3[i0, i1, i2] }" + child: + schedule: "[M] -> [{ S3[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S3[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali6.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali6.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali6.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali6.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,8 +1,8 @@ -for (int c1 = 1; c1 <= M; c1 += 1) { - for (int c3 = 2; c3 < N; c3 += 1) - for (int c5 = 2; c5 < N; c5 += 1) - S1(c1, c3, c5); - for (int c3 = 2; c3 < N; c3 += 1) - for (int c5 = 2; c5 < N; c5 += 1) - S2(c1, c3, c5); +for (int c0 = 1; c0 <= M; c0 += 1) { + for (int c2 = 2; c2 < N; c2 += 1) + for (int c3 = 2; c3 < N; c3 += 1) + S1(c0, c2, c3); + for (int c2 = 2; c2 < N; c2 += 1) + for (int c3 = 2; c3 < N; c3 += 1) + S2(c0, c2, c3); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali6.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali6.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali6.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali6.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S2[i0, i1, i2] -> [0, 1 + 2i0, 1, i1, 0, i2, 0] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + N; S1[i0, i1, i2] -> [0, 2i0, 0, i1, 0, i2, 0] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + N } -[M, N] -> { : M >= 1 and N >= 1 } -[M, N] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali6.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali6.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-pingali6.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-pingali6.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,22 @@ +domain: "[M, N] -> { S2[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + N; S1[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + N }" +child: + context: "[M, N] -> { [] : M >= 1 and N >= 1 }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2] -> [(2i0)]; S2[i0, i1, i2] -> [(1 + 2i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1, i2] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S2[i0, i1, i2] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1, i2] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1, i2] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-QR.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-QR.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-QR.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-QR.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,53 +1,53 @@ if (N >= 1) { S1(0); if (N == 1) { - for (int c3 = 0; c3 < M; c3 += 1) - S2(0, c3); + for (int c1 = 0; c1 < M; c1 += 1) + S2(0, c1); S3(0); - for (int c3 = 0; c3 < M; c3 += 1) - S4(0, c3); + for (int c1 = 0; c1 < M; c1 += 1) + S4(0, c1); S10(0); S5(0); } else { - for (int c3 = 0; c3 < M; c3 += 1) - S2(0, c3); + for (int c1 = 0; c1 < M; c1 += 1) + S2(0, c1); S3(0); - for (int c3 = 0; c3 < M; c3 += 1) - S4(0, c3); + for (int c1 = 0; c1 < M; c1 += 1) + S4(0, c1); S10(0); S1(1); S5(0); } - for (int c1 = 2; c1 < N; c1 += 1) { - for (int c3 = c1 - 1; c3 < N; c3 += 1) { - S6(c1 - 2, c3); - for (int c5 = c1 - 2; c5 < M; c5 += 1) - S7(c1 - 2, c3, c5); - S8(c1 - 2, c3); - for (int c5 = c1 - 2; c5 < M; c5 += 1) - S9(c1 - 2, c3, c5); + for (int c0 = 2; c0 < N; c0 += 1) { + for (int c1 = c0 - 1; c1 < N; c1 += 1) { + S6(c0 - 2, c1); + for (int c2 = c0 - 2; c2 < M; c2 += 1) + S7(c0 - 2, c1, c2); + S8(c0 - 2, c1); + for (int c2 = c0 - 2; c2 < M; c2 += 1) + S9(c0 - 2, c1, c2); } - for (int c3 = c1 - 1; c3 < M; c3 += 1) - S2(c1 - 1, c3); - S3(c1 - 1); - for (int c3 = c1 - 1; c3 < M; c3 += 1) - S4(c1 - 1, c3); - S10(c1 - 1); - S1(c1); - S5(c1 - 1); + for (int c1 = c0 - 1; c1 < M; c1 += 1) + S2(c0 - 1, c1); + S3(c0 - 1); + for (int c1 = c0 - 1; c1 < M; c1 += 1) + S4(c0 - 1, c1); + S10(c0 - 1); + S1(c0); + S5(c0 - 1); } if (N >= 2) { S6(N - 2, N - 1); - for (int c5 = N - 2; c5 < M; c5 += 1) - S7(N - 2, N - 1, c5); + for (int c2 = N - 2; c2 < M; c2 += 1) + S7(N - 2, N - 1, c2); S8(N - 2, N - 1); - for (int c5 = N - 2; c5 < M; c5 += 1) - S9(N - 2, N - 1, c5); - for (int c3 = N - 1; c3 < M; c3 += 1) - S2(N - 1, c3); + for (int c2 = N - 2; c2 < M; c2 += 1) + S9(N - 2, N - 1, c2); + for (int c1 = N - 1; c1 < M; c1 += 1) + S2(N - 1, c1); S3(N - 1); - for (int c3 = N - 1; c3 < M; c3 += 1) - S4(N - 1, c3); + for (int c1 = N - 1; c1 < M; c1 += 1) + S4(N - 1, c1); S10(N - 1); S5(N - 1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-QR.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-QR.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-QR.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-QR.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0] -> [0, i0, 5, 0, 0, 0, 0] : i0 >= 0 and i0 <= -1 + N; S9[i0, i1, i2] -> [0, 2 + i0, 0, i1, 3, i2, 0] : i0 >= 0 and i1 >= 1 + i0 and i1 <= -1 + N and i2 >= i0 and i2 <= -1 + M; S10[i0] -> [0, 1 + i0, 4, 0, 0, 0, 0] : i0 >= 0 and i0 <= -1 + N; S3[i0] -> [0, 1 + i0, 2, 0, 0, 0, 0] : i0 >= 0 and i0 <= -1 + N; S6[i0, i1] -> [0, 2 + i0, 0, i1, 0, 0, 0] : i0 >= 0 and i1 >= 1 + i0 and i1 <= -1 + N; S8[i0, i1] -> [0, 2 + i0, 0, i1, 2, 0, 0] : i0 >= 0 and i1 >= 1 + i0 and i1 <= -1 + N; S2[i0, i1] -> [0, 1 + i0, 1, i1, 0, 0, 0] : i0 >= 0 and i0 <= -1 + N and i1 >= i0 and i1 <= -1 + M; S4[i0, i1] -> [0, 1 + i0, 3, i1, 0, 0, 0] : i0 >= 0 and i0 <= -1 + N and i1 >= i0 and i1 <= -1 + M; S7[i0, i1, i2] -> [0, 2 + i0, 0, i1, 1, i2, 0] : i0 >= 0 and i1 >= 1 + i0 and i1 <= -1 + N and i2 >= i0 and i2 <= -1 + M; S5[i0] -> [0, 1 + i0, 6, 0, 0, 0, 0] : i0 >= 0 and i0 <= -1 + N } -[M, N] -> { : } -[M, N] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-QR.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-QR.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-QR.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-QR.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,36 @@ +domain: "[M, N] -> { S5[i0] : i0 >= 0 and i0 <= -1 + N; S1[i0] : i0 >= 0 and i0 <= -1 + N; S3[i0] : i0 >= 0 and i0 <= -1 + N; S2[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= i0 and i1 <= -1 + M; S6[i0, i1] : i0 >= 0 and i1 >= 1 + i0 and i1 <= -1 + N; S9[i0, i1, i2] : i0 >= 0 and i1 >= 1 + i0 and i1 <= -1 + N and i2 >= i0 and i2 <= -1 + M; S4[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= i0 and i1 <= -1 + M; S8[i0, i1] : i0 >= 0 and i1 >= 1 + i0 and i1 <= -1 + N; S10[i0] : i0 >= 0 and i0 <= -1 + N; S7[i0, i1, i2] : i0 >= 0 and i1 >= 1 + i0 and i1 <= -1 + N and i2 >= i0 and i2 <= -1 + M }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S3[i0] -> [(1 + i0)]; S10[i0] -> [(1 + i0)]; S5[i0] -> [(1 + i0)]; S7[i0, i1, i2] -> [(2 + i0)]; S9[i0, i1, i2] -> [(2 + i0)]; S2[i0, i1] -> [(1 + i0)]; S4[i0, i1] -> [(1 + i0)]; S8[i0, i1] -> [(2 + i0)]; S1[i0] -> [(i0)]; S6[i0, i1] -> [(2 + i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S6[i0, i1]; S9[i0, i1, i2]; S8[i0, i1]; S7[i0, i1, i2] }" + child: + schedule: "[M, N] -> [{ S7[i0, i1, i2] -> [(i1)]; S9[i0, i1, i2] -> [(i1)]; S8[i0, i1] -> [(i1)]; S6[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S6[i0, i1] }" + - filter: "[M, N] -> { S7[i0, i1, i2] }" + child: + schedule: "[M, N] -> [{ S7[i0, i1, i2] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S8[i0, i1] }" + - filter: "[M, N] -> { S9[i0, i1, i2] }" + child: + schedule: "[M, N] -> [{ S9[i0, i1, i2] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S2[i0, i1] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S3[i0] }" + - filter: "[M, N] -> { S4[i0, i1] }" + child: + schedule: "[M, N] -> [{ S4[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S10[i0] }" + - filter: "[M, N] -> { S1[i0] }" + - filter: "[M, N] -> { S5[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-stride2.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-stride2.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-stride2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-stride2.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,2 +1,2 @@ -for (int c1 = 2; c1 <= M; c1 += 7) - S1(c1, (c1 - 2) / 7); +for (int c0 = 2; c0 <= M; c0 += 7) + S1(c0, (c0 - 2) / 7); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-stride2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-stride2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-stride2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-stride2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1] -> [0, i0, 0, 0, 0] : 7i1 = -2 + i0 and i0 >= 0 and i0 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-stride2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-stride2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-stride2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-stride2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0, i1] : 7i1 = -2 + i0 and i0 >= 0 and i0 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-stride.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-stride.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-stride.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-stride.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,2 +1,2 @@ -for (int c1 = 2; c1 <= M; c1 += 7) - S1(c1, (c1 - 2) / 7); +for (int c0 = 2; c0 <= M; c0 += 7) + S1(c0, (c0 - 2) / 7); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-stride.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-stride.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-stride.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-stride.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1] -> [0, i0, 0, 0, 0] : 7i1 = -2 + i0 and i0 >= 2 and i0 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-stride.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-stride.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-stride.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-stride.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0, i1] : 7i1 = -2 + i0 and i0 >= 2 and i0 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.c cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,5 +1,5 @@ -for (int c1 = 0; c1 <= 9; c1 += 2) - for (int c3 = 0; c3 <= min(4, c1 + 3); c3 += 2) - for (int c5 = max(c1, 1); c5 <= min(c1 + 1, c1 - c3 + 4); c5 += 1) - for (int c7 = max(-c1 + c3 + c5, 1); c7 <= min(4, -c1 + c3 + c5 + 1); c7 += 1) - S1(c1 / 2, (-c1 + c3) / 2, -c1 + c5, -c3 + c7); +for (int c0 = 0; c0 <= 9; c0 += 2) + for (int c1 = 0; c1 <= min(4, c0 + 3); c1 += 2) + for (int c2 = max(1, c0); c2 <= min(c0 + 1, c0 - c1 + 4); c2 += 1) + for (int c3 = max(1, -c0 + c1 + c2); c3 <= min(4, -c0 + c1 + c2 + 1); c3 += 1) + S1(c0 / 2, (-c0 + c1) / 2, -c0 + c2, -c1 + c3); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[i0, i1, i2, i3] -> [0, 2i0, 0, 2i0 + 2i1, 0, 2i0 + i2, 0, 2i0 + 2i1 + i3, 0] : i3 <= 4 - 2i0 - 2i1 and i3 >= i2 and i2 <= 9 - 2i0 and i2 >= 0 and i2 >= 1 - 2i0 and i3 <= 1 + i2 and i2 <= 1 and i3 >= 1 - 2i0 - 2i1 } -{ : } -{ [i, j, k, l, m, n, o, p, q] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,15 @@ +domain: "{ S1[i0, i1, i2, i3] : i3 <= 4 - 2i0 - 2i1 and i3 >= i2 and i2 <= 9 - 2i0 and i2 >= 0 and i2 >= 1 - 2i0 and i3 <= 1 + i2 and i2 <= 1 and i3 >= 1 - 2i0 - 2i1 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1, i2, i3] -> [(2i0)] }]" + options: "{ separate[i0] }" + child: + schedule: "[{ S1[i0, i1, i2, i3] -> [(2i0 + 2i1)] }]" + options: "{ separate[i0] }" + child: + schedule: "[{ S1[i0, i1, i2, i3] -> [(2i0 + i2)] }]" + options: "{ separate[i0] }" + child: + schedule: "[{ S1[i0, i1, i2, i3] -> [(2i0 + 2i1 + i3)] }]" + options: "{ separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-two.in cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-two.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-two.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-two.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[i0, i1, i2] -> [i0, j, k, 0] : 2i1 = 3 - i0 and 2j = 3 - i0 and 2k = 9 + i0 and 2i2 = 9 + i0 and i0 >= 0 and i0 <= 1 } -{ : } -{ [i, j, k, l] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-two.st cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-two.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/reservoir-two.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/reservoir-two.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "{ S1[i0, i1, i2] : 2i1 = 3 - i0 and 2i2 = 9 + i0 and i0 >= 0 and i0 <= 1 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1, i2] -> [(i0)] }, { S1[i0, i1, i2] -> [(i1)] }, { S1[i0, i1, i2] -> [(i2)] }]" + options: "{ separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/singleton.in cloog-0.18.4/isl/test_inputs/codegen/cloog/singleton.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/singleton.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/singleton.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S2[] -> [-1]; S1[] -> [0] } -{ : } -{ [i] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/singleton.st cloog-0.18.4/isl/test_inputs/codegen/cloog/singleton.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/singleton.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/singleton.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,7 @@ +domain: "{ S1[]; S2[] }" +child: + context: "{ [] }" + child: + sequence: + - filter: "{ S2[] }" + - filter: "{ S1[] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/sor1d.c cloog-0.18.4/isl/test_inputs/codegen/cloog/sor1d.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/sor1d.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/sor1d.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,13 @@ +if (M >= 1 && N >= 3) + for (int c0 = -1; c0 <= (3 * M + N - 5) / 100; c0 += 1) { + for (int c1 = max(max(0, c0 - (2 * M + N + 95) / 100 + 1), floord(-N + 100 * c0 + 106, 300)); c1 <= min(min(c0, M / 100), (c0 + 1) / 3); c1 += 1) + for (int c2 = max(200 * c1 - 3, 100 * c0 - 100 * c1); c2 <= min(min(2 * M + N - 5, 100 * c0 - 100 * c1 + 99), N + 200 * c1 + 193); c2 += 1) { + if (c1 >= 1 && N + 200 * c1 >= c2 + 7) + S3(c0 - c1, c1 - 1, c1, 100 * c1 - 1, -200 * c1 + c2 + 6); + for (int c3 = max(max(1, 100 * c1), -N + (N + c2) / 2 + 3); c3 <= min(min(M, 100 * c1 + 99), c2 / 2 + 1); c3 += 1) + S1(c0 - c1, c1, c3, c2 - 2 * c3 + 4); + if (M >= 100 * c1 + 100 && c2 >= 200 * c1 + 197) + S2(c0 - c1, c1, c1 + 1, 100 * c1 + 99, -200 * c1 + c2 - 194); + } + S4(c0); + } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/sor1d.st cloog-0.18.4/isl/test_inputs/codegen/cloog/sor1d.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/sor1d.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/sor1d.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,24 @@ +domain: "[M, N] -> { S2[i0, i1, 1 + i1, 99 + 100i1, i4] : i4 >= 3 and i4 >= -193 - 200i1 and i4 >= -194 + 100i0 - 200i1 and 100i0 >= -284 - 3N and i4 <= -1 + N and i4 <= -201 + 2M + N - 200i1 and i4 <= -95 + 100i0 - 200i1 and 100i0 >= -94 - N and 50i0 >= -45 - N and 3N >= -134 - M and i1 >= 0 and N >= 4 and 200i1 >= -192 - N and 200i1 >= -193 - N + 100i0 and 100i0 <= -7 + 2M + N and 7N >= -463 - 2M and 100i1 <= -100 + M and i0 >= 0 and 200i1 <= -204 + 2M + N and 2i1 <= -1 + i0 and 5N >= -75 - 2M and N >= 8 - 2M and 50i0 <= -6 + M + N and 50i0 <= 89 + M + 2N and 100i0 <= -15 + 2M + 3N and M >= 2 and 100i1 <= -5 + M + N and 2N >= -39 - M and 200i1 <= 96 + N + 100i0 and 3N >= 16 - 2M and 100i1 >= -94 - N + 50i0 and N >= 6 - M and 100i1 >= -94 - N; S3[i0, i1, 1 + i1, 99 + 100i1, i4] : i4 >= 3 and i4 >= -193 - 200i1 and i4 >= -194 + 100i0 - 200i1 and 100i0 >= -284 - 3N and i4 <= -1 + N and i4 <= -201 + 2M + N - 200i1 and i4 <= -95 + 100i0 - 200i1 and 100i0 >= -94 - N and 50i0 >= -45 - N and 3N >= -134 - M and i1 >= 0 and N >= 4 and 200i1 >= -192 - N and 200i1 >= -193 - N + 100i0 and 100i0 <= -7 + 2M + N and 7N >= -463 - 2M and 100i1 <= -100 + M and i0 >= 0 and 200i1 <= -204 + 2M + N and 2i1 <= -1 + i0 and 5N >= -75 - 2M and N >= 8 - 2M and 50i0 <= -6 + M + N and 50i0 <= 89 + M + 2N and 100i0 <= -15 + 2M + 3N and M >= 2 and 100i1 <= -5 + M + N and 2N >= -39 - M and 200i1 <= 96 + N + 100i0 and 3N >= 16 - 2M and 100i1 >= -94 - N + 50i0 and N >= 6 - M and 100i1 >= -94 - N; S4[i0] : 200i0 >= -781 - 3N and 200i0 >= -391 - N and 50i0 >= -268 - N and 100i0 >= -392 - N and i0 >= -1 and 200i0 <= 377 + 6M + 5N and 100i0 <= 335 + 3M + 3N and 100i0 <= 190 + 3M + 2N and 200i0 <= -13 + 6M + 3N and 100i0 <= -5 + 3M + N and 3N >= -484 - 2M and N >= -95 - M and N >= -192 - 3M and 5N >= -873 - 3M and 2N >= -189 - 3M and 7N >= -1062 - 6M and 5N >= -771 - 6M and 4N >= -579 - 3M and N >= 3 and N >= 5 - 2M and M >= 1; S1[i0, i1, i2, i3] : i3 >= 4 + 100i0 - 2i2 and i3 >= 2 and i3 <= 103 + 100i0 - 2i2 and i3 <= -1 + N and i2 >= 1 and i2 >= 100i1 and 2i2 >= 5 - N + 100i0 and i2 <= M and i2 <= 99 + 100i1 and i2 <= 50 + 50i0 and i1 >= 0 and 200i1 >= -193 - N + 100i0 and 100i1 <= M and 2i1 <= 1 + i0 and i0 >= 0 and 100i0 <= -5 + 2M + N and N >= 3 and N >= -94 - 2M and M >= 1 }" +child: + context: "[M, N] -> { [] : M >= 0 and N >= 0 }" + child: + schedule: "[M, N] -> [{ S2[i0, i1, i2, i3, i4] -> [(i0 + i1)]; S1[i0, i1, i2, i3] -> [(i0 + i1)]; S3[i0, i1, i2, i3, i4] -> [(1 + i0 + i1)]; S4[i0] -> [(i0)] }]" + options: "[M, N] -> { atomic[i0] }" + child: + sequence: + - filter: "[M, N] -> { S2[i0, i1, i2, i3, i4]; S3[i0, i1, i2, i3, i4]; S1[i0, i1, i2, i3] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1, i2, i3, i4] -> [(i1)]; S1[i0, i1, i2, i3] -> [(i1)]; S3[i0, i1, i2, i3, i4] -> [(i2)] }, { S2[i0, i1, i2, i3, i4] -> [(-4 + 2i3 + i4)]; S1[i0, i1, i2, i3] -> [(-4 + 2i2 + i3)]; S3[i0, i1, i2, i3, i4] -> [(-4 + 2i3 + i4)] }, { S2[i0, i1, i2, i3, i4] -> [(i3)]; S1[i0, i1, i2, i3] -> [(i2)]; S3[i0, i1, i2, i3, i4] -> [(i3)] }]" + options: "[M, N] -> { atomic[i0] }" + child: + sequence: + - filter: "[M, N] -> { S3[i0, i1, i2, i3, i4] }" + child: + schedule: "[M, N] -> [{ S3[i0, i1, i2, i3, i4] -> [(i1)] }, { S3[i0, i1, i2, i3, i4] -> [(i4)] }]" + options: "[M, N] -> { atomic[i0] }" + - filter: "[M, N] -> { S1[i0, i1, i2, i3] }" + - filter: "[M, N] -> { S2[i0, i1, i2, i3, i4] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1, i2, i3, i4] -> [(i2)] }, { S2[i0, i1, i2, i3, i4] -> [(i4)] }]" + options: "[M, N] -> { atomic[i0] }" + - filter: "[M, N] -> { S4[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/square+triangle-1-1-2-3.in cloog-0.18.4/isl/test_inputs/codegen/cloog/square+triangle-1-1-2-3.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/square+triangle-1-1-2-3.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/square+triangle-1-1-2-3.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [i0, i1, 1] : i1 >= 2 and i1 <= i0 and i0 <= M; S1[i0, i1] -> [i0, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M } -[M] -> { : M >= 1 } -[M] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/square+triangle-1-1-2-3.st cloog-0.18.4/isl/test_inputs/codegen/cloog/square+triangle-1-1-2-3.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/square+triangle-1-1-2-3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/square+triangle-1-1-2-3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S2[i0, i1] : i1 >= 2 and i1 <= i0 and i0 <= M }" +child: + context: "[M] -> { [] : M >= 1 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + - filter: "[M] -> { S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/stride2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/stride2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/stride2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/stride2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[27] -> [27, 0]; S2[i0, i1] -> [i0, j] : 3i1 = i0 and 3j = i0 and i0 >= 3 and i0 <= 100 } -{ : } -{ [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/stride2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/stride2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/stride2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/stride2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "{ S2[i0, i1] : 3i1 = i0 and i0 >= 3 and i0 <= 100; S1[27] }" +child: + context: "{ [] }" + child: + schedule: "[{ S2[i0, i1] -> [(i0)]; S1[i0] -> [(i0)] }, { S2[i0, i1] -> [(i1)]; S1[i0] -> [(0)] }]" + options: "{ separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/stride3.c cloog-0.18.4/isl/test_inputs/codegen/cloog/stride3.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/stride3.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/stride3.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,2 +1,2 @@ -for (int c0 = max(m, 1); c0 <= n; c0 += 1) +for (int c0 = max(1, m); c0 <= n; c0 += 1) S1(c0); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/stride3.in cloog-0.18.4/isl/test_inputs/codegen/cloog/stride3.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/stride3.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/stride3.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[m, n] -> { S1[i0] -> [50i0, 0] : i0 >= 1 and i0 <= n and i0 >= m } -[m, n] -> { : } -[m, n] -> { [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/stride3.st cloog-0.18.4/isl/test_inputs/codegen/cloog/stride3.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/stride3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/stride3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[m, n] -> { S1[i] : i >= 1 and i <= n and i >= m }" +child: + context: "[m, n] -> { [] }" + child: + schedule: "[m, n] -> [{ S1[i0] -> [(50i0)] }]" + options: "[m, n] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/stride4.in cloog-0.18.4/isl/test_inputs/codegen/cloog/stride4.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/stride4.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/stride4.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[t] -> { S1[i0, t] -> [i0, t, 0] : exists (e0 = [(t - i0)/16]: 16e0 = t - i0 and i0 >= 0 and i0 <= 99 and t >= 0 and t <= 15) } -[t] -> { : } -[t] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/stride4.st cloog-0.18.4/isl/test_inputs/codegen/cloog/stride4.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/stride4.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/stride4.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[t] -> { S1[i0, t] : exists (e0 = floor((t - i0)/16): 16e0 = t - i0 and i0 >= 0 and i0 <= 99 and t >= 0 and t <= 15) }" +child: + context: "[t] -> { [] }" + child: + schedule: "[t] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[t] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/stride.in cloog-0.18.4/isl/test_inputs/codegen/cloog/stride.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/stride.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/stride.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[25] -> [25, 0]; S2[i0, i1] -> [i0, j] : 3i1 = i0 and 3j = i0 and i0 >= 3 and i0 <= 100 } -{ : } -{ [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/stride.st cloog-0.18.4/isl/test_inputs/codegen/cloog/stride.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/stride.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/stride.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "{ S2[i0, i1] : 3i1 = i0 and i0 >= 3 and i0 <= 100; S1[25] }" +child: + context: "{ [] }" + child: + schedule: "[{ S2[i0, i1] -> [(i0)]; S1[i0] -> [(i0)] }, { S2[i0, i1] -> [(i1)]; S1[i0] -> [(0)] }]" + options: "{ separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/swim.c cloog-0.18.4/isl/test_inputs/codegen/cloog/swim.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/swim.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/swim.c 2015-07-24 12:23:09.000000000 +0000 @@ -26,13 +26,13 @@ S25(); S26(); S27(); - for (int c1 = 1; c1 <= N; c1 += 1) { - for (int c3 = 1; c3 <= N; c3 += 1) { - S28(c1, c3); - S29(c1, c3); - S30(c1, c3); + for (int c0 = 1; c0 <= N; c0 += 1) { + for (int c1 = 1; c1 <= N; c1 += 1) { + S28(c0, c1); + S29(c0, c1); + S30(c0, c1); } - S31(c1); + S31(c0); } S32(); S33(); @@ -41,119 +41,119 @@ S35(); S36(); S37(); - for (int c1 = 2; c1 <= P; c1 += 1) { - S38(c1); - S39(c1); - for (int c3 = 1; c3 <= Q; c3 += 1) - for (int c5 = 1; c5 <= R; c5 += 1) { - S40(c1, c3, c5); - S41(c1, c3, c5); - S42(c1, c3, c5); - S43(c1, c3, c5); + for (int c0 = 2; c0 <= P; c0 += 1) { + S38(c0); + S39(c0); + for (int c1 = 1; c1 <= Q; c1 += 1) + for (int c2 = 1; c2 <= R; c2 += 1) { + S40(c0, c1, c2); + S41(c0, c1, c2); + S42(c0, c1, c2); + S43(c0, c1, c2); } - for (int c3 = 1; c3 <= Q; c3 += 1) { - S44(c1, c3); - S45(c1, c3); - S46(c1, c3); - S47(c1, c3); - } - for (int c3 = 1; c3 <= R; c3 += 1) { - S48(c1, c3); - S49(c1, c3); - S50(c1, c3); - S51(c1, c3); - } - S52(c1); - S53(c1); - S54(c1); - S55(c1); - S56(c1); - S57(c1); - S58(c1); - for (int c3 = 1; c3 <= Q; c3 += 1) - for (int c5 = 1; c5 <= R; c5 += 1) { - S59(c1, c3, c5); - S60(c1, c3, c5); - S61(c1, c3, c5); + for (int c1 = 1; c1 <= Q; c1 += 1) { + S44(c0, c1); + S45(c0, c1); + S46(c0, c1); + S47(c0, c1); + } + for (int c1 = 1; c1 <= R; c1 += 1) { + S48(c0, c1); + S49(c0, c1); + S50(c0, c1); + S51(c0, c1); + } + S52(c0); + S53(c0); + S54(c0); + S55(c0); + S56(c0); + S57(c0); + S58(c0); + for (int c1 = 1; c1 <= Q; c1 += 1) + for (int c2 = 1; c2 <= R; c2 += 1) { + S59(c0, c1, c2); + S60(c0, c1, c2); + S61(c0, c1, c2); } - for (int c3 = 1; c3 <= Q; c3 += 1) { - S62(c1, c3); - S63(c1, c3); - S64(c1, c3); - } - for (int c3 = 1; c3 <= R; c3 += 1) { - S65(c1, c3); - S66(c1, c3); - S67(c1, c3); - } - S68(c1); - S69(c1); - S70(c1); - S71(c1); - S72(c1); - S73(c1); - S74(c1); - S75(c1); - S76(c1); - S77(c1); - S78(c1); - S79(c1); - S80(c1); - S81(c1); - S82(c1); - S83(c1); - S84(c1); - S85(c1); - S86(c1); - S87(c1); - S88(c1); - S89(c1); - S90(c1); - S91(c1); - S92(c1); - S93(c1); - S94(c1); - for (int c3 = 1; c3 <= N; c3 += 1) { - for (int c5 = 1; c5 <= N; c5 += 1) { - S95(c1, c3, c5); - S96(c1, c3, c5); - S97(c1, c3, c5); + for (int c1 = 1; c1 <= Q; c1 += 1) { + S62(c0, c1); + S63(c0, c1); + S64(c0, c1); + } + for (int c1 = 1; c1 <= R; c1 += 1) { + S65(c0, c1); + S66(c0, c1); + S67(c0, c1); + } + S68(c0); + S69(c0); + S70(c0); + S71(c0); + S72(c0); + S73(c0); + S74(c0); + S75(c0); + S76(c0); + S77(c0); + S78(c0); + S79(c0); + S80(c0); + S81(c0); + S82(c0); + S83(c0); + S84(c0); + S85(c0); + S86(c0); + S87(c0); + S88(c0); + S89(c0); + S90(c0); + S91(c0); + S92(c0); + S93(c0); + S94(c0); + for (int c1 = 1; c1 <= N; c1 += 1) { + for (int c2 = 1; c2 <= N; c2 += 1) { + S95(c0, c1, c2); + S96(c0, c1, c2); + S97(c0, c1, c2); } - S98(c1, c3); + S98(c0, c1); } - S99(c1); - S100(c1); - S101(c1); - for (int c3 = 1; c3 <= Q; c3 += 1) - for (int c5 = 1; c5 <= R; c5 += 1) { - S102(c1, c3, c5); - S103(c1, c3, c5); - S104(c1, c3, c5); - S105(c1, c3, c5); - S106(c1, c3, c5); - S107(c1, c3, c5); + S99(c0); + S100(c0); + S101(c0); + for (int c1 = 1; c1 <= Q; c1 += 1) + for (int c2 = 1; c2 <= R; c2 += 1) { + S102(c0, c1, c2); + S103(c0, c1, c2); + S104(c0, c1, c2); + S105(c0, c1, c2); + S106(c0, c1, c2); + S107(c0, c1, c2); } - for (int c3 = 1; c3 <= Q; c3 += 1) { - S108(c1, c3); - S109(c1, c3); - S110(c1, c3); - S111(c1, c3); - S112(c1, c3); - S113(c1, c3); - } - for (int c3 = 1; c3 <= R; c3 += 1) { - S114(c1, c3); - S115(c1, c3); - S116(c1, c3); - S117(c1, c3); - S118(c1, c3); - S119(c1, c3); - } - S120(c1); - S121(c1); - S122(c1); - S123(c1); - S124(c1); - S125(c1); + for (int c1 = 1; c1 <= Q; c1 += 1) { + S108(c0, c1); + S109(c0, c1); + S110(c0, c1); + S111(c0, c1); + S112(c0, c1); + S113(c0, c1); + } + for (int c1 = 1; c1 <= R; c1 += 1) { + S114(c0, c1); + S115(c0, c1); + S116(c0, c1); + S117(c0, c1); + S118(c0, c1); + S119(c0, c1); + } + S120(c0); + S121(c0); + S122(c0); + S123(c0); + S124(c0); + S125(c0); } } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/swim.in cloog-0.18.4/isl/test_inputs/codegen/cloog/swim.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/swim.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/swim.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N, O, P, Q, R] -> { S84[i0] -> [34, i0, 31, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S6[] -> [5, 0, 0, 0, 0, 0, 0] : M = 1; S25[] -> [24, 0, 0, 0, 0, 0, 0] : M = 1; S115[i0, i1] -> [34, i0, 48, i1, 1, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S64[i0, i1] -> [34, i0, 13, i1, 2, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S62[i0, i1] -> [34, i0, 13, i1, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S40[i0, i1, i2] -> [34, i0, 2, i1, 0, i2, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S123[i0] -> [34, i0, 52, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S5[] -> [4, 0, 0, 0, 0, 0, 0] : M = 1; S15[] -> [14, 0, 0, 0, 0, 0, 0] : M = 1; S76[i0] -> [34, i0, 23, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S39[i0] -> [34, i0, 1, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S13[] -> [12, 0, 0, 0, 0, 0, 0] : M = 1; S28[i0, i1] -> [27, i0, 0, i1, 0, 0, 0] : M = 1 and i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= N; S70[i0] -> [34, i0, 17, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S53[i0] -> [34, i0, 6, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S121[i0] -> [34, i0, 50, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S47[i0, i1] -> [34, i0, 3, i1, 3, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S59[i0, i1, i2] -> [34, i0, 12, i1, 0, i2, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S71[i0] -> [34, i0, 18, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S77[i0] -> [34, i0, 24, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S63[i0, i1] -> [34, i0, 13, i1, 1, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S51[i0, i1] -> [34, i0, 4, i1, 3, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S100[i0] -> [34, i0, 44, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S22[] -> [21, 0, 0, 0, 0, 0, 0] : M = 1; S95[i0, i1, i2] -> [34, i0, 42, i1, 0, i2, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= N and i2 >= 1 and i2 <= N; S8[] -> [7, 0, 0, 0, 0, 0, 0] : M = 1; S120[i0] -> [34, i0, 49, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S50[i0, i1] -> [34, i0, 4, i1, 2, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S45[i0, i1] -> [34, i0, 3, i1, 1, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S72[i0] -> [34, i0, 19, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S52[i0] -> [34, i0, 5, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S7[] -> [6, 0, 0, 0, 0, 0, 0] : M = 1; S78[i0] -> [34, i0, 25, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S110[i0, i1] -> [34, i0, 47, i1, 2, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S124[i0] -> [34, i0, 53, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S60[i0, i1, i2] -> [34, i0, 12, i1, 0, i2, 1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S27[] -> [26, 0, 0, 0, 0, 0, 0] : M = 1; S114[i0, i1] -> [34, i0, 48, i1, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S49[i0, i1] -> [34, i0, 4, i1, 1, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S94[i0] -> [34, i0, 41, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S57[i0] -> [34, i0, 10, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S66[i0, i1] -> [34, i0, 14, i1, 1, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S18[] -> [17, 0, 0, 0, 0, 0, 0] : M = 1; S92[i0] -> [34, i0, 39, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S3[] -> [2, 0, 0, 0, 0, 0, 0] : M = 1; S35[] -> [31, 0, 0, 0, 0, 0, 0] : M = 1 and O <= 1; S36[] -> [32, 0, 0, 0, 0, 0, 0] : M = 1; S10[] -> [9, 0, 0, 0, 0, 0, 0] : M = 1; S2[] -> [1, 0, 0, 0, 0, 0, 0] : M = 1; S48[i0, i1] -> [34, i0, 4, i1, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S30[i0, i1] -> [27, i0, 0, i1, 2, 0, 0] : M = 1 and i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= N; S75[i0] -> [34, i0, 22, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S83[i0] -> [34, i0, 30, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S87[i0] -> [34, i0, 34, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S88[i0] -> [34, i0, 35, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S33[] -> [29, 0, 0, 0, 0, 0, 0] : M = 1; S101[i0] -> [34, i0, 45, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S21[] -> [20, 0, 0, 0, 0, 0, 0] : M = 1; S32[] -> [28, 0, 0, 0, 0, 0, 0] : M = 1; S118[i0, i1] -> [34, i0, 48, i1, 4, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S79[i0] -> [34, i0, 26, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S38[i0] -> [34, i0, 0, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S108[i0, i1] -> [34, i0, 47, i1, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S65[i0, i1] -> [34, i0, 14, i1, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S91[i0] -> [34, i0, 38, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S17[] -> [16, 0, 0, 0, 0, 0, 0] : M = 1; S80[i0] -> [34, i0, 27, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S54[i0] -> [34, i0, 7, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S46[i0, i1] -> [34, i0, 3, i1, 2, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S68[i0] -> [34, i0, 15, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S116[i0, i1] -> [34, i0, 48, i1, 2, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S43[i0, i1, i2] -> [34, i0, 2, i1, 0, i2, 3] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S26[] -> [25, 0, 0, 0, 0, 0, 0] : M = 1; S31[i0] -> [27, i0, 1, 0, 0, 0, 0] : M = 1 and i0 >= 1 and i0 <= N; S69[i0] -> [34, i0, 16, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S24[] -> [23, 0, 0, 0, 0, 0, 0] : M = 1; S90[i0] -> [34, i0, 37, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S89[i0] -> [34, i0, 36, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S82[i0] -> [34, i0, 29, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S67[i0, i1] -> [34, i0, 14, i1, 2, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S58[i0] -> [34, i0, 11, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S109[i0, i1] -> [34, i0, 47, i1, 1, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S122[i0] -> [34, i0, 51, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S61[i0, i1, i2] -> [34, i0, 12, i1, 0, i2, 2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S1[] -> [0, 0, 0, 0, 0, 0, 0] : M = 1; S4[] -> [3, 0, 0, 0, 0, 0, 0] : M = 1; S86[i0] -> [34, i0, 33, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S14[] -> [13, 0, 0, 0, 0, 0, 0] : M = 1; S93[i0] -> [34, i0, 40, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S56[i0] -> [34, i0, 9, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S37[] -> [33, 0, 0, 0, 0, 0, 0] : M = 1; S125[i0] -> [34, i0, 54, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S96[i0, i1, i2] -> [34, i0, 42, i1, 0, i2, 1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= N and i2 >= 1 and i2 <= N; S9[] -> [8, 0, 0, 0, 0, 0, 0] : M = 1; S41[i0, i1, i2] -> [34, i0, 2, i1, 0, i2, 1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S102[i0, i1, i2] -> [34, i0, 46, i1, 0, i2, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S112[i0, i1] -> [34, i0, 47, i1, 4, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S16[] -> [15, 0, 0, 0, 0, 0, 0] : M = 1; S85[i0] -> [34, i0, 32, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S42[i0, i1, i2] -> [34, i0, 2, i1, 0, i2, 2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S12[] -> [11, 0, 0, 0, 0, 0, 0] : M = 1; S55[i0] -> [34, i0, 8, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S11[] -> [10, 0, 0, 0, 0, 0, 0] : M = 1; S19[] -> [18, 0, 0, 0, 0, 0, 0] : M = 1; S107[i0, i1, i2] -> [34, i0, 46, i1, 0, i2, 5] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S98[i0, i1] -> [34, i0, 42, i1, 1, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= N; S104[i0, i1, i2] -> [34, i0, 46, i1, 0, i2, 2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S29[i0, i1] -> [27, i0, 0, i1, 1, 0, 0] : M = 1 and i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= N; S20[] -> [19, 0, 0, 0, 0, 0, 0] : M = 1; S103[i0, i1, i2] -> [34, i0, 46, i1, 0, i2, 1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S105[i0, i1, i2] -> [34, i0, 46, i1, 0, i2, 3] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S97[i0, i1, i2] -> [34, i0, 42, i1, 0, i2, 2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= N and i2 >= 1 and i2 <= N; S44[i0, i1] -> [34, i0, 3, i1, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S106[i0, i1, i2] -> [34, i0, 46, i1, 0, i2, 4] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S34[] -> [30, 0, 0, 0, 0, 0, 0] : M = 1; S111[i0, i1] -> [34, i0, 47, i1, 3, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S99[i0] -> [34, i0, 43, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S81[i0] -> [34, i0, 28, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S23[] -> [22, 0, 0, 0, 0, 0, 0] : M = 1; S117[i0, i1] -> [34, i0, 48, i1, 3, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S74[i0] -> [34, i0, 21, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S113[i0, i1] -> [34, i0, 47, i1, 5, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S119[i0, i1] -> [34, i0, 48, i1, 5, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S73[i0] -> [34, i0, 20, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P } -[M, N, O, P, Q, R] -> { : } -[M, N, O, P, Q, R] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/swim.st cloog-0.18.4/isl/test_inputs/codegen/cloog/swim.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/swim.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/swim.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,223 @@ +domain: "[M, N, O, P, Q, R] -> { S40[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S106[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S99[i0] : M = 1 and i0 >= 2 and i0 <= P; S83[i0] : M = 1 and i0 >= 2 and i0 <= P; S86[i0] : M = 1 and i0 >= 2 and i0 <= P; S56[i0] : M = 1 and i0 >= 2 and i0 <= P; S124[i0] : M = 1 and i0 >= 2 and i0 <= P; S66[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S46[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S64[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S22[] : M = 1; S15[] : M = 1; S30[i0, i1] : M = 1 and i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= N; S14[] : M = 1; S12[] : M = 1; S87[i0] : M = 1 and i0 >= 2 and i0 <= P; S110[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S73[i0] : M = 1 and i0 >= 2 and i0 <= P; S44[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S31[i0] : M = 1 and i0 >= 1 and i0 <= N; S118[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S8[] : M = 1; S125[i0] : M = 1 and i0 >= 2 and i0 <= P; S63[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S25[] : M = 1; S51[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S91[i0] : M = 1 and i0 >= 2 and i0 <= P; S84[i0] : M = 1 and i0 >= 2 and i0 <= P; S35[] : M = 1 and O <= 1; S97[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= N and i2 >= 1 and i2 <= N; S75[i0] : M = 1 and i0 >= 2 and i0 <= P; S19[] : M = 1; S50[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S114[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S13[] : M = 1; S72[i0] : M = 1 and i0 >= 2 and i0 <= P; S78[i0] : M = 1 and i0 >= 2 and i0 <= P; S39[i0] : M = 1 and i0 >= 2 and i0 <= P; S102[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S107[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S68[i0] : M = 1 and i0 >= 2 and i0 <= P; S32[] : M = 1; S41[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S69[i0] : M = 1 and i0 >= 2 and i0 <= P; S3[] : M = 1; S100[i0] : M = 1 and i0 >= 2 and i0 <= P; S11[] : M = 1; S76[i0] : M = 1 and i0 >= 2 and i0 <= P; S88[i0] : M = 1 and i0 >= 2 and i0 <= P; S49[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S45[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S10[] : M = 1; S80[i0] : M = 1 and i0 >= 2 and i0 <= P; S61[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S67[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S70[i0] : M = 1 and i0 >= 2 and i0 <= P; S29[i0, i1] : M = 1 and i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= N; S60[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S21[] : M = 1; S92[i0] : M = 1 and i0 >= 2 and i0 <= P; S47[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S24[] : M = 1; S16[] : M = 1; S105[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S18[] : M = 1; S48[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S5[] : M = 1; S113[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S7[] : M = 1; S38[i0] : M = 1 and i0 >= 2 and i0 <= P; S54[i0] : M = 1 and i0 >= 2 and i0 <= P; S109[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S23[] : M = 1; S82[i0] : M = 1 and i0 >= 2 and i0 <= P; S59[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S77[i0] : M = 1 and i0 >= 2 and i0 <= P; S101[i0] : M = 1 and i0 >= 2 and i0 <= P; S37[] : M = 1; S71[i0] : M = 1 and i0 >= 2 and i0 <= P; S121[i0] : M = 1 and i0 >= 2 and i0 <= P; S115[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S104[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S94[i0] : M = 1 and i0 >= 2 and i0 <= P; S6[] : M = 1; S43[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S1[] : M = 1; S98[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= N; S55[i0] : M = 1 and i0 >= 2 and i0 <= P; S58[i0] : M = 1 and i0 >= 2 and i0 <= P; S42[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S89[i0] : M = 1 and i0 >= 2 and i0 <= P; S53[i0] : M = 1 and i0 >= 2 and i0 <= P; S111[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S52[i0] : M = 1 and i0 >= 2 and i0 <= P; S85[i0] : M = 1 and i0 >= 2 and i0 <= P; S26[] : M = 1; S79[i0] : M = 1 and i0 >= 2 and i0 <= P; S81[i0] : M = 1 and i0 >= 2 and i0 <= P; S57[i0] : M = 1 and i0 >= 2 and i0 <= P; S4[] : M = 1; S123[i0] : M = 1 and i0 >= 2 and i0 <= P; S36[] : M = 1; S65[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S34[] : M = 1; S119[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S9[] : M = 1; S28[i0, i1] : M = 1 and i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= N; S20[] : M = 1; S117[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S112[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S103[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S17[] : M = 1; S96[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= N and i2 >= 1 and i2 <= N; S95[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= N and i2 >= 1 and i2 <= N; S62[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S90[i0] : M = 1 and i0 >= 2 and i0 <= P; S120[i0] : M = 1 and i0 >= 2 and i0 <= P; S116[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S108[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S74[i0] : M = 1 and i0 >= 2 and i0 <= P; S93[i0] : M = 1 and i0 >= 2 and i0 <= P; S2[] : M = 1; S27[] : M = 1; S122[i0] : M = 1 and i0 >= 2 and i0 <= P; S33[] : M = 1 }" +child: + context: "[M, N, O, P, Q, R] -> { [] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S1[] }" + - filter: "[M, N, O, P, Q, R] -> { S2[] }" + - filter: "[M, N, O, P, Q, R] -> { S3[] }" + - filter: "[M, N, O, P, Q, R] -> { S4[] }" + - filter: "[M, N, O, P, Q, R] -> { S5[] }" + - filter: "[M, N, O, P, Q, R] -> { S6[] }" + - filter: "[M, N, O, P, Q, R] -> { S7[] }" + - filter: "[M, N, O, P, Q, R] -> { S8[] }" + - filter: "[M, N, O, P, Q, R] -> { S9[] }" + - filter: "[M, N, O, P, Q, R] -> { S10[] }" + - filter: "[M, N, O, P, Q, R] -> { S11[] }" + - filter: "[M, N, O, P, Q, R] -> { S12[] }" + - filter: "[M, N, O, P, Q, R] -> { S13[] }" + - filter: "[M, N, O, P, Q, R] -> { S14[] }" + - filter: "[M, N, O, P, Q, R] -> { S15[] }" + - filter: "[M, N, O, P, Q, R] -> { S16[] }" + - filter: "[M, N, O, P, Q, R] -> { S17[] }" + - filter: "[M, N, O, P, Q, R] -> { S18[] }" + - filter: "[M, N, O, P, Q, R] -> { S19[] }" + - filter: "[M, N, O, P, Q, R] -> { S20[] }" + - filter: "[M, N, O, P, Q, R] -> { S21[] }" + - filter: "[M, N, O, P, Q, R] -> { S22[] }" + - filter: "[M, N, O, P, Q, R] -> { S23[] }" + - filter: "[M, N, O, P, Q, R] -> { S24[] }" + - filter: "[M, N, O, P, Q, R] -> { S25[] }" + - filter: "[M, N, O, P, Q, R] -> { S26[] }" + - filter: "[M, N, O, P, Q, R] -> { S27[] }" + - filter: "[M, N, O, P, Q, R] -> { S30[i0, i1]; S28[i0, i1]; S31[i0]; S29[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S31[i0] -> [(i0)]; S29[i0, i1] -> [(i0)]; S30[i0, i1] -> [(i0)]; S28[i0, i1] -> [(i0)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S30[i0, i1]; S28[i0, i1]; S29[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S29[i0, i1] -> [(i1)]; S30[i0, i1] -> [(i1)]; S28[i0, i1] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S28[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S29[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S30[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S31[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S32[] }" + - filter: "[M, N, O, P, Q, R] -> { S33[] }" + - filter: "[M, N, O, P, Q, R] -> { S34[] }" + - filter: "[M, N, O, P, Q, R] -> { S35[] }" + - filter: "[M, N, O, P, Q, R] -> { S36[] }" + - filter: "[M, N, O, P, Q, R] -> { S37[] }" + - filter: "[M, N, O, P, Q, R] -> { S58[i0]; S116[i0, i1]; S120[i0]; S106[i0, i1, i2]; S102[i0, i1, i2]; S114[i0, i1]; S113[i0, i1]; S122[i0]; S83[i0]; S103[i0, i1, i2]; S71[i0]; S50[i0, i1]; S98[i0, i1]; S65[i0, i1]; S82[i0]; S109[i0, i1]; S51[i0, i1]; S60[i0, i1, i2]; S91[i0]; S78[i0]; S101[i0]; S123[i0]; S111[i0, i1]; S97[i0, i1, i2]; S67[i0, i1]; S117[i0, i1]; S88[i0]; S79[i0]; S46[i0, i1]; S56[i0]; S45[i0, i1]; S74[i0]; S49[i0, i1]; S75[i0]; S115[i0, i1]; S119[i0, i1]; S42[i0, i1, i2]; S57[i0]; S62[i0, i1]; S99[i0]; S107[i0, i1, i2]; S100[i0]; S104[i0, i1, i2]; S70[i0]; S89[i0]; S125[i0]; S44[i0, i1]; S93[i0]; S90[i0]; S84[i0]; S105[i0, i1, i2]; S95[i0, i1, i2]; S66[i0, i1]; S77[i0]; S38[i0]; S41[i0, i1, i2]; S92[i0]; S87[i0]; S47[i0, i1]; S108[i0, i1]; S54[i0]; S76[i0]; S112[i0, i1]; S80[i0]; S55[i0]; S39[i0]; S59[i0, i1, i2]; S121[i0]; S86[i0]; S110[i0, i1]; S48[i0, i1]; S68[i0]; S53[i0]; S72[i0]; S85[i0]; S52[i0]; S69[i0]; S61[i0, i1, i2]; S43[i0, i1, i2]; S124[i0]; S73[i0]; S81[i0]; S63[i0, i1]; S118[i0, i1]; S96[i0, i1, i2]; S40[i0, i1, i2]; S94[i0]; S64[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S99[i0] -> [(i0)]; S97[i0, i1, i2] -> [(i0)]; S53[i0] -> [(i0)]; S101[i0] -> [(i0)]; S60[i0, i1, i2] -> [(i0)]; S40[i0, i1, i2] -> [(i0)]; S103[i0, i1, i2] -> [(i0)]; S55[i0] -> [(i0)]; S89[i0] -> [(i0)]; S56[i0] -> [(i0)]; S87[i0] -> [(i0)]; S115[i0, i1] -> [(i0)]; S123[i0] -> [(i0)]; S88[i0] -> [(i0)]; S70[i0] -> [(i0)]; S59[i0, i1, i2] -> [(i0)]; S52[i0] -> [(i0)]; S54[i0] -> [(i0)]; S63[i0, i1] -> [(i0)]; S92[i0] -> [(i0)]; S93[i0] -> [(i0)]; S119[i0, i1] -> [(i0)]; S76[i0] -> [(i0)]; S57[i0] -> [(i0)]; S44[i0, i1] -> [(i0)]; S79[i0] -> [(i0)]; S61[i0, i1, i2] -> [(i0)]; S69[i0] -> [(i0)]; S117[i0, i1] -> [(i0)]; S121[i0] -> [(i0)]; S84[i0] -> [(i0)]; S83[i0] -> [(i0)]; S43[i0, i1, i2] -> [(i0)]; S98[i0, i1] -> [(i0)]; S78[i0] -> [(i0)]; S114[i0, i1] -> [(i0)]; S66[i0, i1] -> [(i0)]; S77[i0] -> [(i0)]; S109[i0, i1] -> [(i0)]; S42[i0, i1, i2] -> [(i0)]; S58[i0] -> [(i0)]; S71[i0] -> [(i0)]; S68[i0] -> [(i0)]; S116[i0, i1] -> [(i0)]; S81[i0] -> [(i0)]; S125[i0] -> [(i0)]; S80[i0] -> [(i0)]; S73[i0] -> [(i0)]; S110[i0, i1] -> [(i0)]; S72[i0] -> [(i0)]; S51[i0, i1] -> [(i0)]; S122[i0] -> [(i0)]; S38[i0] -> [(i0)]; S39[i0] -> [(i0)]; S90[i0] -> [(i0)]; S113[i0, i1] -> [(i0)]; S46[i0, i1] -> [(i0)]; S47[i0, i1] -> [(i0)]; S96[i0, i1, i2] -> [(i0)]; S45[i0, i1] -> [(i0)]; S49[i0, i1] -> [(i0)]; S118[i0, i1] -> [(i0)]; S50[i0, i1] -> [(i0)]; S102[i0, i1, i2] -> [(i0)]; S112[i0, i1] -> [(i0)]; S86[i0] -> [(i0)]; S124[i0] -> [(i0)]; S41[i0, i1, i2] -> [(i0)]; S100[i0] -> [(i0)]; S104[i0, i1, i2] -> [(i0)]; S75[i0] -> [(i0)]; S62[i0, i1] -> [(i0)]; S85[i0] -> [(i0)]; S105[i0, i1, i2] -> [(i0)]; S82[i0] -> [(i0)]; S111[i0, i1] -> [(i0)]; S48[i0, i1] -> [(i0)]; S65[i0, i1] -> [(i0)]; S120[i0] -> [(i0)]; S107[i0, i1, i2] -> [(i0)]; S106[i0, i1, i2] -> [(i0)]; S95[i0, i1, i2] -> [(i0)]; S108[i0, i1] -> [(i0)]; S91[i0] -> [(i0)]; S67[i0, i1] -> [(i0)]; S74[i0] -> [(i0)]; S64[i0, i1] -> [(i0)]; S94[i0] -> [(i0)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S38[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S39[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S40[i0, i1, i2]; S41[i0, i1, i2]; S43[i0, i1, i2]; S42[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S43[i0, i1, i2] -> [(i1)]; S41[i0, i1, i2] -> [(i1)]; S40[i0, i1, i2] -> [(i1)]; S42[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S43[i0, i1, i2] -> [(i2)]; S41[i0, i1, i2] -> [(i2)]; S40[i0, i1, i2] -> [(i2)]; S42[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S40[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S41[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S42[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S43[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S46[i0, i1]; S45[i0, i1]; S44[i0, i1]; S47[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S47[i0, i1] -> [(i1)]; S46[i0, i1] -> [(i1)]; S44[i0, i1] -> [(i1)]; S45[i0, i1] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S44[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S45[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S46[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S47[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S51[i0, i1]; S49[i0, i1]; S50[i0, i1]; S48[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S51[i0, i1] -> [(i1)]; S49[i0, i1] -> [(i1)]; S48[i0, i1] -> [(i1)]; S50[i0, i1] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S48[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S49[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S50[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S51[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S52[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S53[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S54[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S55[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S56[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S57[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S58[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S60[i0, i1, i2]; S59[i0, i1, i2]; S61[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S61[i0, i1, i2] -> [(i1)]; S59[i0, i1, i2] -> [(i1)]; S60[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S61[i0, i1, i2] -> [(i2)]; S59[i0, i1, i2] -> [(i2)]; S60[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S59[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S60[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S61[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S62[i0, i1]; S63[i0, i1]; S64[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S64[i0, i1] -> [(i1)]; S62[i0, i1] -> [(i1)]; S63[i0, i1] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S62[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S63[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S64[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S65[i0, i1]; S66[i0, i1]; S67[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S66[i0, i1] -> [(i1)]; S65[i0, i1] -> [(i1)]; S67[i0, i1] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S65[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S66[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S67[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S68[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S69[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S70[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S71[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S72[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S73[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S74[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S75[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S76[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S77[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S78[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S79[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S80[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S81[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S82[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S83[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S84[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S85[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S86[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S87[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S88[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S89[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S90[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S91[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S92[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S93[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S94[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S96[i0, i1, i2]; S98[i0, i1]; S97[i0, i1, i2]; S95[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S98[i0, i1] -> [(i1)]; S95[i0, i1, i2] -> [(i1)]; S96[i0, i1, i2] -> [(i1)]; S97[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S96[i0, i1, i2]; S97[i0, i1, i2]; S95[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S95[i0, i1, i2] -> [(i2)]; S96[i0, i1, i2] -> [(i2)]; S97[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S95[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S96[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S97[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S98[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S99[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S100[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S101[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S107[i0, i1, i2]; S105[i0, i1, i2]; S102[i0, i1, i2]; S104[i0, i1, i2]; S106[i0, i1, i2]; S103[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S102[i0, i1, i2] -> [(i1)]; S103[i0, i1, i2] -> [(i1)]; S104[i0, i1, i2] -> [(i1)]; S107[i0, i1, i2] -> [(i1)]; S106[i0, i1, i2] -> [(i1)]; S105[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S102[i0, i1, i2] -> [(i2)]; S103[i0, i1, i2] -> [(i2)]; S104[i0, i1, i2] -> [(i2)]; S107[i0, i1, i2] -> [(i2)]; S106[i0, i1, i2] -> [(i2)]; S105[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S102[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S103[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S104[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S105[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S106[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S107[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S113[i0, i1]; S112[i0, i1]; S108[i0, i1]; S111[i0, i1]; S110[i0, i1]; S109[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S110[i0, i1] -> [(i1)]; S112[i0, i1] -> [(i1)]; S111[i0, i1] -> [(i1)]; S113[i0, i1] -> [(i1)]; S109[i0, i1] -> [(i1)]; S108[i0, i1] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S108[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S109[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S110[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S111[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S112[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S113[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S119[i0, i1]; S114[i0, i1]; S117[i0, i1]; S115[i0, i1]; S118[i0, i1]; S116[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S115[i0, i1] -> [(i1)]; S116[i0, i1] -> [(i1)]; S118[i0, i1] -> [(i1)]; S117[i0, i1] -> [(i1)]; S119[i0, i1] -> [(i1)]; S114[i0, i1] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S114[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S115[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S116[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S117[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S118[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S119[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S120[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S121[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S122[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S123[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S124[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S125[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/test.in cloog-0.18.4/isl/test_inputs/codegen/cloog/test.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/test.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/test.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0, i1] -> [i0, i1, 0] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S2[i0, i0] -> [i0, i0, 1] : i0 >= 3 and i0 <= N } -[M, N] -> { : N >= M and M >= 4 } -[M, N] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/test.st cloog-0.18.4/isl/test_inputs/codegen/cloog/test.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/test.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/test.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "[M, N] -> { S1[i0, i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S2[i0, i0] : i0 >= 3 and i0 <= N }" +child: + context: "[M, N] -> { [] : N >= M and M >= 4 }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1] }" + - filter: "[M, N] -> { S2[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/thomasset.c cloog-0.18.4/isl/test_inputs/codegen/cloog/thomasset.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/thomasset.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/thomasset.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,6 +1,6 @@ { for (int c0 = 0; c0 <= floord(n - 1, 3); c0 += 1) - for (int c2 = 3 * c0 + 1; c2 <= min(3 * c0 + 3, n); c2 += 1) + for (int c2 = 3 * c0 + 1; c2 <= min(n, 3 * c0 + 3); c2 += 1) S1(c2, c0); for (int c0 = floord(n, 3); c0 <= 2 * floord(n, 3); c0 += 1) for (int c1 = 0; c1 < n; c1 += 1) diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/thomasset.in cloog-0.18.4/isl/test_inputs/codegen/cloog/thomasset.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/thomasset.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/thomasset.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n] -> { S2[i0, i1, 0, i3, i4] -> [i3 + i4, -1 + i0] : i0 <= n and i1 <= n and i1 >= 1 and i0 >= 1 and 3i4 <= i1 and 3i4 >= -2 + i1 and 3i3 <= n and 3i3 >= -2 + n; S1[i0, i1] -> [i1, 0] : i0 <= n and i0 >= 1 and 3i1 <= -1 + i0 and 3i1 >= -3 + i0 } -[n] -> { : } -[n] -> { [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/thomasset.st cloog-0.18.4/isl/test_inputs/codegen/cloog/thomasset.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/thomasset.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/thomasset.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[i, j] : i <= n and i >= 1 and 3j <= -1 + i and 3j >= -3 + i; S2[i, j, 0, p, q] : i <= n and j <= n and j >= 1 and i >= 1 and 3q <= j and 3q >= -2 + j and 3p <= n and 3p >= -2 + n }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S2[i0, i1, i2, i3, i4] -> [(i2 + i3 + i4)]; S1[i0, i1] -> [(i1)] }, { S2[i0, i1, i2, i3, i4] -> [(-1 + i0)]; S1[i0, i1] -> [(0)] }]" + options: "[n] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/tiling.c cloog-0.18.4/isl/test_inputs/codegen/cloog/tiling.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/tiling.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/tiling.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,3 +1,3 @@ for (int c0 = 0; c0 <= n / 10; c0 += 1) - for (int c1 = 10 * c0; c1 <= min(10 * c0 + 9, n); c1 += 1) + for (int c1 = 10 * c0; c1 <= min(n, 10 * c0 + 9); c1 += 1) S1(c0, c1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/tiling.in cloog-0.18.4/isl/test_inputs/codegen/cloog/tiling.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/tiling.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/tiling.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n] -> { S1[ii, i] -> [ii, i, 0] : i >= 0 and i <= n and i <= 9 + 10ii and i >= 10ii } -[n] -> { : n >= 0 } -[n] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/tiling.st cloog-0.18.4/isl/test_inputs/codegen/cloog/tiling.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/tiling.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/tiling.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[ii, i] : i >= 0 and i <= n and i <= 9 + 10ii and i >= 10ii }" +child: + context: "[n] -> { [] : n >= 0 }" + child: + schedule: "[n] -> [{ S1[ii, i] -> [(ii)] }, { S1[ii, i] -> [(i)] }]" + options: "[n] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/uday_scalars.c cloog-0.18.4/isl/test_inputs/codegen/cloog/uday_scalars.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/uday_scalars.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/uday_scalars.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,6 +1,6 @@ { - for (int c2 = 0; c2 <= n; c2 += 1) - S1(c2, 0, 0); - for (int c2 = 0; c2 <= n; c2 += 1) - S2(0, c2, 0); + for (int c0 = 0; c0 <= n; c0 += 1) + S1(c0, 0, 0); + for (int c0 = 0; c0 <= n; c0 += 1) + S2(0, c0, 0); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/uday_scalars.in cloog-0.18.4/isl/test_inputs/codegen/cloog/uday_scalars.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/uday_scalars.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/uday_scalars.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n] -> { S1[i0, 0, 0] -> [0, 1, i0, 0] : i0 >= 0 and i0 <= n; S2[0, i1, 0] -> [1, 0, i1, 1] : i1 >= 0 and i1 <= n } -[n] -> { : } -[n] -> { [i, j, k, l] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/uday_scalars.st cloog-0.18.4/isl/test_inputs/codegen/cloog/uday_scalars.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/uday_scalars.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/uday_scalars.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,13 @@ +domain: "[n] -> { S1[j, 0, 0] : j >= 0 and j <= n; S2[0, l, 0] : l >= 0 and l <= n }" +child: + context: "[n] -> { [] }" + child: + sequence: + - filter: "[n] -> { S1[i0, i1, i2] }" + child: + schedule: "[n] -> [{ S1[i0, i1, i2] -> [(i0)] }]" + options: "[n] -> { separate[i0] }" + - filter: "[n] -> { S2[i0, i1, i2] }" + child: + schedule: "[n] -> [{ S2[i0, i1, i2] -> [(i1)] }]" + options: "[n] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/union.in cloog-0.18.4/isl/test_inputs/codegen/cloog/union.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/union.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/union.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S1[i0] -> [i0] : M <= 10 and i0 >= 0 and i0 <= 100; S1[i0] -> [-i0] : M >= 11 and i0 >= 0 and i0 <= 100 } -[M] -> { : M >= 1 or M <= -1 } -[M] -> { [i] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/union.st cloog-0.18.4/isl/test_inputs/codegen/cloog/union.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/union.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/union.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0] : i0 >= 0 and i0 <= 100 }" +child: + context: "[M] -> { [] : M >= 1 or M <= -1 }" + child: + schedule: "[M] -> [{ S1[i0] -> [(i0)] : M <= 10; S1[i0] -> [(-i0)] : M >= 11 }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/unroll2.c cloog-0.18.4/isl/test_inputs/codegen/cloog/unroll2.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/unroll2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/unroll2.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,6 +1,5 @@ -{ - if (n <= 9 && n >= 0) +if (n >= -1 && n <= 9) { + if (n >= 0) S1(n); - if (n <= 9 && n >= -1) - S1(n + 1); + S1(n + 1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/unroll2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/unroll2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/unroll2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/unroll2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n] -> { S1[i] -> [i, 0] : i >= n and i <= 1 + n and n <= 9 and i >= 0 } -[n] -> { : } -[n] -> { [i, j] -> unroll[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/unroll2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/unroll2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/unroll2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/unroll2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[i] : i >= n and i <= 1 + n and n <= 9 and i >= 0 }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S1[i] -> [(i)] }]" + options: "[n] -> { unroll[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/unroll.in cloog-0.18.4/isl/test_inputs/codegen/cloog/unroll.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/unroll.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/unroll.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n] -> { S1[i] -> [i, 0] : i >= 0 and i <= 10 } -[n] -> { : } -[n] -> { [i, j] -> unroll[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/unroll.st cloog-0.18.4/isl/test_inputs/codegen/cloog/unroll.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/unroll.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/unroll.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[i] : i >= 0 and i <= 10 }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S1[i] -> [(i)] }]" + options: "[n] -> { unroll[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/usvd_e_t.in cloog-0.18.4/isl/test_inputs/codegen/cloog/usvd_e_t.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/usvd_e_t.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/usvd_e_t.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S19[i0, i1, i2] -> [i0, i1, i2, 18] : i0 >= 8 and i1 >= 1 and i2 <= 0 and i2 >= -10 + i0 and i1 <= -6 + i0; S21[i0, i1, -7 + i0] -> [i0, i1, -7 + i0, 20] : i0 <= 10 and i1 >= 4 and i1 <= 8 and i0 >= 7; S17[i0, i1, -6 + i0] -> [i0, i1, -6 + i0, 16] : i0 >= 7 and i1 >= 4 and i0 <= 10 and i1 <= -2 + i0; S4[i0, i1, -1] -> [i0, i1, -1, 3] : i0 <= 8 and i1 >= 1 and i1 <= -4 + i0; S1[i0, 0, 0] -> [i0, 0, 0, 0] : i0 >= 0 and i0 <= 4; S10[i0, 4, 0] -> [i0, 4, 0, 9] : i0 >= 7 and i0 <= 10; S16[i0, i1, -6 + i0] -> [i0, i1, -6 + i0, 15] : i0 <= 10 and i1 >= 4 and i0 >= 7 and i1 <= -2 + i0; S24[i0, i1, i2] -> [i0, i1, i2, 23] : i0 >= 8 and i1 >= 4 and i1 <= 8 and i2 <= 3 and i2 >= -7 + i0; S23[i0, i1, i2] -> [i0, i1, i2, 22] : i0 <= 9 and i1 >= 4 and i1 <= 8 and i2 >= 0 and i2 <= -7 + i0; S7[i0, i1, 0] -> [i0, i1, 0, 6] : i0 >= 5 and i1 <= 0 and i1 >= -9 + i0; S25[i0, i1, 4] -> [i0, i1, 4, 24] : i0 >= 10 and i0 <= 14 and i1 >= 1 and i1 <= 5; S18[i0, i1, i2] -> [i0, i1, i2, 17] : i0 <= 10 and i1 >= 1 and i2 >= 4 and i2 <= -4 + i0 and i1 <= -5 + i0; S14[i0, i1, i2] -> [i0, i1, i2, 13] : i0 >= 8 and i1 <= 4 and i2 <= 0 and i2 >= -12 + i0 and i1 >= -6 + i0; S6[i0, i1, 0] -> [i0, i1, 0, 5] : i0 <= 8 and i1 >= -4 and i1 <= -9 + i0; S8[i0, i1, 0] -> [i0, i1, 0, 7] : i0 >= 3 and i0 <= 7 and i1 >= 7 and i1 <= 11; S15[i0, i1, i2] -> [i0, i1, i2, 14] : i0 <= 10 and i1 >= 1 and i1 <= 5 and i2 >= 4 and i2 <= -4 + i0; S11[i0, -3 + i0, i2] -> [i0, -3 + i0, i2, 10] : i0 <= 10 and i0 >= 7 and i2 <= 4 and i2 >= -7 + i0; S20[i0, i1, i2] -> [i0, i1, i2, 19] : i0 >= 8 and i1 <= 4 and i2 >= -4 and i2 <= 0 and i1 >= -6 + i0; S12[i0, -2 + i0, i2] -> [i0, -2 + i0, i2, 11] : i0 >= 7 and i0 <= 10 and i2 <= 4 and i2 >= -7 + i0; S9[i0, 4, 0] -> [i0, 4, 0, 8] : i0 >= 7 and i0 <= 10; S22[i0, i1, -7 + i0] -> [i0, i1, -7 + i0, 21] : i0 >= 7 and i1 >= 5 and i1 <= 9 and i0 <= 10; S13[i0, i1, i2] -> [i0, i1, i2, 12] : i0 <= 10 and i1 >= 4 and i2 <= 4 and i2 >= -7 + i0 and i1 <= -4 + i0; S26[i0, i1, 3] -> [i0, i1, 3, 25] : i0 >= 10 and i0 <= 14 and i1 >= 1 and i1 <= 5; S3[i0, 0, 0] -> [i0, 0, 0, 2] : i0 >= 4 and i0 <= 8; S5[i0, i1, 0] -> [i0, i1, 0, 4] : i0 >= 4 and i1 <= 4 and i1 >= -4 + i0; S2[i0, i1, 0] -> [i0, i1, 0, 1] : i0 >= 0 and i0 <= 4 and i1 >= 0 and i1 <= 4 } -{ : } -{ [i, j, k, l] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/usvd_e_t.st cloog-0.18.4/isl/test_inputs/codegen/cloog/usvd_e_t.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/usvd_e_t.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/usvd_e_t.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,34 @@ +domain: "{ S22[i0, i1, -7 + i0] : i0 >= 7 and i1 >= 5 and i1 <= 9 and i0 <= 10; S21[i0, i1, -7 + i0] : i0 <= 10 and i1 >= 4 and i1 <= 8 and i0 >= 7; S4[i0, i1, -1] : i0 <= 8 and i1 >= 1 and i1 <= -4 + i0; S8[i0, i1, 0] : i0 >= 3 and i0 <= 7 and i1 >= 7 and i1 <= 11; S25[i0, i1, 4] : i0 >= 10 and i0 <= 14 and i1 >= 1 and i1 <= 5; S15[i0, i1, i2] : i0 <= 10 and i1 >= 1 and i1 <= 5 and i2 >= 4 and i2 <= -4 + i0; S6[i0, i1, 0] : i0 <= 8 and i1 >= -4 and i1 <= -9 + i0; S16[i0, i1, -6 + i0] : i0 <= 10 and i1 >= 4 and i0 >= 7 and i1 <= -2 + i0; S7[i0, i1, 0] : i0 >= 5 and i1 <= 0 and i1 >= -9 + i0; S1[i0, 0, 0] : i0 >= 0 and i0 <= 4; S2[i0, i1, 0] : i0 >= 0 and i0 <= 4 and i1 >= 0 and i1 <= 4; S26[i0, i1, 3] : i0 >= 10 and i0 <= 14 and i1 >= 1 and i1 <= 5; S10[i0, 4, 0] : i0 >= 7 and i0 <= 10; S12[i0, -2 + i0, i2] : i0 >= 7 and i0 <= 10 and i2 <= 4 and i2 >= -7 + i0; S23[i0, i1, i2] : i0 <= 9 and i1 >= 4 and i1 <= 8 and i2 >= 0 and i2 <= -7 + i0; S13[i0, i1, i2] : i0 <= 10 and i1 >= 4 and i2 <= 4 and i2 >= -7 + i0 and i1 <= -4 + i0; S20[i0, i1, i2] : i0 >= 8 and i1 <= 4 and i2 >= -4 and i2 <= 0 and i1 >= -6 + i0; S24[i0, i1, i2] : i0 >= 8 and i1 >= 4 and i1 <= 8 and i2 <= 3 and i2 >= -7 + i0; S19[i0, i1, i2] : i0 >= 8 and i1 >= 1 and i2 <= 0 and i2 >= -10 + i0 and i1 <= -6 + i0; S11[i0, -3 + i0, i2] : i0 <= 10 and i0 >= 7 and i2 <= 4 and i2 >= -7 + i0; S14[i0, i1, i2] : i0 >= 8 and i1 <= 4 and i2 <= 0 and i2 >= -12 + i0 and i1 >= -6 + i0; S3[i0, 0, 0] : i0 >= 4 and i0 <= 8; S9[i0, 4, 0] : i0 >= 7 and i0 <= 10; S18[i0, i1, i2] : i0 <= 10 and i1 >= 1 and i2 >= 4 and i2 <= -4 + i0 and i1 <= -5 + i0; S5[i0, i1, 0] : i0 >= 4 and i1 <= 4 and i1 >= -4 + i0; S17[i0, i1, -6 + i0] : i0 >= 7 and i1 >= 4 and i0 <= 10 and i1 <= -2 + i0 }" +child: + context: "{ [] }" + child: + schedule: "[{ S8[i0, i1, i2] -> [(i0)]; S21[i0, i1, i2] -> [(i0)]; S9[i0, i1, i2] -> [(i0)]; S10[i0, i1, i2] -> [(i0)]; S24[i0, i1, i2] -> [(i0)]; S15[i0, i1, i2] -> [(i0)]; S12[i0, i1, i2] -> [(i0)]; S7[i0, i1, i2] -> [(i0)]; S6[i0, i1, i2] -> [(i0)]; S23[i0, i1, i2] -> [(i0)]; S22[i0, i1, i2] -> [(i0)]; S16[i0, i1, i2] -> [(i0)]; S17[i0, i1, i2] -> [(i0)]; S25[i0, i1, i2] -> [(i0)]; S18[i0, i1, i2] -> [(i0)]; S26[i0, i1, i2] -> [(i0)]; S5[i0, i1, i2] -> [(i0)]; S2[i0, i1, i2] -> [(i0)]; S4[i0, i1, i2] -> [(i0)]; S13[i0, i1, i2] -> [(i0)]; S3[i0, i1, i2] -> [(i0)]; S14[i0, i1, i2] -> [(i0)]; S19[i0, i1, i2] -> [(i0)]; S20[i0, i1, i2] -> [(i0)]; S11[i0, i1, i2] -> [(i0)]; S1[i0, i1, i2] -> [(i0)] }, { S8[i0, i1, i2] -> [(i1)]; S21[i0, i1, i2] -> [(i1)]; S9[i0, i1, i2] -> [(i1)]; S10[i0, i1, i2] -> [(i1)]; S24[i0, i1, i2] -> [(i1)]; S15[i0, i1, i2] -> [(i1)]; S12[i0, i1, i2] -> [(i1)]; S7[i0, i1, i2] -> [(i1)]; S6[i0, i1, i2] -> [(i1)]; S23[i0, i1, i2] -> [(i1)]; S22[i0, i1, i2] -> [(i1)]; S16[i0, i1, i2] -> [(i1)]; S17[i0, i1, i2] -> [(i1)]; S25[i0, i1, i2] -> [(i1)]; S18[i0, i1, i2] -> [(i1)]; S26[i0, i1, i2] -> [(i1)]; S5[i0, i1, i2] -> [(i1)]; S2[i0, i1, i2] -> [(i1)]; S4[i0, i1, i2] -> [(i1)]; S13[i0, i1, i2] -> [(i1)]; S3[i0, i1, i2] -> [(i1)]; S14[i0, i1, i2] -> [(i1)]; S19[i0, i1, i2] -> [(i1)]; S20[i0, i1, i2] -> [(i1)]; S11[i0, i1, i2] -> [(i1)]; S1[i0, i1, i2] -> [(i1)] }, { S8[i0, i1, i2] -> [(i2)]; S21[i0, i1, i2] -> [(i2)]; S9[i0, i1, i2] -> [(i2)]; S10[i0, i1, i2] -> [(i2)]; S24[i0, i1, i2] -> [(i2)]; S15[i0, i1, i2] -> [(i2)]; S12[i0, i1, i2] -> [(i2)]; S7[i0, i1, i2] -> [(i2)]; S6[i0, i1, i2] -> [(i2)]; S23[i0, i1, i2] -> [(i2)]; S22[i0, i1, i2] -> [(i2)]; S16[i0, i1, i2] -> [(i2)]; S17[i0, i1, i2] -> [(i2)]; S25[i0, i1, i2] -> [(i2)]; S18[i0, i1, i2] -> [(i2)]; S26[i0, i1, i2] -> [(i2)]; S5[i0, i1, i2] -> [(i2)]; S2[i0, i1, i2] -> [(i2)]; S4[i0, i1, i2] -> [(i2)]; S13[i0, i1, i2] -> [(i2)]; S3[i0, i1, i2] -> [(i2)]; S14[i0, i1, i2] -> [(i2)]; S19[i0, i1, i2] -> [(i2)]; S20[i0, i1, i2] -> [(i2)]; S11[i0, i1, i2] -> [(i2)]; S1[i0, i1, i2] -> [(i2)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1, i2] }" + - filter: "{ S2[i0, i1, i2] }" + - filter: "{ S3[i0, i1, i2] }" + - filter: "{ S4[i0, i1, i2] }" + - filter: "{ S5[i0, i1, i2] }" + - filter: "{ S6[i0, i1, i2] }" + - filter: "{ S7[i0, i1, i2] }" + - filter: "{ S8[i0, i1, i2] }" + - filter: "{ S9[i0, i1, i2] }" + - filter: "{ S10[i0, i1, i2] }" + - filter: "{ S11[i0, i1, i2] }" + - filter: "{ S12[i0, i1, i2] }" + - filter: "{ S13[i0, i1, i2] }" + - filter: "{ S14[i0, i1, i2] }" + - filter: "{ S15[i0, i1, i2] }" + - filter: "{ S16[i0, i1, i2] }" + - filter: "{ S17[i0, i1, i2] }" + - filter: "{ S18[i0, i1, i2] }" + - filter: "{ S19[i0, i1, i2] }" + - filter: "{ S20[i0, i1, i2] }" + - filter: "{ S21[i0, i1, i2] }" + - filter: "{ S22[i0, i1, i2] }" + - filter: "{ S23[i0, i1, i2] }" + - filter: "{ S24[i0, i1, i2] }" + - filter: "{ S25[i0, i1, i2] }" + - filter: "{ S26[i0, i1, i2] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/vasilache.c cloog-0.18.4/isl/test_inputs/codegen/cloog/vasilache.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/vasilache.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/vasilache.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,23 +1,23 @@ { S1(); S2(); - for (int c1 = 0; c1 < N; c1 += 1) - for (int c3 = 0; c3 < N; c3 += 1) { - S4(c1, c3); - S5(c1, c3); + for (int c0 = 0; c0 < N; c0 += 1) + for (int c1 = 0; c1 < N; c1 += 1) { + S4(c0, c1); + S5(c0, c1); } - for (int c1 = 0; c1 < N; c1 += 1) - for (int c3 = 0; c3 < N; c3 += 1) - for (int c5 = 0; c5 <= (N - 1) / 32; c5 += 1) { - S7(c1, c3, c5, 32 * c5); - for (int c7 = 32 * c5 + 1; c7 <= min(N - 1, 32 * c5 + 31); c7 += 1) { - S6(c1, c3, c5, c7 - 1); - S7(c1, c3, c5, c7); + for (int c0 = 0; c0 < N; c0 += 1) + for (int c1 = 0; c1 < N; c1 += 1) + for (int c2 = 0; c2 <= (N - 1) / 32; c2 += 1) { + S7(c0, c1, c2, 32 * c2); + for (int c3 = 32 * c2 + 1; c3 <= min(N - 1, 32 * c2 + 31); c3 += 1) { + S6(c0, c1, c2, c3 - 1); + S7(c0, c1, c2, c3); } - if (N >= 32 * c5 + 33) { - S6(c1, c3, c5, 32 * c5 + 31); + if (32 * c2 + 31 >= N) { + S6(c0, c1, c2, N - 1); } else - S6(c1, c3, c5, N - 1); + S6(c0, c1, c2, 32 * c2 + 31); } S8(); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/vasilache.in cloog-0.18.4/isl/test_inputs/codegen/cloog/vasilache.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/vasilache.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/vasilache.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M, N] -> { S4[i0, i1] -> [3, i0, 0, i1, 0, 0, 0, 0, 0] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N; S1[] -> [0, 0, 0, 0, 0, 0, 0, 0, 0]; S6[i0, i1, i2, i3] -> [4, i0, 0, i1, 0, i2, 0, 1 + i3, 0] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N and i3 >= 0 and i3 <= -1 + N and i3 >= 32i2 and i3 <= 31 + 32i2; S7[i0, i1, i2, i3] -> [4, i0, 0, i1, 0, i2, 0, i3, 1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N and i3 >= 0 and i3 <= -1 + N and i3 >= 32i2 and i3 <= 31 + 32i2; S5[i0, i1] -> [3, i0, 0, i1, 1, 0, 0, 0, 0] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N; S2[] -> [1, 0, 0, 0, 0, 0, 0, 0, 0]; S8[] -> [5, 0, 0, 0, 0, 0, 0, 0, 0]; S3[] -> [2, 0, 0, 0, 0, 0, 0, 0, 0] : M >= 79 } -[M, N] -> { : M <= 3 and N >= 100 } -[M, N] -> { [i, j, k, l, m, n, o, p, q] -> separate[x] : x >= 7 } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/vasilache.st cloog-0.18.4/isl/test_inputs/codegen/cloog/vasilache.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/vasilache.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/vasilache.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,37 @@ +domain: "[M, N] -> { S5[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N; S8[]; S2[]; S7[i0, i1, i2, i3] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N and i3 >= 0 and i3 <= -1 + N and i3 >= 32i2 and i3 <= 31 + 32i2; S4[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N; S1[]; S3[] : M >= 79; S6[i0, i1, i2, i3] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N and i3 >= 0 and i3 <= -1 + N and i3 >= 32i2 and i3 <= 31 + 32i2 }" +child: + context: "[M, N] -> { [] : M <= 3 and N >= 100 }" + child: + sequence: + - filter: "[M, N] -> { S1[] }" + - filter: "[M, N] -> { S2[] }" + - filter: "[M, N] -> { S3[] }" + - filter: "[M, N] -> { S5[i0, i1]; S4[i0, i1] }" + child: + schedule: "[M, N] -> [{ S5[i0, i1] -> [(i0)]; S4[i0, i1] -> [(i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S5[i0, i1] -> [(i1)]; S4[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S4[i0, i1] }" + - filter: "[M, N] -> { S5[i0, i1] }" + - filter: "[M, N] -> { S7[i0, i1, i2, i3]; S6[i0, i1, i2, i3] }" + child: + schedule: "[M, N] -> [{ S7[i0, i1, i2, i3] -> [(i0)]; S6[i0, i1, i2, i3] -> [(i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S7[i0, i1, i2, i3] -> [(i1)]; S6[i0, i1, i2, i3] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S7[i0, i1, i2, i3] -> [(i2)]; S6[i0, i1, i2, i3] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S7[i0, i1, i2, i3] -> [(i3)]; S6[i0, i1, i2, i3] -> [(1 + i3)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S6[i0, i1, i2, i3] }" + - filter: "[M, N] -> { S7[i0, i1, i2, i3] }" + - filter: "[M, N] -> { S8[] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/vivien2.c cloog-0.18.4/isl/test_inputs/codegen/cloog/vivien2.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/vivien2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/vivien2.c 2015-07-24 12:23:09.000000000 +0000 @@ -4,47 +4,46 @@ for (int c0 = 2; c0 <= n + 29; c0 += 1) { if (c0 >= 3) { S4(c0 - c0 / 2 - 1, c0 / 2 + 1); - if (c0 + 2 >= 2 * n) { - for (int c2 = 1; c2 < -n + c0; c2 += 1) - S5(-n + c0, n, c2); - } else if (c0 >= 5) { + if (c0 >= 5 && 2 * n >= c0 + 3) { S4(c0 - c0 / 2 - 2, c0 / 2 + 2); - for (int c2 = 1; c2 < (c0 + 1) / 2 - 1; c2 += 1) + for (int c2 = 1; c2 < c0 - c0 / 2 - 1; c2 += 1) S5(c0 - c0 / 2 - 1, c0 / 2 + 1, c2); } - } - for (int c1 = -c0 + c0 / 2 + 3; c1 <= min(n - c0, -1); c1 += 1) { - S4(-c1, c0 + c1); - S6(-c1 + 2, c0 + c1 - 2); - for (int c2 = 1; c2 <= -c1; c2 += 1) - S5(-c1 + 1, c0 + c1 - 1, c2); - } - if (c0 >= n + 2 && 2 * n >= c0 + 3) { - S6(-n + c0 + 1, n - 1); - for (int c2 = 1; c2 < -n + c0; c2 += 1) - S5(-n + c0, n, c2); - } - if (c0 >= n + 3) { - S6(-n + c0, n); - S1(c0 - 1); - } else { - if (c0 >= 5 && n + 1 >= c0) { - S6(2, c0 - 2); - S1(c0 - 1); - } else if (c0 <= 4 && c0 >= 3) + for (int c1 = -c0 + c0 / 2 + 3; c1 <= min(-1, n - c0); c1 += 1) { + S4(-c1, c0 + c1); + S6(-c1 + 2, c0 + c1 - 2); + for (int c2 = 1; c2 <= -c1; c2 += 1) + S5(-c1 + 1, c0 + c1 - 1, c2); + } + if (2 * n >= c0 + 3 && c0 >= n + 2) { + S6(-n + c0 + 1, n - 1); + for (int c2 = 1; c2 < -n + c0; c2 += 1) + S5(-n + c0, n, c2); + if (c0 == n + 2) { + S6(2, n); + S1(n + 1); + } + } else if (c0 + 2 >= 2 * n) + for (int c2 = 1; c2 < -n + c0; c2 += 1) + S5(-n + c0, n, c2); + if (c0 >= n + 3) { + S6(-n + c0, n); S1(c0 - 1); - if (c0 >= 3 && n + 1 >= c0) - S6(1, c0 - 1); - if (c0 == n + 2) { - S6(2, n); - S1(n + 1); + } else { + if (c0 <= 4) { + S1(c0 - 1); + } else if (n + 1 >= c0) { + S6(2, c0 - 2); + S1(c0 - 1); + } + if (n + 1 >= c0) + S6(1, c0 - 1); } - } - if (c0 == 2) + } else S1(1); if (c0 % 2 == 0) S3(c0 / 2); - for (int c1 = max(-n + c0, 1); c1 < (c0 + 1) / 2; c1 += 1) + for (int c1 = max(1, -n + c0); c1 < (c0 + 1) / 2; c1 += 1) S2(c0 - c1, c1); } for (int c0 = n + 30; c0 <= 2 * n; c0 += 1) { @@ -55,7 +54,7 @@ S5(-n + c0, n, c2); } else { S4(c0 - c0 / 2 - 2, c0 / 2 + 2); - for (int c2 = 1; c2 < (c0 + 1) / 2 - 1; c2 += 1) + for (int c2 = 1; c2 < c0 - c0 / 2 - 1; c2 += 1) S5(c0 - c0 / 2 - 1, c0 / 2 + 1, c2); } for (int c1 = -c0 + c0 / 2 + 3; c1 <= n - c0; c1 += 1) { diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/vivien2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/vivien2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/vivien2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/vivien2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n] -> { S6[i0, i1] -> [2i0 + 2i1, 2 - i0, 0] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S2[i0, i1] -> [1 + 2i0 + 2i1, i1, 0] : 29i1 >= 1 - i0 and i0 <= n and i1 >= 1 and i1 <= -1 + i0; S1[i0] -> [2 + 2i0, 0, 0] : i0 >= 1 - 27n and i0 <= 28 + n; S4[i0, i1] -> [2i0 + 2i1, -i0, 0] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S3[i0] -> [1 + 4i0, 0, 0] : i0 >= 1 and i0 <= n; S5[i0, i1, i2] -> [2i0 + 2i1, 1 - i0, i2] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n and i2 >= 1 and i2 <= -1 + i0 } -[n] -> { : n >= 30 } -[n] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/vivien2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/vivien2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/vivien2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/vivien2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[n] -> { S2[i, j] : 29j >= 1 - i and i <= n and j >= 1 and j <= -1 + i; S1[i] : i >= 1 - 27n and i <= 28 + n; S4[i, j] : i >= 1 and i <= n and j >= 1 + i and j <= n; S5[i, j, k] : i >= 1 and i <= n and j >= 1 + i and j <= n and k >= 1 and k <= -1 + i; S6[i, j] : i >= 1 and i <= n and j >= 1 + i and j <= n; S3[i] : i >= 1 and i <= n }" +child: + context: "[n] -> { [] : n >= 30 }" + child: + schedule: "[n] -> [{ S1[i0] -> [(2 + 2i0)]; S4[i0, i1] -> [(2i0 + 2i1)]; S6[i0, i1] -> [(2i0 + 2i1)]; S3[i0] -> [(1 + 4i0)]; S5[i0, i1, i2] -> [(2i0 + 2i1)]; S2[i0, i1] -> [(1 + 2i0 + 2i1)] }, { S1[i0] -> [(0)]; S4[i0, i1] -> [(-i0)]; S6[i0, i1] -> [(2 - i0)]; S3[i0] -> [(0)]; S5[i0, i1, i2] -> [(1 - i0)]; S2[i0, i1] -> [(i1)] }, { S1[i0] -> [(0)]; S4[i0, i1] -> [(0)]; S6[i0, i1] -> [(0)]; S3[i0] -> [(0)]; S5[i0, i1, i2] -> [(i2)]; S2[i0, i1] -> [(0)] }]" + options: "[n] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/vivien.c cloog-0.18.4/isl/test_inputs/codegen/cloog/vivien.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/vivien.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/vivien.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,54 +1,60 @@ { for (int c0 = -27 * n + 2; c0 <= 1; c0 += 1) S1(c0 - 1); - for (int c0 = 2; c0 <= min(n + 29, 2 * n); c0 += 1) { - if (2 * n >= c0 + 1 && c0 >= 3) - S4(c0 - c0 / 2 - 1, c0 / 2 + 1); - if (2 * n >= c0 + 1 && c0 + 2 >= 2 * n) { - for (int c2 = 1; c2 < -n + c0; c2 += 1) - S5(-n + c0, n, c2); - } else if (2 * n >= c0 + 3 && c0 >= 5) { - S4(c0 - c0 / 2 - 2, c0 / 2 + 2); - for (int c2 = 1; c2 < (c0 + 1) / 2 - 1; c2 += 1) - S5(c0 - c0 / 2 - 1, c0 / 2 + 1, c2); - } - for (int c1 = -c0 + c0 / 2 + 3; c1 <= min(n - c0, -1); c1 += 1) { - S4(-c1, c0 + c1); - S6(-c1 + 2, c0 + c1 - 2); - for (int c2 = 1; c2 <= -c1; c2 += 1) - S5(-c1 + 1, c0 + c1 - 1, c2); - } - if (2 * n >= c0 + 3 && c0 >= n + 2) { - S6(-n + c0 + 1, n - 1); - for (int c2 = 1; c2 < -n + c0; c2 += 1) - S5(-n + c0, n, c2); - } - if (2 * n >= c0 + 1 && c0 >= n + 3) { - S6(-n + c0, n); - } else { - if (n + 1 >= c0 && c0 >= 5) { - S6(2, c0 - 2); - S1(c0 - 1); - } else if (c0 <= 4 && c0 >= 3 && n + 1 >= c0) - S1(c0 - 1); - if (n + 1 >= c0 && c0 >= 3) - S6(1, c0 - 1); - } - if (c0 >= n + 3) { - S1(c0 - 1); - } else if (c0 == n + 2 && n >= 3) { - S6(2, n); - S1(n + 1); - } - if (c0 == 2) { + for (int c0 = 2; c0 <= min(2 * n, n + 29); c0 += 1) { + if (c0 >= 3) { + if (2 * n >= c0 + 1) { + S4(c0 - c0 / 2 - 1, c0 / 2 + 1); + if (c0 + 2 >= 2 * n) { + for (int c2 = 1; c2 < -n + c0; c2 += 1) + S5(-n + c0, n, c2); + } else if (c0 >= 5) { + S4(c0 - c0 / 2 - 2, c0 / 2 + 2); + for (int c2 = 1; c2 < c0 - c0 / 2 - 1; c2 += 1) + S5(c0 - c0 / 2 - 1, c0 / 2 + 1, c2); + } + } + for (int c1 = -c0 + c0 / 2 + 3; c1 <= min(-1, n - c0); c1 += 1) { + S4(-c1, c0 + c1); + S6(-c1 + 2, c0 + c1 - 2); + for (int c2 = 1; c2 <= -c1; c2 += 1) + S5(-c1 + 1, c0 + c1 - 1, c2); + } + if (2 * n >= c0 + 3 && c0 >= n + 2) { + S6(-n + c0 + 1, n - 1); + for (int c2 = 1; c2 < -n + c0; c2 += 1) + S5(-n + c0, n, c2); + } + if (n >= 3 && c0 == n + 2) { + S6(2, n); + S1(n + 1); + } else { + if (c0 >= n + 3 && 2 * n >= c0 + 1) + S6(-n + c0, n); + if (c0 >= n + 3) { + S1(c0 - 1); + } else { + if (n + 1 >= c0 && c0 <= 4) { + S1(c0 - 1); + } else if (c0 >= 5 && n + 1 >= c0) { + S6(2, c0 - 2); + S1(c0 - 1); + } + if (n + 1 >= c0) + S6(1, c0 - 1); + } + } + if (n == 2 && c0 == 4) + S1(3); + } else S1(1); - } else if (c0 == 4 && n == 2) - S1(3); if (c0 % 2 == 0) S3(c0 / 2); - for (int c1 = max(-n + c0, 1); c1 < (c0 + 1) / 2; c1 += 1) + for (int c1 = max(1, -n + c0); c1 < (c0 + 1) / 2; c1 += 1) S2(c0 - c1, c1); } + for (int c0 = max(2 * n + 1, -27 * n + 2); c0 <= n + 29; c0 += 1) + S1(c0 - 1); for (int c0 = n + 30; c0 <= 2 * n; c0 += 1) { if (2 * n >= c0 + 1) { S4(c0 - c0 / 2 - 1, c0 / 2 + 1); @@ -57,7 +63,7 @@ S5(-n + c0, n, c2); } else { S4(c0 - c0 / 2 - 2, c0 / 2 + 2); - for (int c2 = 1; c2 < (c0 + 1) / 2 - 1; c2 += 1) + for (int c2 = 1; c2 < c0 - c0 / 2 - 1; c2 += 1) S5(c0 - c0 / 2 - 1, c0 / 2 + 1, c2); } for (int c1 = -c0 + c0 / 2 + 3; c1 <= n - c0; c1 += 1) { @@ -78,6 +84,4 @@ for (int c1 = -n + c0; c1 < (c0 + 1) / 2; c1 += 1) S2(c0 - c1, c1); } - for (int c0 = max(2 * n + 1, -27 * n + 2); c0 <= n + 29; c0 += 1) - S1(c0 - 1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/vivien.in cloog-0.18.4/isl/test_inputs/codegen/cloog/vivien.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/vivien.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/vivien.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n] -> { S6[i0, i1] -> [2i0 + 2i1, 2 - i0, 0] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S2[i0, i1] -> [1 + 2i0 + 2i1, i1, 0] : 29i1 >= 1 - i0 and i0 <= n and i1 >= 1 and i1 <= -1 + i0; S1[i0] -> [2 + 2i0, 0, 0] : i0 >= 1 - 27n and i0 <= 28 + n; S4[i0, i1] -> [2i0 + 2i1, -i0, 0] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S3[i0] -> [1 + 4i0, 0, 0] : i0 >= 1 and i0 <= n; S5[i0, i1, i2] -> [2i0 + 2i1, 1 - i0, i2] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n and i2 >= 1 and i2 <= -1 + i0 } -[n] -> { : } -[n] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/vivien.st cloog-0.18.4/isl/test_inputs/codegen/cloog/vivien.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/vivien.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/vivien.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[n] -> { S2[i, j] : 29j >= 1 - i and i <= n and j >= 1 and j <= -1 + i; S1[i] : i >= 1 - 27n and i <= 28 + n; S4[i, j] : i >= 1 and i <= n and j >= 1 + i and j <= n; S5[i, j, k] : i >= 1 and i <= n and j >= 1 + i and j <= n and k >= 1 and k <= -1 + i; S6[i, j] : i >= 1 and i <= n and j >= 1 + i and j <= n; S3[i] : i >= 1 and i <= n }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S1[i0] -> [(2 + 2i0)]; S4[i0, i1] -> [(2i0 + 2i1)]; S6[i0, i1] -> [(2i0 + 2i1)]; S3[i0] -> [(1 + 4i0)]; S5[i0, i1, i2] -> [(2i0 + 2i1)]; S2[i0, i1] -> [(1 + 2i0 + 2i1)] }, { S1[i0] -> [(0)]; S4[i0, i1] -> [(-i0)]; S6[i0, i1] -> [(2 - i0)]; S3[i0] -> [(0)]; S5[i0, i1, i2] -> [(1 - i0)]; S2[i0, i1] -> [(i1)] }, { S1[i0] -> [(0)]; S4[i0, i1] -> [(0)]; S6[i0, i1] -> [(0)]; S3[i0] -> [(0)]; S5[i0, i1, i2] -> [(i2)]; S2[i0, i1] -> [(0)] }]" + options: "[n] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/walters2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/walters2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/walters2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/walters2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[j, i] -> [j, i, 0] : j >= 1 and j <= 24 and i >= 1 and i <= 50; S2[j, 51] -> [j, 51, 1] : j >= 1 and j <= 24; S2[25, i] -> [25, i, 1] : i >= 1 and i <= 51; S2[0, i] -> [0, i, 1] : i >= 0 and i <= 51; S2[j, 0] -> [j, 0, 1] : j >= 1 and j <= 25 } -{ : } -{ [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/walters2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/walters2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/walters2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/walters2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "{ S2[j, 51] : j <= 24 and j >= 1; S2[25, i] : i <= 51 and i >= 1; S2[j, 0] : j <= 25 and j >= 1; S2[0, i] : i <= 51 and i >= 0; S1[j, i] : j >= 1 and j <= 24 and i >= 1 and i <= 50 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[j, i] -> [(j)]; S2[j, i] -> [(j)] }, { S1[j, i] -> [(i)]; S2[j, i] -> [(i)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[j, i] }" + - filter: "{ S2[j, i] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/walters3.in cloog-0.18.4/isl/test_inputs/codegen/cloog/walters3.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/walters3.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/walters3.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S2[j, a, b] -> [j, j', b, 1] : 2a = j and 2j' = j and j >= 1 and j <= 10 and 2b <= j and 2b >= -1 + j; S1[j, a, b] -> [j, j', k, 0] : 2a = j and 2j' = j and 2k = j and 2b = j and j <= 8 and j >= 2 } -{ : } -{ [i, j, k, l] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/walters3.st cloog-0.18.4/isl/test_inputs/codegen/cloog/walters3.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/walters3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/walters3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +domain: "{ S2[j, a, b] : 2a = j and j >= 1 and j <= 10 and 2b <= j and 2b >= -1 + j; S1[j, a, b] : 2a = j and 2b = j and j <= 8 and j >= 2 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[j, a, b] -> [(j)]; S2[j, a, b] -> [(j)] }, { S1[j, a, b] -> [(a)]; S2[j, a, b] -> [(a)] }, { S1[j, a, b] -> [(b)]; S2[j, a, b] -> [(b)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[j, a, b] }" + - filter: "{ S2[j, a, b] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/walters.in cloog-0.18.4/isl/test_inputs/codegen/cloog/walters.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/walters.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/walters.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S2[i, div36, div37, div38] -> [i, div36, k, div38, 1] : 3div37 = 2 + i and 3k = 2 + i and i >= 1 and i <= 10 and 3div36 >= -2 + i and 3div38 <= 1 + i and 3div38 >= -1 + i and 3div36 <= i; S1[i, div36, div37, div38] -> [i, j, div37, div38, 0] : 3j = i and 3div36 = i and i >= 3 and i <= 10 and 3div37 >= i and 3div38 <= 1 + i and 3div37 <= 2 + i and 3div38 >= -1 + i; S3[i, div36, div37, div38] -> [i, div36, div37, l, 2] : 3l = 1 + i and 3div38 = 1 + i and i <= 10 and i >= 2 and 3div36 >= -2 + i and 3div37 <= 2 + i and 3div36 <= i and 3div37 >= i; S4[i, div36, div37, div38] -> [i, div36, div37, div38, 3] : i >= 1 and i <= 10 and 3div36 <= i and 3div36 >= -2 + i and 3div37 <= 2 + i and 3div37 >= i and 3div38 <= 1 + i and 3div38 >= -1 + i } -{ : } -{ [i, j, k, l, m] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/walters.st cloog-0.18.4/isl/test_inputs/codegen/cloog/walters.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/walters.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/walters.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,12 @@ +domain: "{ S2[i, div36, div37, div38] : 3div37 = 2 + i and i >= 1 and i <= 10 and 3div36 >= -2 + i and 3div38 <= 1 + i and 3div38 >= -1 + i and 3div36 <= i; S4[i, div36, div37, div38] : i >= 1 and i <= 10 and 3div36 <= i and 3div36 >= -2 + i and 3div37 <= 2 + i and 3div37 >= i and 3div38 <= 1 + i and 3div38 >= -1 + i; S1[i, div36, div37, div38] : 3div36 = i and i >= 3 and i <= 10 and 3div37 >= i and 3div38 <= 1 + i and 3div37 <= 2 + i and 3div38 >= -1 + i; S3[i, div36, div37, div38] : 3div38 = 1 + i and i <= 10 and i >= 2 and 3div36 >= -2 + i and 3div37 <= 2 + i and 3div36 <= i and 3div37 >= i }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i, div36, div37, div38] -> [(i)]; S4[i, div36, div37, div38] -> [(i)]; S3[i, div36, div37, div38] -> [(i)]; S2[i, div36, div37, div38] -> [(i)] }, { S1[i, div36, div37, div38] -> [(div36)]; S4[i, div36, div37, div38] -> [(div36)]; S3[i, div36, div37, div38] -> [(div36)]; S2[i, div36, div37, div38] -> [(div36)] }, { S1[i, div36, div37, div38] -> [(div37)]; S4[i, div36, div37, div38] -> [(div37)]; S3[i, div36, div37, div38] -> [(div37)]; S2[i, div36, div37, div38] -> [(div37)] }, { S1[i, div36, div37, div38] -> [(div38)]; S4[i, div36, div37, div38] -> [(div38)]; S3[i, div36, div37, div38] -> [(div38)]; S2[i, div36, div37, div38] -> [(div38)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[i, div36, div37, div38] }" + - filter: "{ S2[i, div36, div37, div38] }" + - filter: "{ S3[i, div36, div37, div38] }" + - filter: "{ S4[i, div36, div37, div38] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/wavefront.c cloog-0.18.4/isl/test_inputs/codegen/cloog/wavefront.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/wavefront.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/wavefront.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,3 +1,3 @@ for (int c0 = 2; c0 <= n + m; c0 += 1) - for (int c1 = max(-m + c0, 1); c1 <= min(n, c0 - 1); c1 += 1) + for (int c1 = max(1, -m + c0); c1 <= min(n, c0 - 1); c1 += 1) S1(c1, c0 - c1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/wavefront.in cloog-0.18.4/isl/test_inputs/codegen/cloog/wavefront.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/wavefront.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/wavefront.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n, m] -> { S1[i0, i1] -> [i0 + i1, i0] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= m } -[n, m] -> { : } -[n, m] -> { [i, j] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/wavefront.st cloog-0.18.4/isl/test_inputs/codegen/cloog/wavefront.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/wavefront.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/wavefront.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[n, m] -> { S1[i0, i1] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= m }" +child: + context: "[n, m] -> { [] }" + child: + schedule: "[n, m] -> [{ S1[i0, i1] -> [(i0 + i1)] }, { S1[i0, i1] -> [(i0)] }]" + options: "[n, m] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/yosr2.in cloog-0.18.4/isl/test_inputs/codegen/cloog/yosr2.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/yosr2.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/yosr2.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[M] -> { S3[i0, i1, i2] -> [i0] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M and i2 >= 1 and i2 <= -1 + i0; S4[i0, i1] -> [i1] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M; S1[i0, i1] -> [i0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= -1 + i0; S2[i0] -> [0] : i0 >= 1 and i0 <= M } -[M] -> { : M >= 2 } -[M] -> { [i] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/yosr2.st cloog-0.18.4/isl/test_inputs/codegen/cloog/yosr2.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/yosr2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/yosr2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[M] -> { S4[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M; S3[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M and i2 >= 1 and i2 <= -1 + i0; S1[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= -1 + i0; S2[i0] : i0 >= 1 and i0 <= M }" +child: + context: "[M] -> { [] : M >= 2 }" + child: + schedule: "[M] -> [{ S2[i0] -> [(0)]; S1[i0, i1] -> [(i0)]; S4[i0, i1] -> [(i1)]; S3[i0, i1, i2] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/yosr.c cloog-0.18.4/isl/test_inputs/codegen/cloog/yosr.c --- cloog-0.18.2/isl/test_inputs/codegen/cloog/yosr.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/yosr.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,10 +1,10 @@ { for (int c0 = 1; c0 < n; c0 += 1) { - for (int c2 = c0 + 1; c2 <= n; c2 += 1) - S1(c0, c2); for (int c1 = 1; c1 < c0; c1 += 1) for (int c2 = c1 + 1; c2 <= n; c2 += 1) S2(c1, c2, c0); + for (int c2 = c0 + 1; c2 <= n; c2 += 1) + S1(c0, c2); } for (int c1 = 1; c1 < n; c1 += 1) for (int c2 = c1 + 1; c2 <= n; c2 += 1) diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/yosr.in cloog-0.18.4/isl/test_inputs/codegen/cloog/yosr.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/yosr.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/yosr.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n] -> { S2[i0, i1, i2] -> [i2] : i0 >= 1 and i0 <= -1 + n and i1 >= 1 + i0 and i1 <= n and i2 >= 1 + i0 and i2 <= n; S1[i0, i1] -> [i0] : i0 >= 1 and i0 <= -1 + n and i1 >= 1 + i0 and i1 <= n } -[n] -> { : } -[n] -> { [i] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/yosr.st cloog-0.18.4/isl/test_inputs/codegen/cloog/yosr.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/yosr.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/yosr.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[i0, i1] : i0 >= 1 and i0 <= -1 + n and i1 >= 1 + i0 and i1 <= n; S2[i0, i1, i2] : i0 >= 1 and i0 <= -1 + n and i1 >= 1 + i0 and i1 <= n and i2 >= 1 + i0 and i2 <= n }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S2[i0, i1, i2] -> [(i2)]; S1[i0, i1] -> [(i0)] }]" + options: "[n] -> { separate[i0] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/youcef.in cloog-0.18.4/isl/test_inputs/codegen/cloog/youcef.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/youcef.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/youcef.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -{ S1[i0, i0] -> [i0, i0, 0] : i0 >= 0 and i0 <= 5; S2[i0, i1] -> [i0, i1, 1] : i0 >= 0 and i0 <= 5 and i1 >= i0 and i1 <= 5; S3[i0, 5] -> [i0, 5, 2] : i0 >= 0 and i0 <= 5 } -{ : } -{ [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/youcefn.in cloog-0.18.4/isl/test_inputs/codegen/cloog/youcefn.in --- cloog-0.18.2/isl/test_inputs/codegen/cloog/youcefn.in 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/youcefn.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[n, m] -> { S3[i0, n] -> [i0, n, 2] : i0 >= 1 and i0 <= m; S2[i0, i1] -> [i0, i1, 1] : i0 >= 1 and i0 <= n and i1 >= i0 and i1 <= n; S1[i0, i0] -> [i0, i0, 0] : i0 >= 1 and i0 <= n } -[n, m] -> { : n >= 2 and m >= n } -[n, m] -> { [i, j, k] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/youcefn.st cloog-0.18.4/isl/test_inputs/codegen/cloog/youcefn.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/youcefn.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/youcefn.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,11 @@ +domain: "[n, m] -> { S1[i0, i0] : i0 >= 1 and i0 <= n; S3[i0, n] : i0 >= 1 and i0 <= m; S2[i0, i1] : i0 >= 1 and i0 <= n and i1 >= i0 and i1 <= n }" +child: + context: "[n, m] -> { [] : n >= 2 and m >= n }" + child: + schedule: "[n, m] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)]; S3[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)]; S3[i0, i1] -> [(i1)] }]" + options: "[n, m] -> { separate[i0] }" + child: + sequence: + - filter: "[n, m] -> { S1[i0, i1] }" + - filter: "[n, m] -> { S2[i0, i1] }" + - filter: "[n, m] -> { S3[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/cloog/youcef.st cloog-0.18.4/isl/test_inputs/codegen/cloog/youcef.st --- cloog-0.18.2/isl/test_inputs/codegen/cloog/youcef.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/cloog/youcef.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,11 @@ +domain: "{ S2[i0, i1] : i0 >= 0 and i0 <= 5 and i1 >= i0 and i1 <= 5; S1[i0, i0] : i0 >= 0 and i0 <= 5; S3[i0, 5] : i0 >= 0 and i0 <= 5 }" +child: + context: "{ [] }" + child: + schedule: "[{ S3[i0, i1] -> [(i0)]; S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S3[i0, i1] -> [(i1)]; S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1] }" + - filter: "{ S2[i0, i1] }" + - filter: "{ S3[i0, i1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/component0.c cloog-0.18.4/isl/test_inputs/codegen/component0.c --- cloog-0.18.2/isl/test_inputs/codegen/component0.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/component0.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,5 @@ +{ + A(); + for (int c0 = 0; c0 <= 9; c0 += 1) + B(c0); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/component0.st cloog-0.18.4/isl/test_inputs/codegen/component0.st --- cloog-0.18.2/isl/test_inputs/codegen/component0.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/component0.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,3 @@ +domain: "{ A[]; B[i] : 0 <= i < 10 }" +child: + schedule: "[{ A[] -> [0]; B[i] -> [i] }]" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/component1.c cloog-0.18.4/isl/test_inputs/codegen/component1.c --- cloog-0.18.2/isl/test_inputs/codegen/component1.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/component1.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,5 @@ +{ + A(); + for (int c0 = 0; c0 <= 9; c0 += 1) + B(c0); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/component1.st cloog-0.18.4/isl/test_inputs/codegen/component1.st --- cloog-0.18.2/isl/test_inputs/codegen/component1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/component1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,7 @@ +domain: "{ A[]; B[i] : 0 <= i < 10 }" +child: + schedule: "[{ A[] -> [0]; B[i] -> [i] }]" + child: + sequence: + - filter: "{ A[] }" + - filter: "{ B[i] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/component2.c cloog-0.18.4/isl/test_inputs/codegen/component2.c --- cloog-0.18.2/isl/test_inputs/codegen/component2.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/component2.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,5 @@ +for (int c0 = 0; c0 <= 9; c0 += 1) { + B(c0); + if (c0 == 0) + A(); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/component2.st cloog-0.18.4/isl/test_inputs/codegen/component2.st --- cloog-0.18.2/isl/test_inputs/codegen/component2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/component2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,7 @@ +domain: "{ A[]; B[i] : 0 <= i < 10 }" +child: + schedule: "[{ A[] -> [0]; B[i] -> [i] }]" + child: + sequence: + - filter: "{ B[i] }" + - filter: "{ A[] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/component3.c cloog-0.18.4/isl/test_inputs/codegen/component3.c --- cloog-0.18.2/isl/test_inputs/codegen/component3.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/component3.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,5 @@ +{ + A(); + for (int c0 = 0; c0 <= 9; c0 += 1) + B(c0); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/component3.st cloog-0.18.4/isl/test_inputs/codegen/component3.st --- cloog-0.18.2/isl/test_inputs/codegen/component3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/component3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,7 @@ +domain: "{ A[]; B[i] : 0 <= i < 10 }" +child: + schedule: "[{ A[] -> [0]; B[i] -> [i] }]" + child: + set: + - filter: "{ B[i] }" + - filter: "{ A[] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/component4.c cloog-0.18.4/isl/test_inputs/codegen/component4.c --- cloog-0.18.2/isl/test_inputs/codegen/component4.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/component4.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,7 @@ +{ + for (int c1 = 0; c1 <= 9; c1 += 1) + A(c1); + for (int c0 = 0; c0 <= 9; c0 += 1) + for (int c2 = 0; c2 <= 9; c2 += 1) + B(c0, c2); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/component4.st cloog-0.18.4/isl/test_inputs/codegen/component4.st --- cloog-0.18.2/isl/test_inputs/codegen/component4.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/component4.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,7 @@ +domain: "{ A[i] : 0 <= i < 10; B[i,j] : 0 <= i,j < 10 }" +child: + schedule: "[{ A[i] -> [0]; B[i,j] -> [i] }]" + child: + sequence: + - filter: "{ A[i] }" + - filter: "{ B[i,j] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/component5.c cloog-0.18.4/isl/test_inputs/codegen/component5.c --- cloog-0.18.2/isl/test_inputs/codegen/component5.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/component5.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +for (int c0 = 0; c0 <= 9; c0 += 1) + for (int c1 = 0; c1 <= 9; c1 += 1) { + if (c0 == 0) + A(c1); + B(c0, c1); + } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/component5.st cloog-0.18.4/isl/test_inputs/codegen/component5.st --- cloog-0.18.2/isl/test_inputs/codegen/component5.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/component5.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,9 @@ +domain: "{ A[i] : 0 <= i < 10; B[i,j] : 0 <= i,j < 10 }" +child: + schedule: "[{ A[i] -> [0]; B[i,j] -> [i] }]" + child: + schedule: "[{ A[i] -> [i]; B[i,j] -> [j] }]" + child: + sequence: + - filter: "{ A[i] }" + - filter: "{ B[i,j] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/component6.c cloog-0.18.4/isl/test_inputs/codegen/component6.c --- cloog-0.18.2/isl/test_inputs/codegen/component6.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/component6.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,5 @@ +{ + A(); + for (int c0 = 0; c0 <= 9; c0 += 1) + B(c0); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/component6.st cloog-0.18.4/isl/test_inputs/codegen/component6.st --- cloog-0.18.2/isl/test_inputs/codegen/component6.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/component6.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +# Check that components are still detected in presence of nested context node +domain: "{ A[]; B[i] : 0 <= i < 10 }" +child: + schedule: "[{ A[] -> [0]; B[i] -> [i] }]" + child: + context: "[n] -> { [i] : 0 <= n <= i }" + child: + sequence: + - filter: "{ A[] }" + - filter: "{ B[i] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/dwt.c cloog-0.18.4/isl/test_inputs/codegen/dwt.c --- cloog-0.18.2/isl/test_inputs/codegen/dwt.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/dwt.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,7 +1,8 @@ -for (int c0 = 0; c0 < Ncl; c0 += 1) +for (int c0 = 0; c0 < Ncl; c0 += 1) { if (Ncl >= c0 + 2 && c0 >= 1) { S(c0, 28); } else if (c0 == 0) { S(0, 26); } else S(Ncl - 1, 27); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/empty.c cloog-0.18.4/isl/test_inputs/codegen/empty.c --- cloog-0.18.2/isl/test_inputs/codegen/empty.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/empty.c 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,6 @@ +for (int c0 = 0; c0 <= 10; c0 += 1) { + S0(c0); + if (c0 == 5) + S2(); + S1(c0); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/empty.in cloog-0.18.4/isl/test_inputs/codegen/empty.in --- cloog-0.18.2/isl/test_inputs/codegen/empty.in 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/empty.in 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,5 @@ +# Earlier versions of isl would end up with an empty partial +# executed relation and fail to detect this emptiness. +[M] -> { S0[i] -> [i, -M] : 0 <= i <= 10; S1[i] -> [i, 0] : 0 <= i <= 10; S2[] -> [5, 0] } +[M] -> { : M >= 1 } +{ } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/filter.c cloog-0.18.4/isl/test_inputs/codegen/filter.c --- cloog-0.18.2/isl/test_inputs/codegen/filter.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/filter.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,8 @@ +if (n >= m + 1) { + for (int c0 = 0; c0 < n; c0 += 1) + for (int c2 = 0; c2 < n; c2 += 1) + A(c0, c2); +} else + for (int c0 = 0; c0 < n; c0 += 1) + for (int c2 = 0; c2 < n; c2 += 1) + A(c0, c2); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/filter.st cloog-0.18.4/isl/test_inputs/codegen/filter.st --- cloog-0.18.2/isl/test_inputs/codegen/filter.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/filter.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,18 @@ +# Check proper handling of filters that turn out to be empty on their paths +domain: "[n,m] -> { A[i,j] : 0 <= i,j < n }" +child: + set: + - filter: "[n,m] -> { A[i,j] : m < n }" + child: + schedule: "[{ A[i,j] -> [i] }]" + child: + set: + - filter: "[n,m] -> { A[i,j] : m < n }" + - filter: "[n,m] -> { A[i,j] : m >= n }" + - filter: "[n,m] -> { A[i,j] : m >= n }" + child: + schedule: "[{ A[i,j] -> [i] }]" + child: + set: + - filter: "[n,m] -> { A[i,j] : m < n }" + - filter: "[n,m] -> { A[i,j] : m >= n }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/gemm.c cloog-0.18.4/isl/test_inputs/codegen/gemm.c --- cloog-0.18.2/isl/test_inputs/codegen/gemm.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/gemm.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +for (int c0 = 0; c0 < ni; c0 += 1) + for (int c1 = 0; c1 < nj; c1 += 1) { + S_2(c0, c1); + for (int c2 = 0; c2 < nk; c2 += 1) + S_4(c0, c1, c2); + } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/gemm.st cloog-0.18.4/isl/test_inputs/codegen/gemm.st --- cloog-0.18.2/isl/test_inputs/codegen/gemm.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/gemm.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,12 @@ +domain: "[ni, nj, nk] -> { S_4[i, j, k] : k <= -1 + nk and k >= 0 and j <= -1 + nj and j >= 0 and i <= -1 + ni and i >= 0; S_2[i, j] : j <= -1 + nj and j >= 0 and i <= -1 + ni and i >= 0 }" +child: + set: + - filter: "[ni, nj, nk] -> { S_4[i, j, k]; S_2[i, j] }" + child: + schedule: "[ni, nj, nk] -> [{ S_4[i, j, k] -> [(i)]; S_2[i, j] -> [(i)] }, { S_4[i, j, k] -> [(j)]; S_2[i, j] -> [(j)] }, { S_4[i, j, k] -> [(k)]; S_2[i, j] -> [(0)] }]" + permutable: 1 + coincident: [ 1, 1, 0 ] + child: + sequence: + - filter: "[ni, nj, nk] -> { S_2[i, j] }" + - filter: "[ni, nj, nk] -> { S_4[i, j, k] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/hoist2.c cloog-0.18.4/isl/test_inputs/codegen/hoist2.c --- cloog-0.18.2/isl/test_inputs/codegen/hoist2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/hoist2.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,3 +1,3 @@ for (int c0 = 1; c0 <= 5; c0 += 1) - for (int c1 = max(t1, t1 - 64 * b + 64); c1 <= min(70, -((c0 + 1) % 2) - c0 + 73); c1 += 64) + for (int c1 = t1 - 64 * b + 64; c1 <= min(70, -((c0 - 1) % 2) - c0 + 73); c1 += 64) A(c0, 64 * b + c1 - 8); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/hoist.c cloog-0.18.4/isl/test_inputs/codegen/hoist.c --- cloog-0.18.2/isl/test_inputs/codegen/hoist.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/hoist.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,4 +1,4 @@ -if (nj >= t1 + 1 && ni >= t0 + 1) +if (ni >= t0 + 1 && nj >= t1 + 1) for (int c2 = 0; c2 <= min(15, nk - 1); c2 += 1) { S_1(t0, t1, c2); if (nj >= t1 + 17) { diff -Nru cloog-0.18.2/isl/test_inputs/codegen/isolate1.c cloog-0.18.4/isl/test_inputs/codegen/isolate1.c --- cloog-0.18.2/isl/test_inputs/codegen/isolate1.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/isolate1.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,8 @@ +{ + for (int c0 = 0; c0 <= 3; c0 += 1) + A(c0); + for (int c0 = 4; c0 <= 6; c0 += 1) + A(c0); + for (int c0 = 7; c0 <= 99; c0 += 1) + A(c0); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/isolate1.st cloog-0.18.4/isl/test_inputs/codegen/isolate1.st --- cloog-0.18.2/isl/test_inputs/codegen/isolate1.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/isolate1.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,5 @@ +# Check that the isolate option is adjusted by schedule space scaling +domain: "{ A[i] : 0 <= i < 100 }" +child: + schedule: "[{ A[i] -> [3i] }]" + options: "{ isolate[[] -> [x]] : 10 <= x <= 20 }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/isolate2.c cloog-0.18.4/isl/test_inputs/codegen/isolate2.c --- cloog-0.18.2/isl/test_inputs/codegen/isolate2.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/isolate2.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,11 @@ +for (int c0 = 0; c0 <= 99; c0 += 1) { + if (c0 >= 4 && c0 <= 6) { + for (int c1 = 0; c1 <= 99; c1 += 1) + A(c0, c1); + } else if (c0 >= 7) { + for (int c1 = 0; c1 <= 99; c1 += 1) + A(c0, c1); + } else + for (int c1 = 0; c1 <= 99; c1 += 1) + A(c0, c1); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/isolate2.st cloog-0.18.4/isl/test_inputs/codegen/isolate2.st --- cloog-0.18.2/isl/test_inputs/codegen/isolate2.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/isolate2.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,7 @@ +# Check that the isolate option is adjusted by schedule space scaling +domain: "{ A[i,j] : 0 <= i,j < 100 }" +child: + schedule: "[{ A[i,j] -> [3i] }]" + child: + schedule: "[{ A[i,j] -> [3j] }]" + options: "{ isolate[[x] -> [y]] : 10 <= x <= 20 }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/isolate3.c cloog-0.18.4/isl/test_inputs/codegen/isolate3.c --- cloog-0.18.2/isl/test_inputs/codegen/isolate3.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/isolate3.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,17 @@ +{ + for (int c0 = 0; c0 <= 9; c0 += 1) + A(c0); + A(10); + A(11); + A(12); + A(13); + A(14); + A(15); + A(16); + A(17); + A(18); + A(19); + A(20); + for (int c0 = 21; c0 <= 99; c0 += 1) + A(c0); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/isolate3.st cloog-0.18.4/isl/test_inputs/codegen/isolate3.st --- cloog-0.18.2/isl/test_inputs/codegen/isolate3.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/isolate3.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,5 @@ +# Check use of options specific to isolated part +domain: "{ A[i] : 0 <= i < 100 }" +child: + schedule: "[{ A[i] -> [i] }]" + options: "{ isolate[[] -> [x]] : 10 <= x <= 20; [isolate[] -> unroll[x]] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/isolate4.c cloog-0.18.4/isl/test_inputs/codegen/isolate4.c --- cloog-0.18.2/isl/test_inputs/codegen/isolate4.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/isolate4.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,13 @@ +{ + A(0); + A(1); + A(2); + A(3); + A(4); + for (int c0 = 5; c0 <= 15; c0 += 1) + A(c0); + A(16); + A(17); + A(18); + A(19); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/isolate4.st cloog-0.18.4/isl/test_inputs/codegen/isolate4.st --- cloog-0.18.2/isl/test_inputs/codegen/isolate4.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/isolate4.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,5 @@ +# Check that generic options are not applied to isolated part +domain: "{ A[i] : 0 <= i < 20 }" +child: + schedule: "[{ A[i] -> [i] }]" + options: "{ isolate[[] -> [x]] : 5 <= x <= 15; unroll[x] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/isolate5.c cloog-0.18.4/isl/test_inputs/codegen/isolate5.c --- cloog-0.18.2/isl/test_inputs/codegen/isolate5.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/isolate5.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,23 @@ +{ + for (int c0 = 0; c0 <= 9; c0 += 1) + for (int c1 = 0; c1 <= 1; c1 += 1) { + if (c0 % 2 == 0) { + A(c0 / 2, c1); + } else + B((c0 - 1) / 2, c1); + } + for (int c0 = 10; c0 <= 89; c0 += 1) + for (int c1 = 0; c1 <= 1; c1 += 1) { + if (c0 % 2 == 0) { + A(c0 / 2, c1); + } else + B((c0 - 1) / 2, c1); + } + for (int c0 = 90; c0 <= 199; c0 += 1) + for (int c1 = 0; c1 <= 1; c1 += 1) { + if (c0 % 2 == 0) { + A(c0 / 2, c1); + } else + B((c0 - 1) / 2, c1); + } +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/isolate5.st cloog-0.18.4/isl/test_inputs/codegen/isolate5.st --- cloog-0.18.2/isl/test_inputs/codegen/isolate5.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/isolate5.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,5 @@ +# Check that use of isolate option prevents shifted stride detection +domain: "{ A[i,j] : 0 <= i < 100 and 0 <= j < 2; B[i,j] : 0 <= i < 100 and 0 <= j < 2 }" +child: + schedule: "[{ A[i,j] -> [2i]; B[i,j] -> [2i+1] }, { A[i,j] -> [j]; B[i,j] -> [j]}]" + options: "{ isolate[[] -> [x, y]] : 10 <= x < 90 }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/isolate6.c cloog-0.18.4/isl/test_inputs/codegen/isolate6.c --- cloog-0.18.2/isl/test_inputs/codegen/isolate6.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/isolate6.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,26 @@ +{ + for (int c0 = 0; c0 <= 8; c0 += 1) { + for (int c1 = 0; c1 <= -c0 + 8; c1 += 1) + for (int c2 = 10 * c0; c2 <= 10 * c0 + 9; c2 += 1) { + A(c2, 10 * c1); + A(c2, 10 * c1 + 1); + A(c2, 10 * c1 + 2); + A(c2, 10 * c1 + 3); + A(c2, 10 * c1 + 4); + A(c2, 10 * c1 + 5); + A(c2, 10 * c1 + 6); + A(c2, 10 * c1 + 7); + A(c2, 10 * c1 + 8); + A(c2, 10 * c1 + 9); + } + for (int c1 = -c0 + 9; c1 <= -c0 + 10; c1 += 1) + for (int c2 = 10 * c0; c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1) + for (int c3 = 10 * c1; c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1) + A(c2, c3); + } + for (int c0 = 9; c0 <= 10; c0 += 1) + for (int c1 = 0; c1 <= -c0 + 10; c1 += 1) + for (int c2 = 10 * c0; c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1) + for (int c3 = 10 * c1; c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1) + A(c2, c3); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/isolate6.st cloog-0.18.4/isl/test_inputs/codegen/isolate6.st --- cloog-0.18.2/isl/test_inputs/codegen/isolate6.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/isolate6.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,8 @@ +# Example from the manual +domain: "{ A[i,j] : 0 <= i,j and i + j <= 100 }" +child: + schedule: "[{ A[i,j] -> [floor(i/10)] }, \ + { A[i,j] -> [floor(j/10)] }, \ + { A[i,j] -> [i] }, { A[i,j] -> [j] }]" + options: "{ isolate[[] -> [a,b,c,d]] : 0 <= 10a,10b and \ + 10a+9+10b+9 <= 100; [isolate[] -> unroll[3]] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/lu.c cloog-0.18.4/isl/test_inputs/codegen/lu.c --- cloog-0.18.2/isl/test_inputs/codegen/lu.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/lu.c 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,17 @@ +for (int c0 = 0; c0 < n - 1; c0 += 32) + for (int c1 = c0; c1 < n; c1 += 32) + for (int c2 = c0; c2 < n; c2 += 32) { + if (c1 >= c0 + 32) { + for (int c3 = c0; c3 <= min(c0 + 31, c2 + 30); c3 += 1) + for (int c4 = c1; c4 <= min(n - 1, c1 + 31); c4 += 1) + for (int c5 = max(c2, c3 + 1); c5 <= min(n - 1, c2 + 31); c5 += 1) + S_6(c3, c4, c5); + } else + for (int c3 = c0; c3 <= min(min(n - 2, c0 + 31), c2 + 30); c3 += 1) { + for (int c5 = max(c2, c3 + 1); c5 <= min(n - 1, c2 + 31); c5 += 1) + S_2(c3, c5); + for (int c4 = c3 + 1; c4 <= min(n - 1, c0 + 31); c4 += 1) + for (int c5 = max(c2, c3 + 1); c5 <= min(n - 1, c2 + 31); c5 += 1) + S_6(c3, c4, c5); + } + } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/lu.in cloog-0.18.4/isl/test_inputs/codegen/lu.in --- cloog-0.18.2/isl/test_inputs/codegen/lu.in 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/lu.in 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,4 @@ +# Check that the stride of the second loop is properly detected +[n] -> { S_2[k, j] -> [o0, o0, o2, k, k, j, 1] : exists (e0 = floor((o2)/32), e1 = floor((o0)/32): 32e0 = o2 and 32e1 = o0 and o0 <= k and o0 >= -31 + k and k >= 0 and j <= -1 + n and o2 <= j and o2 >= -31 + j and j >= 1 + k); S_6[k, i, j] -> [o0, o1, o2, k, i, j, 0] : exists (e0 = floor((o0)/32), e1 = floor((o1)/32), e2 = floor((o2)/32): 32e0 = o0 and 32e1 = o1 and 32e2 = o2 and o0 <= k and o0 >= -31 + k and o1 <= i and o1 >= -31 + i and o2 <= j and o2 >= -31 + j and k >= 0 and i >= 1 + k and j <= -1 + n and j >= 1 + k and i <= -1 + n) } +{ : } +{ [a,b,c,d,e,f,g] -> atomic[x] : x < 3; [a,b,c,d,e,f,g] -> separate[x] : x >= 3 } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/basics-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/basics-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/basics-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/basics-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,3 +1,3 @@ for (int c0 = -9; c0 <= 9; c0 += 1) - for (int c1 = max(-c0 + 1, 1); c1 <= min(-c0 + 10, 10); c1 += 1) + for (int c1 = max(1, -c0 + 1); c1 <= min(10, -c0 + 10); c1 += 1) s0(c0, c1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/code_gen-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/code_gen-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/code_gen-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/code_gen-0.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,6 +1,6 @@ for (int c0 = 1; c0 <= 8; c0 += 1) for (int c1 = 0; c1 <= 7; c1 += 1) { - if (c1 <= 4 && c0 <= 6 && c0 >= 2) + if (c0 >= 2 && c0 <= 6 && c1 <= 4) s1(c0, c1); if (c1 + 1 >= c0) s0(c0, c1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/code_gen-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/code_gen-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/code_gen-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/code_gen-1.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,16 +1,15 @@ for (int c0 = 1; c0 <= 8; c0 += 1) { - if (c0 <= 6) - for (int c1 = 0; c1 < c0 - 1; c1 += 1) - s1(c0, c1); if (c0 >= 2) { + if (c0 <= 6) + for (int c1 = 0; c1 < c0 - 1; c1 += 1) + s1(c0, c1); for (int c1 = c0 - 1; c1 <= 4; c1 += 1) { s1(c0, c1); s0(c0, c1); } - for (int c1 = max(c0 - 1, 5); c1 <= 7; c1 += 1) + for (int c1 = max(5, c0 - 1); c1 <= 7; c1 += 1) s0(c0, c1); - } - if (c0 == 1) + } else for (int c1 = 0; c1 <= 7; c1 += 1) s0(1, c1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/dagstuhl1-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/dagstuhl1-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/dagstuhl1-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/dagstuhl1-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,2 +1,2 @@ for (int c0 = 0; c0 <= 99; c0 += 1) - s0(c0, (c0 + 10) % 10, (c0 + 10) / 10 - 1); + s0(c0, c0 % 10, (c0 + 10) / 10 - 1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/guard1-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/guard1-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/guard1-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/guard1-0.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,2 +1,2 @@ -if (n + 3 * floord(-n + m - 2, 3) + 2 == m) +if ((n - m + 2) % 3 == 0) s0(n, m); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/guard1-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/guard1-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/guard1-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/guard1-1.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,2 +1,2 @@ -if (n + 2 * floord(-n + m - 1, 2) + 1 == m) +if ((n - m + 1) % 2 == 0) s0(n, m); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/hpf-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/hpf-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/hpf-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/hpf-0.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,4 +1,4 @@ -if (P1 == P2 && P2 >= 0 && P2 <= 3) - for (int c0 = 0; c0 <= min(-P2 + 4, 2); c0 += 1) - for (int c2 = -P2 - c0 + 3 * floord(P2 + c0 - 1, 3) + 3; c2 <= 3; c2 += 3) +if (P2 >= 0 && P2 <= 3 && P1 == P2) + for (int c0 = 0; c0 <= min(2, -P2 + 4); c0 += 1) + for (int c2 = (-P2 - c0 + 6) % 3; c2 <= 3; c2 += 3) s0(c0, c0, c2, c2); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/if_then-2.c cloog-0.18.4/isl/test_inputs/codegen/omega/if_then-2.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/if_then-2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/if_then-2.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = 1; c0 <= 100; c0 += 1) +for (int c0 = 1; c0 <= 100; c0 += 1) { if (n >= 2) { s0(c0); for (int c1 = 1; c1 <= 100; c1 += 1) { @@ -8,3 +8,4 @@ } else for (int c1 = 1; c1 <= 100; c1 += 1) s2(c0, c1); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/if_then-4.c cloog-0.18.4/isl/test_inputs/codegen/omega/if_then-4.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/if_then-4.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/if_then-4.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,7 +1,7 @@ for (int c0 = 4; c0 <= 100; c0 += 4) { for (int c1 = 1; c1 <= 100; c1 += 1) s0(c0, c1); - if (c0 <= 96 && c0 >= 8) + if (c0 >= 8 && c0 <= 96) for (int c1 = 10; c1 <= 100; c1 += 1) s1(c0 + 2, c1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/if_then-5.c cloog-0.18.4/isl/test_inputs/codegen/omega/if_then-5.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/if_then-5.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/if_then-5.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,7 +1,7 @@ for (int c0 = 4; c0 <= 100; c0 += 4) { for (int c1 = 1; c1 <= 100; c1 += 1) s0(c0, c1); - if (c0 <= 96 && c0 >= 8) + if (c0 >= 8 && c0 <= 96) for (int c1 = 10; c1 <= 100; c1 += 1) s1(c0 + 2, c1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/iter8-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/iter8-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/iter8-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/iter8-0.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,2 +1,2 @@ -for (int c0 = max(exprVar2 + 8 * floord(-exprVar2 + exprVar1 - 1, 8) + 9, exprVar2 + 1); c0 <= 16; c0 += 8) +for (int c0 = max(exprVar2 + 1, exprVar2 + 8 * floord(-exprVar2 + exprVar1 - 1, 8) + 9); c0 <= 16; c0 += 8) s0(c0); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/iter9-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/iter9-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/iter9-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/iter9-0.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,11 +1,11 @@ for (int c0 = 1; c0 <= 15; c0 += 1) { - if (8 * floord(7 * exprVar1 + 7, 8) + 8 >= 7 * exprVar1 + c0) { + if (((-exprVar1 + 15) % 8) + c0 <= 15) { s4(c0); s0(c0); s3(c0); s2(c0); s1(c0); } - if (8 * floord(7 * exprVar1 + 7, 8) + 8 >= 7 * exprVar1 + c0 || (exprVar1 + 8 * floord(-exprVar1 + c0 - 1, 8) + 1 == c0 && c0 >= exprVar1 + 1)) + if (((-exprVar1 + 15) % 8) + c0 <= 15 || (c0 >= exprVar1 + 1 && (exprVar1 - c0 + 1) % 8 == 0)) s5(c0); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lefur00-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/lefur00-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lefur00-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lefur00-0.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,5 +1,5 @@ for (int c0 = 0; c0 <= 15; c0 += 1) - for (int c1 = max(2 * c0 - 15, c0 / 2); c1 <= min(c0 + 1, 15); c1 += 1) - for (int c2 = max(max(max(67 * c0 - (c0 + 1) / 3, 1), 67 * c1 - (c1 + 2) / 3), 133 * c0 - 67 * c1 + (c0 + c1 + 1) / 3 - 66); c2 <= min(min(100 * c0 + 99, 1000), 133 * c0 - 67 * c1 + floord(c0 + c1 - 1, 3) + 133); c2 += 1) - for (int c3 = max(max(100 * c1 + (c2 + 1) / 2, 200 * c0 - c2), c2); c3 <= min(min(200 * c0 - c2 + 199, 100 * c1 + (c2 + 1) / 2 + 99), 2 * c2 + 1); c3 += 1) + for (int c1 = max(2 * c0 - 15, c0 / 2); c1 <= min(15, c0 + 1); c1 += 1) + for (int c2 = max(max(max(1, 67 * c0 - (c0 + 1) / 3), 67 * c1 - (c1 + 2) / 3), 133 * c0 - 67 * c1 + (c0 + c1 + 1) / 3 - 66); c2 <= min(min(1000, 100 * c0 + 99), 133 * c0 - 67 * c1 + (c0 + c1 + 2) / 3 + 132); c2 += 1) + for (int c3 = max(max(c2, 200 * c0 - c2), 100 * c1 + (c2 + 1) / 2); c3 <= min(min(2 * c2 + 1, 200 * c0 - c2 + 199), 100 * c1 + (c2 + 1) / 2 + 99); c3 += 1) s0(c0, c1, c2, c3); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lefur01-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/lefur01-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lefur01-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lefur01-0.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,5 +1,5 @@ for (int c0 = 0; c0 <= 15; c0 += 1) - for (int c1 = max(2 * c0 - 15, c0 / 2); c1 <= min(c0 + 1, 15); c1 += 1) - for (int c2 = max(max(max(67 * c0 - (c0 + 1) / 3, 1), 67 * c1 - (c1 + 2) / 3), 133 * c0 - 67 * c1 + (c0 + c1 + 1) / 3 - 66); c2 <= min(min(100 * c0 + 99, 1000), 133 * c0 - 67 * c1 + floord(c0 + c1 - 1, 3) + 133); c2 += 1) - for (int c3 = max(max(100 * c1 + (c2 + 1) / 2, 200 * c0 - c2), c2); c3 <= min(min(200 * c0 - c2 + 199, 100 * c1 + (c2 + 1) / 2 + 99), 2 * c2 + 1); c3 += 1) + for (int c1 = max(2 * c0 - 15, c0 / 2); c1 <= min(15, c0 + 1); c1 += 1) + for (int c2 = max(max(max(1, 67 * c0 - (c0 + 1) / 3), 67 * c1 - (c1 + 2) / 3), 133 * c0 - 67 * c1 + (c0 + c1 + 1) / 3 - 66); c2 <= min(min(1000, 100 * c0 + 99), 133 * c0 - 67 * c1 + (c0 + c1 + 2) / 3 + 132); c2 += 1) + for (int c3 = max(max(c2, 200 * c0 - c2), 100 * c1 + (c2 + 1) / 2); c3 <= min(min(2 * c2 + 1, 200 * c0 - c2 + 199), 100 * c1 + (c2 + 1) / 2 + 99); c3 += 1) s0(c0, c1, c2, c3); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lefur01-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/lefur01-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lefur01-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lefur01-1.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,5 +1,5 @@ for (int c0 = 0; c0 <= 15; c0 += 1) - for (int c1 = max(2 * c0 - 15, c0 / 2); c1 <= min(c0 + 1, 15); c1 += 1) - for (int c2 = max(max(max(1, 67 * c1 - (c1 + 2) / 3), 67 * c0 - (c0 + 1) / 3), 133 * c0 - 67 * c1 + (c0 + c1 + 1) / 3 - 66); c2 <= min(min(100 * c0 + 99, 1000), 133 * c0 - 67 * c1 + floord(c0 + c1 - 1, 3) + 133); c2 += 1) - for (int c3 = max(max(100 * c1 + (c2 + 1) / 2, 200 * c0 - c2), c2); c3 <= min(min(200 * c0 - c2 + 199, 100 * c1 + (c2 + 1) / 2 + 99), 2 * c2 + 1); c3 += 1) + for (int c1 = max(2 * c0 - 15, c0 / 2); c1 <= min(15, c0 + 1); c1 += 1) + for (int c2 = max(max(max(1, 67 * c0 - (c0 + 1) / 3), 67 * c1 - (c1 + 2) / 3), 133 * c0 - 67 * c1 + (c0 + c1 + 1) / 3 - 66); c2 <= min(min(1000, 100 * c0 + 99), 133 * c0 - 67 * c1 + (c0 + c1 + 2) / 3 + 132); c2 += 1) + for (int c3 = max(max(c2, 200 * c0 - c2), 100 * c1 + (c2 + 1) / 2); c3 <= min(min(2 * c2 + 1, 200 * c0 - c2 + 199), 100 * c1 + (c2 + 1) / 2 + 99); c3 += 1) s0(c0, c1, c2, c3); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lefur03-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/lefur03-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lefur03-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lefur03-0.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,7 +1,7 @@ for (int c0 = 0; c0 <= 3; c0 += 1) - for (int c1 = max(2 * c0 - 3, 0); c1 <= min(3, c0 + c0 / 2 + 1); c1 += 1) - for (int c2 = c0; c2 <= min(min(2 * c0 - c1 + 1, 3 * c1 + 2), 3); c2 += 1) - for (int c3 = max(max(max(c2 + floord(3 * c1 - c2 - 1, 6), c1 - (-c1 + 3) / 3), c0 - (-c0 + 3) / 3), 0); c3 <= min(c0 + 1, 3); c3 += 1) - for (int c4 = max(max(max(max(250 * c3 + 1, 333 * c2 + (c2 + 1) / 3), 333 * c1 + c1 / 3), -200 * c1 + 400 * c3 - 199), 667 * c0 - 333 * c1 - (c0 + c1 + 3) / 3 - 332); c4 <= min(min(min(min(1000, -200 * c1 + 400 * c3 + 400), 500 * c0 + 499), 333 * c2 - (-c2 + 3) / 3 + 333), 333 * c3 - (-c3 + 3) / 3 + 334); c4 += 1) - for (int c5 = max(max(max(c4, 1000 * c3 - 2 * c4 + 2), 500 * c1 + (c4 + 1) / 2), 1000 * c0 - c4); c5 <= min(min(min(1000 * c0 - c4 + 999, 500 * c1 + (c4 + 1) / 2 + 499), 1000 * c3 - 2 * c4 + 1001), 2 * c4 + 1); c5 += 1) + for (int c1 = max(2 * c0 - 3, c0 / 2); c1 <= min(3, c0 + 1); c1 += 1) + for (int c2 = c0; c2 <= min(min(3, 2 * c0 - c1 + 1), 3 * c1 + 2); c2 += 1) + for (int c3 = max(max(max(0, c1 - (-c1 + 3) / 3), c0 - (-c2 + 3) / 3), c2 + floord(3 * c1 - c2 - 1, 6)); c3 <= min(3, c0 + 1); c3 += 1) + for (int c4 = max(max(max(max(-200 * c1 + 400 * c3 - 199, 250 * c3 + 1), 667 * c0 - 333 * c1 - (c0 + c1 + 3) / 3 - 332), 333 * c1 + c1 / 3), 333 * c2 + (c2 + 1) / 3); c4 <= min(min(min(min(1000, 500 * c0 + 499), -200 * c1 + 400 * c3 + 400), 333 * c2 - (-c2 + 3) / 3 + 333), 333 * c3 - (-c3 + 3) / 3 + 334); c4 += 1) + for (int c5 = max(max(max(c4, 1000 * c0 - c4), 1000 * c3 - 2 * c4 + 2), 500 * c1 + (c4 + 1) / 2); c5 <= min(min(min(2 * c4 + 1, 1000 * c0 - c4 + 999), 1000 * c3 - 2 * c4 + 1001), 500 * c1 + (c4 + 1) / 2 + 499); c5 += 1) s0(c0, c1, c2, c3, c4, c5); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lefur04-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/lefur04-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lefur04-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lefur04-0.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,8 +1,8 @@ for (int c0 = 0; c0 <= 3; c0 += 1) - for (int c1 = max(2 * c0 - 3, c0 / 2); c1 <= min(c0 + 1, 3); c1 += 1) + for (int c1 = max(2 * c0 - 3, c0 / 2); c1 <= min(3, c0 + 1); c1 += 1) for (int c2 = c0; c2 <= min(min(3, 2 * c0 - c1 + 1), 3 * c1 + 2); c2 += 1) - for (int c3 = max(max(max(c2 - (c2 + 2) / 3, c2 + floord(3 * c1 - c2 - 1, 6)), c1 - (-c1 + 3) / 3), c0 - (-c2 + 3) / 3); c3 <= min(c0 + c0 / 2 + 1, 3); c3 += 1) - for (int c5 = max(max(max(max(c1 - (c1 - 2 * c3 + 5) / 5, 0), c3 - (c3 + 3) / 3), 2 * c3 - 4), c2 - (c2 + 3) / 3); c5 <= min(min(c1 + 1, c3), -c2 + 2 * c3 - (c2 + 3) / 3 + 2); c5 += 1) - for (int c6 = max(max(max(max(max(1000 * c0 - 500 * c5 - 501, -200 * c1 + 400 * c3 - 199), 333 * c1 + c1 / 3), 250 * c3 + 1), 667 * c0 - 333 * c1 - (c0 + c1 + 3) / 3 - 332), 333 * c2 + (c2 + 1) / 3); c6 <= min(min(min(min(min(min(-200 * c1 + 400 * c3 + 400, 500 * c0 + 499), 333 * c2 - (-c2 + 3) / 3 + 333), 333 * c3 - (-c3 + 3) / 3 + 334), 500 * c5 + 501), 1000), 1000 * c0 - 500 * c5 + 997); c6 += 1) - for (int c7 = max(max(max(max(c6, 500 * c5 + 2), 1000 * c3 - 2 * c6 + 2), 500 * c1 + (c6 + 1) / 2), 1000 * c0 - c6); c7 <= min(min(min(min(500 * c5 + 501, 2 * c6 + 1), 1000 * c0 - c6 + 999), 500 * c1 + (c6 + 1) / 2 + 499), 1000 * c3 - 2 * c6 + 1001); c7 += 1) + for (int c3 = max(max(max(c1 - (-c1 + 3) / 3, c0 - (-c2 + 3) / 3), c2 - (c2 + 2) / 3), c2 + floord(3 * c1 - c2 - 1, 6)); c3 <= min(3, c0 + c2 / 3 + 1); c3 += 1) + for (int c5 = max(max(max(max(0, 2 * c3 - 4), c1 - (-c1 + 3) / 3), c2 - (c2 + 3) / 3), c3 - (c3 + 3) / 3); c5 <= min(min(c1 + 1, c3), -c2 + 2 * c3 - (c2 + 3) / 3 + 2); c5 += 1) + for (int c6 = max(max(max(max(max(-200 * c1 + 400 * c3 - 199, 250 * c3 + 1), 1000 * c0 - 500 * c5 - 501), 667 * c0 - 333 * c1 - (c0 + c1 + 3) / 3 - 332), 333 * c1 + c1 / 3), 333 * c2 + (c2 + 1) / 3); c6 <= min(min(min(min(min(min(1000, 500 * c0 + 499), -200 * c1 + 400 * c3 + 400), 500 * c5 + 501), 1000 * c0 - 500 * c5 + 997), 333 * c2 - (-c2 + 3) / 3 + 333), 333 * c3 - (-c3 + 3) / 3 + 334); c6 += 1) + for (int c7 = max(max(max(max(500 * c5 + 2, c6), 1000 * c0 - c6), 1000 * c3 - 2 * c6 + 2), 500 * c1 + (c6 + 1) / 2); c7 <= min(min(min(min(500 * c5 + 501, 2 * c6 + 1), 1000 * c0 - c6 + 999), 1000 * c3 - 2 * c6 + 1001), 500 * c1 + (c6 + 1) / 2 + 499); c7 += 1) s0(c0, c1, c2, c3, c2 / 3, c5, c6, c7); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lift1-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/lift1-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lift1-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lift1-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,7 +1,7 @@ for (int c0 = 1; c0 <= 100; c0 += 1) for (int c1 = 1; c1 <= 100; c1 += 1) for (int c2 = 1; c2 <= 100; c2 += 1) - for (int c3 = 1; c3 <= 100; c3 += 1) + for (int c3 = 1; c3 <= 100; c3 += 1) { if (c0 >= 61) { for (int c4 = 1; c4 <= 100; c4 += 1) s1(c0, c1, c2, c3, c4); @@ -10,3 +10,4 @@ s1(c0, c1, c2, c3, c4); s0(c0, c1, c2, c3, c4); } + } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lift1-2.c cloog-0.18.4/isl/test_inputs/codegen/omega/lift1-2.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lift1-2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lift1-2.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,6 +1,6 @@ for (int c0 = 1; c0 <= 100; c0 += 1) for (int c1 = 1; c1 <= 100; c1 += 1) - for (int c2 = 1; c2 <= 100; c2 += 1) + for (int c2 = 1; c2 <= 100; c2 += 1) { if (c0 >= 61) { for (int c3 = 1; c3 <= 100; c3 += 1) for (int c4 = 1; c4 <= 100; c4 += 1) @@ -11,3 +11,4 @@ s1(c0, c1, c2, c3, c4); s0(c0, c1, c2, c3, c4); } + } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lift1-3.c cloog-0.18.4/isl/test_inputs/codegen/omega/lift1-3.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lift1-3.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lift1-3.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,5 +1,5 @@ for (int c0 = 1; c0 <= 100; c0 += 1) - for (int c1 = 1; c1 <= 100; c1 += 1) + for (int c1 = 1; c1 <= 100; c1 += 1) { if (c0 >= 61) { for (int c2 = 1; c2 <= 100; c2 += 1) for (int c3 = 1; c3 <= 100; c3 += 1) @@ -12,3 +12,4 @@ s1(c0, c1, c2, c3, c4); s0(c0, c1, c2, c3, c4); } + } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lift1-4.c cloog-0.18.4/isl/test_inputs/codegen/omega/lift1-4.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lift1-4.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lift1-4.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = 1; c0 <= 100; c0 += 1) +for (int c0 = 1; c0 <= 100; c0 += 1) { if (c0 >= 61) { for (int c1 = 1; c1 <= 100; c1 += 1) for (int c2 = 1; c2 <= 100; c2 += 1) @@ -13,3 +13,4 @@ s1(c0, c1, c2, c3, c4); s0(c0, c1, c2, c3, c4); } +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lift2-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/lift2-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lift2-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lift2-0.c 2014-10-02 15:48:18.000000000 +0000 @@ -4,6 +4,6 @@ for (int c3 = 1; c3 <= 100; c3 += 1) for (int c4 = 1; c4 <= 100; c4 += 1) { s1(c0, c1, c2, c3, c4); - if (c0 <= 60 && c0 >= 5) + if (c0 >= 5 && c0 <= 60) s0(c0, c1, c2, c3, c4); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lift2-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/lift2-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lift2-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lift2-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,7 +1,7 @@ for (int c0 = 1; c0 <= 100; c0 += 1) for (int c1 = 1; c1 <= 100; c1 += 1) for (int c2 = 1; c2 <= 100; c2 += 1) - for (int c3 = 1; c3 <= 100; c3 += 1) + for (int c3 = 1; c3 <= 100; c3 += 1) { if (c0 >= 61) { for (int c4 = 1; c4 <= 100; c4 += 1) s1(c0, c1, c2, c3, c4); @@ -13,3 +13,4 @@ s1(c0, c1, c2, c3, c4); s0(c0, c1, c2, c3, c4); } + } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lift2-2.c cloog-0.18.4/isl/test_inputs/codegen/omega/lift2-2.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lift2-2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lift2-2.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,6 +1,6 @@ for (int c0 = 1; c0 <= 100; c0 += 1) for (int c1 = 1; c1 <= 100; c1 += 1) - for (int c2 = 1; c2 <= 100; c2 += 1) + for (int c2 = 1; c2 <= 100; c2 += 1) { if (c0 >= 61) { for (int c3 = 1; c3 <= 100; c3 += 1) for (int c4 = 1; c4 <= 100; c4 += 1) @@ -15,3 +15,4 @@ s1(c0, c1, c2, c3, c4); s0(c0, c1, c2, c3, c4); } + } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lift2-3.c cloog-0.18.4/isl/test_inputs/codegen/omega/lift2-3.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lift2-3.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lift2-3.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,5 +1,5 @@ for (int c0 = 1; c0 <= 100; c0 += 1) - for (int c1 = 1; c1 <= 100; c1 += 1) + for (int c1 = 1; c1 <= 100; c1 += 1) { if (c0 >= 61) { for (int c2 = 1; c2 <= 100; c2 += 1) for (int c3 = 1; c3 <= 100; c3 += 1) @@ -17,3 +17,4 @@ s1(c0, c1, c2, c3, c4); s0(c0, c1, c2, c3, c4); } + } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lift2-4.c cloog-0.18.4/isl/test_inputs/codegen/omega/lift2-4.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lift2-4.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lift2-4.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = 1; c0 <= 100; c0 += 1) +for (int c0 = 1; c0 <= 100; c0 += 1) { if (c0 >= 61) { for (int c1 = 1; c1 <= 100; c1 += 1) for (int c2 = 1; c2 <= 100; c2 += 1) @@ -19,3 +19,4 @@ s1(c0, c1, c2, c3, c4); s0(c0, c1, c2, c3, c4); } +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lu-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/lu-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lu-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lu-0.c 2014-10-02 15:33:27.000000000 +0000 @@ -2,9 +2,9 @@ for (int c1 = c0 - 1; c1 <= n; c1 += 64) for (int c2 = c0; c2 <= n; c2 += 1) { for (int c3 = c0; c3 <= min(min(c0 + 63, c1 + 62), c2 - 1); c3 += 1) - for (int c4 = max(c3 + 1, c1); c4 <= min(c1 + 63, n); c4 += 1) + for (int c4 = max(c1, c3 + 1); c4 <= min(n, c1 + 63); c4 += 1) s1(c3, c4, c2); if (c0 + 63 >= c2) - for (int c4 = max(c2 + 1, c1); c4 <= min(n, c1 + 63); c4 += 1) + for (int c4 = max(c1, c2 + 1); c4 <= min(n, c1 + 63); c4 += 1) s0(c2, c4); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lu-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/lu-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lu-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lu-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -2,9 +2,9 @@ for (int c1 = c0 - 1; c1 <= n; c1 += 64) for (int c2 = c0; c2 <= n; c2 += 1) { for (int c3 = c0; c3 <= min(min(c0 + 63, c1 + 62), c2 - 1); c3 += 1) - for (int c4 = max(c3 + 1, c1); c4 <= min(c1 + 63, n); c4 += 1) + for (int c4 = max(c1, c3 + 1); c4 <= min(n, c1 + 63); c4 += 1) s1(c3, c4, c2); if (c0 + 63 >= c2) - for (int c4 = max(c2 + 1, c1); c4 <= min(n, c1 + 63); c4 += 1) + for (int c4 = max(c1, c2 + 1); c4 <= min(n, c1 + 63); c4 += 1) s0(c2, c4); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lu-2.c cloog-0.18.4/isl/test_inputs/codegen/omega/lu-2.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lu-2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lu-2.c 2014-10-02 15:33:27.000000000 +0000 @@ -2,9 +2,9 @@ for (int c1 = c0 - 1; c1 <= n; c1 += 64) for (int c2 = c0; c2 <= n; c2 += 1) { for (int c3 = c0; c3 <= min(min(c0 + 63, c1 + 62), c2 - 1); c3 += 1) - for (int c4 = max(c3 + 1, c1); c4 <= min(c1 + 63, n); c4 += 1) + for (int c4 = max(c1, c3 + 1); c4 <= min(n, c1 + 63); c4 += 1) s1(c3, c4, c2); if (c0 + 63 >= c2) - for (int c4 = max(c2 + 1, c1); c4 <= min(n, c1 + 63); c4 += 1) + for (int c4 = max(c1, c2 + 1); c4 <= min(n, c1 + 63); c4 += 1) s0(c2, c4); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lu-3.c cloog-0.18.4/isl/test_inputs/codegen/omega/lu-3.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lu-3.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lu-3.c 2014-10-02 15:33:27.000000000 +0000 @@ -2,13 +2,13 @@ for (int c1 = c0 - 1; c1 <= n; c1 += 64) { for (int c2 = c0; c2 <= min(n, c0 + 63); c2 += 1) { for (int c3 = c0; c3 <= min(c1 + 62, c2 - 1); c3 += 1) - for (int c4 = max(c3 + 1, c1); c4 <= min(c1 + 63, n); c4 += 1) + for (int c4 = max(c1, c3 + 1); c4 <= min(n, c1 + 63); c4 += 1) s1(c3, c4, c2); - for (int c4 = max(c2 + 1, c1); c4 <= min(n, c1 + 63); c4 += 1) + for (int c4 = max(c1, c2 + 1); c4 <= min(n, c1 + 63); c4 += 1) s0(c2, c4); } for (int c2 = c0 + 64; c2 <= n; c2 += 1) for (int c3 = c0; c3 <= min(c0 + 63, c1 + 62); c3 += 1) - for (int c4 = max(c3 + 1, c1); c4 <= min(c1 + 63, n); c4 += 1) + for (int c4 = max(c1, c3 + 1); c4 <= min(n, c1 + 63); c4 += 1) s1(c3, c4, c2); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lu_spmd-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/lu_spmd-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lu_spmd-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lu_spmd-0.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,13 +1,12 @@ if (ub >= lb) for (int c0 = 1; c0 <= ub; c0 += 1) for (int c1 = c0; c1 <= n; c1 += 1) { - if (lb >= c0 + 1) { - s3(c0, c1, lb, c0, c1); - } else if (c1 >= c0 + 1) { + if (c0 >= lb && c1 >= c0 + 1) { s0(c0, c1); if (n >= ub + 1) s2(c0, c1); - } - for (int c3 = max(c0, lb); c3 <= ub; c3 += 1) + } else if (lb >= c0 + 1) + s3(c0, c1, lb, c0, c1); + for (int c3 = max(lb, c0); c3 <= ub; c3 += 1) s1(c0, c1, c3); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/lu_spmd-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/lu_spmd-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/lu_spmd-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/lu_spmd-1.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,13 +1,12 @@ if (ub >= lb) for (int c0 = 1; c0 <= ub; c0 += 1) for (int c1 = c0; c1 <= n; c1 += 1) { - if (lb >= c0 + 1) { - s3(c0, c1, lb, c0, c1); - } else if (c1 >= c0 + 1) { + if (c0 >= lb && c1 >= c0 + 1) { s0(c0, c1); if (n >= ub + 1) s2(c0, c1); - } - for (int c3 = max(c0, lb); c3 <= ub; c3 += 1) + } else if (lb >= c0 + 1) + s3(c0, c1, lb, c0, c1); + for (int c3 = max(lb, c0); c3 <= ub; c3 += 1) s1(c0, c1, c3); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/m10-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/m10-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/m10-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/m10-1.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,5 +1,5 @@ -for (int c0 = 1; c0 <= 18; c0 += 1) - if (c0 <= 9 && c0 >= 2) { +for (int c0 = 1; c0 <= 18; c0 += 1) { + if (c0 >= 2 && c0 <= 9) { for (int c1 = 1; c1 <= 9; c1 += 1) { if (c0 % 2 == 0) s0(c1, c0 / 2); @@ -11,3 +11,4 @@ } else if (c0 % 2 == 0) for (int c1 = 1; c1 <= 9; c1 += 1) s0(c1, c0 / 2); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/m11-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/m11-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/m11-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/m11-0.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,6 +1,6 @@ for (int c0 = 1; c0 <= min(4, floord(2 * m - 1, 17) + 1); c0 += 1) for (int c1 = 1; c1 <= 2; c1 += 1) - for (int c2 = 0; c2 <= min(-c1 + c1 / 2 + 3, -c0 - c1 + (2 * m + 3 * c0 + 10 * c1 + 6) / 20 + 1); c2 += 1) - for (int c3 = 8 * c0 + (c0 + 1) / 2 - 8; c3 <= min(min(8 * c0 + c0 / 2, 30), m - 5 * c1 - 10 * c2 + 5); c3 += 1) - for (int c4 = 5 * c1 + 10 * c2 - 4; c4 <= min(m - c3 + 1, 5 * c1 + 10 * c2); c4 += 1) + for (int c2 = 0; c2 <= min(2, -c0 - c1 + (2 * m + 3 * c0 + 10 * c1 + 6) / 20 + 1); c2 += 1) + for (int c3 = 8 * c0 + (c0 + 1) / 2 - 8; c3 <= min(min(30, m - 5 * c1 - 10 * c2 + 5), 8 * c0 + c0 / 2); c3 += 1) + for (int c4 = 5 * c1 + 10 * c2 - 4; c4 <= min(5 * c1 + 10 * c2, m - c3 + 1); c4 += 1) s0(c0, c1, c2, c3, c4, -9 * c0 + c3 + c0 / 2 + 9, -5 * c1 - 5 * c2 + c4 + 5); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/m1-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/m1-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/m1-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/m1-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = 1; c0 <= 9; c0 += 1) +for (int c0 = 1; c0 <= 9; c0 += 1) { if (c0 >= 6) { for (int c1 = 1; c1 <= 9; c1 += 1) s0(c0, c1); @@ -10,3 +10,4 @@ s0(5, c1); s1(5, c1); } +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/m2-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/m2-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/m2-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/m2-0.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = 2; c0 <= 9; c0 += 1) +for (int c0 = 2; c0 <= 9; c0 += 1) { if (c0 >= 5) { s1(c0, 1); for (int c1 = 2; c1 <= 9; c1 += 1) { @@ -8,3 +8,4 @@ } else for (int c1 = 2; c1 <= 9; c1 += 1) s0(c0, c1); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/m3-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/m3-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/m3-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/m3-0.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,3 +1,3 @@ for (int c0 = -9; c0 <= 9; c0 += 1) - for (int c1 = max(-c0 + 1, 1); c1 <= min(-c0 + 10, 10); c1 += 1) + for (int c1 = max(1, -c0 + 1); c1 <= min(10, -c0 + 10); c1 += 1) s0(c0, c1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/m7-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/m7-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/m7-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/m7-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = 1; c0 <= 9; c0 += 1) +for (int c0 = 1; c0 <= 9; c0 += 1) { if (c0 % 2 == 0) { for (int c1 = 1; c1 <= 9; c1 += 1) { s0(c1, c0); @@ -7,3 +7,4 @@ } else for (int c1 = 1; c1 <= 9; c1 += 1) s0(c1, c0); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/m8-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/m8-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/m8-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/m8-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = 2; c0 <= 8; c0 += 2) +for (int c0 = 2; c0 <= 8; c0 += 2) { if (c0 % 4 == 0) { for (int c1 = 1; c1 <= 9; c1 += 1) { s0(c1, c0); @@ -7,3 +7,4 @@ } else for (int c1 = 1; c1 <= 9; c1 += 1) s1(c1, c0); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/p6-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/p6-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/p6-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/p6-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,3 +1,3 @@ for (int c0 = -9; c0 <= 9; c0 += 1) - for (int c1 = max(-c0 + 1, 1); c1 <= min(-c0 + 10, 10); c1 += 1) + for (int c1 = max(1, -c0 + 1); c1 <= min(10, -c0 + 10); c1 += 1) s0(c0, c1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/p.delft-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/p.delft-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/p.delft-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/p.delft-0.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,4 +1,4 @@ -if (P1 == P2 && P2 >= 0 && P2 <= 3) - for (int c0 = 0; c0 <= min(-P2 + 4, 2); c0 += 1) - for (int c2 = -P2 - c0 + 3 * floord(P2 + c0 - 1, 3) + 3; c2 <= 3; c2 += 3) +if (P2 >= 0 && P2 <= 3 && P1 == P2) + for (int c0 = 0; c0 <= min(2, -P2 + 4); c0 += 1) + for (int c2 = (-P2 - c0 + 6) % 3; c2 <= 3; c2 += 3) s0(c0, c0, c2, c2); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/p.delft2-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/p.delft2-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/p.delft2-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/p.delft2-0.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,11 +1,10 @@ -if (P2 <= 3 && P2 >= 0 && P1 <= 3 && P1 >= 0) +if (P1 >= 0 && P1 <= 3 && P2 >= 0 && P2 <= 3) for (int c0 = P1 - 1; c0 <= 3; c0 += 1) - if (P1 + 2 * floord(-P1 + c0 - 1, 2) + 1 == c0) - for (int c2 = 0; c2 <= -((P1 + 4) / 4) + 8; c2 += 1) - if ((5 * c0 + 2 * c2 + 5) % 9 <= 2) - for (int c3 = 0; c3 <= -((P2 + 4) / 4) + 8; c3 += 1) - if ((5 * P2 + 2 * c3) % 9 <= 3) - if (c0 + 1 == P1 && (5 * P1 + 2 * c2) % 9 <= 2 && P1 >= 1) { - s0(P1 - 1, P2, c2, c3, ((5 * P1 + 2 * c2) % 9) + 1, (-4 * P2 + 2 * c3 + 9) % 9); - } else if (c2 % 4 == 0 && c0 == 3 && P1 == 0) - s0(3, P2, c2, c3, (-c2 + 12) / 4, (-4 * P2 + 2 * c3 + 9) % 9); + for (int c2 = 0; c2 <= 7; c2 += 1) + for (int c3 = 0; c3 <= 7; c3 += 1) + if ((5 * P2 + 2 * c3) % 9 <= 3) { + if (P1 >= 1 && c0 + 1 == P1 && (5 * P1 + 2 * c2) % 9 <= 2) { + s0(P1 - 1, P2, c2, c3, ((5 * P1 + 2 * c2) % 9) + 1, (-4 * P2 + 2 * c3 + 9) % 9); + } else if (P1 == 0 && c0 == 3 && c2 % 4 == 0) + s0(3, P2, c2, c3, (-c2 / 4) + 3, (-4 * P2 + 2 * c3 + 9) % 9); + } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/stride2-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/stride2-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/stride2-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/stride2-0.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,3 +1,3 @@ for (int c0 = 0; c0 <= n; c0 += 32) - for (int c1 = c0; c1 <= min(c0 + 31, n); c1 += 1) + for (int c1 = c0; c1 <= min(n, c0 + 31); c1 += 1) s0(c0, c1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/stride3-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/stride3-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/stride3-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/stride3-0.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,3 +1,3 @@ for (int c0 = 3; c0 <= n; c0 += 32) - for (int c1 = c0; c1 <= min(c0 + 31, n); c1 += 1) + for (int c1 = c0; c1 <= min(n, c0 + 31); c1 += 1) s0(c0, c1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/stride5-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/stride5-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/stride5-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/stride5-0.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,3 +1,3 @@ -for (int c0 = 2; c0 <= min(-2 * n + 400, 100); c0 += 2) +for (int c0 = 2; c0 <= min(100, -2 * n + 400); c0 += 2) for (int c1 = 2 * n + c0; c1 <= 400; c1 += 2) s0(c0, c1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/stride6-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/stride6-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/stride6-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/stride6-0.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,3 +1,3 @@ for (int c0 = 1; c0 <= 101; c0 += 1) - for (int c1 = -((c0 + 1) % 2) + c0 + 1; c1 <= 400; c1 += 2) + for (int c1 = -((c0 - 1) % 2) + c0 + 1; c1 <= 400; c1 += 2) s0(c0, c1); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/stride7-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/stride7-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/stride7-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/stride7-0.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = 1; c0 <= 36; c0 += 1) +for (int c0 = 1; c0 <= 36; c0 += 1) { if (c0 <= 3) { for (int c1 = 1; c1 <= 9; c1 += 1) s1(c1, c0); @@ -11,3 +11,4 @@ } else if (c0 % 4 == 0) for (int c1 = 1; c1 <= 9; c1 += 1) s0(c1, c0 / 4); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/substitution-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/substitution-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/substitution-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/substitution-1.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,3 +1,3 @@ for (int c0 = 0; c0 <= 14; c0 += 1) - for (int c1 = max(2 * c0 - 12, -c0 + 3 * floord(c0 - 1, 2) + 3); c1 <= min(2 * c0, c0 / 2 + 9); c1 += 3) + for (int c1 = max(2 * c0 - 12, -c0 + 3 * ((c0 + 1) / 2)); c1 <= min(2 * c0, c0 / 2 + 9); c1 += 3) s0((2 * c0 - c1) / 3, (-c0 + 2 * c1) / 3); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/syr2k-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/syr2k-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/syr2k-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/syr2k-0.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = 1; c0 <= min(2 * b - 1, n); c0 += 1) - for (int c1 = max(-b + 1, -n + 1); c1 <= min(n - c0, b - c0); c1 += 1) - for (int c2 = max(1, c0 + c1); c2 <= min(n + c1, n); c2 += 1) +for (int c0 = 1; c0 <= min(n, 2 * b - 1); c0 += 1) + for (int c1 = max(-n + 1, -b + 1); c1 <= min(b - c0, n - c0); c1 += 1) + for (int c2 = max(1, c0 + c1); c2 <= min(n, n + c1); c2 += 1) s0(-c0 - c1 + c2 + 1, -c1 + c2, c2); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/syr2k-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/syr2k-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/syr2k-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/syr2k-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = 1; c0 <= min(2 * b - 1, n); c0 += 1) +for (int c0 = 1; c0 <= min(n, 2 * b - 1); c0 += 1) for (int c1 = -b + 1; c1 <= b - c0; c1 += 1) - for (int c2 = max(c0 + c1, 1); c2 <= min(n + c1, n); c2 += 1) + for (int c2 = max(1, c0 + c1); c2 <= min(n, n + c1); c2 += 1) s0(-c0 - c1 + c2 + 1, -c1 + c2, c2); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/syr2k-2.c cloog-0.18.4/isl/test_inputs/codegen/omega/syr2k-2.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/syr2k-2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/syr2k-2.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = 1; c0 <= min(2 * b - 1, n); c0 += 1) - for (int c1 = max(-b + 1, -n + 1); c1 <= min(n - c0, b - c0); c1 += 1) - for (int c2 = max(1, c0 + c1); c2 <= min(n + c1, n); c2 += 1) +for (int c0 = 1; c0 <= min(n, 2 * b - 1); c0 += 1) + for (int c1 = max(-n + 1, -b + 1); c1 <= min(b - c0, n - c0); c1 += 1) + for (int c2 = max(1, c0 + c1); c2 <= min(n, n + c1); c2 += 1) s0(-c0 - c1 + c2 + 1, -c1 + c2, c2); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/syr2k-3.c cloog-0.18.4/isl/test_inputs/codegen/omega/syr2k-3.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/syr2k-3.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/syr2k-3.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = 1; c0 <= min(2 * b - 1, n); c0 += 1) +for (int c0 = 1; c0 <= min(n, 2 * b - 1); c0 += 1) for (int c1 = -b + 1; c1 <= b - c0; c1 += 1) - for (int c2 = max(c0 + c1, 1); c2 <= min(n + c1, n); c2 += 1) + for (int c2 = max(1, c0 + c1); c2 <= min(n, n + c1); c2 += 1) s0(-c0 - c1 + c2 + 1, -c1 + c2, c2); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/ts1d-check0-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/ts1d-check0-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/ts1d-check0-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/ts1d-check0-0.c 2014-10-02 15:33:27.000000000 +0000 @@ -3,7 +3,7 @@ s0(1, c1, 1, 0, 0); for (int c1 = 0; c1 <= floord(T - 1, 500); c1 += 1) for (int c2 = 1000 * c1; c2 <= min(N + 2 * T - 3, N + 1000 * c1 + 997); c2 += 1) { - for (int c3 = max(-((N + c2) % 2) - N - 1000 * c1 + c2 + 2, 0); c3 <= min(min(998, 2 * T - 1000 * c1 - 2), -1000 * c1 + c2 - 2); c3 += 2) { + for (int c3 = max(0, -((N + c2) % 2) - N - 1000 * c1 + c2 + 2); c3 <= min(min(998, 2 * T - 1000 * c1 - 2), -1000 * c1 + c2 - 2); c3 += 2) { s1(2, 1000 * c1 + c3, 0, -1000 * c1 + c2 - c3, 1); s2(2, 1000 * c1 + c3 + 1, 0, -1000 * c1 + c2 - c3 - 1, 1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/ts1d-check-sblock-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/ts1d-check-sblock-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/ts1d-check-sblock-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/ts1d-check-sblock-0.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,13 +1,14 @@ { - for (int c1 = 0; c1 <= 1; c1 += 1) + for (int c1 = 0; c1 <= 1; c1 += 1) { if (c1 == 1) { s0(1, 1, 1, 0, 0); s0(1, 1, 1, N - 1, 0); } else for (int c3 = 0; c3 < N; c3 += 1) s0(1, 0, 1, c3, 0); + } for (int c1 = 0; c1 <= floord(T - 1, 1000); c1 += 1) for (int c2 = 1000 * c1 + 1; c2 <= min(N + T - 3, N + 1000 * c1 + 997); c2 += 1) - for (int c3 = max(-N - 1000 * c1 + c2 + 2, 0); c3 <= min(min(999, T - 1000 * c1 - 1), -1000 * c1 + c2 - 1); c3 += 1) + for (int c3 = max(0, -N - 1000 * c1 + c2 + 2); c3 <= min(min(999, T - 1000 * c1 - 1), -1000 * c1 + c2 - 1); c3 += 1) s1(2, 1000 * c1 + c3, 1, -1000 * c1 + c2 - c3, 1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/ts1d-mp-i_ts-m_b-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/ts1d-mp-i_ts-m_b-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/ts1d-mp-i_ts-m_b-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/ts1d-mp-i_ts-m_b-0.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,30 +1,31 @@ { - for (int c1 = -1; c1 < (T >= 1 ? T : 0); c1 += 1) - for (int c2 = 0; c2 < N; c2 += 1) - if (c2 == 0 && T >= c1 + 1 && c1 >= 0) { + for (int c1 = -1; c1 < T; c1 += 1) + for (int c2 = 0; c2 < N; c2 += 1) { + if (c1 == -1) { + s0(1, -1, c2, 0, 0); + } else if (c2 == 0) { s0(1, c1, 0, 0, 0); - } else if (c2 + 1 == N && T >= c1 + 1 && c1 >= 0) { + } else if (c2 + 1 == N) s0(1, c1, N - 1, 0, 0); - } else if (c1 == -1 && c2 >= 0 && N >= c2 + 1) - s0(1, -1, c2, 0, 0); + } for (int c1 = 0; c1 <= floord(T - 1, 500); c1 += 1) { for (int c3 = -((c1 + 9) / 8) + 2; c3 <= floord(N - 500 * c1 - 3, 4000) + 1; c3 += 1) - for (int c4 = max(1000 * c1 + 4000 * c3 - 3999, 500 * c1 + 1); c4 <= min(min(2 * N - 4000 * c3 + 3995, N + T - 3), 1000 * c1 + 4000 * c3 - 3000); c4 += 1) - for (int c5 = max(0, -N - 500 * c1 + c4 + 2); c5 <= min(min(-500 * c1 + c4 - 1, -500 * c1 - 2000 * c3 + (c4 + 1) / 2 + 1999), T - 500 * c1 - 1); c5 += 1) + for (int c4 = max(500 * c1 + 1, 1000 * c1 + 4000 * c3 - 3999); c4 <= min(min(N + T - 3, 1000 * c1 + 4000 * c3 - 3000), 2 * N - 4000 * c3 + 3995); c4 += 1) + for (int c5 = max(0, -N - 500 * c1 + c4 + 2); c5 <= min(min(T - 500 * c1 - 1, -500 * c1 + c4 - 1), -500 * c1 - 2000 * c3 + (c4 + 1) / 2 + 1999); c5 += 1) s1(2, 500 * c1 + c5, 1, -500 * c1 + c4 - c5, 1); for (int c3 = max(-((T + 4000) / 4000) + 2, -((c1 + 9) / 8) + 2); c3 <= floord(N - 500 * c1 - 3, 4000) + 1; c3 += 1) - for (int c4 = max(1000 * c1 + 4000 * c3 - 3999, -4000 * c3 + 4000); c4 <= min(min(2 * N - 4000 * c3 + 3995, 2 * T + 4000 * c3 - 4000), 1000 * c1 + 4000 * c3 - 3000); c4 += 1) + for (int c4 = max(1000 * c1 + 4000 * c3 - 3999, -4000 * c3 + 4000); c4 <= min(min(2 * T + 4000 * c3 - 4000, 1000 * c1 + 4000 * c3 - 3000), 2 * N - 4000 * c3 + 3995); c4 += 1) s2(2, -2000 * c3 + (c4 + 1) / 2 + 1999, 1, 2000 * c3 + c4 - (c4 + 1) / 2 - 1999, 1); for (int c3 = -((c1 + 7) / 8) + 1; c3 <= min(floord(N + T - 1000 * c1 - 1004, 4000) + 1, floord(N - 500 * c1 - 504, 4000) + 1); c3 += 1) - for (int c4 = max(1000 * c1 + 4000 * c3 - 2999, 500 * c1 + 1); c4 <= min(min(N + T - 3, N + 500 * c1 + 497), 1000 * c1 + 4000 * c3); c4 += 1) - for (int c5 = max(0, -N - 500 * c1 + c4 + 2); c5 <= min(min(-500 * c1 + c4 - 1, 499), T - 500 * c1 - 1); c5 += 1) + for (int c4 = max(500 * c1 + 1, 1000 * c1 + 4000 * c3 - 2999); c4 <= min(min(N + T - 3, N + 500 * c1 + 497), 1000 * c1 + 4000 * c3); c4 += 1) + for (int c5 = max(0, -N - 500 * c1 + c4 + 2); c5 <= min(min(499, T - 500 * c1 - 1), -500 * c1 + c4 - 1); c5 += 1) s3(2, 500 * c1 + c5, 1, -500 * c1 + c4 - c5, 1); for (int c3 = max(-((T + 4000) / 4000) + 1, -((c1 + 9) / 8) + 1); c3 <= floord(N - 500 * c1 - 3, 4000); c3 += 1) - for (int c4 = max(1000 * c1 + 4000 * c3 + 1, -4000 * c3); c4 <= min(min(2 * N - 4000 * c3 - 5, 2 * T + 4000 * c3), 1000 * c1 + 4000 * c3 + 1000); c4 += 1) + for (int c4 = max(-4000 * c3, 1000 * c1 + 4000 * c3 + 1); c4 <= min(min(2 * N - 4000 * c3 - 5, 2 * T + 4000 * c3), 1000 * c1 + 4000 * c3 + 1000); c4 += 1) s4(2, -2000 * c3 + (c4 + 1) / 2 - 1, 1, 2000 * c3 + c4 - (c4 + 1) / 2 + 1, 1); for (int c3 = -((c1 + 8) / 8) + 1; c3 <= min(floord(N + T - 1000 * c1 - 4, 4000), floord(N - 500 * c1 + 496, 4000)); c3 += 1) - for (int c4 = max(-4000 * c3 + 2, 1000 * c1 + 4000 * c3 + 1); c4 <= min(min(min(N + T - 3, N + 500 * c1 + 497), 2 * T + 4000 * c3 - 2), 1000 * c1 + 4000 * c3 + 998); c4 += 1) - for (int c5 = max(-500 * c1 - 2000 * c3 + (c4 + 1) / 2, -N - 500 * c1 + c4 + 2); c5 <= min(min(499, -500 * c1 + c4 - 1), T - 500 * c1 - 1); c5 += 1) + for (int c4 = max(1000 * c1 + 4000 * c3 + 1, -4000 * c3 + 2); c4 <= min(min(min(N + T - 3, N + 500 * c1 + 497), 2 * T + 4000 * c3 - 2), 1000 * c1 + 4000 * c3 + 998); c4 += 1) + for (int c5 = max(-N - 500 * c1 + c4 + 2, -500 * c1 - 2000 * c3 + (c4 + 1) / 2); c5 <= min(min(499, T - 500 * c1 - 1), -500 * c1 + c4 - 1); c5 += 1) s5(2, 500 * c1 + c5, 1, -500 * c1 + c4 - c5, 1); } if (T >= 1) diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/wak1-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/wak1-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/wak1-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/wak1-0.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,26 +1,26 @@ { - for (int c0 = a2; c0 <= min(min(b2, a3 - 1), a1 - 1); c0 += 1) + for (int c0 = a2; c0 <= min(min(a1 - 1, a3 - 1), b2); c0 += 1) s1(c0); - for (int c0 = a3; c0 <= min(b3, a1 - 1); c0 += 1) { + for (int c0 = a1; c0 <= min(b1, a3 - 1); c0 += 1) { + s0(c0); if (c0 >= a2 && b2 >= c0) s1(c0); - s2(c0); } - for (int c0 = max(max(a3, b3 + 1), a2); c0 <= min(b2, a1 - 1); c0 += 1) + for (int c0 = max(max(a1, b1 + 1), a2); c0 <= min(a3 - 1, b2); c0 += 1) s1(c0); - for (int c0 = a1; c0 <= b1; c0 += 1) { - s0(c0); - if (b2 >= c0 && c0 >= a2) + for (int c0 = a3; c0 <= b3; c0 += 1) { + if (c0 >= a1 && b1 >= c0) + s0(c0); + if (c0 >= a2 && b2 >= c0) s1(c0); - if (b3 >= c0 && c0 >= a3) - s2(c0); + s2(c0); } - for (int c0 = max(max(a1, b1 + 1), a2); c0 <= min(b2, a3 - 1); c0 += 1) + for (int c0 = max(max(a3, b3 + 1), a2); c0 <= min(a1 - 1, b2); c0 += 1) s1(c0); - for (int c0 = max(max(a1, b1 + 1), a3); c0 <= b3; c0 += 1) { + for (int c0 = max(max(a1, a3), b3 + 1); c0 <= b1; c0 += 1) { + s0(c0); if (c0 >= a2 && b2 >= c0) s1(c0); - s2(c0); } for (int c0 = max(max(max(max(a1, b1 + 1), a3), b3 + 1), a2); c0 <= b2; c0 += 1) s1(c0); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/wak1-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/wak1-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/wak1-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/wak1-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,50 +1,50 @@ { - for (int c0 = a3; c0 <= min(min(a2 - 1, b3), a1 - 1); c0 += 1) - s2(c0); - for (int c0 = a2; c0 <= min(min(b2, a3 - 1), a1 - 1); c0 += 1) + for (int c0 = a2; c0 <= min(min(a1 - 1, a3 - 1), b2); c0 += 1) s1(c0); - for (int c0 = max(a3, a2); c0 <= min(min(b2, b3), a1 - 1); c0 += 1) { + for (int c0 = a3; c0 <= min(min(a1 - 1, b3), a2 - 1); c0 += 1) + s2(c0); + for (int c0 = max(a3, a2); c0 <= min(min(a1 - 1, b3), b2); c0 += 1) { s1(c0); s2(c0); } - for (int c0 = max(max(a3, a2), b2 + 1); c0 <= min(b3, a1 - 1); c0 += 1) - s2(c0); - for (int c0 = a1; c0 <= min(min(a2 - 1, a3 - 1), b1); c0 += 1) + for (int c0 = a1; c0 <= min(min(b1, a3 - 1), a2 - 1); c0 += 1) s0(c0); - for (int c0 = max(a1, a3); c0 <= min(min(a2 - 1, b3), b1); c0 += 1) { - s0(c0); - s2(c0); - } - for (int c0 = max(max(a1, b1 + 1), a3); c0 <= min(a2 - 1, b3); c0 += 1) - s2(c0); - for (int c0 = max(a1, a2); c0 <= min(min(b2, a3 - 1), b1); c0 += 1) { + for (int c0 = max(a1, a2); c0 <= min(min(b1, a3 - 1), b2); c0 += 1) { s0(c0); s1(c0); } - for (int c0 = max(max(a1, b1 + 1), a2); c0 <= min(b2, a3 - 1); c0 += 1) + for (int c0 = max(max(a1, b1 + 1), a2); c0 <= min(a3 - 1, b2); c0 += 1) s1(c0); - for (int c0 = max(max(a1, a3), a2); c0 <= min(min(b2, b3), b1); c0 += 1) { + for (int c0 = max(a1, a3); c0 <= min(min(b1, b3), a2 - 1); c0 += 1) { + s0(c0); + s2(c0); + } + for (int c0 = max(max(a1, b1 + 1), a3); c0 <= min(b3, a2 - 1); c0 += 1) + s2(c0); + for (int c0 = max(max(a1, a3), a2); c0 <= min(min(b1, b3), b2); c0 += 1) { s0(c0); s1(c0); s2(c0); } - for (int c0 = max(max(max(a1, b1 + 1), a3), a2); c0 <= min(b2, b3); c0 += 1) { + for (int c0 = max(max(max(a1, b1 + 1), a3), a2); c0 <= min(b3, b2); c0 += 1) { s1(c0); s2(c0); } - for (int c0 = max(max(a1, a2), b2 + 1); c0 <= min(a3 - 1, b1); c0 += 1) + for (int c0 = max(max(a3, a2), b2 + 1); c0 <= min(a1 - 1, b3); c0 += 1) + s2(c0); + for (int c0 = max(max(a1, a2), b2 + 1); c0 <= min(b1, a3 - 1); c0 += 1) s0(c0); - for (int c0 = max(max(max(a1, a3), a2), b2 + 1); c0 <= min(b3, b1); c0 += 1) { + for (int c0 = max(max(max(a1, a3), a2), b2 + 1); c0 <= min(b1, b3); c0 += 1) { s0(c0); s2(c0); } for (int c0 = max(max(max(max(a1, b1 + 1), a3), a2), b2 + 1); c0 <= b3; c0 += 1) s2(c0); - for (int c0 = max(max(a3, b3 + 1), a2); c0 <= min(b2, a1 - 1); c0 += 1) + for (int c0 = max(max(a3, b3 + 1), a2); c0 <= min(a1 - 1, b2); c0 += 1) s1(c0); - for (int c0 = max(max(a1, a3), b3 + 1); c0 <= min(a2 - 1, b1); c0 += 1) + for (int c0 = max(max(a1, a3), b3 + 1); c0 <= min(b1, a2 - 1); c0 += 1) s0(c0); - for (int c0 = max(max(max(a1, a3), b3 + 1), a2); c0 <= min(b2, b1); c0 += 1) { + for (int c0 = max(max(max(a1, a3), b3 + 1), a2); c0 <= min(b1, b2); c0 += 1) { s0(c0); s1(c0); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/wak2-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/wak2-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/wak2-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/wak2-0.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,15 +1,15 @@ { - for (int c0 = a1; c0 <= min(a2 - 1, b1); c0 += 1) + for (int c0 = a1; c0 <= min(b1, a2 - 1); c0 += 1) for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1) s0(c0, c1_0); if (c2 >= d2 + 1) { - for (int c0 = max(a1, a2); c0 <= min(b2, b1); c0 += 1) + for (int c0 = max(a1, a2); c0 <= min(b1, b2); c0 += 1) for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1) s0(c0, c1_0); } else for (int c0 = a2; c0 <= b2; c0 += 1) { if (c0 >= a1 && b1 >= c0) - for (int c1_0 = c1; c1_0 <= min(c2 - 1, d1); c1_0 += 1) + for (int c1_0 = c1; c1_0 <= min(d1, c2 - 1); c1_0 += 1) s0(c0, c1_0); for (int c1_0 = c2; c1_0 <= d2; c1_0 += 1) { if (c0 >= a1 && b1 >= c0 && c1_0 >= c1 && d1 >= c1_0) @@ -17,7 +17,7 @@ s1(c0, c1_0); } if (c0 >= a1 && b1 >= c0) - for (int c1_0 = max(d2 + 1, c1); c1_0 <= d1; c1_0 += 1) + for (int c1_0 = max(c1, d2 + 1); c1_0 <= d1; c1_0 += 1) s0(c0, c1_0); } for (int c0 = max(max(a1, a2), b2 + 1); c0 <= b1; c0 += 1) diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/wak2-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/wak2-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/wak2-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/wak2-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,13 +1,13 @@ { - for (int c0 = a1; c0 <= min(a2 - 1, b1); c0 += 1) + for (int c0 = a1; c0 <= min(b1, a2 - 1); c0 += 1) for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1) s0(c0, c1_0); if (c2 >= d2 + 1) { - for (int c0 = max(a1, a2); c0 <= min(b2, b1); c0 += 1) + for (int c0 = max(a1, a2); c0 <= min(b1, b2); c0 += 1) for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1) s0(c0, c1_0); } else - for (int c0 = a2; c0 <= b2; c0 += 1) + for (int c0 = a2; c0 <= b2; c0 += 1) { if (a1 >= c0 + 1) { for (int c1_0 = c2; c1_0 <= d2; c1_0 += 1) s1(c0, c1_0); @@ -15,19 +15,20 @@ for (int c1_0 = c2; c1_0 <= d2; c1_0 += 1) s1(c0, c1_0); } else { - for (int c1_0 = c1; c1_0 <= min(c2 - 1, d1); c1_0 += 1) + for (int c1_0 = c1; c1_0 <= min(d1, c2 - 1); c1_0 += 1) s0(c0, c1_0); - for (int c1_0 = c2; c1_0 <= min(d2, c1 - 1); c1_0 += 1) + for (int c1_0 = c2; c1_0 <= min(c1 - 1, d2); c1_0 += 1) s1(c0, c1_0); - for (int c1_0 = max(c2, c1); c1_0 <= min(d1, d2); c1_0 += 1) { + for (int c1_0 = max(c1, c2); c1_0 <= min(d1, d2); c1_0 += 1) { s0(c0, c1_0); s1(c0, c1_0); } - for (int c1_0 = max(d2 + 1, c1); c1_0 <= d1; c1_0 += 1) + for (int c1_0 = max(c1, d2 + 1); c1_0 <= d1; c1_0 += 1) s0(c0, c1_0); - for (int c1_0 = max(max(d1 + 1, c1), c2); c1_0 <= d2; c1_0 += 1) + for (int c1_0 = max(max(c1, d1 + 1), c2); c1_0 <= d2; c1_0 += 1) s1(c0, c1_0); } + } for (int c0 = max(max(a1, a2), b2 + 1); c0 <= b1; c0 += 1) for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1) s0(c0, c1_0); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/wak3-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/wak3-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/wak3-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/wak3-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,11 +1,11 @@ { - for (int c0 = a; c0 <= min(b, a + 9); c0 += 1) + for (int c0 = a; c0 <= min(a + 9, b); c0 += 1) s0(c0); - for (int c0 = a + 10; c0 <= min(b, a + 19); c0 += 1) { + for (int c0 = a + 10; c0 <= min(a + 19, b); c0 += 1) { s0(c0); s1(c0); } - for (int c0 = max(a + 10, b + 1); c0 <= min(b + 10, a + 19); c0 += 1) + for (int c0 = max(a + 10, b + 1); c0 <= min(a + 19, b + 10); c0 += 1) s1(c0); for (int c0 = a + 20; c0 <= b; c0 += 1) { s0(c0); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/wak4-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/wak4-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/wak4-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/wak4-0.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = max(max(max(max(a1, a2), a3), a4), a5); c0 <= min(min(min(min(b5, b4), b3), b2), b1); c0 += 1) { +for (int c0 = max(max(max(max(a1, a2), a3), a4), a5); c0 <= min(min(min(min(b1, b2), b3), b4), b5); c0 += 1) { s0(c0); s1(c0); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/wak4-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/wak4-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/wak4-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/wak4-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = max(max(max(max(a1, a2), a3), a4), a5); c0 <= min(min(min(min(b5, b4), b3), b2), b1); c0 += 1) { +for (int c0 = max(max(max(max(a1, a2), a3), a4), a5); c0 <= min(min(min(min(b1, b2), b3), b4), b5); c0 += 1) { s0(c0); s1(c0); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/x-0.c cloog-0.18.4/isl/test_inputs/codegen/omega/x-0.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/x-0.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/x-0.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,14 +1,14 @@ for (int c0 = 1; c0 <= 11; c0 += 1) { - for (int c1 = max(1, -c0 + 9); c1 <= min(-c0 + 12, c0 - 4); c1 += 1) - s0(c1, c0 + c1 - 8); - for (int c1 = max(c0 - 3, 1); c1 <= min(-c0 + 8, c0); c1 += 1) + for (int c1 = max(1, c0 - 3); c1 <= min(c0, -c0 + 8); c1 += 1) s1(c1, c0 - c1 + 1); - for (int c1 = max(c0 - 3, -c0 + 9); c1 <= min(-c0 + 12, c0); c1 += 1) { + for (int c1 = max(1, -c0 + 9); c1 <= min(c0 - 4, -c0 + 12); c1 += 1) + s0(c1, c0 + c1 - 8); + for (int c1 = max(c0 - 3, -c0 + 9); c1 <= min(c0, -c0 + 12); c1 += 1) { s0(c1, c0 + c1 - 8); s1(c1, c0 - c1 + 1); } for (int c1 = max(c0 - 3, -c0 + 13); c1 <= min(8, c0); c1 += 1) s1(c1, c0 - c1 + 1); - for (int c1 = max(c0 + 1, -c0 + 9); c1 <= min(-c0 + 12, 8); c1 += 1) + for (int c1 = max(c0 + 1, -c0 + 9); c1 <= min(8, -c0 + 12); c1 += 1) s0(c1, c0 + c1 - 8); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/omega/x-1.c cloog-0.18.4/isl/test_inputs/codegen/omega/x-1.c --- cloog-0.18.2/isl/test_inputs/codegen/omega/x-1.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/omega/x-1.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,14 +1,14 @@ for (int c0 = 1; c0 <= 11; c0 += 1) { - for (int c1 = max(1, -c0 + 9); c1 <= min(-c0 + 12, c0 - 4); c1 += 1) - s0(c1, c0 + c1 - 8); - for (int c1 = max(c0 - 3, 1); c1 <= min(-c0 + 8, c0); c1 += 1) + for (int c1 = max(1, c0 - 3); c1 <= min(c0, -c0 + 8); c1 += 1) s1(c1, c0 - c1 + 1); - for (int c1 = max(c0 - 3, -c0 + 9); c1 <= min(-c0 + 12, c0); c1 += 1) { + for (int c1 = max(1, -c0 + 9); c1 <= min(c0 - 4, -c0 + 12); c1 += 1) + s0(c1, c0 + c1 - 8); + for (int c1 = max(c0 - 3, -c0 + 9); c1 <= min(c0, -c0 + 12); c1 += 1) { s0(c1, c0 + c1 - 8); s1(c1, c0 - c1 + 1); } for (int c1 = max(c0 - 3, -c0 + 13); c1 <= min(8, c0); c1 += 1) s1(c1, c0 - c1 + 1); - for (int c1 = max(c0 + 1, -c0 + 9); c1 <= min(-c0 + 12, 8); c1 += 1) + for (int c1 = max(c0 + 1, -c0 + 9); c1 <= min(8, -c0 + 12); c1 += 1) s0(c1, c0 + c1 - 8); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/pldi2012/figure7_c.c cloog-0.18.4/isl/test_inputs/codegen/pldi2012/figure7_c.c --- cloog-0.18.2/isl/test_inputs/codegen/pldi2012/figure7_c.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/pldi2012/figure7_c.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ -for (int c0 = 1; c0 <= 100; c0 += 1) +for (int c0 = 1; c0 <= 100; c0 += 1) { if (n >= 2) { s0(c0); for (int c1 = 1; c1 <= 100; c1 += 1) { @@ -8,3 +8,4 @@ } else for (int c1 = 1; c1 <= 100; c1 += 1) s2(c0, c1); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/pldi2012/figure8_b.c cloog-0.18.4/isl/test_inputs/codegen/pldi2012/figure8_b.c --- cloog-0.18.2/isl/test_inputs/codegen/pldi2012/figure8_b.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/pldi2012/figure8_b.c 2014-10-02 15:48:18.000000000 +0000 @@ -3,6 +3,6 @@ s1(c0); s0(c0 + 2); } - if (n >= 4 * floord(n, 4) + 2 && n >= 0) + if (n >= 2 && n % 4 >= 2) s1(-(n % 4) + n + 2); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/roman.c cloog-0.18.4/isl/test_inputs/codegen/roman.c --- cloog-0.18.2/isl/test_inputs/codegen/roman.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/roman.c 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,32 @@ +{ + for (int c1 = 0; c1 <= min(np1 - i, -i + 1); c1 += 1) { + S_9(c1); + S_12(c1); + } + for (int c1 = max(0, -i + 2); c1 <= -((-np1 + i + 4294967295) % 4294967296) + 4294967295; c1 += 1) { + S_9(c1); + S_10(c1); + for (int c3 = 0; c3 <= min(19, i + c1 - 3); c3 += 1) { + S_15(c1, c3); + for (int c5 = 0; c5 < c3; c5 += 1) { + S_16(c1, c3, c5); + S_17(c1, c3, c5); + } + S_16(c1, c3, c3); + S_18(c1, c3); + S_24(c1, c3); + S_19(c1, c3); + } + if (np1 >= i && i + c1 <= 21) { + S_15(c1, i + c1 - 2); + for (int c5 = 0; c5 < i + c1 - 2; c5 += 1) { + S_16(c1, i + c1 - 2, c5); + S_17(c1, i + c1 - 2, c5); + } + S_16(c1, i + c1 - 2, i + c1 - 2); + S_18(c1, i + c1 - 2); + S_24(c1, i + c1 - 2); + } + S_12(c1); + } +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/roman.in cloog-0.18.4/isl/test_inputs/codegen/roman.in --- cloog-0.18.2/isl/test_inputs/codegen/roman.in 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/roman.in 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,5 @@ +# Older versions of isl would get confused on this input due to disappearing +# div constraints. +[np1, i] -> { S_17[i0, i1, i2] -> [0, i0, 2, i1, 1, i2, 1] : exists (e0 = [(np1 - i)/4294967296], e1 = [(-2 + i + i0)/4294967296], e2 = [(i1)/4294967296]: i0 >= 0 and 4294967296e0 <= np1 - i and 4294967296e0 >= -4294967295 + np1 - i and 4294967296e0 <= np1 - i - i0 and i0 <= 20 and i1 >= 0 and 4294967296e1 <= -2 + i + i0 and 4294967296e1 >= -4294967297 + i + i0 and 4294967296e1 <= -2 + i + i0 - i1 and i1 <= 19 and i2 >= 0 and 4294967296e2 <= i1 and 4294967296e2 >= -4294967295 + i1 and 4294967296e2 <= i1 - i2 and i2 <= 19 and i0 >= 2 - i and i2 <= -1 + i1); S_18[i0, i1] -> [0, i0, 2, i1, 2, 0, 0] : exists (e0 = [(np1 - i)/4294967296], e1 = [(-2 + i + i0)/4294967296]: i0 >= 0 and 4294967296e0 <= np1 - i and 4294967296e0 >= -4294967295 + np1 - i and 4294967296e0 <= np1 - i - i0 and i0 <= 20 and i1 >= 0 and 4294967296e1 <= -2 + i + i0 and 4294967296e1 >= -4294967297 + i + i0 and 4294967296e1 <= -2 + i + i0 - i1 and i1 <= 19 and i0 >= 2 - i); S_24[i0, i1] -> [0, i0, 2, i1, 3, 0, 0] : exists (e0 = [(np1 - i)/4294967296], e1 = [(-2 + i + i0)/4294967296]: i0 >= 0 and 4294967296e0 <= np1 - i and 4294967296e0 >= -4294967295 + np1 - i and 4294967296e0 <= np1 - i - i0 and i0 <= 20 and i1 >= 0 and 4294967296e1 <= -2 + i + i0 and 4294967296e1 >= -4294967297 + i + i0 and 4294967296e1 <= -2 + i + i0 - i1 and i1 <= 19 and i0 >= 2 - i); S_15[i0, i1] -> [0, i0, 2, i1, 0, 0, 0] : exists (e0 = [(np1 - i)/4294967296], e1 = [(-2 + i + i0)/4294967296]: i0 >= 0 and 4294967296e0 <= np1 - i and 4294967296e0 >= -4294967295 + np1 - i and 4294967296e0 <= np1 - i - i0 and i0 <= 20 and i1 >= 0 and 4294967296e1 <= -2 + i + i0 and 4294967296e1 >= -4294967297 + i + i0 and 4294967296e1 <= -2 + i + i0 - i1 and i1 <= 19 and i0 >= 2 - i); S_9[i0] -> [0, i0, 0, 0, 0, 0, 0] : exists (e0 = [(np1 - i)/4294967296]: i0 >= 0 and 4294967296e0 <= np1 - i and 4294967296e0 >= -4294967295 + np1 - i and 4294967296e0 <= np1 - i - i0 and i0 <= 20); S_10[i0] -> [0, i0, 1, 0, 0, 0, 0] : exists (e0 = [(np1 - i)/4294967296]: i0 >= 0 and 4294967296e0 <= np1 - i and 4294967296e0 >= -4294967295 + np1 - i and 4294967296e0 <= np1 - i - i0 and i0 <= 20 and i0 >= 2 - i); S_19[i0, i1] -> [0, i0, 2, i1, 4, 0, 0] : exists (e0 = [(np1 - i)/4294967296], e1 = [(-2 + i + i0)/4294967296]: i0 >= 0 and 4294967296e0 <= np1 - i and 4294967296e0 >= -4294967295 + np1 - i and 4294967296e0 <= np1 - i - i0 and i0 <= 20 and i1 >= 0 and 4294967296e1 <= -2 + i + i0 and 4294967296e1 >= -4294967297 + i + i0 and 4294967296e1 <= -2 + i + i0 - i1 and i1 <= 19 and i0 >= 2 - i and i1 <= -3 + i + i0); S_12[i0] -> [0, i0, 3, 0, 0, 0, 0] : exists (e0 = [(np1 - i)/4294967296]: i0 >= 0 and 4294967296e0 <= np1 - i and 4294967296e0 >= -4294967295 + np1 - i and 4294967296e0 <= np1 - i - i0 and i0 <= 20); S_16[i0, i1, i2] -> [0, i0, 2, i1, 1, i2, 0] : exists (e0 = [(np1 - i)/4294967296], e1 = [(-2 + i + i0)/4294967296], e2 = [(i1)/4294967296]: i0 >= 0 and 4294967296e0 <= np1 - i and 4294967296e0 >= -4294967295 + np1 - i and 4294967296e0 <= np1 - i - i0 and i0 <= 20 and i1 >= 0 and 4294967296e1 <= -2 + i + i0 and 4294967296e1 >= -4294967297 + i + i0 and 4294967296e1 <= -2 + i + i0 - i1 and i1 <= 19 and i2 >= 0 and 4294967296e2 <= i1 and 4294967296e2 >= -4294967295 + i1 and 4294967296e2 <= i1 - i2 and i2 <= 19 and i0 >= 2 - i) } +[np1, i] -> { : exists (e0 = [(np1 - i)/4294967296]: 4294967296e0 <= np1 - i and 4294967296e0 >= -20 + np1 - i and np1 >= -2147483648 and np1 <= 2147483647 and i >= -2147483648 and i <= 2147483647) } +[np1, i] -> { [i0, i1, i2, i3, i4, i5, i6] -> separate[o0] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/separate2.c cloog-0.18.4/isl/test_inputs/codegen/separate2.c --- cloog-0.18.2/isl/test_inputs/codegen/separate2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/separate2.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,9 +1,9 @@ if ((length - 1) % 16 <= 14) for (int c0 = 0; c0 <= 1; c0 += 1) for (int c5 = 0; c5 <= 31; c5 += 1) - for (int c6 = 0; c6 <= 30; c6 += 1) { - if ((2 * c5 - c6 + 31) % 32 == 31 && 2 * ((length - 1) % 16) + 2 * c5 == 2 * ((length - 1) % 32) + c6 && c6 + 62 >= 2 * ((length - 1) % 16) + 2 * c5 && 2 * length + c6 >= 2 * ((length - 1) % 16) + 4 && 2 * ((length - 1) % 16) >= c6 && 2 * ((length - 1) % 16) + 2 * c5 >= c6) - S_3(c0, 0, (-(2 * ((length - 1) % 16)) + 2 * length + c6 - 2) / 2); + for (int c6 = max(0, 2 * ((length - 1) % 16) + 2 * c5 - 60); c6 <= 30; c6 += 1) { + if (length + c5 >= ((length - 1) % 32) + 2 && (length - 1) % 32 >= c5 && 2 * ((length - 1) % 32) + c6 >= 2 * c5 && 2 * c5 + 30 >= 2 * ((length - 1) % 32) + c6 && 2 * ((length - 1) % 32) + c6 == 2 * ((length - 1) % 16) + 2 * c5 && (2 * c5 - c6) % 32 == 0) + S_3(c0, 0, (c6 / 2) - ((length - 1) % 16) + length - 1); if (length <= 16 && length >= c5 + 1 && c6 >= 1 && length >= c6) S_0(c0, c5, c6 - 1); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/separate.st cloog-0.18.4/isl/test_inputs/codegen/separate.st --- cloog-0.18.2/isl/test_inputs/codegen/separate.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/separate.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,4 @@ +domain: "{ a[i] : 0 <= i < 10; b[i] : 0 <= i < 10 }" +child: + schedule: "[{ a[i] -> [i]; b[i] -> [i+1] }]" + options: "{ separate[x] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/separation_class2.c cloog-0.18.4/isl/test_inputs/codegen/separation_class2.c --- cloog-0.18.2/isl/test_inputs/codegen/separation_class2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/separation_class2.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,6 +1,6 @@ { - for (int c0 = 0; c0 < -(n % 8) + n - 7; c0 += 8) { - for (int c1 = 0; c1 < -(n % 8) + n - 7; c1 += 8) + for (int c0 = 0; c0 < -(n % 8) + n; c0 += 8) { + for (int c1 = 0; c1 < -(n % 8) + n; c1 += 8) for (int c2 = 0; c2 <= 7; c2 += 1) for (int c3 = 0; c3 <= 7; c3 += 1) A(c0 + c2, c1 + c3); @@ -10,6 +10,6 @@ } for (int c1 = 0; c1 < n; c1 += 8) for (int c2 = 0; c2 < n % 8; c2 += 1) - for (int c3 = 0; c3 <= min(n - c1 - 1, 7); c3 += 1) + for (int c3 = 0; c3 <= min(7, n - c1 - 1); c3 += 1) A(-((n - 1) % 8) + n + c2 - 1, c1 + c3); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/separation_class3.c cloog-0.18.4/isl/test_inputs/codegen/separation_class3.c --- cloog-0.18.2/isl/test_inputs/codegen/separation_class3.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/separation_class3.c 2014-10-02 15:48:18.000000000 +0000 @@ -11,10 +11,10 @@ for (int c6 = -2 * c0 + c4 + 4; c6 <= 2 * c0 - c4 + 4; c6 += 1) S_0(c4, c6); } - for (int c4 = max(2 * c0 - 1, 0); c4 <= min(7, 2 * c0); c4 += 1) + for (int c4 = max(0, 2 * c0 - 1); c4 <= min(7, 2 * c0); c4 += 1) for (int c6 = -2 * c0 + c4 + 8; c6 <= 8; c6 += 1) S_0(c4, c6); - if (c0 <= 3 && c0 >= 1) { + if (c0 >= 1 && c0 <= 3) { for (int c2 = 0; c2 <= 1; c2 += 1) for (int c4 = 2 * c0 - 1; c4 <= 2 * c0; c4 += 1) for (int c6 = 2 * c0 + 4 * c2 - c4 + 1; c6 <= -2 * c0 + 4 * c2 + c4 + 3; c6 += 1) diff -Nru cloog-0.18.2/isl/test_inputs/codegen/separation_class4.c cloog-0.18.4/isl/test_inputs/codegen/separation_class4.c --- cloog-0.18.2/isl/test_inputs/codegen/separation_class4.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/separation_class4.c 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,20 @@ +for (int c0 = 0; c0 <= 128; c0 += 1) { + if (c0 <= 127) { + if (c0 == 0) { + for (int c3 = 0; c3 <= 1; c3 += 1) + for (int c5 = c3 + 58; c5 <= -c3 + 61; c5 += 1) + S_0(c3, c5); + } else + for (int c2 = 1; c2 <= 2; c2 += 1) + for (int c3 = max(4 * c0 - 2, 4 * c0 + 6 * c2 - 12); c3 <= min(4 * c0 + 1, 4 * c0 + 6 * c2 - 7); c3 += 1) + for (int c5 = max(4 * c0 - c3 + 57, -4 * c0 + c3 + 58); c5 <= min(4 * c0 - c3 + 61, -4 * c0 + c3 + 62); c5 += 1) + S_0(c3, c5); + for (int c2 = 1; c2 <= 2; c2 += 1) + for (int c3 = max(4 * c0, 4 * c0 + 6 * c2 - 10); c3 <= min(4 * c0 + 3, 4 * c0 + 6 * c2 - 5); c3 += 1) + for (int c5 = max(-4 * c0 + c3 + 59, 4 * c0 - c3 + 62); c5 <= min(-4 * c0 + c3 + 63, 4 * c0 - c3 + 66); c5 += 1) + S_0(c3, c5); + } else + for (int c3 = 510; c3 <= 511; c3 += 1) + for (int c5 = -c3 + 569; c5 < c3 - 449; c5 += 1) + S_0(c3, c5); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/separation_class4.in cloog-0.18.4/isl/test_inputs/codegen/separation_class4.in --- cloog-0.18.2/isl/test_inputs/codegen/separation_class4.in 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/separation_class4.in 2014-10-02 15:33:27.000000000 +0000 @@ -0,0 +1,10 @@ +# Check that isl is not confused by the combination of separation classes +# and unroll. +{ S_0[t, i] -> [o0, 1, o9, t] : 4o0 >= -3 + t and 4o0 <= t and i >= 60 and i <= 65 and 6o9 >= 5 + t - 4o0 and 6o9 <= 10 + t - 4o0 and 4o0 <= -62 + t + i and 4o0 >= 59 + t - i and o0 >= 0 and o0 <= 127 and t <= 511 and t >= 0 and 4o0 >= -66 + t + i and 4o0 <= 63 + t - i; +S_0[t, i] -> [o0, 0, o9, t] : 4o0 >= -1 + t and 4o0 <= 2 + t and i >= 57 and i <= 62 and 6o9 >= 7 + t - 4o0 and 6o9 <= 12 + t - 4o0 and t >= 0 and t <= 511 and 4o0 <= -57 + t + i and 4o0 >= 58 + t - i and o0 >= 0 and o0 <= 128 and 4o0 >= -61 + t + i and 4o0 <= 62 + t - i } +{ : } +{ [i0, i1, i2, t] -> unroll[1]; +[i0, 1, i2, t] -> separation_class[[1] -> [0]] + : 0 <= i0 <= 127; +[i0, 0, i2, t] -> separation_class[[1] -> [0]] + : 1 <= i0 <= 127} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/separation_class.c cloog-0.18.4/isl/test_inputs/codegen/separation_class.c --- cloog-0.18.2/isl/test_inputs/codegen/separation_class.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/separation_class.c 2014-10-02 15:33:27.000000000 +0000 @@ -12,6 +12,6 @@ for (int c0 = 9; c0 <= 10; c0 += 1) for (int c1 = 0; c1 <= -c0 + 10; c1 += 1) for (int c2 = 10 * c0; c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1) - for (int c3 = 10 * c1; c3 <= min(-c2 + 100, 10 * c1 + 9); c3 += 1) + for (int c3 = 10 * c1; c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1) A(c2, c3); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/shift2.c cloog-0.18.4/isl/test_inputs/codegen/shift2.c --- cloog-0.18.2/isl/test_inputs/codegen/shift2.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/shift2.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,53 +1,43 @@ for (int c0 = 0; c0 <= 1; c0 += 1) { - for (int c1 = 0; c1 < length - 1; c1 += 32) { - for (int c2 = c1; c2 < length; c2 += 32) { - if (c1 == 0) - for (int c3 = 0; c3 <= min(length, 2 * c2 - 32); c3 += 32) - for (int c5 = 0; c5 <= min(31, length - c2 - 1); c5 += 1) - for (int c6 = max(-c3 + 1, 0); c6 <= min(31, length - c3); c6 += 1) - S_0(c0, c2 + c5, c3 + c6 - 1); - for (int c3 = max(2 * c1, 2 * c2); c3 <= min(2 * c2 + 62, 2 * length - 2); c3 += 32) - for (int c4 = 0; c4 <= min(min(length - c1 - 2, -c1 + c3 / 2 + 14), 31); c4 += 1) { - if (c4 == 0 && c3 == 0 && c2 == 0 && c1 == 0) { - for (int c6 = 1; c6 <= min(31, length); c6 += 1) - S_0(c0, 0, c6 - 1); - } else if (c4 == 0 && c3 == 2 * c2 + 32 && c1 == 0) - for (int c5 = 0; c5 <= 15; c5 += 1) - for (int c6 = 0; c6 <= min(31, length - 2 * c2 - 32); c6 += 1) - S_0(c0, c2 + c5, 2 * c2 + c6 + 31); - for (int c5 = max((-2 * c2 + c3) / 2, c1 - c2 + c4 + 1); c5 <= min(-c2 + c3 / 2 + 15, length - c2 - 1); c5 += 1) { - if (c4 == 0 && c1 == 0) - for (int c6 = max(-c3 + 1, 0); c6 <= min(2 * c2 - c3 + 2 * c5 - 1, length - c3); c6 += 1) - S_0(c0, c2 + c5, c3 + c6 - 1); - S_3(c0, c1 + c4, c2 + c5); - if (c4 == 0 && c1 == 0 && length >= 2 * c2 + 2 * c5) + for (int c2 = 0; c2 <= length; c2 += 32) { + if (length >= c2 + 1) { + for (int c3 = 0; c3 <= length; c3 += 32) { + for (int c5 = 0; c5 <= min(31, length - c2 - 1); c5 += 1) { + for (int c6 = max(0, -c3 + 1); c6 <= min(min(31, length - c3), 2 * c2 - c3 + 2 * c5 - 1); c6 += 1) + S_0(c0, c2 + c5, c3 + c6 - 1); + if (c2 + c5 >= 1 && 2 * c2 + 2 * c5 >= c3 && c3 + 30 >= 2 * c2 + 2 * c5) { + S_3(c0, 0, c2 + c5); + if (length >= 2 * c2 + 2 * c5) S_0(c0, c2 + c5, 2 * c2 + 2 * c5 - 1); - if (c4 == 0 && c1 == 0) - for (int c6 = 2 * c2 - c3 + 2 * c5 + 1; c6 <= min(length - c3, 31); c6 += 1) - S_0(c0, c2 + c5, c3 + c6 - 1); } - if (c4 == 0 && c1 == 0 && c3 + 30 >= 2 * length) + for (int c6 = max(0, 2 * c2 - c3 + 2 * c5 + 1); c6 <= min(31, length - c3); c6 += 1) + S_0(c0, c2 + c5, c3 + c6 - 1); + } + if (length <= 15 && c2 == 0 && c3 == 0) + S_4(c0); + if (c3 >= 2 * c2 && 2 * c2 + 32 >= c3) + for (int c4 = 1; c4 <= min(min(31, length - 2), (c3 / 2) + 14); c4 += 1) + for (int c5 = max((c3 / 2) - c2, -c2 + c4 + 1); c5 <= min(length - c2 - 1, (c3 / 2) - c2 + 15); c5 += 1) + S_3(c0, c4, c2 + c5); + } + for (int c3 = max(2 * c2, -(length % 32) + length + 32); c3 <= min(2 * length - 2, 2 * c2 + 62); c3 += 32) + for (int c4 = 0; c4 <= min(31, length - 2); c4 += 1) { + for (int c5 = max((c3 / 2) - c2, -c2 + c4 + 1); c5 <= min(length - c2 - 1, (c3 / 2) - c2 + 15); c5 += 1) + S_3(c0, c4, c2 + c5); + if (c3 + 30 >= 2 * length && c4 == 0) S_4(c0); - if (c4 == 0 && c3 == 2 * c2 && c1 == 0) - for (int c5 = 16; c5 <= min(length - c2 - 1, 31); c5 += 1) - for (int c6 = max(0, -2 * c2 + 1); c6 <= min(31, length - 2 * c2); c6 += 1) - S_0(c0, c2 + c5, 2 * c2 + c6 - 1); } - if (32 * floord(length - 16, 32) + 16 == length && c2 + 16 == length && c1 == 0) + if (c2 + 16 == length && (length - 16) % 32 == 0) S_4(c0); - if (c1 == 0) - for (int c3 = 2 * c2 + 64; c3 <= length; c3 += 32) - for (int c5 = 0; c5 <= 31; c5 += 1) - for (int c6 = 0; c6 <= min(31, length - c3); c6 += 1) - S_0(c0, c2 + c5, c3 + c6 - 1); - } - if (length % 32 == 0 && c1 == 0) + } else if (length == 0) { + S_4(c0); + } else S_4(c0); } - if (length <= 1) - for (int c5 = 0; c5 <= length; c5 += 1) - if (c5 == length) { - S_4(c0); - } else - S_0(c0, 0, 0); + for (int c1 = 32; c1 < length - 1; c1 += 32) + for (int c2 = c1; c2 < length; c2 += 32) + for (int c3 = c2; c3 <= min(length - 1, c2 + 31); c3 += 16) + for (int c4 = 0; c4 <= min(min(31, length - c1 - 2), -c1 + c3 + 14); c4 += 1) + for (int c5 = max(-c2 + c3, c1 - c2 + c4 + 1); c5 <= min(length - c2 - 1, -c2 + c3 + 15); c5 += 1) + S_3(c0, c1 + c4, c2 + c5); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/single_valued.c cloog-0.18.4/isl/test_inputs/codegen/single_valued.c --- cloog-0.18.2/isl/test_inputs/codegen/single_valued.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/single_valued.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,2 +1,2 @@ -if (2 * (63 * t1 % 64) + t1 <= 134) +if (2 * ((t1 - 1) % 64) + 8 >= t1) S(-(2 * ((t1 - 1) % 64)) + t1 + 126); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/stride5.c cloog-0.18.4/isl/test_inputs/codegen/stride5.c --- cloog-0.18.2/isl/test_inputs/codegen/stride5.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/stride5.c 2015-07-24 12:23:09.000000000 +0000 @@ -1,3 +1,3 @@ -if (2 * floord(n, 2) == n) - for (int c0 = (n + 4 * floord(-n - 1, 4) + 4) / 2; c0 <= 100; c0 += 2) +if (n % 2 == 0) + for (int c0 = (n / 2) + 2 * floord(-n - 1, 4) + 2; c0 <= 100; c0 += 2) S(c0); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/stride6.c cloog-0.18.4/isl/test_inputs/codegen/stride6.c --- cloog-0.18.2/isl/test_inputs/codegen/stride6.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/stride6.c 2014-10-02 15:33:27.000000000 +0000 @@ -1,4 +1,4 @@ for (int c1 = -1024; c1 <= 0; c1 += 32) - for (int c2 = max(-((niter - c1) % 32) + niter - c1 - 32, -((niter - 1) % 32) + niter - 1); c2 <= min(niter + 1022, niter - c1 - 1); c2 += 32) - for (int c5 = max(max(niter - c1 - c2 - 32, -c1 - 1023), 0); c5 <= min(min(-c1, niter - c1 - c2 - 1), 31); c5 += 1) + for (int c2 = max(-((niter - 1) % 32) + niter - 1, -((niter - c1) % 32) + niter - c1 - 32); c2 <= min(niter + 1022, niter - c1 - 1); c2 += 32) + for (int c5 = max(max(0, -c1 - 1023), niter - c1 - c2 - 32); c5 <= min(min(31, -c1), niter - c1 - c2 - 1); c5 += 1) S_4(niter - 1, -c1 - c5); diff -Nru cloog-0.18.2/isl/test_inputs/codegen/stride7.c cloog-0.18.4/isl/test_inputs/codegen/stride7.c --- cloog-0.18.2/isl/test_inputs/codegen/stride7.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/stride7.c 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,6 @@ +for (int c0 = 2; c0 <= 200; c0 += 64) { + for (int c2 = c0 - 1; c2 <= 120; c2 += 1) + s2(c0, c2); + for (int c2 = 122; c2 <= c0 + 62; c2 += 1) + s4(c0, c2); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/stride7.in cloog-0.18.4/isl/test_inputs/codegen/stride7.in --- cloog-0.18.2/isl/test_inputs/codegen/stride7.in 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/stride7.in 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,7 @@ +# Check that no redundant guards are introduced +{ s4[a, b] -> [a, 2, b] : exists (e0 = floor((-2 + a)/64): + 64e0 = -2 + a and a <= 200 and b <= 62 + a and b >= 122); + s2[a, b] -> [a, 2, b] : exists (e0 = floor((-2 + a)/64): + 64e0 = -2 + a and a >= 2 and b <= 120 and b >= -1 + a and a <= 100) } +{ : } +{ } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/unroll10.c cloog-0.18.4/isl/test_inputs/codegen/unroll10.c --- cloog-0.18.2/isl/test_inputs/codegen/unroll10.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/unroll10.c 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,29 @@ +if (m >= 1 && n >= 1) { + A(0); + if (m >= 2 && n >= 2) { + A(1); + if (m >= 3 && n >= 3) { + A(2); + if (m >= 4 && n >= 4) { + A(3); + if (m >= 5 && n >= 5) { + A(4); + if (m >= 6 && n >= 6) { + A(5); + if (m >= 7 && n >= 7) { + A(6); + if (m >= 8 && n >= 8) { + A(7); + if (m >= 9 && n >= 9) { + A(8); + if (m >= 10 && n >= 10) + A(9); + } + } + } + } + } + } + } + } +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/unroll10.in cloog-0.18.4/isl/test_inputs/codegen/unroll10.in --- cloog-0.18.2/isl/test_inputs/codegen/unroll10.in 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/unroll10.in 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,4 @@ +# Check that all information is taken into account while trying to unroll +[m,n] -> { A[i] -> [i] : 0 <= i < n,m } +[m,n] -> { : m <= 10 or n <= 10 } +{ [i] -> unroll[x] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/unroll10.st cloog-0.18.4/isl/test_inputs/codegen/unroll10.st --- cloog-0.18.2/isl/test_inputs/codegen/unroll10.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/unroll10.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,7 @@ +# Check that all information is taken into account while trying to unroll +domain: "[m,n] -> { A[i] : 0 <= i < n,m }" +child: + context: "[m,n] -> { [] : m <= 10 or n <= 10 }" + child: + schedule: "[{ A[i] -> [i] }]" + options: "{ unroll[x] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/unroll11.c cloog-0.18.4/isl/test_inputs/codegen/unroll11.c --- cloog-0.18.2/isl/test_inputs/codegen/unroll11.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/unroll11.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,8 @@ +{ + if (t1 >= 126) + S(0, t1 - 384); + S(0, t1 - 256); + if (t1 >= 126) + S(1, t1 - 384); + S(1, t1 - 256); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/unroll11.in cloog-0.18.4/isl/test_inputs/codegen/unroll11.in --- cloog-0.18.2/isl/test_inputs/codegen/unroll11.in 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/unroll11.in 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,10 @@ +# Check that the most appropriate lower bound is selected +[t1,t2]->{ S[i,j] -> [i,j] : exists (alpha, beta : + 0 <= i <= 1 && + t1 = j+128alpha && + 0 <= j+2beta < 128 && + 510 <= t2+2beta <= 514 && + 0 <= 2beta - t2 <= 5 +)} +[t1,t2] -> {: 125 <= t1 <= 127 and 254 <= t2 < 257} +{[i,j] -> unroll[x]} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/unroll4.c cloog-0.18.4/isl/test_inputs/codegen/unroll4.c --- cloog-0.18.2/isl/test_inputs/codegen/unroll4.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/unroll4.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,22 +1,22 @@ { write_shared_A(3, ((t1 + 3) % 4) + 1, ((t2 + 31) % 32) + 1); - if (t1 % 3 == 0 && t2 >= 1 && t2 <= 2) - write_shared_A(3, (-t1 + 12) / 3, t2 + 32); + if (t2 >= 1 && t2 <= 2 && t1 % 3 == 0) + write_shared_A(3, (-t1 / 3) + 4, t2 + 32); { - int c3 = ((t1 + 3) % 4) + 1 >= t2 && t2 >= 2 && t2 <= 33 ? t2 + 32 : ((t2 + 30) % 32) + 2; - if (c3 == t2 + 32 || (c3 == t2 && ((-t1 + 8) % 4) + t2 >= ((t2 + 1) % 2) + 5)) + int c3 = t2 >= 2 && ((t1 + 3) % 4) + 1 >= t2 ? t2 + 32 : ((t2 + 30) % 32) + 2; + if (c3 == t2 + 32 || (c3 == t2 && t2 >= ((t1 + 3) % 4) + ((t2 - 1) % 2) + 2)) write_shared_A(3, ((t1 + 3) % 4) + 5, c3); } - if (t2 >= t1 + 1 && t2 <= 4 && t1 >= 1) + if (t1 >= 1 && t2 >= t1 + 1 && t2 <= 4) write_shared_A(3, t1 + 4, t2 + 32); write_shared_A(4, ((t1 + 3) % 4) + 1, ((t2 + 31) % 32) + 1); - if (t1 % 3 == 0 && t2 >= 1 && t2 <= 2) - write_shared_A(4, (-t1 + 12) / 3, t2 + 32); + if (t2 >= 1 && t2 <= 2 && t1 % 3 == 0) + write_shared_A(4, (-t1 / 3) + 4, t2 + 32); { - int c3 = ((t1 + 3) % 4) + 1 >= t2 && t2 >= 2 && t2 <= 33 ? t2 + 32 : ((t2 + 30) % 32) + 2; - if (c3 == t2 + 32 || (c3 == t2 && ((-t1 + 8) % 4) + t2 >= ((t2 + 1) % 2) + 5)) + int c3 = t2 >= 2 && ((t1 + 3) % 4) + 1 >= t2 ? t2 + 32 : ((t2 + 30) % 32) + 2; + if (c3 == t2 + 32 || (c3 == t2 && t2 >= ((t1 + 3) % 4) + ((t2 - 1) % 2) + 2)) write_shared_A(4, ((t1 + 3) % 4) + 5, c3); } - if (t2 >= t1 + 1 && t2 <= 4 && t1 >= 1) + if (t1 >= 1 && t2 >= t1 + 1 && t2 <= 4) write_shared_A(4, t1 + 4, t2 + 32); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/unroll6.c cloog-0.18.4/isl/test_inputs/codegen/unroll6.c --- cloog-0.18.2/isl/test_inputs/codegen/unroll6.c 2013-12-18 12:35:44.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/unroll6.c 2014-10-02 15:48:18.000000000 +0000 @@ -1,8 +1,8 @@ { - if (((-t1 + 128) % 128) + nn >= 128 * g + 130 && 128 * g + 127 >= (-t1 + 128) % 128 && nn >= 128 * g + 6) + if (g >= 0 && nn >= 128 * g + 6 && nn >= ((t1 + 127) % 128) + 128 * g + 3) for (int c1 = 393214; c1 < nn - 1; c1 += 393216) A(c1, ((t1 + 127) % 128) + 128 * g + 1, ((t1 + 127) % 128) + 1); - if (nn >= t1 + 128 * g + 130 && t1 + 128 * g >= -127 && t1 <= 2 && t1 >= 1) + if (t1 >= 1 && t1 <= 2 && nn >= t1 + 128 * g + 130 && t1 + 128 * g >= -127) for (int c1 = 393214; c1 < nn - 1; c1 += 393216) A(c1, t1 + 128 * g + 128, t1 + 128); } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/unroll7.c cloog-0.18.4/isl/test_inputs/codegen/unroll7.c --- cloog-0.18.2/isl/test_inputs/codegen/unroll7.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/unroll7.c 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,10 @@ +{ + S(0, 0); + S(0, 3); + S(0, 4); + S(1, 1); + S(1, 4); + S(2, 2); + S(3, 3); + S(4, 4); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/unroll7.in cloog-0.18.4/isl/test_inputs/codegen/unroll7.in --- cloog-0.18.2/isl/test_inputs/codegen/unroll7.in 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/unroll7.in 2014-10-02 15:48:18.000000000 +0000 @@ -0,0 +1,5 @@ +# Check that some code is generated. +# Older versions of isl would abort on unknown divs. +{ S[i,j] -> [i,j]: exists (alpha, beta: j=i+4alpha +3beta and 0 <= alpha < 24 and 0 <= beta and 0 <= i,j < 5) } +{ : } +{ [i,j] -> unroll[x] } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/unroll8.c cloog-0.18.4/isl/test_inputs/codegen/unroll8.c --- cloog-0.18.2/isl/test_inputs/codegen/unroll8.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/unroll8.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,6 @@ +for (int c0 = 0; c0 <= 99; c0 += 1) { + A(c0, 0); + A(c0, 1); + B(c0, 0); + B(c0, 1); +} diff -Nru cloog-0.18.2/isl/test_inputs/codegen/unroll8.st cloog-0.18.4/isl/test_inputs/codegen/unroll8.st --- cloog-0.18.2/isl/test_inputs/codegen/unroll8.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/unroll8.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,5 @@ +# Check that options are adjusted by shifted stride detection +domain: "{ A[i,j] : 0 <= i < 100 and 0 <= j < 2; B[i,j] : 0 <= i < 100 and 0 <= j < 2 }" +child: + schedule: "[{ A[i,j] -> [2i]; B[i,j] -> [2i+1] }, { A[i,j] -> [j]; B[i,j] -> [j]}]" + options: "{ unroll[1] }" diff -Nru cloog-0.18.2/isl/test_inputs/codegen/unroll9.c cloog-0.18.4/isl/test_inputs/codegen/unroll9.c --- cloog-0.18.2/isl/test_inputs/codegen/unroll9.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/unroll9.c 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,7 @@ +for (int c0 = 0; c0 <= 99; c0 += 1) + for (int c1 = 0; c1 <= 99; c1 += 1) { + A(c1, 0, c0); + A(c1, 1, c0); + B(c1, 0, c0); + B(c1, 1, c0); + } diff -Nru cloog-0.18.2/isl/test_inputs/codegen/unroll9.st cloog-0.18.4/isl/test_inputs/codegen/unroll9.st --- cloog-0.18.2/isl/test_inputs/codegen/unroll9.st 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/isl/test_inputs/codegen/unroll9.st 2015-07-24 12:23:09.000000000 +0000 @@ -0,0 +1,7 @@ +# Check that options are interpreted locally +domain: "{ A[i,j,k] : 0 <= i,k < 100 and 0 <= j < 2; B[i,j,k] : 0 <= i,k < 100 and 0 <= j < 2 }" +child: + schedule: "[{ A[i,j,k] -> [k]; B[i,j,k] -> [k] }]" + child: + schedule: "[{ A[i,j,k] -> [2i]; B[i,j,k] -> [2i+1] }, { A[i,j,k] -> [j]; B[i,j,k] -> [j]}]" + options: "{ unroll[1] }" diff -Nru cloog-0.18.2/m4/ax_compiler_vendor.m4 cloog-0.18.4/m4/ax_compiler_vendor.m4 --- cloog-0.18.2/m4/ax_compiler_vendor.m4 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/m4/ax_compiler_vendor.m4 2015-07-24 11:54:00.000000000 +0000 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.nongnu.org/autoconf-archive/ax_compiler_vendor.html +# http://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html # =========================================================================== # # SYNOPSIS @@ -44,18 +44,45 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. +#serial 15 + AC_DEFUN([AX_COMPILER_VENDOR], -[ -AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, - [ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown - # note: don't check for gcc first since some other compilers define __GNUC__ - for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do - vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")" +[AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, + dnl Please add if possible support to ax_compiler_version.m4 + [# note: don't check for gcc first since some other compilers define __GNUC__ + vendors="intel: __ICC,__ECC,__INTEL_COMPILER + ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__ + pathscale: __PATHCC__,__PATHSCALE__ + clang: __clang__ + cray: _CRAYC + fujitsu: __FUJITSU + gnu: __GNUC__ + sun: __SUNPRO_C,__SUNPRO_CC + hp: __HP_cc,__HP_aCC + dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER + borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ + comeau: __COMO__ + kai: __KCC + lcc: __LCC__ + sgi: __sgi,sgi + microsoft: _MSC_VER + metrowerks: __MWERKS__ + watcom: __WATCOMC__ + portland: __PGI + tcc: __TINYC__ + unknown: UNKNOWN" + for ventest in $vendors; do + case $ventest in + *:) vendor=$ventest; continue ;; + *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;; + esac AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ -#if !($vencpp) - thisisanerror; -#endif -])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break]) + #if !($vencpp) + thisisanerror; + #endif + ])], [break]) done + ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1` ]) ]) + diff -Nru cloog-0.18.2/m4/libtool.m4 cloog-0.18.4/m4/libtool.m4 --- cloog-0.18.2/m4/libtool.m4 2013-12-18 12:36:05.000000000 +0000 +++ cloog-0.18.4/m4/libtool.m4 2014-10-02 14:14:44.000000000 +0000 @@ -1,6 +1,8 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -37,7 +39,7 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) -# serial 58 LT_INIT +# serial 57 LT_INIT # LT_PREREQ(VERSION) @@ -89,7 +91,7 @@ _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed -LIBTOOL_DEPS=$ltmain +LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -128,7 +130,7 @@ # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set -# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} @@ -177,13 +179,13 @@ m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options that allow our +# See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}"; then +if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) -if test -n "${ZSH_VERSION+set}"; then +if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi @@ -196,7 +198,7 @@ # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. - if test set != "${COLLECT_NAMES+set}"; then + if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -207,14 +209,14 @@ ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, +# All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a -with_gnu_ld=$lt_cv_prog_gnu_ld +with_gnu_ld="$lt_cv_prog_gnu_ld" -old_CC=$CC -old_CFLAGS=$CFLAGS +old_CC="$CC" +old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc @@ -267,14 +269,14 @@ # _LT_PROG_LTMAIN # --------------- -# Note that this code is called both from 'configure', and 'config.status' +# Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# 'config.status' has no value for ac_aux_dir unless we are using Automake, +# `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain=$ac_aux_dir/ltmain.sh +ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN @@ -284,7 +286,7 @@ # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the 'libtool' +# in macros and then make a single call at the end using the `libtool' # label. @@ -419,8 +421,8 @@ # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ -# Quote a variable value, and forward it to 'config.status' so that its -# declaration there will have the same value as in 'configure'. VARNAME +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) @@ -444,7 +446,7 @@ # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags='_LT_TAGS'dnl +available_tags="_LT_TAGS"dnl ]) @@ -472,7 +474,7 @@ # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], @@ -498,8 +500,8 @@ # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations -# into 'config.status', and then the shell code to quote escape them in -# for loops in 'config.status'. Finally, any additional code accumulated +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], @@ -545,7 +547,7 @@ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -558,7 +560,7 @@ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -574,7 +576,7 @@ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the -# '#!' sequence but before initialization text begins. After this +# `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). @@ -596,7 +598,7 @@ _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF -test 0 = "$lt_write_fail" && chmod +x $1[]dnl +test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT @@ -619,7 +621,7 @@ } >&AS_MESSAGE_LOG_FD lt_cl_help="\ -'$as_me' creates a local libtool stub from the current configuration, +\`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. @@ -641,7 +643,7 @@ This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." -while test 0 != $[#] +while test $[#] != 0 do case $[1] in --version | --v* | -V ) @@ -654,10 +656,10 @@ lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] -Try '$[0] --help' for more information.]) ;; +Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] -Try '$[0] --help' for more information.]) ;; +Try \`$[0] --help' for more information.]) ;; esac shift done @@ -683,7 +685,7 @@ # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: -test yes = "$silent" && +test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false @@ -703,13 +705,13 @@ _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ - # See if we are running on zsh, and set the options that allow our + # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}"; then + if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi - cfgfile=${ofile}T + cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" @@ -717,7 +719,7 @@ #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE) $VERSION +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # @@ -737,7 +739,7 @@ # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. -if test set != "${COLLECT_NAMES+set}"; then +if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -754,6 +756,8 @@ sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) + _LT_PROG_REPLACE_SHELLFNS + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -771,6 +775,7 @@ [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS @@ -969,7 +974,7 @@ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no - if test -z "$LT_MULTI_MODULE"; then + if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the @@ -987,7 +992,7 @@ cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. - elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1005,7 +1010,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS=$save_LDFLAGS + LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], @@ -1027,7 +1032,7 @@ _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD - elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1037,32 +1042,32 @@ ]) case $host_os in rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac - if test yes = "$lt_cv_apple_cc_single_mod"; then + if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi - if test yes = "$lt_cv_ld_exported_symbols_list"; then - _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -1082,29 +1087,29 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - if test yes = "$lt_cv_ld_force_load"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in - ifort*|nagfor*) _lt_dar_can_shared=yes ;; + ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac - if test yes = "$_lt_dar_can_shared"; then + if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all - _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], -[ if test yes != "$lt_cv_apple_cc_single_mod"; then - _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else @@ -1124,7 +1129,7 @@ # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl -if test set = "${lt_cv_aix_libpath+set}"; then +if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], @@ -1142,7 +1147,7 @@ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) @@ -1162,8 +1167,8 @@ # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start -# of the generated configure script that will find a shell with a builtin -# printf (that we can use as an echo command). +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO @@ -1191,10 +1196,10 @@ # Invoke $ECHO with all args, space-separated. func_echo_all () { - $ECHO "$*" + $ECHO "$*" } -case $ECHO in +case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; @@ -1220,17 +1225,16 @@ AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], - [Search for dependent libraries within DIR (or the compiler's sysroot - if not specified).])], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= -case $with_sysroot in #( +case ${with_sysroot} in #( yes) - if test yes = "$GCC"; then + if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( @@ -1240,14 +1244,14 @@ no|'') ;; #( *) - AC_MSG_RESULT([$with_sysroot]) + AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl -[dependent libraries, and where our libraries should be installed.])]) +[dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- @@ -1255,33 +1259,31 @@ [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) -test no = "$enable_libtool_lock" || enable_libtool_lock=yes +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) - # Find out what ABI is being produced by ac_compile, and set mode - # options accordingly. + # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) - HPUX_IA64_MODE=32 + HPUX_IA64_MODE="32" ;; *ELF-64*) - HPUX_IA64_MODE=64 + HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. + # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - if test yes = "$lt_cv_prog_gnu_ld"; then + if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" @@ -1310,46 +1312,9 @@ rm -rf conftest* ;; -mips64*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - emul=elf - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - emul="${emul}32" - ;; - *64-bit*) - emul="${emul}64" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *MSB*) - emul="${emul}btsmip" - ;; - *LSB*) - emul="${emul}ltsmip" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *N32*) - emul="${emul}n32" - ;; - esac - LD="${LD-ld} -m $emul" - fi - rm -rf conftest* - ;; - x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. Note that the listed cases only cover the - # situations where additional linker options are needed (such as when - # doing 32-bit compilation for a host where ld defaults to 64-bit, or - # vice versa); the common cases where no linker options are needed do - # not appear in the list. + # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in @@ -1368,10 +1333,10 @@ ;; esac ;; - powerpc64le-*linux*) + powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; - powerpc64-*linux*) + powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -1390,10 +1355,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - powerpcle-*linux*) + powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; - powerpc-*linux*) + powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -1411,20 +1376,19 @@ *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS=$CFLAGS + SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) - if test yes != "$lt_cv_cc_needs_belf"; then + if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS=$SAVE_CFLAGS + CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. + # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in @@ -1432,7 +1396,7 @@ case $lt_cv_prog_gnu_ld in yes*) case $host in - i?86-*-solaris*|x86_64-*-solaris*) + i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) @@ -1441,7 +1405,7 @@ esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD=${LD-ld}_sol2 + LD="${LD-ld}_sol2" fi ;; *) @@ -1457,7 +1421,7 @@ ;; esac -need_locks=$enable_libtool_lock +need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK @@ -1476,11 +1440,11 @@ [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) - if test 0 -eq "$ac_status"; then + if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) - if test 0 -ne "$ac_status"; then + if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi @@ -1488,7 +1452,7 @@ ]) ]) -if test no = "$lt_cv_ar_at_file"; then +if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file @@ -1519,7 +1483,7 @@ if test -n "$RANLIB"; then case $host_os in - bitrig* | openbsd*) + openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) @@ -1555,7 +1519,7 @@ [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment + lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -1582,7 +1546,7 @@ $RM conftest* ]) -if test yes = "[$]$2"; then +if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) @@ -1604,7 +1568,7 @@ m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no - save_LDFLAGS=$LDFLAGS + save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -1623,10 +1587,10 @@ fi fi $RM -r conftest* - LDFLAGS=$save_LDFLAGS + LDFLAGS="$save_LDFLAGS" ]) -if test yes = "[$]$2"; then +if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) @@ -1647,7 +1611,7 @@ AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 - teststring=ABCD + teststring="ABCD" case $build_os in msdosdjgpp*) @@ -1687,7 +1651,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1738,22 +1702,22 @@ *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8; do + for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && - test 17 != "$i" # 1/2 MB should be enough + test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring @@ -1769,7 +1733,7 @@ ;; esac ]) -if test -n "$lt_cv_sys_max_cmd_len"; then +if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) @@ -1797,7 +1761,7 @@ # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl -if test yes = "$cross_compiling"; then : +if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -1846,7 +1810,7 @@ /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -1872,7 +1836,7 @@ return status; }] _LT_EOF - if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in @@ -1893,7 +1857,7 @@ # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl -if test yes != "$enable_dlopen"; then +if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown @@ -1903,52 +1867,44 @@ case $host_os in beos*) - lt_cv_dlopen=load_add_on + lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) - lt_cv_dlopen=LoadLibrary + lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) - lt_cv_dlopen=dlopen + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) - # if libdl is installed we need to link against it + # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ - lt_cv_dlopen=dyld + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; - tpf*) - # Don't try to run any link tests for TPF. We know it's impossible - # because TPF is a cross-compiler, and we know how we open DSOs. - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - lt_cv_dlopen_self=no - ;; - *) AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen=shl_load], + [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen=dlopen], + [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) @@ -1957,21 +1913,21 @@ ;; esac - if test no = "$lt_cv_dlopen"; then - enable_dlopen=no - else + if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes + else + enable_dlopen=no fi case $lt_cv_dlopen in dlopen) - save_CPPFLAGS=$CPPFLAGS - test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS=$LDFLAGS + save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS=$LIBS + save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], @@ -1981,7 +1937,7 @@ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) - if test yes = "$lt_cv_dlopen_self"; then + if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl @@ -1991,9 +1947,9 @@ ]) fi - CPPFLAGS=$save_CPPFLAGS - LDFLAGS=$save_LDFLAGS - LIBS=$save_LIBS + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" ;; esac @@ -2085,8 +2041,8 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) -hard_links=nottested -if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes @@ -2096,8 +2052,8 @@ ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) - if test no = "$hard_links"; then - AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else @@ -2124,8 +2080,8 @@ _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", - [Define to the sub-directory where libtool stores uninstalled libraries.]) +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR @@ -2137,15 +2093,15 @@ _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || - test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. - if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one - ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && - test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else @@ -2159,12 +2115,12 @@ fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) -if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || - test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no -elif test yes = "$shlibpath_overrides_runpath" || - test no = "$enable_shared"; then +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi @@ -2188,7 +2144,7 @@ # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) - if test -n "$STRIP"; then + if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) @@ -2219,14 +2175,14 @@ AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ -if test yes = "$GCC"; then +if test "$GCC" = yes; then case $host_os in - darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; - *) lt_awk_arg='/^libraries:/' ;; + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; - *) lt_sed_strip_eq='s|=/|/|g' ;; + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in @@ -2242,35 +2198,28 @@ ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary... + # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= - lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - # ...but if some path component already ends with the multilib dir we assume - # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). - case "$lt_multi_os_dir; $lt_search_path_spec " in - "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) - lt_multi_os_dir= - ;; - esac + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" - elif test -n "$lt_multi_os_dir"; then + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS = " "; FS = "/|\n";} { - lt_foo = ""; - lt_count = 0; +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { - lt_foo = "/" $lt_i lt_foo; + lt_foo="/" $lt_i lt_foo; } else { lt_count--; } @@ -2284,7 +2233,7 @@ # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else @@ -2293,7 +2242,7 @@ library_names_spec= libname_spec='lib$name' soname_spec= -shrext_cmds=.so +shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -2313,11 +2262,11 @@ case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='$libname$release$shared_ext$major' + soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) @@ -2325,40 +2274,40 @@ need_lib_prefix=no need_version=no hardcode_into_libs=yes - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 supports IA64 - library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with - # the line '#! .'. This would cause the generated library to - # depend on '.', always an invalid library. This was fixed in + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' - echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac - # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test yes = "$aix_use_runtimelinking"; then + if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi @@ -2369,18 +2318,18 @@ powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) - library_names_spec='$libname$shared_ext' + library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -2388,8 +2337,8 @@ bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" @@ -2401,7 +2350,7 @@ cygwin* | mingw* | pw32* | cegcc*) version_type=windows - shrext_cmds=.dll + shrext_cmds=".dll" need_version=no need_lib_prefix=no @@ -2410,8 +2359,8 @@ # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ @@ -2427,17 +2376,17 @@ case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix - soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' @@ -2446,8 +2395,8 @@ *,cl*) # Native MSVC libname_spec='$name' - soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' - library_names_spec='$libname.dll.lib' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' case $build_os in mingw*) @@ -2474,7 +2423,7 @@ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) - sys_lib_search_path_spec=$LIB + sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` @@ -2487,8 +2436,8 @@ esac # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' @@ -2501,7 +2450,7 @@ *) # Assume MSVC wrapper - library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac @@ -2514,8 +2463,8 @@ version_type=darwin need_lib_prefix=no need_version=no - library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' - soname_spec='$libname$release$major$shared_ext' + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' @@ -2528,8 +2477,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -2547,12 +2496,12 @@ version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac @@ -2582,10 +2531,10 @@ need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=no + shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -2603,9 +2552,9 @@ dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - if test 32 = "$HPUX_IA64_MODE"; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" @@ -2618,8 +2567,8 @@ dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; @@ -2628,8 +2577,8 @@ dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... @@ -2642,8 +2591,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -2654,7 +2603,7 @@ case $host_os in nonstopux*) version_type=nonstopux ;; *) - if test yes = "$lt_cv_prog_gnu_ld"; then + if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix @@ -2662,8 +2611,8 @@ esac need_lib_prefix=no need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= @@ -2682,8 +2631,8 @@ esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" - sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; @@ -2692,33 +2641,13 @@ dynamic_linker=no ;; -linux*android*) - version_type=none # Android doesn't support versioned libraries. - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext' - soname_spec='$libname$release$shared_ext' - finish_cmds= - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - ;; - # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -2758,17 +2687,29 @@ dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH @@ -2778,7 +2719,7 @@ newsos6) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; @@ -2787,34 +2728,45 @@ version_type=qnx need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; -openbsd* | bitrig*) +openbsd*) version_type=sunos - sys_lib_dlsearch_path_spec=/usr/lib + sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - need_version=no - else - need_version=yes - fi - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi ;; os2*) libname_spec='$name' - shrext_cmds=.dll + shrext_cmds=".dll" need_lib_prefix=no - library_names_spec='$libname$shared_ext $libname.a' + library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; @@ -2823,11 +2775,11 @@ version_type=osf need_lib_prefix=no need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) @@ -2838,8 +2790,8 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes @@ -2849,11 +2801,11 @@ sunos4*) version_type=sunos - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes - if test yes = "$with_gnu_ld"; then + if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes @@ -2861,8 +2813,8 @@ sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) @@ -2883,10 +2835,10 @@ ;; sysv4*MP*) - if test -d /usr/nec; then + if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' - soname_spec='$libname$shared_ext.$major' + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; @@ -2895,12 +2847,12 @@ version_type=freebsd-elf need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes - if test yes = "$with_gnu_ld"; then + if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' @@ -2918,7 +2870,7 @@ version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes @@ -2926,8 +2878,8 @@ uts4*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -2936,18 +2888,18 @@ ;; esac AC_MSG_RESULT([$dynamic_linker]) -test no = "$dynamic_linker" && can_build_shared=no +test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test yes = "$GCC"; then +if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then - sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi -if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then - sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], @@ -2989,32 +2941,32 @@ # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- -# find a file program that can recognize shared library +# find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD=$MAGIC_CMD - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$1"; then - lt_cv_path_MAGIC_CMD=$ac_dir/"$1" + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD=$lt_cv_path_MAGIC_CMD + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -3037,11 +2989,11 @@ break fi done - IFS=$lt_save_ifs - MAGIC_CMD=$lt_save_MAGIC_CMD + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) -MAGIC_CMD=$lt_cv_path_MAGIC_CMD +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else @@ -3059,7 +3011,7 @@ # _LT_PATH_MAGIC # -------------- -# find a file program that can recognize a shared library +# find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then @@ -3086,16 +3038,16 @@ AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test no = "$withval" || with_gnu_ld=yes], + [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld -if test yes = "$GCC"; then +if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) - # gcc leaves a trailing carriage return, which upsets mingw + # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; @@ -3109,7 +3061,7 @@ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done - test -z "$LD" && LD=$ac_prog + test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. @@ -3120,37 +3072,37 @@ with_gnu_ld=unknown ;; esac -elif test yes = "$with_gnu_ld"; then +elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD=$ac_dir/$ac_prog + lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 /dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else @@ -3347,7 +3300,7 @@ lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -3365,8 +3318,8 @@ lt_cv_deplibs_check_method=pass_all ;; -openbsd* | bitrig*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' @@ -3459,33 +3412,33 @@ AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. - lt_cv_path_NM=$NM + lt_cv_path_NM="$NM" else - lt_nm_to_check=${ac_tool_prefix}nm + lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/$lt_tmp_nm - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. - # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" - break 2 + break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" - break 2 + break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but @@ -3496,21 +3449,21 @@ esac fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) -if test no != "$lt_cv_path_NM"; then - NM=$lt_cv_path_NM +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) - DUMPBIN="$DUMPBIN -symbols -headers" + DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: @@ -3518,8 +3471,8 @@ esac fi AC_SUBST([DUMPBIN]) - if test : != "$DUMPBIN"; then - NM=$DUMPBIN + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm @@ -3565,8 +3518,8 @@ case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh; - # decide which one to use based on capabilities of $DLLTOOL + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib @@ -3578,7 +3531,7 @@ ;; *) # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd=$ECHO + lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) @@ -3605,28 +3558,13 @@ lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) -if test yes != "$lt_cv_path_mainfest_tool"; then +if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL -# _LT_DLL_DEF_P([FILE]) -# --------------------- -# True iff FILE is a Windows DLL '.def' file. -# Keep in sync with func_dll_def_p in the libtool script -AC_DEFUN([_LT_DLL_DEF_P], -[dnl - test DEF = "`$SED -n dnl - -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace - -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments - -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl - -e q dnl Only consider the first "real" line - $1`" dnl -])# _LT_DLL_DEF_P - - # LT_LIB_M # -------- # check for math library @@ -3638,11 +3576,11 @@ # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) - AC_CHECK_LIB(m, cos, LIBM=-lm) + AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) @@ -3661,7 +3599,7 @@ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -if test yes = "$GCC"; then +if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; @@ -3713,7 +3651,7 @@ symcode='[[ABCDGISTW]]' ;; hpux*) - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; @@ -3746,44 +3684,14 @@ symcode='[[ABCDGIRSTW]]' ;; esac -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" - # Adjust the below global symbol transforms to fixup imported variables. - lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" - lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" - lt_c_name_lib_hook="\ - -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ - -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" -else - # Disable hooks by default. - lt_cv_sys_global_symbol_to_import= - lt_cdecl_hook= - lt_c_name_hook= - lt_c_name_lib_hook= -fi - # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ -$lt_cdecl_hook\ -" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ -$lt_c_name_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" - -# Transform an extracted symbol line into symbol name with lib prefix and -# symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ -$lt_c_name_lib_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -3801,24 +3709,21 @@ # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function, - # D for any global variable and I for any imported variable. + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ -" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ -" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ -" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ -" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ -" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" @@ -3858,11 +3763,11 @@ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE -/* DATA imports from DLLs on WIN32 can't be const, because runtime +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST -#elif defined __osf__ +#elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else @@ -3888,7 +3793,7 @@ { { "@PROGRAM@", (void *) 0 }, _LT_EOF - $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; @@ -3908,9 +3813,9 @@ mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS - LIBS=conftstm.$ac_objext + LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS @@ -3931,7 +3836,7 @@ rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. - if test yes = "$pipe_works"; then + if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= @@ -3958,16 +3863,12 @@ [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) -_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], - [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) -_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], - [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3983,18 +3884,17 @@ m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. - if test yes = "$GXX"; then + if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) @@ -4005,8 +3905,8 @@ ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -4071,7 +3971,7 @@ case $host_os in aix[[4-9]]*) # All AIX code is PIC. - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else @@ -4112,14 +4012,14 @@ case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' - if test ia64 != "$host_cpu"; then + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default @@ -4156,7 +4056,7 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) - # old Intel C++ for x86_64, which still supported -KPIC. + # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' @@ -4212,7 +4112,7 @@ ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -4301,18 +4201,17 @@ fi ], [ - if test yes = "$GCC"; then + if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) @@ -4323,8 +4222,8 @@ ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -4411,7 +4310,7 @@ case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else @@ -4419,20 +4318,6 @@ fi ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - case $cc_basename in - nagfor*) - # NAG Fortran compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). @@ -4453,7 +4338,7 @@ ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) @@ -4464,7 +4349,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in - # old Intel for x86_64, which still supported -KPIC. + # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4489,12 +4374,6 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -4592,7 +4471,7 @@ ;; sysv4*MP*) - if test -d /usr/nec; then + if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi @@ -4621,7 +4500,7 @@ fi ]) case $host_os in - # For platforms that do not support PIC, -DPIC is meaningless: + # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; @@ -4697,7 +4576,7 @@ fi ;; pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in @@ -4710,6 +4589,9 @@ ;; esac ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -4743,9 +4625,9 @@ # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ' (' and ')$', so one must not match beginning or - # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', - # as well as any symbol that contains 'd'. + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if @@ -4761,7 +4643,7 @@ # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. - if test yes != "$GCC"; then + if test "$GCC" != yes; then with_gnu_ld=no fi ;; @@ -4769,9 +4651,12 @@ # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; - openbsd* | bitrig*) + openbsd*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes @@ -4779,7 +4664,7 @@ # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no - if test yes = "$with_gnu_ld"; then + if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility @@ -4801,24 +4686,24 @@ esac fi - if test yes = "$lt_use_gnu_ld_interface"; then + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='$wl' + wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -4831,7 +4716,7 @@ case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken - if test ia64 != "$host_cpu"; then + if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 @@ -4850,7 +4735,7 @@ case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) @@ -4866,7 +4751,7 @@ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4876,7 +4761,7 @@ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes @@ -4884,61 +4769,61 @@ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no - if test linux-dietlibc = "$host_os"; then + if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test no = "$tmp_diet" + && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -4949,44 +4834,42 @@ lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; - nagfor*) # NAGFOR 5.3 - tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test yes = "$supports_anon_versioning"; then + if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test yes = "$supports_anon_versioning"; then + if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4995,13 +4878,13 @@ fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -5019,8 +4902,8 @@ _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -5032,7 +4915,7 @@ _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify @@ -5047,9 +4930,9 @@ # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -5066,15 +4949,15 @@ *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac - if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= @@ -5090,7 +4973,7 @@ # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes - if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported @@ -5098,12 +4981,12 @@ ;; aix[[4-9]]*) - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag= + no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm @@ -5121,7 +5004,7 @@ # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do - if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi @@ -5144,13 +5027,13 @@ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - if test yes = "$GCC"; then + if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` + collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -5169,61 +5052,62 @@ ;; esac shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag="$shared_flag "'$wl-G' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' fi + _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' else - shared_flag='$wl-bM:SRE' + shared_flag='${wl}-bM:SRE' fi fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes - if test yes = "$aix_use_runtimelinking"; then + if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else - if test ia64 = "$host_cpu"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' - if test yes = "$with_gnu_ld"; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; @@ -5232,7 +5116,7 @@ case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) @@ -5262,17 +5146,16 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll + shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes @@ -5281,18 +5164,18 @@ # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # Assume MSVC wrapper @@ -5301,7 +5184,7 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll + shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. @@ -5351,33 +5234,33 @@ ;; hpux9*) - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) - if test yes,no = "$GCC,$with_gnu_ld"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes @@ -5385,25 +5268,25 @@ ;; hpux11*) - if test yes,no = "$GCC,$with_gnu_ld"; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ @@ -5411,14 +5294,14 @@ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in @@ -5429,7 +5312,7 @@ *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. @@ -5440,16 +5323,16 @@ ;; irix5* | irix6* | nonstopux*) - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], - [save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], @@ -5462,22 +5345,22 @@ end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) - LDFLAGS=$save_LDFLAGS]) - if test yes = "$lt_cv_irix_exported_symbol"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -5491,7 +5374,7 @@ newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; @@ -5499,19 +5382,27 @@ *nto* | *qnx*) ;; - openbsd* | bitrig*) + openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac fi else _LT_TAGVAR(ld_shlibs, $1)=no @@ -5527,28 +5418,28 @@ ;; osf3*) - if test yes = "$GCC"; then - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag - if test yes = "$GCC"; then - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -5559,24 +5450,24 @@ solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' - if test yes = "$GCC"; then - wlarc='$wl' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' - _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) - wlarc='$wl' - _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi @@ -5586,11 +5477,11 @@ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. GCC discards it without '$wl', + # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test yes = "$GCC"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi @@ -5600,10 +5491,10 @@ ;; sunos4*) - if test sequent = "$host_vendor"; then + if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi @@ -5652,43 +5543,43 @@ ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not + # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; @@ -5703,17 +5594,17 @@ ;; esac - if test sni = "$host_vendor"; then + if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) -test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld @@ -5730,7 +5621,7 @@ # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - if test yes,yes = "$GCC,$enable_shared"; then + if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. @@ -5810,12 +5701,12 @@ _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], - [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is - "absolute", i.e impossible to change by setting $shlibpath_var if the + "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR @@ -5856,10 +5747,10 @@ # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to 'libtool'. +# the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl -lt_save_CC=$CC +lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. @@ -5899,18 +5790,18 @@ LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB - # Report what library types will actually be built + # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test no = "$can_build_shared" && enable_shared=no + test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test yes = "$enable_shared" && enable_static=no + test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' @@ -5918,8 +5809,8 @@ ;; aix[[4-9]]*) - if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then - test yes = "$enable_shared" && enable_static=no + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no fi ;; esac @@ -5927,13 +5818,13 @@ AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes + test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP -CC=$lt_save_CC +CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG @@ -5941,14 +5832,14 @@ # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to 'libtool'. +# the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl -if test -n "$CXX" && ( test no != "$CXX" && - ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || - (test g++ != "$CXX"))); then +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes @@ -5990,7 +5881,7 @@ # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_caught_CXX_error"; then +if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" @@ -6032,35 +5923,35 @@ if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately - if test yes = "$GXX"; then + if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi - if test yes = "$GXX"; then + if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. - if test yes = "$with_gnu_ld"; then - _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) - wlarc='$wl' + wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi @@ -6096,12 +5987,12 @@ _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag= + no_entry_flag="" else aix_use_runtimelinking=no @@ -6135,13 +6026,13 @@ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - if test yes = "$GXX"; then + if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` + collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -6159,56 +6050,56 @@ fi esac shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag=$shared_flag' $wl-G' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc - if test ia64 = "$host_cpu"; then + if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' else - shared_flag='$wl-bM:SRE' + shared_flag='${wl}-bM:SRE' fi fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes - if test yes = "$aix_use_runtimelinking"; then + if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else - if test ia64 = "$host_cpu"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' - if test yes = "$with_gnu_ld"; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' @@ -6216,7 +6107,7 @@ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; @@ -6226,7 +6117,7 @@ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6254,58 +6145,57 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll + shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6351,14 +6241,14 @@ ;; haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default @@ -6370,7 +6260,7 @@ _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -6379,11 +6269,11 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test yes = "$GXX"; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -6393,15 +6283,15 @@ ;; hpux10*|hpux11*) - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi @@ -6427,13 +6317,13 @@ aCC*) case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists @@ -6444,20 +6334,20 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test yes = "$GXX"; then - if test no = "$with_gnu_ld"; then + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -6472,22 +6362,22 @@ interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -6496,17 +6386,17 @@ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) - if test yes = "$GXX"; then - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; @@ -6519,8 +6409,8 @@ # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -6529,10 +6419,10 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. @@ -6546,59 +6436,59 @@ # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -6612,18 +6502,18 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) @@ -6631,10 +6521,10 @@ *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on @@ -6692,17 +6582,22 @@ _LT_TAGVAR(ld_shlibs, $1)=yes ;; - openbsd* | bitrig*) + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else @@ -6718,9 +6613,9 @@ # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using @@ -6738,17 +6633,17 @@ cxx*) case $host in osf3*) - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ - $RM $lib.exp' + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac @@ -6763,21 +6658,21 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test yes,no = "$GXX,$with_gnu_ld"; then - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists @@ -6823,9 +6718,9 @@ # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -6833,7 +6728,7 @@ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. + # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; @@ -6850,30 +6745,30 @@ ;; gcx*) # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker - if test yes,no = "$GXX,$with_gnu_ld"; then - _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else - # g++ 2.7 appears to require '-G' NOT '-shared' on this + # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -6881,11 +6776,11 @@ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi @@ -6894,52 +6789,52 @@ ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not + # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ - '"$_LT_TAGVAR(old_archive_cmds, $1)" + '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" + '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; @@ -6970,10 +6865,10 @@ esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - _LT_TAGVAR(GCC, $1)=$GXX - _LT_TAGVAR(LD, $1)=$LD + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7000,7 +6895,7 @@ lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test yes != "$_lt_caught_CXX_error" +fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG @@ -7022,9 +6917,9 @@ AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { - case @S|@2 in - .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; - *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF @@ -7112,13 +7007,13 @@ pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case $prev$p in + case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. - if test x-L = "$p" || - test x-R = "$p"; then + if test $p = "-L" || + test $p = "-R"; then prev=$p continue fi @@ -7134,16 +7029,16 @@ case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac - if test no = "$pre_test_object_deps_done"; then - case $prev in + if test "$pre_test_object_deps_done" = no; then + case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being @@ -7151,9 +7046,9 @@ esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)=$prev$p + _LT_TAGVAR(postdeps, $1)="${prev}${p}" else - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= @@ -7168,15 +7063,15 @@ continue fi - if test no = "$pre_test_object_deps_done"; then + if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)=$p + _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then - _LT_TAGVAR(postdep_objects, $1)=$p + _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi @@ -7223,7 +7118,7 @@ ;; esac - if test yes != "$solaris_use_stlport4"; then + if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; @@ -7246,7 +7141,7 @@ # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. - if test yes != "$solaris_use_stlport4"; then + if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; @@ -7260,7 +7155,7 @@ esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) @@ -7280,10 +7175,10 @@ # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. +# to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) -if test -z "$F77" || test no = "$F77"; then +if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi @@ -7320,7 +7215,7 @@ # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_disable_F77"; then +if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t @@ -7342,7 +7237,7 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. - lt_save_CC=$CC + lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} @@ -7356,21 +7251,21 @@ AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test no = "$can_build_shared" && enable_shared=no + test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test yes = "$enable_shared" && enable_static=no + test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) - if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then - test yes = "$enable_shared" && enable_static=no + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no fi ;; esac @@ -7378,11 +7273,11 @@ AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes + test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) - _LT_TAGVAR(GCC, $1)=$G77 - _LT_TAGVAR(LD, $1)=$LD + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7399,9 +7294,9 @@ fi # test -n "$compiler" GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS -fi # test yes != "$_lt_disable_F77" + CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" +fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG @@ -7411,11 +7306,11 @@ # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. +# to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) -if test -z "$FC" || test no = "$FC"; then +if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi @@ -7452,7 +7347,7 @@ # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_disable_FC"; then +if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t @@ -7474,7 +7369,7 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. - lt_save_CC=$CC + lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} @@ -7490,21 +7385,21 @@ AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test no = "$can_build_shared" && enable_shared=no + test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test yes = "$enable_shared" && enable_static=no + test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) - if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then - test yes = "$enable_shared" && enable_static=no + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no fi ;; esac @@ -7512,11 +7407,11 @@ AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes + test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) - _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu - _LT_TAGVAR(LD, $1)=$LD + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7536,7 +7431,7 @@ GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS -fi # test yes != "$_lt_disable_FC" +fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG @@ -7546,7 +7441,7 @@ # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. +# to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE @@ -7580,7 +7475,7 @@ CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)=$LD +_LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. @@ -7617,7 +7512,7 @@ # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. +# to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE @@ -7651,7 +7546,7 @@ CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)=$LD +_LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. @@ -7688,7 +7583,7 @@ # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. +# to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE @@ -7704,7 +7599,7 @@ lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests -lt_simple_link_test_code=$lt_simple_compile_test_code +lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER @@ -7714,7 +7609,7 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC=$CC +lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= @@ -7743,7 +7638,7 @@ [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) - test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) @@ -7854,7 +7749,7 @@ # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f "$lt_ac_sed" && continue + test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in @@ -7871,9 +7766,9 @@ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough - test 10 -lt "$lt_ac_count" && break + test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` - if test "$lt_ac_count" -gt "$lt_ac_max"; then + if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi @@ -7897,7 +7792,27 @@ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], -[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false @@ -7921,9 +7836,102 @@ ])# _LT_CHECK_SHELL_FEATURES +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) + + +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) + + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) + + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) + + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi + +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) + + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) + # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- -# Determine what file name conversion functions should be used by +# Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], diff -Nru cloog-0.18.2/m4/lt~obsolete.m4 cloog-0.18.4/m4/lt~obsolete.m4 --- cloog-0.18.2/m4/lt~obsolete.m4 2013-12-18 12:36:05.000000000 +0000 +++ cloog-0.18.4/m4/lt~obsolete.m4 2014-10-02 14:14:45.000000000 +0000 @@ -1,7 +1,6 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007, 2009, 2011-2013 Free Software -# Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives @@ -12,7 +11,7 @@ # These exist entirely to fool aclocal when bootstrapping libtool. # -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # @@ -26,7 +25,7 @@ # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until diff -Nru cloog-0.18.2/m4/ltoptions.m4 cloog-0.18.4/m4/ltoptions.m4 --- cloog-0.18.2/m4/ltoptions.m4 2013-12-18 12:36:05.000000000 +0000 +++ cloog-0.18.4/m4/ltoptions.m4 2014-10-02 14:14:44.000000000 +0000 @@ -1,14 +1,14 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2013 Free Software -# Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 8 ltoptions.m4 +# serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -29,7 +29,7 @@ [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option '$2'])])[]dnl + [m4_warning([Unknown $1 option `$2'])])[]dnl ]) @@ -75,13 +75,13 @@ dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither - dnl 'shared' nor 'disable-shared' was passed, we enable building of shared + dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) + [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS @@ -112,7 +112,7 @@ [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'dlopen' option into LT_INIT's first parameter.]) +put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -148,7 +148,7 @@ _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'win32-dll' option into LT_INIT's first parameter.]) +put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -157,9 +157,9 @@ # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- -# implement the --enable-shared flag, and supports the 'shared' and -# 'disable-shared' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], @@ -172,14 +172,14 @@ *) enable_shared=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) @@ -211,9 +211,9 @@ # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- -# implement the --enable-static flag, and support the 'static' and -# 'disable-static' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], @@ -226,14 +226,14 @@ *) enable_static=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) @@ -265,9 +265,9 @@ # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- -# implement the --enable-fast-install flag, and support the 'fast-install' -# and 'disable-fast-install' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], @@ -280,14 +280,14 @@ *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) @@ -304,14 +304,14 @@ [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put -the 'fast-install' option into LT_INIT's first parameter.]) +the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put -the 'disable-fast-install' option into LT_INIT's first parameter.]) +the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -321,9 +321,9 @@ # _LT_WITH_PIC([MODE]) # -------------------- -# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' +# implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. -# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], @@ -334,17 +334,19 @@ *) pic_mode=default # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do - IFS=$lt_save_ifs + IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done - IFS=$lt_save_ifs + IFS="$lt_save_ifs" ;; esac], - [pic_mode=m4_default([$1], [default])]) + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC @@ -357,7 +359,7 @@ [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'pic-only' option into LT_INIT's first parameter.]) +put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: diff -Nru cloog-0.18.2/m4/ltsugar.m4 cloog-0.18.4/m4/ltsugar.m4 --- cloog-0.18.2/m4/ltsugar.m4 2013-12-18 12:36:05.000000000 +0000 +++ cloog-0.18.4/m4/ltsugar.m4 2014-10-02 14:14:44.000000000 +0000 @@ -1,7 +1,6 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007-2008, 2011-2013 Free Software -# Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives @@ -34,7 +33,7 @@ # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support -# Autoconf-2.59, which quotes differently. +# Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], @@ -45,7 +44,7 @@ # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different diff -Nru cloog-0.18.2/m4/ltversion.m4 cloog-0.18.4/m4/ltversion.m4 --- cloog-0.18.2/m4/ltversion.m4 2013-12-18 12:36:05.000000000 +0000 +++ cloog-0.18.4/m4/ltversion.m4 2014-10-02 14:14:45.000000000 +0000 @@ -1,6 +1,6 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +9,15 @@ # @configure_input@ -# serial 4038 ltversion.m4 +# serial 3337 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.2.418]) -m4_define([LT_PACKAGE_REVISION], [2.4.2.418]) +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.2.418' -macro_revision='2.4.2.418' +[macro_version='2.4.2' +macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff -Nru cloog-0.18.2/Makefile.am cloog-0.18.4/Makefile.am --- cloog-0.18.2/Makefile.am 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/Makefile.am 2014-10-02 16:33:52.000000000 +0000 @@ -46,6 +46,7 @@ OSL_LA = $(top_builddir)/osl/libosl.la endif +AUTOMAKE_OPTIONS = subdir-objects SUBDIRS = $(MAYBE_ISL) $(MAYBE_OSL) . doc test DIST_SUBDIRS = $(MAYBE_ISL) $(MAYBE_OSL) . doc test @@ -85,6 +86,7 @@ source/statement.c \ source/stride.c \ source/union_domain.c \ + source/util.c \ source/version.c AM_CPPFLAGS = -I. -I$(top_builddir)/include -I$(top_srcdir)/include @@ -120,6 +122,7 @@ include/cloog/statement.h \ include/cloog/stride.h \ include/cloog/union_domain.h \ + include/cloog/util.h \ include/cloog/version.h pkgmatrixincludedir = $(pkgincludedir)/matrix @@ -139,6 +142,7 @@ EXTRA_DIST = \ autoconf/Doxyfile.in \ source/matrix/constraintset.c \ + cmake \ doc/cloog.texi \ doc/images \ examples @@ -153,6 +157,8 @@ uninstall-local: rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)" + rm -f "$(DESTDIR)$(libdir)/isl/isl-config.cmake" + rm -f "$(DESTDIR)$(libdir)/$(PACKAGE_NAME)/cloog-isl-config.cmake" dist-hook: rm -f $(distdir)/test/Makefile @@ -164,7 +170,7 @@ # *****************************************************************************/ valcheck: - $(MAKE) valgrind -C test + $(MAKE) test_valgrind -C test total: @echo " /*-----------------------------------------------*" diff -Nru cloog-0.18.2/Makefile.in cloog-0.18.4/Makefile.in --- cloog-0.18.2/Makefile.in 2013-12-18 12:36:08.000000000 +0000 +++ cloog-0.18.4/Makefile.in 2015-07-27 12:06:01.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -31,6 +30,51 @@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -51,15 +95,22 @@ host_triplet = @host@ bin_PROGRAMS = $(am__EXEEXT_1) subdir = . -DIST_COMMON = README $(am__configure_deps) $(pkginclude_HEADERS) \ - $(pkgislinclude_HEADERS) $(pkgmatrixinclude_HEADERS) \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/genversion.sh.in $(top_srcdir)/autoconf/Doxyfile.in \ - $(top_srcdir)/configure \ +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(top_srcdir)/autoconf/Doxyfile.in \ + $(top_srcdir)/source/version.c.in \ $(top_srcdir)/include/cloog/version.h.in \ - $(top_srcdir)/source/version.c.in ChangeLog \ + $(srcdir)/genversion.sh.in $(top_srcdir)/autoconf/depcomp \ + $(pkginclude_HEADERS) $(pkgislinclude_HEADERS) \ + $(pkgmatrixinclude_HEADERS) ChangeLog README autoconf/compile \ autoconf/config.guess autoconf/config.sub autoconf/depcomp \ - autoconf/install-sh autoconf/ltmain.sh autoconf/missing + autoconf/install-sh autoconf/missing autoconf/ltmain.sh \ + $(top_srcdir)/autoconf/compile \ + $(top_srcdir)/autoconf/config.guess \ + $(top_srcdir)/autoconf/config.sub \ + $(top_srcdir)/autoconf/install-sh \ + $(top_srcdir)/autoconf/ltmain.sh \ + $(top_srcdir)/autoconf/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cc_maxopt.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ @@ -117,24 +168,33 @@ source/input.c source/int.c source/loop.c source/names.c \ source/options.c source/pprint.c source/program.c \ source/statement.c source/stride.c source/union_domain.c \ - source/version.c source/isl/domain.c source/isl/constraints.c \ - source/isl/backend.c -@NEED_GET_MEMORY_FUNCTIONS_TRUE@am__objects_1 = libcloog_isl_la-mp_get_memory_functions.lo -am__objects_2 = $(am__objects_1) libcloog_isl_la-block.lo \ - libcloog_isl_la-clast.lo libcloog_isl_la-matrix.lo \ - libcloog_isl_la-state.lo libcloog_isl_la-input.lo \ - libcloog_isl_la-int.lo libcloog_isl_la-loop.lo \ - libcloog_isl_la-names.lo libcloog_isl_la-options.lo \ - libcloog_isl_la-pprint.lo libcloog_isl_la-program.lo \ - libcloog_isl_la-statement.lo libcloog_isl_la-stride.lo \ - libcloog_isl_la-union_domain.lo libcloog_isl_la-version.lo + source/util.c source/version.c source/isl/domain.c \ + source/isl/constraints.c source/isl/backend.c +am__dirstamp = $(am__leading_dot)dirstamp +@NEED_GET_MEMORY_FUNCTIONS_TRUE@am__objects_1 = source/libcloog_isl_la-mp_get_memory_functions.lo +am__objects_2 = $(am__objects_1) source/libcloog_isl_la-block.lo \ + source/libcloog_isl_la-clast.lo \ + source/libcloog_isl_la-matrix.lo \ + source/libcloog_isl_la-state.lo \ + source/libcloog_isl_la-input.lo source/libcloog_isl_la-int.lo \ + source/libcloog_isl_la-loop.lo source/libcloog_isl_la-names.lo \ + source/libcloog_isl_la-options.lo \ + source/libcloog_isl_la-pprint.lo \ + source/libcloog_isl_la-program.lo \ + source/libcloog_isl_la-statement.lo \ + source/libcloog_isl_la-stride.lo \ + source/libcloog_isl_la-union_domain.lo \ + source/libcloog_isl_la-util.lo \ + source/libcloog_isl_la-version.lo am_libcloog_isl_la_OBJECTS = $(am__objects_2) \ - libcloog_isl_la-domain.lo libcloog_isl_la-constraints.lo \ - libcloog_isl_la-backend.lo + source/isl/libcloog_isl_la-domain.lo \ + source/isl/libcloog_isl_la-constraints.lo \ + source/isl/libcloog_isl_la-backend.lo libcloog_isl_la_OBJECTS = $(am_libcloog_isl_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = libcloog_isl_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libcloog_isl_la_LDFLAGS) $(LDFLAGS) \ @@ -142,9 +202,21 @@ @NO_ISL_FALSE@am_libcloog_isl_la_rpath = -rpath $(libdir) @NO_ISL_FALSE@am__EXEEXT_1 = cloog$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) -am_cloog_OBJECTS = cloog.$(OBJEXT) +am_cloog_OBJECTS = source/cloog.$(OBJEXT) cloog_OBJECTS = $(am_cloog_OBJECTS) cloog_LDADD = $(LDADD) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp am__depfiles_maybe = depfiles @@ -157,38 +229,61 @@ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(libcloog_isl_la_SOURCES) $(cloog_SOURCES) DIST_SOURCES = $(am__libcloog_isl_la_SOURCES_DIST) $(cloog_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac HEADERS = $(pkginclude_HEADERS) $(pkgislinclude_HEADERS) \ $(pkgmatrixinclude_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir dist dist-all distcheck +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +CSCOPE = cscope DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -198,6 +293,7 @@ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi +am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ @@ -225,6 +321,7 @@ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best +DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -392,6 +489,7 @@ @BUNDLED_ISL_TRUE@ISL_LA = $(top_builddir)/isl/libisl.la @BUNDLED_OSL_TRUE@MAYBE_OSL = osl @BUNDLED_OSL_TRUE@OSL_LA = $(top_builddir)/osl/libosl.la +AUTOMAKE_OPTIONS = subdir-objects SUBDIRS = $(MAYBE_ISL) $(MAYBE_OSL) . doc test DIST_SUBDIRS = $(MAYBE_ISL) $(MAYBE_OSL) . doc test ACLOCAL_AMFLAGS = -I m4 @@ -417,6 +515,7 @@ source/statement.c \ source/stride.c \ source/union_domain.c \ + source/util.c \ source/version.c AM_CPPFLAGS = -I. -I$(top_builddir)/include -I$(top_srcdir)/include @@ -453,6 +552,7 @@ include/cloog/statement.h \ include/cloog/stride.h \ include/cloog/union_domain.h \ + include/cloog/util.h \ include/cloog/version.h pkgmatrixincludedir = $(pkgincludedir)/matrix @@ -469,6 +569,7 @@ EXTRA_DIST = \ autoconf/Doxyfile.in \ source/matrix/constraintset.c \ + cmake \ doc/cloog.texi \ doc/images \ examples @@ -519,9 +620,9 @@ cd $(top_builddir) && $(SHELL) ./config.status $@ genversion.sh: $(top_builddir)/config.status $(srcdir)/genversion.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ + install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -529,6 +630,8 @@ else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } @@ -544,24 +647,84 @@ clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +source/$(am__dirstamp): + @$(MKDIR_P) source + @: > source/$(am__dirstamp) +source/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) source/$(DEPDIR) + @: > source/$(DEPDIR)/$(am__dirstamp) +source/libcloog_isl_la-mp_get_memory_functions.lo: \ + source/$(am__dirstamp) source/$(DEPDIR)/$(am__dirstamp) +source/libcloog_isl_la-block.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libcloog_isl_la-clast.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libcloog_isl_la-matrix.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libcloog_isl_la-state.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libcloog_isl_la-input.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libcloog_isl_la-int.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libcloog_isl_la-loop.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libcloog_isl_la-names.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libcloog_isl_la-options.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libcloog_isl_la-pprint.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libcloog_isl_la-program.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libcloog_isl_la-statement.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libcloog_isl_la-stride.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libcloog_isl_la-union_domain.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libcloog_isl_la-util.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libcloog_isl_la-version.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/isl/$(am__dirstamp): + @$(MKDIR_P) source/isl + @: > source/isl/$(am__dirstamp) +source/isl/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) source/isl/$(DEPDIR) + @: > source/isl/$(DEPDIR)/$(am__dirstamp) +source/isl/libcloog_isl_la-domain.lo: source/isl/$(am__dirstamp) \ + source/isl/$(DEPDIR)/$(am__dirstamp) +source/isl/libcloog_isl_la-constraints.lo: source/isl/$(am__dirstamp) \ + source/isl/$(DEPDIR)/$(am__dirstamp) +source/isl/libcloog_isl_la-backend.lo: source/isl/$(am__dirstamp) \ + source/isl/$(DEPDIR)/$(am__dirstamp) + libcloog-isl.la: $(libcloog_isl_la_OBJECTS) $(libcloog_isl_la_DEPENDENCIES) $(EXTRA_libcloog_isl_la_DEPENDENCIES) $(AM_V_CCLD)$(libcloog_isl_la_LINK) $(am_libcloog_isl_la_rpath) $(libcloog_isl_la_OBJECTS) $(libcloog_isl_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ @@ -582,7 +745,8 @@ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ + -e 's/$$/$(EXEEXT)/' \ + `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files @@ -595,217 +759,226 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list +source/cloog.$(OBJEXT): source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) + cloog$(EXEEXT): $(cloog_OBJECTS) $(cloog_DEPENDENCIES) $(EXTRA_cloog_DEPENDENCIES) @rm -f cloog$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cloog_OBJECTS) $(cloog_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) + -rm -f source/*.$(OBJEXT) + -rm -f source/*.lo + -rm -f source/isl/*.$(OBJEXT) + -rm -f source/isl/*.lo distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cloog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-backend.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-block.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-clast.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-constraints.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-domain.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-input.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-int.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-loop.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-matrix.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-mp_get_memory_functions.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-names.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-options.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-pprint.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-program.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-state.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-statement.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-stride.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-union_domain.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcloog_isl_la-version.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/cloog.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libcloog_isl_la-block.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libcloog_isl_la-clast.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libcloog_isl_la-input.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libcloog_isl_la-int.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libcloog_isl_la-loop.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libcloog_isl_la-matrix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libcloog_isl_la-mp_get_memory_functions.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libcloog_isl_la-names.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libcloog_isl_la-options.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libcloog_isl_la-pprint.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libcloog_isl_la-program.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libcloog_isl_la-state.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libcloog_isl_la-statement.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libcloog_isl_la-stride.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libcloog_isl_la-union_domain.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libcloog_isl_la-util.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libcloog_isl_la-version.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/isl/$(DEPDIR)/libcloog_isl_la-backend.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/isl/$(DEPDIR)/libcloog_isl_la-constraints.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/isl/$(DEPDIR)/libcloog_isl_la-domain.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -libcloog_isl_la-mp_get_memory_functions.lo: source/mp_get_memory_functions.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-mp_get_memory_functions.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-mp_get_memory_functions.Tpo -c -o libcloog_isl_la-mp_get_memory_functions.lo `test -f 'source/mp_get_memory_functions.c' || echo '$(srcdir)/'`source/mp_get_memory_functions.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-mp_get_memory_functions.Tpo $(DEPDIR)/libcloog_isl_la-mp_get_memory_functions.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/mp_get_memory_functions.c' object='libcloog_isl_la-mp_get_memory_functions.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-mp_get_memory_functions.lo `test -f 'source/mp_get_memory_functions.c' || echo '$(srcdir)/'`source/mp_get_memory_functions.c - -libcloog_isl_la-block.lo: source/block.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-block.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-block.Tpo -c -o libcloog_isl_la-block.lo `test -f 'source/block.c' || echo '$(srcdir)/'`source/block.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-block.Tpo $(DEPDIR)/libcloog_isl_la-block.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/block.c' object='libcloog_isl_la-block.lo' libtool=yes @AMDEPBACKSLASH@ +source/libcloog_isl_la-mp_get_memory_functions.lo: source/mp_get_memory_functions.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libcloog_isl_la-mp_get_memory_functions.lo -MD -MP -MF source/$(DEPDIR)/libcloog_isl_la-mp_get_memory_functions.Tpo -c -o source/libcloog_isl_la-mp_get_memory_functions.lo `test -f 'source/mp_get_memory_functions.c' || echo '$(srcdir)/'`source/mp_get_memory_functions.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libcloog_isl_la-mp_get_memory_functions.Tpo source/$(DEPDIR)/libcloog_isl_la-mp_get_memory_functions.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/mp_get_memory_functions.c' object='source/libcloog_isl_la-mp_get_memory_functions.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-block.lo `test -f 'source/block.c' || echo '$(srcdir)/'`source/block.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libcloog_isl_la-mp_get_memory_functions.lo `test -f 'source/mp_get_memory_functions.c' || echo '$(srcdir)/'`source/mp_get_memory_functions.c -libcloog_isl_la-clast.lo: source/clast.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-clast.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-clast.Tpo -c -o libcloog_isl_la-clast.lo `test -f 'source/clast.c' || echo '$(srcdir)/'`source/clast.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-clast.Tpo $(DEPDIR)/libcloog_isl_la-clast.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/clast.c' object='libcloog_isl_la-clast.lo' libtool=yes @AMDEPBACKSLASH@ +source/libcloog_isl_la-block.lo: source/block.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libcloog_isl_la-block.lo -MD -MP -MF source/$(DEPDIR)/libcloog_isl_la-block.Tpo -c -o source/libcloog_isl_la-block.lo `test -f 'source/block.c' || echo '$(srcdir)/'`source/block.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libcloog_isl_la-block.Tpo source/$(DEPDIR)/libcloog_isl_la-block.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/block.c' object='source/libcloog_isl_la-block.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-clast.lo `test -f 'source/clast.c' || echo '$(srcdir)/'`source/clast.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libcloog_isl_la-block.lo `test -f 'source/block.c' || echo '$(srcdir)/'`source/block.c -libcloog_isl_la-matrix.lo: source/matrix.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-matrix.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-matrix.Tpo -c -o libcloog_isl_la-matrix.lo `test -f 'source/matrix.c' || echo '$(srcdir)/'`source/matrix.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-matrix.Tpo $(DEPDIR)/libcloog_isl_la-matrix.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/matrix.c' object='libcloog_isl_la-matrix.lo' libtool=yes @AMDEPBACKSLASH@ +source/libcloog_isl_la-clast.lo: source/clast.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libcloog_isl_la-clast.lo -MD -MP -MF source/$(DEPDIR)/libcloog_isl_la-clast.Tpo -c -o source/libcloog_isl_la-clast.lo `test -f 'source/clast.c' || echo '$(srcdir)/'`source/clast.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libcloog_isl_la-clast.Tpo source/$(DEPDIR)/libcloog_isl_la-clast.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/clast.c' object='source/libcloog_isl_la-clast.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-matrix.lo `test -f 'source/matrix.c' || echo '$(srcdir)/'`source/matrix.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libcloog_isl_la-clast.lo `test -f 'source/clast.c' || echo '$(srcdir)/'`source/clast.c -libcloog_isl_la-state.lo: source/state.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-state.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-state.Tpo -c -o libcloog_isl_la-state.lo `test -f 'source/state.c' || echo '$(srcdir)/'`source/state.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-state.Tpo $(DEPDIR)/libcloog_isl_la-state.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/state.c' object='libcloog_isl_la-state.lo' libtool=yes @AMDEPBACKSLASH@ +source/libcloog_isl_la-matrix.lo: source/matrix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libcloog_isl_la-matrix.lo -MD -MP -MF source/$(DEPDIR)/libcloog_isl_la-matrix.Tpo -c -o source/libcloog_isl_la-matrix.lo `test -f 'source/matrix.c' || echo '$(srcdir)/'`source/matrix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libcloog_isl_la-matrix.Tpo source/$(DEPDIR)/libcloog_isl_la-matrix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/matrix.c' object='source/libcloog_isl_la-matrix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-state.lo `test -f 'source/state.c' || echo '$(srcdir)/'`source/state.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libcloog_isl_la-matrix.lo `test -f 'source/matrix.c' || echo '$(srcdir)/'`source/matrix.c -libcloog_isl_la-input.lo: source/input.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-input.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-input.Tpo -c -o libcloog_isl_la-input.lo `test -f 'source/input.c' || echo '$(srcdir)/'`source/input.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-input.Tpo $(DEPDIR)/libcloog_isl_la-input.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/input.c' object='libcloog_isl_la-input.lo' libtool=yes @AMDEPBACKSLASH@ +source/libcloog_isl_la-state.lo: source/state.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libcloog_isl_la-state.lo -MD -MP -MF source/$(DEPDIR)/libcloog_isl_la-state.Tpo -c -o source/libcloog_isl_la-state.lo `test -f 'source/state.c' || echo '$(srcdir)/'`source/state.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libcloog_isl_la-state.Tpo source/$(DEPDIR)/libcloog_isl_la-state.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/state.c' object='source/libcloog_isl_la-state.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-input.lo `test -f 'source/input.c' || echo '$(srcdir)/'`source/input.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libcloog_isl_la-state.lo `test -f 'source/state.c' || echo '$(srcdir)/'`source/state.c -libcloog_isl_la-int.lo: source/int.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-int.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-int.Tpo -c -o libcloog_isl_la-int.lo `test -f 'source/int.c' || echo '$(srcdir)/'`source/int.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-int.Tpo $(DEPDIR)/libcloog_isl_la-int.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/int.c' object='libcloog_isl_la-int.lo' libtool=yes @AMDEPBACKSLASH@ +source/libcloog_isl_la-input.lo: source/input.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libcloog_isl_la-input.lo -MD -MP -MF source/$(DEPDIR)/libcloog_isl_la-input.Tpo -c -o source/libcloog_isl_la-input.lo `test -f 'source/input.c' || echo '$(srcdir)/'`source/input.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libcloog_isl_la-input.Tpo source/$(DEPDIR)/libcloog_isl_la-input.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/input.c' object='source/libcloog_isl_la-input.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-int.lo `test -f 'source/int.c' || echo '$(srcdir)/'`source/int.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libcloog_isl_la-input.lo `test -f 'source/input.c' || echo '$(srcdir)/'`source/input.c -libcloog_isl_la-loop.lo: source/loop.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-loop.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-loop.Tpo -c -o libcloog_isl_la-loop.lo `test -f 'source/loop.c' || echo '$(srcdir)/'`source/loop.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-loop.Tpo $(DEPDIR)/libcloog_isl_la-loop.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/loop.c' object='libcloog_isl_la-loop.lo' libtool=yes @AMDEPBACKSLASH@ +source/libcloog_isl_la-int.lo: source/int.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libcloog_isl_la-int.lo -MD -MP -MF source/$(DEPDIR)/libcloog_isl_la-int.Tpo -c -o source/libcloog_isl_la-int.lo `test -f 'source/int.c' || echo '$(srcdir)/'`source/int.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libcloog_isl_la-int.Tpo source/$(DEPDIR)/libcloog_isl_la-int.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/int.c' object='source/libcloog_isl_la-int.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-loop.lo `test -f 'source/loop.c' || echo '$(srcdir)/'`source/loop.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libcloog_isl_la-int.lo `test -f 'source/int.c' || echo '$(srcdir)/'`source/int.c -libcloog_isl_la-names.lo: source/names.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-names.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-names.Tpo -c -o libcloog_isl_la-names.lo `test -f 'source/names.c' || echo '$(srcdir)/'`source/names.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-names.Tpo $(DEPDIR)/libcloog_isl_la-names.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/names.c' object='libcloog_isl_la-names.lo' libtool=yes @AMDEPBACKSLASH@ +source/libcloog_isl_la-loop.lo: source/loop.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libcloog_isl_la-loop.lo -MD -MP -MF source/$(DEPDIR)/libcloog_isl_la-loop.Tpo -c -o source/libcloog_isl_la-loop.lo `test -f 'source/loop.c' || echo '$(srcdir)/'`source/loop.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libcloog_isl_la-loop.Tpo source/$(DEPDIR)/libcloog_isl_la-loop.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/loop.c' object='source/libcloog_isl_la-loop.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-names.lo `test -f 'source/names.c' || echo '$(srcdir)/'`source/names.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libcloog_isl_la-loop.lo `test -f 'source/loop.c' || echo '$(srcdir)/'`source/loop.c -libcloog_isl_la-options.lo: source/options.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-options.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-options.Tpo -c -o libcloog_isl_la-options.lo `test -f 'source/options.c' || echo '$(srcdir)/'`source/options.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-options.Tpo $(DEPDIR)/libcloog_isl_la-options.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/options.c' object='libcloog_isl_la-options.lo' libtool=yes @AMDEPBACKSLASH@ +source/libcloog_isl_la-names.lo: source/names.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libcloog_isl_la-names.lo -MD -MP -MF source/$(DEPDIR)/libcloog_isl_la-names.Tpo -c -o source/libcloog_isl_la-names.lo `test -f 'source/names.c' || echo '$(srcdir)/'`source/names.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libcloog_isl_la-names.Tpo source/$(DEPDIR)/libcloog_isl_la-names.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/names.c' object='source/libcloog_isl_la-names.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-options.lo `test -f 'source/options.c' || echo '$(srcdir)/'`source/options.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libcloog_isl_la-names.lo `test -f 'source/names.c' || echo '$(srcdir)/'`source/names.c -libcloog_isl_la-pprint.lo: source/pprint.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-pprint.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-pprint.Tpo -c -o libcloog_isl_la-pprint.lo `test -f 'source/pprint.c' || echo '$(srcdir)/'`source/pprint.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-pprint.Tpo $(DEPDIR)/libcloog_isl_la-pprint.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/pprint.c' object='libcloog_isl_la-pprint.lo' libtool=yes @AMDEPBACKSLASH@ +source/libcloog_isl_la-options.lo: source/options.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libcloog_isl_la-options.lo -MD -MP -MF source/$(DEPDIR)/libcloog_isl_la-options.Tpo -c -o source/libcloog_isl_la-options.lo `test -f 'source/options.c' || echo '$(srcdir)/'`source/options.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libcloog_isl_la-options.Tpo source/$(DEPDIR)/libcloog_isl_la-options.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/options.c' object='source/libcloog_isl_la-options.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-pprint.lo `test -f 'source/pprint.c' || echo '$(srcdir)/'`source/pprint.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libcloog_isl_la-options.lo `test -f 'source/options.c' || echo '$(srcdir)/'`source/options.c -libcloog_isl_la-program.lo: source/program.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-program.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-program.Tpo -c -o libcloog_isl_la-program.lo `test -f 'source/program.c' || echo '$(srcdir)/'`source/program.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-program.Tpo $(DEPDIR)/libcloog_isl_la-program.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/program.c' object='libcloog_isl_la-program.lo' libtool=yes @AMDEPBACKSLASH@ +source/libcloog_isl_la-pprint.lo: source/pprint.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libcloog_isl_la-pprint.lo -MD -MP -MF source/$(DEPDIR)/libcloog_isl_la-pprint.Tpo -c -o source/libcloog_isl_la-pprint.lo `test -f 'source/pprint.c' || echo '$(srcdir)/'`source/pprint.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libcloog_isl_la-pprint.Tpo source/$(DEPDIR)/libcloog_isl_la-pprint.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/pprint.c' object='source/libcloog_isl_la-pprint.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-program.lo `test -f 'source/program.c' || echo '$(srcdir)/'`source/program.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libcloog_isl_la-pprint.lo `test -f 'source/pprint.c' || echo '$(srcdir)/'`source/pprint.c -libcloog_isl_la-statement.lo: source/statement.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-statement.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-statement.Tpo -c -o libcloog_isl_la-statement.lo `test -f 'source/statement.c' || echo '$(srcdir)/'`source/statement.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-statement.Tpo $(DEPDIR)/libcloog_isl_la-statement.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/statement.c' object='libcloog_isl_la-statement.lo' libtool=yes @AMDEPBACKSLASH@ +source/libcloog_isl_la-program.lo: source/program.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libcloog_isl_la-program.lo -MD -MP -MF source/$(DEPDIR)/libcloog_isl_la-program.Tpo -c -o source/libcloog_isl_la-program.lo `test -f 'source/program.c' || echo '$(srcdir)/'`source/program.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libcloog_isl_la-program.Tpo source/$(DEPDIR)/libcloog_isl_la-program.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/program.c' object='source/libcloog_isl_la-program.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-statement.lo `test -f 'source/statement.c' || echo '$(srcdir)/'`source/statement.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libcloog_isl_la-program.lo `test -f 'source/program.c' || echo '$(srcdir)/'`source/program.c -libcloog_isl_la-stride.lo: source/stride.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-stride.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-stride.Tpo -c -o libcloog_isl_la-stride.lo `test -f 'source/stride.c' || echo '$(srcdir)/'`source/stride.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-stride.Tpo $(DEPDIR)/libcloog_isl_la-stride.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/stride.c' object='libcloog_isl_la-stride.lo' libtool=yes @AMDEPBACKSLASH@ +source/libcloog_isl_la-statement.lo: source/statement.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libcloog_isl_la-statement.lo -MD -MP -MF source/$(DEPDIR)/libcloog_isl_la-statement.Tpo -c -o source/libcloog_isl_la-statement.lo `test -f 'source/statement.c' || echo '$(srcdir)/'`source/statement.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libcloog_isl_la-statement.Tpo source/$(DEPDIR)/libcloog_isl_la-statement.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/statement.c' object='source/libcloog_isl_la-statement.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-stride.lo `test -f 'source/stride.c' || echo '$(srcdir)/'`source/stride.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libcloog_isl_la-statement.lo `test -f 'source/statement.c' || echo '$(srcdir)/'`source/statement.c -libcloog_isl_la-union_domain.lo: source/union_domain.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-union_domain.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-union_domain.Tpo -c -o libcloog_isl_la-union_domain.lo `test -f 'source/union_domain.c' || echo '$(srcdir)/'`source/union_domain.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-union_domain.Tpo $(DEPDIR)/libcloog_isl_la-union_domain.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/union_domain.c' object='libcloog_isl_la-union_domain.lo' libtool=yes @AMDEPBACKSLASH@ +source/libcloog_isl_la-stride.lo: source/stride.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libcloog_isl_la-stride.lo -MD -MP -MF source/$(DEPDIR)/libcloog_isl_la-stride.Tpo -c -o source/libcloog_isl_la-stride.lo `test -f 'source/stride.c' || echo '$(srcdir)/'`source/stride.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libcloog_isl_la-stride.Tpo source/$(DEPDIR)/libcloog_isl_la-stride.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/stride.c' object='source/libcloog_isl_la-stride.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-union_domain.lo `test -f 'source/union_domain.c' || echo '$(srcdir)/'`source/union_domain.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libcloog_isl_la-stride.lo `test -f 'source/stride.c' || echo '$(srcdir)/'`source/stride.c -libcloog_isl_la-version.lo: source/version.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-version.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-version.Tpo -c -o libcloog_isl_la-version.lo `test -f 'source/version.c' || echo '$(srcdir)/'`source/version.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-version.Tpo $(DEPDIR)/libcloog_isl_la-version.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/version.c' object='libcloog_isl_la-version.lo' libtool=yes @AMDEPBACKSLASH@ +source/libcloog_isl_la-union_domain.lo: source/union_domain.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libcloog_isl_la-union_domain.lo -MD -MP -MF source/$(DEPDIR)/libcloog_isl_la-union_domain.Tpo -c -o source/libcloog_isl_la-union_domain.lo `test -f 'source/union_domain.c' || echo '$(srcdir)/'`source/union_domain.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libcloog_isl_la-union_domain.Tpo source/$(DEPDIR)/libcloog_isl_la-union_domain.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/union_domain.c' object='source/libcloog_isl_la-union_domain.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-version.lo `test -f 'source/version.c' || echo '$(srcdir)/'`source/version.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libcloog_isl_la-union_domain.lo `test -f 'source/union_domain.c' || echo '$(srcdir)/'`source/union_domain.c -libcloog_isl_la-domain.lo: source/isl/domain.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-domain.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-domain.Tpo -c -o libcloog_isl_la-domain.lo `test -f 'source/isl/domain.c' || echo '$(srcdir)/'`source/isl/domain.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-domain.Tpo $(DEPDIR)/libcloog_isl_la-domain.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/isl/domain.c' object='libcloog_isl_la-domain.lo' libtool=yes @AMDEPBACKSLASH@ +source/libcloog_isl_la-util.lo: source/util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libcloog_isl_la-util.lo -MD -MP -MF source/$(DEPDIR)/libcloog_isl_la-util.Tpo -c -o source/libcloog_isl_la-util.lo `test -f 'source/util.c' || echo '$(srcdir)/'`source/util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libcloog_isl_la-util.Tpo source/$(DEPDIR)/libcloog_isl_la-util.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/util.c' object='source/libcloog_isl_la-util.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-domain.lo `test -f 'source/isl/domain.c' || echo '$(srcdir)/'`source/isl/domain.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libcloog_isl_la-util.lo `test -f 'source/util.c' || echo '$(srcdir)/'`source/util.c -libcloog_isl_la-constraints.lo: source/isl/constraints.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-constraints.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-constraints.Tpo -c -o libcloog_isl_la-constraints.lo `test -f 'source/isl/constraints.c' || echo '$(srcdir)/'`source/isl/constraints.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-constraints.Tpo $(DEPDIR)/libcloog_isl_la-constraints.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/isl/constraints.c' object='libcloog_isl_la-constraints.lo' libtool=yes @AMDEPBACKSLASH@ +source/libcloog_isl_la-version.lo: source/version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libcloog_isl_la-version.lo -MD -MP -MF source/$(DEPDIR)/libcloog_isl_la-version.Tpo -c -o source/libcloog_isl_la-version.lo `test -f 'source/version.c' || echo '$(srcdir)/'`source/version.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libcloog_isl_la-version.Tpo source/$(DEPDIR)/libcloog_isl_la-version.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/version.c' object='source/libcloog_isl_la-version.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-constraints.lo `test -f 'source/isl/constraints.c' || echo '$(srcdir)/'`source/isl/constraints.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libcloog_isl_la-version.lo `test -f 'source/version.c' || echo '$(srcdir)/'`source/version.c -libcloog_isl_la-backend.lo: source/isl/backend.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcloog_isl_la-backend.lo -MD -MP -MF $(DEPDIR)/libcloog_isl_la-backend.Tpo -c -o libcloog_isl_la-backend.lo `test -f 'source/isl/backend.c' || echo '$(srcdir)/'`source/isl/backend.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcloog_isl_la-backend.Tpo $(DEPDIR)/libcloog_isl_la-backend.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/isl/backend.c' object='libcloog_isl_la-backend.lo' libtool=yes @AMDEPBACKSLASH@ +source/isl/libcloog_isl_la-domain.lo: source/isl/domain.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/isl/libcloog_isl_la-domain.lo -MD -MP -MF source/isl/$(DEPDIR)/libcloog_isl_la-domain.Tpo -c -o source/isl/libcloog_isl_la-domain.lo `test -f 'source/isl/domain.c' || echo '$(srcdir)/'`source/isl/domain.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/isl/$(DEPDIR)/libcloog_isl_la-domain.Tpo source/isl/$(DEPDIR)/libcloog_isl_la-domain.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/isl/domain.c' object='source/isl/libcloog_isl_la-domain.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcloog_isl_la-backend.lo `test -f 'source/isl/backend.c' || echo '$(srcdir)/'`source/isl/backend.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/isl/libcloog_isl_la-domain.lo `test -f 'source/isl/domain.c' || echo '$(srcdir)/'`source/isl/domain.c -cloog.o: source/cloog.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cloog.o -MD -MP -MF $(DEPDIR)/cloog.Tpo -c -o cloog.o `test -f 'source/cloog.c' || echo '$(srcdir)/'`source/cloog.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cloog.Tpo $(DEPDIR)/cloog.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/cloog.c' object='cloog.o' libtool=no @AMDEPBACKSLASH@ +source/isl/libcloog_isl_la-constraints.lo: source/isl/constraints.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/isl/libcloog_isl_la-constraints.lo -MD -MP -MF source/isl/$(DEPDIR)/libcloog_isl_la-constraints.Tpo -c -o source/isl/libcloog_isl_la-constraints.lo `test -f 'source/isl/constraints.c' || echo '$(srcdir)/'`source/isl/constraints.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/isl/$(DEPDIR)/libcloog_isl_la-constraints.Tpo source/isl/$(DEPDIR)/libcloog_isl_la-constraints.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/isl/constraints.c' object='source/isl/libcloog_isl_la-constraints.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cloog.o `test -f 'source/cloog.c' || echo '$(srcdir)/'`source/cloog.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/isl/libcloog_isl_la-constraints.lo `test -f 'source/isl/constraints.c' || echo '$(srcdir)/'`source/isl/constraints.c -cloog.obj: source/cloog.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cloog.obj -MD -MP -MF $(DEPDIR)/cloog.Tpo -c -o cloog.obj `if test -f 'source/cloog.c'; then $(CYGPATH_W) 'source/cloog.c'; else $(CYGPATH_W) '$(srcdir)/source/cloog.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cloog.Tpo $(DEPDIR)/cloog.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/cloog.c' object='cloog.obj' libtool=no @AMDEPBACKSLASH@ +source/isl/libcloog_isl_la-backend.lo: source/isl/backend.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/isl/libcloog_isl_la-backend.lo -MD -MP -MF source/isl/$(DEPDIR)/libcloog_isl_la-backend.Tpo -c -o source/isl/libcloog_isl_la-backend.lo `test -f 'source/isl/backend.c' || echo '$(srcdir)/'`source/isl/backend.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/isl/$(DEPDIR)/libcloog_isl_la-backend.Tpo source/isl/$(DEPDIR)/libcloog_isl_la-backend.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/isl/backend.c' object='source/isl/libcloog_isl_la-backend.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cloog.obj `if test -f 'source/cloog.c'; then $(CYGPATH_W) 'source/cloog.c'; else $(CYGPATH_W) '$(srcdir)/source/cloog.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcloog_isl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/isl/libcloog_isl_la-backend.lo `test -f 'source/isl/backend.c' || echo '$(srcdir)/'`source/isl/backend.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs + -rm -rf source/.libs source/_libs + -rm -rf source/isl/.libs source/isl/_libs distclean-libtool: -rm -f libtool config.lt install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -822,8 +995,11 @@ dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) install-pkgislincludeHEADERS: $(pkgislinclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(pkgislincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgislincludedir)" @list='$(pkgislinclude_HEADERS)'; test -n "$(pkgislincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgislincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgislincludedir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -840,8 +1016,11 @@ dir='$(DESTDIR)$(pkgislincludedir)'; $(am__uninstall_files_from_dir) install-pkgmatrixincludeHEADERS: $(pkgmatrixinclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(pkgmatrixincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgmatrixincludedir)" @list='$(pkgmatrixinclude_HEADERS)'; test -n "$(pkgmatrixincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgmatrixincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgmatrixincludedir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -858,22 +1037,25 @@ dir='$(DESTDIR)$(pkgmatrixincludedir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -888,57 +1070,12 @@ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -954,12 +1091,7 @@ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -971,15 +1103,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -988,9 +1116,31 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) @@ -1026,13 +1176,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -1064,40 +1211,42 @@ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__remove_distdir) + $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__remove_distdir) - -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) + $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) + $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) + $(am__post_remove_distdir) -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another @@ -1108,8 +1257,6 @@ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ @@ -1121,18 +1268,19 @@ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -1155,7 +1303,7 @@ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 - $(am__remove_distdir) + $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' @@ -1221,6 +1369,10 @@ distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f source/$(DEPDIR)/$(am__dirstamp) + -rm -f source/$(am__dirstamp) + -rm -f source/isl/$(DEPDIR)/$(am__dirstamp) + -rm -f source/isl/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -1232,7 +1384,7 @@ distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf ./$(DEPDIR) + -rm -rf source/$(DEPDIR) source/isl/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags @@ -1281,7 +1433,7 @@ maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf ./$(DEPDIR) + -rm -rf source/$(DEPDIR) source/isl/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -1303,31 +1455,30 @@ uninstall-pkgislincludeHEADERS \ uninstall-pkgmatrixincludeHEADERS -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive +.MAKE: $(am__recursive_targets) install-am install-strip -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am am--refresh check check-am clean clean-binPROGRAMS \ - clean-generic clean-libLTLIBRARIES clean-libtool ctags \ - ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \ - dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ - distcheck distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS install-data \ - install-data-am install-data-local install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-libLTLIBRARIES \ - install-man install-pdf install-pdf-am \ +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-binPROGRAMS \ + clean-cscope clean-generic clean-libLTLIBRARIES clean-libtool \ + cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-data-local install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-pkgincludeHEADERS install-pkgislincludeHEADERS \ install-pkgmatrixincludeHEADERS install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-libLTLIBRARIES uninstall-local \ - uninstall-pkgincludeHEADERS uninstall-pkgislincludeHEADERS \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ + uninstall-local uninstall-pkgincludeHEADERS \ + uninstall-pkgislincludeHEADERS \ uninstall-pkgmatrixincludeHEADERS @@ -1348,6 +1499,8 @@ uninstall-local: rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)" + rm -f "$(DESTDIR)$(libdir)/isl/isl-config.cmake" + rm -f "$(DESTDIR)$(libdir)/$(PACKAGE_NAME)/cloog-isl-config.cmake" dist-hook: rm -f $(distdir)/test/Makefile @@ -1359,7 +1512,7 @@ # *****************************************************************************/ valcheck: - $(MAKE) valgrind -C test + $(MAKE) test_valgrind -C test total: @echo " /*-----------------------------------------------*" diff -Nru cloog-0.18.2/osl/aclocal.m4 cloog-0.18.4/osl/aclocal.m4 --- cloog-0.18.2/osl/aclocal.m4 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/aclocal.m4 2015-07-24 11:59:07.000000000 +0000 @@ -0,0 +1,1161 @@ +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.14' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.14.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.14.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/ax_cc_maxopt.m4]) +m4_include([m4/ax_cflags_warn_all.m4]) +m4_include([m4/ax_check_compiler_flags.m4]) +m4_include([m4/ax_compiler_vendor.m4]) +m4_include([m4/ax_gcc_archflag.m4]) +m4_include([m4/ax_gcc_x86_cpuid.m4]) +m4_include([m4/ax_submodule.m4]) +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) diff -Nru cloog-0.18.2/osl/AUTHORS cloog-0.18.4/osl/AUTHORS --- cloog-0.18.2/osl/AUTHORS 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/AUTHORS 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,12 @@ +* * * * * * * * * * * * * * +* OpenScop Library 0.9.0 * +* * * * * * * * * * * * * * + +Version 0.9.0 + +Current maintainer: +* Cedric Bastoul + +Authors of the OpenScop Library: +* Cedric Bastoul +* Louis-Noel Pouchet diff -Nru cloog-0.18.2/osl/autoconf/compile cloog-0.18.4/osl/autoconf/compile --- cloog-0.18.2/osl/autoconf/compile 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/autoconf/compile 2014-10-02 14:14:44.000000000 +0000 @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program 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 2, or (at your option) +# any later version. +# +# This program 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 this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru cloog-0.18.2/osl/autoconf/config.guess cloog-0.18.4/osl/autoconf/config.guess --- cloog-0.18.2/osl/autoconf/config.guess 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/autoconf/config.guess 2014-10-02 14:14:44.000000000 +0000 @@ -0,0 +1,1558 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2013 Free Software Foundation, Inc. + +timestamp='2013-06-10' + +# This file 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 of the License, or +# (at your option) any later version. +# +# This program 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 this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2013 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; +esac + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -Nru cloog-0.18.2/osl/autoconf/config.sub cloog-0.18.4/osl/autoconf/config.sub --- cloog-0.18.2/osl/autoconf/config.sub 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/autoconf/config.sub 2014-10-02 14:14:44.000000000 +0000 @@ -0,0 +1,1791 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2013 Free Software Foundation, Inc. + +timestamp='2013-08-10' + +# This file 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 of the License, or +# (at your option) any later version. +# +# This program 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 this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2013 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 \ + | or1k | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or1k-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -Nru cloog-0.18.2/osl/autoconf/depcomp cloog-0.18.4/osl/autoconf/depcomp --- cloog-0.18.2/osl/autoconf/depcomp 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/autoconf/depcomp 2014-10-02 14:14:44.000000000 +0000 @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2013-05-30.07; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. + +# This program 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 2, or (at your option) +# any later version. + +# This program 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 this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru cloog-0.18.2/osl/autoconf/install-sh cloog-0.18.4/osl/autoconf/install-sh --- cloog-0.18.2/osl/autoconf/install-sh 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/autoconf/install-sh 2014-10-02 14:14:44.000000000 +0000 @@ -0,0 +1,527 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2011-11-20.07; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru cloog-0.18.2/osl/autoconf/ltmain.sh cloog-0.18.4/osl/autoconf/ltmain.sh --- cloog-0.18.2/osl/autoconf/ltmain.sh 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/autoconf/ltmain.sh 2014-10-02 14:14:41.000000000 +0000 @@ -0,0 +1,9661 @@ + +# libtool (GNU libtool) 2.4.2 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool 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 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --no-warn don't display warning messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . + +PROGRAM=libtool +PACKAGE=libtool +VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1" +TIMESTAMP="" +package_revision=1.3337 + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + + + +: ${CP="cp -f"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $opt_debug + + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ + p + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $opt_debug + + func_error "missing argument for $1." + exit_cmd=exit +} + + +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + +exit_cmd=: + + + + + +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" + +# Global variables. +nonopt= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}=\$${1}\${2}" +} # func_append may be replaced by extended shell implementation + +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}=\$${1}\\ \$func_quote_for_eval_result" +} # func_append_quoted may be replaced by extended shell implementation + + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "${@}"` +} # func_arith may be replaced by extended shell implementation + + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." +} + + +# func_config +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + +# func_features +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test "$build_libtool_libs" = yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + +# func_enable_tag tagname +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname="$1" + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do + opt="$1" + shift + case $opt in + --debug|-x) opt_debug='set -x' + func_echo "enabling shell trace mode" + $opt_debug + ;; + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" + shift + ;; + --preserve-dup-deps) + opt_preserve_dup_deps=: + ;; + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) + opt_silent=false +func_append preserve_args " $opt" + ;; + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" + shift + ;; + + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + + # Separate optargs to long options: + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done + + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } + + + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} + + + + +## ----------- ## +## Main. ## +## ----------- ## + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_mode_compile arg... +func_mode_compile () +{ + $opt_debug + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify \`-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + func_append_quoted lastarg "$arg" + done + IFS="$save_ifs" + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with \`-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj="$func_basename_result" + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from \`$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$opt_mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps ; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; + esac + fi + if test "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs="$dlprefiles" + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib="$l" + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + echo + if test "$linkmode" = prog; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$opt_mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + elif test -n "$old_library"; then + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$absdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$opt_mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system can not link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$1" + number_minor="$2" + number_revision="$3" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + *) + func_fatal_configuration "$modename: unknown library version type \`$version_type'" + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + func_append verstring ":${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + func_append libobjs " $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$opt_mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname="$1" + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd1 in $cmds; do + IFS="$save_ifs" + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + func_append oldobjs " $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + odir="$objdir" + else + odir="$dir/$objdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$opt_mode" = uninstall && odir="$dir" + + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case "$opt_mode" in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$opt_mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + func_append rmfiles " $odir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$opt_mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: +# vi:sw=2 + diff -Nru cloog-0.18.2/osl/autoconf/missing cloog-0.18.4/osl/autoconf/missing --- cloog-0.18.2/osl/autoconf/missing 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/autoconf/missing 2014-10-02 14:14:44.000000000 +0000 @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2013-10-28.13; # UTC + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. + +# This program 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 2, or (at your option) +# any later version. + +# This program 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 this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru cloog-0.18.2/osl/autoconf/test-driver cloog-0.18.4/osl/autoconf/test-driver --- cloog-0.18.2/osl/autoconf/test-driver 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/autoconf/test-driver 2014-10-02 14:14:44.000000000 +0000 @@ -0,0 +1,139 @@ +#! /bin/sh +# test-driver - basic testsuite driver script. + +scriptversion=2013-07-13.22; # UTC + +# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# +# This program 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 2, or (at your option) +# any later version. +# +# This program 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 this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +# Make unconditional expansion of undefined variables an error. This +# helps a lot in preventing typo-related bugs. +set -u + +usage_error () +{ + echo "$0: $*" >&2 + print_usage >&2 + exit 2 +} + +print_usage () +{ + cat <$log_file 2>&1 +estatus=$? +if test $enable_hard_errors = no && test $estatus -eq 99; then + estatus=1 +fi + +case $estatus:$expect_failure in + 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; + 0:*) col=$grn res=PASS recheck=no gcopy=no;; + 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; + 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; + *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; + *:*) col=$red res=FAIL recheck=yes gcopy=yes;; +esac + +# Report outcome to console. +echo "${col}${res}${std}: $test_name" + +# Register the test result, and other relevant metadata. +echo ":test-result: $res" > $trs_file +echo ":global-test-result: $res" >> $trs_file +echo ":recheck: $recheck" >> $trs_file +echo ":copy-in-global-log: $gcopy" >> $trs_file + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru cloog-0.18.2/osl/autoconf/texinfo.tex cloog-0.18.4/osl/autoconf/texinfo.tex --- cloog-0.18.2/osl/autoconf/texinfo.tex 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/autoconf/texinfo.tex 2014-10-02 14:14:44.000000000 +0000 @@ -0,0 +1,10079 @@ +% texinfo.tex -- TeX macros to handle Texinfo files. +% +% Load plain if necessary, i.e., if running under initex. +\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi +% +\def\texinfoversion{2013-02-01.11} +% +% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, +% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, +% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. +% +% This texinfo.tex file 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 of the +% License, or (at your option) any later version. +% +% This texinfo.tex file 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 this program. If not, see . +% +% As a special exception, when this file is read by TeX when processing +% a Texinfo source document, you may use the result without +% restriction. This Exception is an additional permission under section 7 +% of the GNU General Public License, version 3 ("GPLv3"). +% +% Please try the latest version of texinfo.tex before submitting bug +% reports; you can get the latest version from: +% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or +% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or +% http://www.gnu.org/software/texinfo/ (the Texinfo home page) +% The texinfo.tex in any given distribution could well be out +% of date, so if that's what you're using, please check. +% +% Send bug reports to bug-texinfo@gnu.org. Please include including a +% complete document in each bug report with which we can reproduce the +% problem. Patches are, of course, greatly appreciated. +% +% To process a Texinfo manual with TeX, it's most reliable to use the +% texi2dvi shell script that comes with the distribution. For a simple +% manual foo.texi, however, you can get away with this: +% tex foo.texi +% texindex foo.?? +% tex foo.texi +% tex foo.texi +% dvips foo.dvi -o # or whatever; this makes foo.ps. +% The extra TeX runs get the cross-reference information correct. +% Sometimes one run after texindex suffices, and sometimes you need more +% than two; texi2dvi does it as many times as necessary. +% +% It is possible to adapt texinfo.tex for other languages, to some +% extent. You can get the existing language-specific files from the +% full Texinfo distribution. +% +% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. + + +\message{Loading texinfo [version \texinfoversion]:} + +% If in a .fmt file, print the version number +% and turn on active characters that we couldn't do earlier because +% they might have appeared in the input file name. +\everyjob{\message{[Texinfo version \texinfoversion]}% + \catcode`+=\active \catcode`\_=\active} + +\chardef\other=12 + +% We never want plain's \outer definition of \+ in Texinfo. +% For @tex, we can use \tabalign. +\let\+ = \relax + +% Save some plain tex macros whose names we will redefine. +\let\ptexb=\b +\let\ptexbullet=\bullet +\let\ptexc=\c +\let\ptexcomma=\, +\let\ptexdot=\. +\let\ptexdots=\dots +\let\ptexend=\end +\let\ptexequiv=\equiv +\let\ptexexclam=\! +\let\ptexfootnote=\footnote +\let\ptexgtr=> +\let\ptexhat=^ +\let\ptexi=\i +\let\ptexindent=\indent +\let\ptexinsert=\insert +\let\ptexlbrace=\{ +\let\ptexless=< +\let\ptexnewwrite\newwrite +\let\ptexnoindent=\noindent +\let\ptexplus=+ +\let\ptexraggedright=\raggedright +\let\ptexrbrace=\} +\let\ptexslash=\/ +\let\ptexstar=\* +\let\ptext=\t +\let\ptextop=\top +{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode + +% If this character appears in an error message or help string, it +% starts a new line in the output. +\newlinechar = `^^J + +% Use TeX 3.0's \inputlineno to get the line number, for better error +% messages, but if we're using an old version of TeX, don't do anything. +% +\ifx\inputlineno\thisisundefined + \let\linenumber = \empty % Pre-3.0. +\else + \def\linenumber{l.\the\inputlineno:\space} +\fi + +% Set up fixed words for English if not already set. +\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi +\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi +\ifx\putworderror\undefined \gdef\putworderror{error}\fi +\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi +\ifx\putwordin\undefined \gdef\putwordin{in}\fi +\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi +\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi +\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi +\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi +\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi +\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi +\ifx\putwordof\undefined \gdef\putwordof{of}\fi +\ifx\putwordon\undefined \gdef\putwordon{on}\fi +\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi +\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi +\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi +\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi +\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi +\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi +\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi +% +\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi +\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi +\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi +\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi +\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi +\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi +\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi +\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi +\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi +\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi +\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi +\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi +% +\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi +\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi +\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi +\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi +\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi + +% Since the category of space is not known, we have to be careful. +\chardef\spacecat = 10 +\def\spaceisspace{\catcode`\ =\spacecat} + +% sometimes characters are active, so we need control sequences. +\chardef\ampChar = `\& +\chardef\colonChar = `\: +\chardef\commaChar = `\, +\chardef\dashChar = `\- +\chardef\dotChar = `\. +\chardef\exclamChar= `\! +\chardef\hashChar = `\# +\chardef\lquoteChar= `\` +\chardef\questChar = `\? +\chardef\rquoteChar= `\' +\chardef\semiChar = `\; +\chardef\slashChar = `\/ +\chardef\underChar = `\_ + +% Ignore a token. +% +\def\gobble#1{} + +% The following is used inside several \edef's. +\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} + +% Hyphenation fixes. +\hyphenation{ + Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script + ap-pen-dix bit-map bit-maps + data-base data-bases eshell fall-ing half-way long-est man-u-script + man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm + par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces + spell-ing spell-ings + stand-alone strong-est time-stamp time-stamps which-ever white-space + wide-spread wrap-around +} + +% Margin to add to right of even pages, to left of odd pages. +\newdimen\bindingoffset +\newdimen\normaloffset +\newdimen\pagewidth \newdimen\pageheight + +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=0pt } + +% Sometimes it is convenient to have everything in the transcript file +% and nothing on the terminal. We don't just call \tracingall here, +% since that produces some useless output on the terminal. We also make +% some effort to order the tracing commands to reduce output in the log +% file; cf. trace.sty in LaTeX. +% +\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% +\def\loggingall{% + \tracingstats2 + \tracingpages1 + \tracinglostchars2 % 2 gives us more in etex + \tracingparagraphs1 + \tracingoutput1 + \tracingmacros2 + \tracingrestores1 + \showboxbreadth\maxdimen \showboxdepth\maxdimen + \ifx\eTeXversion\thisisundefined\else % etex gives us more logging + \tracingscantokens1 + \tracingifs1 + \tracinggroups1 + \tracingnesting2 + \tracingassigns1 + \fi + \tracingcommands3 % 3 gives us more in etex + \errorcontextlines16 +}% + +% @errormsg{MSG}. Do the index-like expansions on MSG, but if things +% aren't perfect, it's not the end of the world, being an error message, +% after all. +% +\def\errormsg{\begingroup \indexnofonts \doerrormsg} +\def\doerrormsg#1{\errmessage{#1}} + +% add check for \lastpenalty to plain's definitions. If the last thing +% we did was a \nobreak, we don't want to insert more space. +% +\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount + \removelastskip\penalty-50\smallskip\fi\fi} +\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount + \removelastskip\penalty-100\medskip\fi\fi} +\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount + \removelastskip\penalty-200\bigskip\fi\fi} + +% Do @cropmarks to get crop marks. +% +\newif\ifcropmarks +\let\cropmarks = \cropmarkstrue +% +% Dimensions to add cropmarks at corners. +% Added by P. A. MacKay, 12 Nov. 1986 +% +\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines +\newdimen\cornerlong \cornerlong=1pc +\newdimen\cornerthick \cornerthick=.3pt +\newdimen\topandbottommargin \topandbottommargin=.75in + +% Output a mark which sets \thischapter, \thissection and \thiscolor. +% We dump everything together because we only have one kind of mark. +% This works because we only use \botmark / \topmark, not \firstmark. +% +% A mark contains a subexpression of the \ifcase ... \fi construct. +% \get*marks macros below extract the needed part using \ifcase. +% +% Another complication is to let the user choose whether \thischapter +% (\thissection) refers to the chapter (section) in effect at the top +% of a page, or that at the bottom of a page. The solution is +% described on page 260 of The TeXbook. It involves outputting two +% marks for the sectioning macros, one before the section break, and +% one after. I won't pretend I can describe this better than DEK... +\def\domark{% + \toks0=\expandafter{\lastchapterdefs}% + \toks2=\expandafter{\lastsectiondefs}% + \toks4=\expandafter{\prevchapterdefs}% + \toks6=\expandafter{\prevsectiondefs}% + \toks8=\expandafter{\lastcolordefs}% + \mark{% + \the\toks0 \the\toks2 + \noexpand\or \the\toks4 \the\toks6 + \noexpand\else \the\toks8 + }% +} +% \topmark doesn't work for the very first chapter (after the title +% page or the contents), so we use \firstmark there -- this gets us +% the mark with the chapter defs, unless the user sneaks in, e.g., +% @setcolor (or @url, or @link, etc.) between @contents and the very +% first @chapter. +\def\gettopheadingmarks{% + \ifcase0\topmark\fi + \ifx\thischapter\empty \ifcase0\firstmark\fi \fi +} +\def\getbottomheadingmarks{\ifcase1\botmark\fi} +\def\getcolormarks{\ifcase2\topmark\fi} + +% Avoid "undefined control sequence" errors. +\def\lastchapterdefs{} +\def\lastsectiondefs{} +\def\prevchapterdefs{} +\def\prevsectiondefs{} +\def\lastcolordefs{} + +% Main output routine. +\chardef\PAGE = 255 +\output = {\onepageout{\pagecontents\PAGE}} + +\newbox\headlinebox +\newbox\footlinebox + +% \onepageout takes a vbox as an argument. Note that \pagecontents +% does insertions, but you have to call it yourself. +\def\onepageout#1{% + \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi + % + \ifodd\pageno \advance\hoffset by \bindingoffset + \else \advance\hoffset by -\bindingoffset\fi + % + % Do this outside of the \shipout so @code etc. will be expanded in + % the headline as they should be, not taken literally (outputting ''code). + \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi + \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% + \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi + \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% + % + {% + % Have to do this stuff outside the \shipout because we want it to + % take effect in \write's, yet the group defined by the \vbox ends + % before the \shipout runs. + % + \indexdummies % don't expand commands in the output. + \normalturnoffactive % \ in index entries must not stay \, e.g., if + % the page break happens to be in the middle of an example. + % We don't want .vr (or whatever) entries like this: + % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} + % "\acronym" won't work when it's read back in; + % it needs to be + % {\code {{\tt \backslashcurfont }acronym} + \shipout\vbox{% + % Do this early so pdf references go to the beginning of the page. + \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi + % + \ifcropmarks \vbox to \outervsize\bgroup + \hsize = \outerhsize + \vskip-\topandbottommargin + \vtop to0pt{% + \line{\ewtop\hfil\ewtop}% + \nointerlineskip + \line{% + \vbox{\moveleft\cornerthick\nstop}% + \hfill + \vbox{\moveright\cornerthick\nstop}% + }% + \vss}% + \vskip\topandbottommargin + \line\bgroup + \hfil % center the page within the outer (page) hsize. + \ifodd\pageno\hskip\bindingoffset\fi + \vbox\bgroup + \fi + % + \unvbox\headlinebox + \pagebody{#1}% + \ifdim\ht\footlinebox > 0pt + % Only leave this space if the footline is nonempty. + % (We lessened \vsize for it in \oddfootingyyy.) + % The \baselineskip=24pt in plain's \makefootline has no effect. + \vskip 24pt + \unvbox\footlinebox + \fi + % + \ifcropmarks + \egroup % end of \vbox\bgroup + \hfil\egroup % end of (centering) \line\bgroup + \vskip\topandbottommargin plus1fill minus1fill + \boxmaxdepth = \cornerthick + \vbox to0pt{\vss + \line{% + \vbox{\moveleft\cornerthick\nsbot}% + \hfill + \vbox{\moveright\cornerthick\nsbot}% + }% + \nointerlineskip + \line{\ewbot\hfil\ewbot}% + }% + \egroup % \vbox from first cropmarks clause + \fi + }% end of \shipout\vbox + }% end of group with \indexdummies + \advancepageno + \ifnum\outputpenalty>-20000 \else\dosupereject\fi +} + +\newinsert\margin \dimen\margin=\maxdimen + +\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} +{\catcode`\@ =11 +\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi +% marginal hacks, juha@viisa.uucp (Juha Takala) +\ifvoid\margin\else % marginal info is present + \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi +\dimen@=\dp#1\relax \unvbox#1\relax +\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi +\ifr@ggedbottom \kern-\dimen@ \vfil \fi} +} + +% Here are the rules for the cropmarks. Note that they are +% offset so that the space between them is truly \outerhsize or \outervsize +% (P. A. MacKay, 12 November, 1986) +% +\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} +\def\nstop{\vbox + {\hrule height\cornerthick depth\cornerlong width\cornerthick}} +\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} +\def\nsbot{\vbox + {\hrule height\cornerlong depth\cornerthick width\cornerthick}} + +% Parse an argument, then pass it to #1. The argument is the rest of +% the input line (except we remove a trailing comment). #1 should be a +% macro which expects an ordinary undelimited TeX argument. +% +\def\parsearg{\parseargusing{}} +\def\parseargusing#1#2{% + \def\argtorun{#2}% + \begingroup + \obeylines + \spaceisspace + #1% + \parseargline\empty% Insert the \empty token, see \finishparsearg below. +} + +{\obeylines % + \gdef\parseargline#1^^M{% + \endgroup % End of the group started in \parsearg. + \argremovecomment #1\comment\ArgTerm% + }% +} + +% First remove any @comment, then any @c comment. +\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} + +% Each occurrence of `\^^M' or `\^^M' is replaced by a single space. +% +% \argremovec might leave us with trailing space, e.g., +% @end itemize @c foo +% This space token undergoes the same procedure and is eventually removed +% by \finishparsearg. +% +\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} +\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} +\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% + \def\temp{#3}% + \ifx\temp\empty + % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: + \let\temp\finishparsearg + \else + \let\temp\argcheckspaces + \fi + % Put the space token in: + \temp#1 #3\ArgTerm +} + +% If a _delimited_ argument is enclosed in braces, they get stripped; so +% to get _exactly_ the rest of the line, we had to prevent such situation. +% We prepended an \empty token at the very beginning and we expand it now, +% just before passing the control to \argtorun. +% (Similarly, we have to think about #3 of \argcheckspacesY above: it is +% either the null string, or it ends with \^^M---thus there is no danger +% that a pair of braces would be stripped. +% +% But first, we have to remove the trailing space token. +% +\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} + +% \parseargdef\foo{...} +% is roughly equivalent to +% \def\foo{\parsearg\Xfoo} +% \def\Xfoo#1{...} +% +% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my +% favourite TeX trick. --kasal, 16nov03 + +\def\parseargdef#1{% + \expandafter \doparseargdef \csname\string#1\endcsname #1% +} +\def\doparseargdef#1#2{% + \def#2{\parsearg#1}% + \def#1##1% +} + +% Several utility definitions with active space: +{ + \obeyspaces + \gdef\obeyedspace{ } + + % Make each space character in the input produce a normal interword + % space in the output. Don't allow a line break at this space, as this + % is used only in environments like @example, where each line of input + % should produce a line of output anyway. + % + \gdef\sepspaces{\obeyspaces\let =\tie} + + % If an index command is used in an @example environment, any spaces + % therein should become regular spaces in the raw index file, not the + % expansion of \tie (\leavevmode \penalty \@M \ ). + \gdef\unsepspaces{\let =\space} +} + + +\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} + +% Define the framework for environments in texinfo.tex. It's used like this: +% +% \envdef\foo{...} +% \def\Efoo{...} +% +% It's the responsibility of \envdef to insert \begingroup before the +% actual body; @end closes the group after calling \Efoo. \envdef also +% defines \thisenv, so the current environment is known; @end checks +% whether the environment name matches. The \checkenv macro can also be +% used to check whether the current environment is the one expected. +% +% Non-false conditionals (@iftex, @ifset) don't fit into this, so they +% are not treated as environments; they don't open a group. (The +% implementation of @end takes care not to call \endgroup in this +% special case.) + + +% At run-time, environments start with this: +\def\startenvironment#1{\begingroup\def\thisenv{#1}} +% initialize +\let\thisenv\empty + +% ... but they get defined via ``\envdef\foo{...}'': +\long\def\envdef#1#2{\def#1{\startenvironment#1#2}} +\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} + +% Check whether we're in the right environment: +\def\checkenv#1{% + \def\temp{#1}% + \ifx\thisenv\temp + \else + \badenverr + \fi +} + +% Environment mismatch, #1 expected: +\def\badenverr{% + \errhelp = \EMsimple + \errmessage{This command can appear only \inenvironment\temp, + not \inenvironment\thisenv}% +} +\def\inenvironment#1{% + \ifx#1\empty + outside of any environment% + \else + in environment \expandafter\string#1% + \fi +} + +% @end foo executes the definition of \Efoo. +% But first, it executes a specialized version of \checkenv +% +\parseargdef\end{% + \if 1\csname iscond.#1\endcsname + \else + % The general wording of \badenverr may not be ideal. + \expandafter\checkenv\csname#1\endcsname + \csname E#1\endcsname + \endgroup + \fi +} + +\newhelp\EMsimple{Press RETURN to continue.} + + +% Be sure we're in horizontal mode when doing a tie, since we make space +% equivalent to this in @example-like environments. Otherwise, a space +% at the beginning of a line will start with \penalty -- and +% since \penalty is valid in vertical mode, we'd end up putting the +% penalty on the vertical list instead of in the new paragraph. +{\catcode`@ = 11 + % Avoid using \@M directly, because that causes trouble + % if the definition is written into an index file. + \global\let\tiepenalty = \@M + \gdef\tie{\leavevmode\penalty\tiepenalty\ } +} + +% @: forces normal size whitespace following. +\def\:{\spacefactor=1000 } + +% @* forces a line break. +\def\*{\unskip\hfil\break\hbox{}\ignorespaces} + +% @/ allows a line break. +\let\/=\allowbreak + +% @. is an end-of-sentence period. +\def\.{.\spacefactor=\endofsentencespacefactor\space} + +% @! is an end-of-sentence bang. +\def\!{!\spacefactor=\endofsentencespacefactor\space} + +% @? is an end-of-sentence query. +\def\?{?\spacefactor=\endofsentencespacefactor\space} + +% @frenchspacing on|off says whether to put extra space after punctuation. +% +\def\onword{on} +\def\offword{off} +% +\parseargdef\frenchspacing{% + \def\temp{#1}% + \ifx\temp\onword \plainfrenchspacing + \else\ifx\temp\offword \plainnonfrenchspacing + \else + \errhelp = \EMsimple + \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% + \fi\fi +} + +% @w prevents a word break. Without the \leavevmode, @w at the +% beginning of a paragraph, when TeX is still in vertical mode, would +% produce a whole line of output instead of starting the paragraph. +\def\w#1{\leavevmode\hbox{#1}} + +% @group ... @end group forces ... to be all on one page, by enclosing +% it in a TeX vbox. We use \vtop instead of \vbox to construct the box +% to keep its height that of a normal line. According to the rules for +% \topskip (p.114 of the TeXbook), the glue inserted is +% max (\topskip - \ht (first item), 0). If that height is large, +% therefore, no glue is inserted, and the space between the headline and +% the text is small, which looks bad. +% +% Another complication is that the group might be very large. This can +% cause the glue on the previous page to be unduly stretched, because it +% does not have much material. In this case, it's better to add an +% explicit \vfill so that the extra space is at the bottom. The +% threshold for doing this is if the group is more than \vfilllimit +% percent of a page (\vfilllimit can be changed inside of @tex). +% +\newbox\groupbox +\def\vfilllimit{0.7} +% +\envdef\group{% + \ifnum\catcode`\^^M=\active \else + \errhelp = \groupinvalidhelp + \errmessage{@group invalid in context where filling is enabled}% + \fi + \startsavinginserts + % + \setbox\groupbox = \vtop\bgroup + % Do @comment since we are called inside an environment such as + % @example, where each end-of-line in the input causes an + % end-of-line in the output. We don't want the end-of-line after + % the `@group' to put extra space in the output. Since @group + % should appear on a line by itself (according to the Texinfo + % manual), we don't worry about eating any user text. + \comment +} +% +% The \vtop produces a box with normal height and large depth; thus, TeX puts +% \baselineskip glue before it, and (when the next line of text is done) +% \lineskip glue after it. Thus, space below is not quite equal to space +% above. But it's pretty close. +\def\Egroup{% + % To get correct interline space between the last line of the group + % and the first line afterwards, we have to propagate \prevdepth. + \endgraf % Not \par, as it may have been set to \lisppar. + \global\dimen1 = \prevdepth + \egroup % End the \vtop. + % \dimen0 is the vertical size of the group's box. + \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox + % \dimen2 is how much space is left on the page (more or less). + \dimen2 = \pageheight \advance\dimen2 by -\pagetotal + % if the group doesn't fit on the current page, and it's a big big + % group, force a page break. + \ifdim \dimen0 > \dimen2 + \ifdim \pagetotal < \vfilllimit\pageheight + \page + \fi + \fi + \box\groupbox + \prevdepth = \dimen1 + \checkinserts +} +% +% TeX puts in an \escapechar (i.e., `@') at the beginning of the help +% message, so this ends up printing `@group can only ...'. +% +\newhelp\groupinvalidhelp{% +group can only be used in environments such as @example,^^J% +where each line of input produces a line of output.} + +% @need space-in-mils +% forces a page break if there is not space-in-mils remaining. + +\newdimen\mil \mil=0.001in + +\parseargdef\need{% + % Ensure vertical mode, so we don't make a big box in the middle of a + % paragraph. + \par + % + % If the @need value is less than one line space, it's useless. + \dimen0 = #1\mil + \dimen2 = \ht\strutbox + \advance\dimen2 by \dp\strutbox + \ifdim\dimen0 > \dimen2 + % + % Do a \strut just to make the height of this box be normal, so the + % normal leading is inserted relative to the preceding line. + % And a page break here is fine. + \vtop to #1\mil{\strut\vfil}% + % + % TeX does not even consider page breaks if a penalty added to the + % main vertical list is 10000 or more. But in order to see if the + % empty box we just added fits on the page, we must make it consider + % page breaks. On the other hand, we don't want to actually break the + % page after the empty box. So we use a penalty of 9999. + % + % There is an extremely small chance that TeX will actually break the + % page at this \penalty, if there are no other feasible breakpoints in + % sight. (If the user is using lots of big @group commands, which + % almost-but-not-quite fill up a page, TeX will have a hard time doing + % good page breaking, for example.) However, I could not construct an + % example where a page broke at this \penalty; if it happens in a real + % document, then we can reconsider our strategy. + \penalty9999 + % + % Back up by the size of the box, whether we did a page break or not. + \kern -#1\mil + % + % Do not allow a page break right after this kern. + \nobreak + \fi +} + +% @br forces paragraph break (and is undocumented). + +\let\br = \par + +% @page forces the start of a new page. +% +\def\page{\par\vfill\supereject} + +% @exdent text.... +% outputs text on separate line in roman font, starting at standard page margin + +% This records the amount of indent in the innermost environment. +% That's how much \exdent should take out. +\newskip\exdentamount + +% This defn is used inside fill environments such as @defun. +\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} + +% This defn is used inside nofill environments such as @example. +\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount + \leftline{\hskip\leftskip{\rm#1}}}} + +% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current +% paragraph. For more general purposes, use the \margin insertion +% class. WHICH is `l' or `r'. Not documented, written for gawk manual. +% +\newskip\inmarginspacing \inmarginspacing=1cm +\def\strutdepth{\dp\strutbox} +% +\def\doinmargin#1#2{\strut\vadjust{% + \nobreak + \kern-\strutdepth + \vtop to \strutdepth{% + \baselineskip=\strutdepth + \vss + % if you have multiple lines of stuff to put here, you'll need to + % make the vbox yourself of the appropriate size. + \ifx#1l% + \llap{\ignorespaces #2\hskip\inmarginspacing}% + \else + \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% + \fi + \null + }% +}} +\def\inleftmargin{\doinmargin l} +\def\inrightmargin{\doinmargin r} +% +% @inmargin{TEXT [, RIGHT-TEXT]} +% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; +% else use TEXT for both). +% +\def\inmargin#1{\parseinmargin #1,,\finish} +\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \def\lefttext{#1}% have both texts + \def\righttext{#2}% + \else + \def\lefttext{#1}% have only one text + \def\righttext{#1}% + \fi + % + \ifodd\pageno + \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin + \else + \def\temp{\inleftmargin\lefttext}% + \fi + \temp +} + +% @| inserts a changebar to the left of the current line. It should +% surround any changed text. This approach does *not* work if the +% change spans more than two lines of output. To handle that, we would +% have adopt a much more difficult approach (putting marks into the main +% vertical list for the beginning and end of each change). This command +% is not documented, not supported, and doesn't work. +% +\def\|{% + % \vadjust can only be used in horizontal mode. + \leavevmode + % + % Append this vertical mode material after the current line in the output. + \vadjust{% + % We want to insert a rule with the height and depth of the current + % leading; that is exactly what \strutbox is supposed to record. + \vskip-\baselineskip + % + % \vadjust-items are inserted at the left edge of the type. So + % the \llap here moves out into the left-hand margin. + \llap{% + % + % For a thicker or thinner bar, change the `1pt'. + \vrule height\baselineskip width1pt + % + % This is the space between the bar and the text. + \hskip 12pt + }% + }% +} + +% @include FILE -- \input text of FILE. +% +\def\include{\parseargusing\filenamecatcodes\includezzz} +\def\includezzz#1{% + \pushthisfilestack + \def\thisfile{#1}% + {% + \makevalueexpandable % we want to expand any @value in FILE. + \turnoffactive % and allow special characters in the expansion + \indexnofonts % Allow `@@' and other weird things in file names. + \wlog{texinfo.tex: doing @include of #1^^J}% + \edef\temp{\noexpand\input #1 }% + % + % This trickery is to read FILE outside of a group, in case it makes + % definitions, etc. + \expandafter + }\temp + \popthisfilestack +} +\def\filenamecatcodes{% + \catcode`\\=\other + \catcode`~=\other + \catcode`^=\other + \catcode`_=\other + \catcode`|=\other + \catcode`<=\other + \catcode`>=\other + \catcode`+=\other + \catcode`-=\other + \catcode`\`=\other + \catcode`\'=\other +} + +\def\pushthisfilestack{% + \expandafter\pushthisfilestackX\popthisfilestack\StackTerm +} +\def\pushthisfilestackX{% + \expandafter\pushthisfilestackY\thisfile\StackTerm +} +\def\pushthisfilestackY #1\StackTerm #2\StackTerm {% + \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% +} + +\def\popthisfilestack{\errthisfilestackempty} +\def\errthisfilestackempty{\errmessage{Internal error: + the stack of filenames is empty.}} +% +\def\thisfile{} + +% @center line +% outputs that line, centered. +% +\parseargdef\center{% + \ifhmode + \let\centersub\centerH + \else + \let\centersub\centerV + \fi + \centersub{\hfil \ignorespaces#1\unskip \hfil}% + \let\centersub\relax % don't let the definition persist, just in case +} +\def\centerH#1{{% + \hfil\break + \advance\hsize by -\leftskip + \advance\hsize by -\rightskip + \line{#1}% + \break +}} +% +\newcount\centerpenalty +\def\centerV#1{% + % The idea here is the same as in \startdefun, \cartouche, etc.: if + % @center is the first thing after a section heading, we need to wipe + % out the negative parskip inserted by \sectionheading, but still + % prevent a page break here. + \centerpenalty = \lastpenalty + \ifnum\centerpenalty>10000 \vskip\parskip \fi + \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi + \line{\kern\leftskip #1\kern\rightskip}% +} + +% @sp n outputs n lines of vertical space +% +\parseargdef\sp{\vskip #1\baselineskip} + +% @comment ...line which is ignored... +% @c is the same as @comment +% @ignore ... @end ignore is another way to write a comment +% +\def\comment{\begingroup \catcode`\^^M=\other% +\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% +\commentxxx} +{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} +% +\let\c=\comment + +% @paragraphindent NCHARS +% We'll use ems for NCHARS, close enough. +% NCHARS can also be the word `asis' or `none'. +% We cannot feasibly implement @paragraphindent asis, though. +% +\def\asisword{asis} % no translation, these are keywords +\def\noneword{none} +% +\parseargdef\paragraphindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \defaultparindent = 0pt + \else + \defaultparindent = #1em + \fi + \fi + \parindent = \defaultparindent +} + +% @exampleindent NCHARS +% We'll use ems for NCHARS like @paragraphindent. +% It seems @exampleindent asis isn't necessary, but +% I preserve it to make it similar to @paragraphindent. +\parseargdef\exampleindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \lispnarrowing = 0pt + \else + \lispnarrowing = #1em + \fi + \fi +} + +% @firstparagraphindent WORD +% If WORD is `none', then suppress indentation of the first paragraph +% after a section heading. If WORD is `insert', then do indent at such +% paragraphs. +% +% The paragraph indentation is suppressed or not by calling +% \suppressfirstparagraphindent, which the sectioning commands do. +% We switch the definition of this back and forth according to WORD. +% By default, we suppress indentation. +% +\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} +\def\insertword{insert} +% +\parseargdef\firstparagraphindent{% + \def\temp{#1}% + \ifx\temp\noneword + \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent + \else\ifx\temp\insertword + \let\suppressfirstparagraphindent = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @firstparagraphindent option `\temp'}% + \fi\fi +} + +% Here is how we actually suppress indentation. Redefine \everypar to +% \kern backwards by \parindent, and then reset itself to empty. +% +% We also make \indent itself not actually do anything until the next +% paragraph. +% +\gdef\dosuppressfirstparagraphindent{% + \gdef\indent{% + \restorefirstparagraphindent + \indent + }% + \gdef\noindent{% + \restorefirstparagraphindent + \noindent + }% + \global\everypar = {% + \kern -\parindent + \restorefirstparagraphindent + }% +} + +\gdef\restorefirstparagraphindent{% + \global \let \indent = \ptexindent + \global \let \noindent = \ptexnoindent + \global \everypar = {}% +} + + +% @refill is a no-op. +\let\refill=\relax + +% If working on a large document in chapters, it is convenient to +% be able to disable indexing, cross-referencing, and contents, for test runs. +% This is done with @novalidate (before @setfilename). +% +\newif\iflinks \linkstrue % by default we want the aux files. +\let\novalidate = \linksfalse + +% @setfilename is done at the beginning of every texinfo file. +% So open here the files we need to have open while reading the input. +% This makes it possible to make a .fmt file for texinfo. +\def\setfilename{% + \fixbackslash % Turn off hack to swallow `\input texinfo'. + \iflinks + \tryauxfile + % Open the new aux file. TeX will close it automatically at exit. + \immediate\openout\auxfile=\jobname.aux + \fi % \openindices needs to do some work in any case. + \openindices + \let\setfilename=\comment % Ignore extra @setfilename cmds. + % + % If texinfo.cnf is present on the system, read it. + % Useful for site-wide @afourpaper, etc. + \openin 1 texinfo.cnf + \ifeof 1 \else \input texinfo.cnf \fi + \closein 1 + % + \comment % Ignore the actual filename. +} + +% Called from \setfilename. +% +\def\openindices{% + \newindex{cp}% + \newcodeindex{fn}% + \newcodeindex{vr}% + \newcodeindex{tp}% + \newcodeindex{ky}% + \newcodeindex{pg}% +} + +% @bye. +\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} + + +\message{pdf,} +% adobe `portable' document format +\newcount\tempnum +\newcount\lnkcount +\newtoks\filename +\newcount\filenamelength +\newcount\pgn +\newtoks\toksA +\newtoks\toksB +\newtoks\toksC +\newtoks\toksD +\newbox\boxA +\newcount\countA +\newif\ifpdf +\newif\ifpdfmakepagedest + +% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 +% can be set). So we test for \relax and 0 as well as being undefined. +\ifx\pdfoutput\thisisundefined +\else + \ifx\pdfoutput\relax + \else + \ifcase\pdfoutput + \else + \pdftrue + \fi + \fi +\fi + +% PDF uses PostScript string constants for the names of xref targets, +% for display in the outlines, and in other places. Thus, we have to +% double any backslashes. Otherwise, a name like "\node" will be +% interpreted as a newline (\n), followed by o, d, e. Not good. +% +% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and +% related messages. The final outcome is that it is up to the TeX user +% to double the backslashes and otherwise make the string valid, so +% that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to +% do this reliably, so we use it. + +% #1 is a control sequence in which to do the replacements, +% which we \xdef. +\def\txiescapepdf#1{% + \ifx\pdfescapestring\thisisundefined + % No primitive available; should we give a warning or log? + % Many times it won't matter. + \else + % The expandable \pdfescapestring primitive escapes parentheses, + % backslashes, and other special chars. + \xdef#1{\pdfescapestring{#1}}% + \fi +} + +\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images +with PDF output, and none of those formats could be found. (.eps cannot +be supported due to the design of the PDF format; use regular TeX (DVI +output) for that.)} + +\ifpdf + % + % Color manipulation macros based on pdfcolor.tex, + % except using rgb instead of cmyk; the latter is said to render as a + % very dark gray on-screen and a very dark halftone in print, instead + % of actual black. + \def\rgbDarkRed{0.50 0.09 0.12} + \def\rgbBlack{0 0 0} + % + % k sets the color for filling (usual text, etc.); + % K sets the color for stroking (thin rules, e.g., normal _'s). + \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} + % + % Set color, and create a mark which defines \thiscolor accordingly, + % so that \makeheadline knows which color to restore. + \def\setcolor#1{% + \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% + \domark + \pdfsetcolor{#1}% + } + % + \def\maincolor{\rgbBlack} + \pdfsetcolor{\maincolor} + \edef\thiscolor{\maincolor} + \def\lastcolordefs{} + % + \def\makefootline{% + \baselineskip24pt + \line{\pdfsetcolor{\maincolor}\the\footline}% + } + % + \def\makeheadline{% + \vbox to 0pt{% + \vskip-22.5pt + \line{% + \vbox to8.5pt{}% + % Extract \thiscolor definition from the marks. + \getcolormarks + % Typeset the headline with \maincolor, then restore the color. + \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% + }% + \vss + }% + \nointerlineskip + } + % + % + \pdfcatalog{/PageMode /UseOutlines} + % + % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). + \def\dopdfimage#1#2#3{% + \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% + \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% + % + % pdftex (and the PDF format) support .pdf, .png, .jpg (among + % others). Let's try in that order, PDF first since if + % someone has a scalable image, presumably better to use that than a + % bitmap. + \let\pdfimgext=\empty + \begingroup + \openin 1 #1.pdf \ifeof 1 + \openin 1 #1.PDF \ifeof 1 + \openin 1 #1.png \ifeof 1 + \openin 1 #1.jpg \ifeof 1 + \openin 1 #1.jpeg \ifeof 1 + \openin 1 #1.JPG \ifeof 1 + \errhelp = \nopdfimagehelp + \errmessage{Could not find image file #1 for pdf}% + \else \gdef\pdfimgext{JPG}% + \fi + \else \gdef\pdfimgext{jpeg}% + \fi + \else \gdef\pdfimgext{jpg}% + \fi + \else \gdef\pdfimgext{png}% + \fi + \else \gdef\pdfimgext{PDF}% + \fi + \else \gdef\pdfimgext{pdf}% + \fi + \closein 1 + \endgroup + % + % without \immediate, ancient pdftex seg faults when the same image is + % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) + \ifnum\pdftexversion < 14 + \immediate\pdfimage + \else + \immediate\pdfximage + \fi + \ifdim \wd0 >0pt width \pdfimagewidth \fi + \ifdim \wd2 >0pt height \pdfimageheight \fi + \ifnum\pdftexversion<13 + #1.\pdfimgext + \else + {#1.\pdfimgext}% + \fi + \ifnum\pdftexversion < 14 \else + \pdfrefximage \pdflastximage + \fi} + % + \def\pdfmkdest#1{{% + % We have to set dummies so commands such as @code, and characters + % such as \, aren't expanded when present in a section title. + \indexnofonts + \turnoffactive + \makevalueexpandable + \def\pdfdestname{#1}% + \txiescapepdf\pdfdestname + \safewhatsit{\pdfdest name{\pdfdestname} xyz}% + }} + % + % used to mark target names; must be expandable. + \def\pdfmkpgn#1{#1} + % + % by default, use a color that is dark enough to print on paper as + % nearly black, but still distinguishable for online viewing. + \def\urlcolor{\rgbDarkRed} + \def\linkcolor{\rgbDarkRed} + \def\endlink{\setcolor{\maincolor}\pdfendlink} + % + % Adding outlines to PDF; macros for calculating structure of outlines + % come from Petr Olsak + \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% + \else \csname#1\endcsname \fi} + \def\advancenumber#1{\tempnum=\expnumber{#1}\relax + \advance\tempnum by 1 + \expandafter\xdef\csname#1\endcsname{\the\tempnum}} + % + % #1 is the section text, which is what will be displayed in the + % outline by the pdf viewer. #2 is the pdf expression for the number + % of subentries (or empty, for subsubsections). #3 is the node text, + % which might be empty if this toc entry had no corresponding node. + % #4 is the page number + % + \def\dopdfoutline#1#2#3#4{% + % Generate a link to the node text if that exists; else, use the + % page number. We could generate a destination for the section + % text in the case where a section has no node, but it doesn't + % seem worth the trouble, since most documents are normally structured. + \edef\pdfoutlinedest{#3}% + \ifx\pdfoutlinedest\empty + \def\pdfoutlinedest{#4}% + \else + \txiescapepdf\pdfoutlinedest + \fi + % + % Also escape PDF chars in the display string. + \edef\pdfoutlinetext{#1}% + \txiescapepdf\pdfoutlinetext + % + \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% + } + % + \def\pdfmakeoutlines{% + \begingroup + % Read toc silently, to get counts of subentries for \pdfoutline. + \def\partentry##1##2##3##4{}% ignore parts in the outlines + \def\numchapentry##1##2##3##4{% + \def\thischapnum{##2}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + }% + \def\numsecentry##1##2##3##4{% + \advancenumber{chap\thischapnum}% + \def\thissecnum{##2}% + \def\thissubsecnum{0}% + }% + \def\numsubsecentry##1##2##3##4{% + \advancenumber{sec\thissecnum}% + \def\thissubsecnum{##2}% + }% + \def\numsubsubsecentry##1##2##3##4{% + \advancenumber{subsec\thissubsecnum}% + }% + \def\thischapnum{0}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + % + % use \def rather than \let here because we redefine \chapentry et + % al. a second time, below. + \def\appentry{\numchapentry}% + \def\appsecentry{\numsecentry}% + \def\appsubsecentry{\numsubsecentry}% + \def\appsubsubsecentry{\numsubsubsecentry}% + \def\unnchapentry{\numchapentry}% + \def\unnsecentry{\numsecentry}% + \def\unnsubsecentry{\numsubsecentry}% + \def\unnsubsubsecentry{\numsubsubsecentry}% + \readdatafile{toc}% + % + % Read toc second time, this time actually producing the outlines. + % The `-' means take the \expnumber as the absolute number of + % subentries, which we calculated on our first read of the .toc above. + % + % We use the node names as the destinations. + \def\numchapentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% + \def\numsubsubsecentry##1##2##3##4{% count is always zero + \dopdfoutline{##1}{}{##3}{##4}}% + % + % PDF outlines are displayed using system fonts, instead of + % document fonts. Therefore we cannot use special characters, + % since the encoding is unknown. For example, the eogonek from + % Latin 2 (0xea) gets translated to a | character. Info from + % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. + % + % TODO this right, we have to translate 8-bit characters to + % their "best" equivalent, based on the @documentencoding. Too + % much work for too little return. Just use the ASCII equivalents + % we use for the index sort strings. + % + \indexnofonts + \setupdatafile + % We can have normal brace characters in the PDF outlines, unlike + % Texinfo index files. So set that up. + \def\{{\lbracecharliteral}% + \def\}{\rbracecharliteral}% + \catcode`\\=\active \otherbackslash + \input \tocreadfilename + \endgroup + } + {\catcode`[=1 \catcode`]=2 + \catcode`{=\other \catcode`}=\other + \gdef\lbracecharliteral[{]% + \gdef\rbracecharliteral[}]% + ] + % + \def\skipspaces#1{\def\PP{#1}\def\D{|}% + \ifx\PP\D\let\nextsp\relax + \else\let\nextsp\skipspaces + \addtokens{\filename}{\PP}% + \advance\filenamelength by 1 + \fi + \nextsp} + \def\getfilename#1{% + \filenamelength=0 + % If we don't expand the argument now, \skipspaces will get + % snagged on things like "@value{foo}". + \edef\temp{#1}% + \expandafter\skipspaces\temp|\relax + } + \ifnum\pdftexversion < 14 + \let \startlink \pdfannotlink + \else + \let \startlink \pdfstartlink + \fi + % make a live url in pdf output. + \def\pdfurl#1{% + \begingroup + % it seems we really need yet another set of dummies; have not + % tried to figure out what each command should do in the context + % of @url. for now, just make @/ a no-op, that's the only one + % people have actually reported a problem with. + % + \normalturnoffactive + \def\@{@}% + \let\/=\empty + \makevalueexpandable + % do we want to go so far as to use \indexnofonts instead of just + % special-casing \var here? + \def\var##1{##1}% + % + \leavevmode\setcolor{\urlcolor}% + \startlink attr{/Border [0 0 0]}% + user{/Subtype /Link /A << /S /URI /URI (#1) >>}% + \endgroup} + \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} + \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} + \def\maketoks{% + \expandafter\poptoks\the\toksA|ENDTOKS|\relax + \ifx\first0\adn0 + \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 + \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else + \ifnum0=\countA\else\makelink\fi + \ifx\first.\let\next=\done\else + \let\next=\maketoks + \addtokens{\toksB}{\the\toksD} + \ifx\first,\addtokens{\toksB}{\space}\fi + \fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \next} + \def\makelink{\addtokens{\toksB}% + {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} + \def\pdflink#1{% + \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} + \setcolor{\linkcolor}#1\endlink} + \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} +\else + % non-pdf mode + \let\pdfmkdest = \gobble + \let\pdfurl = \gobble + \let\endlink = \relax + \let\setcolor = \gobble + \let\pdfsetcolor = \gobble + \let\pdfmakeoutlines = \relax +\fi % \ifx\pdfoutput + + +\message{fonts,} + +% Change the current font style to #1, remembering it in \curfontstyle. +% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in +% italics, not bold italics. +% +\def\setfontstyle#1{% + \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. + \csname ten#1\endcsname % change the current font +} + +% Select #1 fonts with the current style. +% +\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} + +\def\rm{\fam=0 \setfontstyle{rm}} +\def\it{\fam=\itfam \setfontstyle{it}} +\def\sl{\fam=\slfam \setfontstyle{sl}} +\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} +\def\tt{\fam=\ttfam \setfontstyle{tt}} + +% Unfortunately, we have to override this for titles and the like, since +% in those cases "rm" is bold. Sigh. +\def\rmisbold{\rm\def\curfontstyle{bf}} + +% Texinfo sort of supports the sans serif font style, which plain TeX does not. +% So we set up a \sf. +\newfam\sffam +\def\sf{\fam=\sffam \setfontstyle{sf}} +\let\li = \sf % Sometimes we call it \li, not \sf. + +% We don't need math for this font style. +\def\ttsl{\setfontstyle{ttsl}} + + +% Set the baselineskip to #1, and the lineskip and strut size +% correspondingly. There is no deep meaning behind these magic numbers +% used as factors; they just match (closely enough) what Knuth defined. +% +\def\lineskipfactor{.08333} +\def\strutheightpercent{.70833} +\def\strutdepthpercent {.29167} +% +% can get a sort of poor man's double spacing by redefining this. +\def\baselinefactor{1} +% +\newdimen\textleading +\def\setleading#1{% + \dimen0 = #1\relax + \normalbaselineskip = \baselinefactor\dimen0 + \normallineskip = \lineskipfactor\normalbaselineskip + \normalbaselines + \setbox\strutbox =\hbox{% + \vrule width0pt height\strutheightpercent\baselineskip + depth \strutdepthpercent \baselineskip + }% +} + +% PDF CMaps. See also LaTeX's t1.cmap. +% +% do nothing with this by default. +\expandafter\let\csname cmapOT1\endcsname\gobble +\expandafter\let\csname cmapOT1IT\endcsname\gobble +\expandafter\let\csname cmapOT1TT\endcsname\gobble + +% if we are producing pdf, and we have \pdffontattr, then define cmaps. +% (\pdffontattr was introduced many years ago, but people still run +% older pdftex's; it's easy to conditionalize, so we do.) +\ifpdf \ifx\pdffontattr\thisisundefined \else + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1-0) +%%Title: (TeX-OT1-0 TeX OT1 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1) +/Supplement 0 +>> def +/CMapName /TeX-OT1-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<23> <26> <0023> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +40 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1IT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1IT-0) +%%Title: (TeX-OT1IT-0 TeX OT1IT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1IT) +/Supplement 0 +>> def +/CMapName /TeX-OT1IT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<25> <26> <0025> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +42 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<23> <0023> +<24> <00A3> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1IT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1TT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1TT-0) +%%Title: (TeX-OT1TT-0 TeX OT1TT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1TT) +/Supplement 0 +>> def +/CMapName /TeX-OT1TT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +5 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<21> <26> <0021> +<28> <5F> <0028> +<61> <7E> <0061> +endbfrange +32 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <2191> +<0C> <2193> +<0D> <0027> +<0E> <00A1> +<0F> <00BF> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<20> <2423> +<27> <2019> +<60> <2018> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1TT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +\fi\fi + + +% Set the font macro #1 to the font named \fontprefix#2. +% #3 is the font's design size, #4 is a scale factor, #5 is the CMap +% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit). +% Example: +% #1 = \textrm +% #2 = \rmshape +% #3 = 10 +% #4 = \mainmagstep +% #5 = OT1 +% +\def\setfont#1#2#3#4#5{% + \font#1=\fontprefix#2#3 scaled #4 + \csname cmap#5\endcsname#1% +} +% This is what gets called when #5 of \setfont is empty. +\let\cmap\gobble +% +% (end of cmaps) + +% Use cm as the default font prefix. +% To specify the font prefix, you must define \fontprefix +% before you read in texinfo.tex. +\ifx\fontprefix\thisisundefined +\def\fontprefix{cm} +\fi +% Support font families that don't use the same naming scheme as CM. +\def\rmshape{r} +\def\rmbshape{bx} % where the normal face is bold +\def\bfshape{b} +\def\bxshape{bx} +\def\ttshape{tt} +\def\ttbshape{tt} +\def\ttslshape{sltt} +\def\itshape{ti} +\def\itbshape{bxti} +\def\slshape{sl} +\def\slbshape{bxsl} +\def\sfshape{ss} +\def\sfbshape{ss} +\def\scshape{csc} +\def\scbshape{csc} + +% Definitions for a main text size of 11pt. (The default in Texinfo.) +% +\def\definetextfontsizexi{% +% Text fonts (11.2pt, magstep1). +\def\textnominalsize{11pt} +\edef\mainmagstep{\magstephalf} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep +\def\textecsize{1095} + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstep1}{OT1} +\setfont\deftt\ttshape{10}{\magstep1}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 +\def\smallecsize{0900} + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 +\def\smallerecsize{0800} + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\titleecsize{2074} + +% Chapter (and unnumbered) fonts (17.28pt). +\def\chapnominalsize{17pt} +\setfont\chaprm\rmbshape{12}{\magstep2}{OT1} +\setfont\chapit\itbshape{10}{\magstep3}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep3}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} +\setfont\chapsf\sfbshape{17}{1000}{OT1} +\let\chapbf=\chaprm +\setfont\chapsc\scbshape{10}{\magstep3}{OT1} +\font\chapi=cmmi12 scaled \magstep2 +\font\chapsy=cmsy10 scaled \magstep3 +\def\chapecsize{1728} + +% Section fonts (14.4pt). +\def\secnominalsize{14pt} +\setfont\secrm\rmbshape{12}{\magstep1}{OT1} +\setfont\secit\itbshape{10}{\magstep2}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep2}{OT1} +\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\secsf\sfbshape{12}{\magstep1}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep2}{OT1} +\font\seci=cmmi12 scaled \magstep1 +\font\secsy=cmsy10 scaled \magstep2 +\def\sececsize{1440} + +% Subsection fonts (13.15pt). +\def\ssecnominalsize{13pt} +\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} +\setfont\ssecit\itbshape{10}{1315}{OT1IT} +\setfont\ssecsl\slbshape{10}{1315}{OT1} +\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} +\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1315}{OT1} +\font\sseci=cmmi12 scaled \magstephalf +\font\ssecsy=cmsy10 scaled 1315 +\def\ssececsize{1200} + +% Reduced fonts for @acro in text (10pt). +\def\reducednominalsize{10pt} +\setfont\reducedrm\rmshape{10}{1000}{OT1} +\setfont\reducedtt\ttshape{10}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{1000}{OT1} +\setfont\reducedit\itshape{10}{1000}{OT1IT} +\setfont\reducedsl\slshape{10}{1000}{OT1} +\setfont\reducedsf\sfshape{10}{1000}{OT1} +\setfont\reducedsc\scshape{10}{1000}{OT1} +\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} +\font\reducedi=cmmi10 +\font\reducedsy=cmsy10 +\def\reducedecsize{1000} + +\textleading = 13.2pt % line spacing for 11pt CM +\textfonts % reset the current fonts +\rm +} % end of 11pt text font size definitions, \definetextfontsizexi + + +% Definitions to make the main text be 10pt Computer Modern, with +% section, chapter, etc., sizes following suit. This is for the GNU +% Press printing of the Emacs 22 manual. Maybe other manuals in the +% future. Used with @smallbook, which sets the leading to 12pt. +% +\def\definetextfontsizex{% +% Text fonts (10pt). +\def\textnominalsize{10pt} +\edef\mainmagstep{1000} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep +\def\textecsize{1000} + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstephalf}{OT1} +\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 +\def\smallecsize{0900} + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 +\def\smallerecsize{0800} + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\titleecsize{2074} + +% Chapter fonts (14.4pt). +\def\chapnominalsize{14pt} +\setfont\chaprm\rmbshape{12}{\magstep1}{OT1} +\setfont\chapit\itbshape{10}{\magstep2}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep2}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\chapsf\sfbshape{12}{\magstep1}{OT1} +\let\chapbf\chaprm +\setfont\chapsc\scbshape{10}{\magstep2}{OT1} +\font\chapi=cmmi12 scaled \magstep1 +\font\chapsy=cmsy10 scaled \magstep2 +\def\chapecsize{1440} + +% Section fonts (12pt). +\def\secnominalsize{12pt} +\setfont\secrm\rmbshape{12}{1000}{OT1} +\setfont\secit\itbshape{10}{\magstep1}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep1}{OT1} +\setfont\sectt\ttbshape{12}{1000}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} +\setfont\secsf\sfbshape{12}{1000}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep1}{OT1} +\font\seci=cmmi12 +\font\secsy=cmsy10 scaled \magstep1 +\def\sececsize{1200} + +% Subsection fonts (10pt). +\def\ssecnominalsize{10pt} +\setfont\ssecrm\rmbshape{10}{1000}{OT1} +\setfont\ssecit\itbshape{10}{1000}{OT1IT} +\setfont\ssecsl\slbshape{10}{1000}{OT1} +\setfont\ssectt\ttbshape{10}{1000}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} +\setfont\ssecsf\sfbshape{10}{1000}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1000}{OT1} +\font\sseci=cmmi10 +\font\ssecsy=cmsy10 +\def\ssececsize{1000} + +% Reduced fonts for @acro in text (9pt). +\def\reducednominalsize{9pt} +\setfont\reducedrm\rmshape{9}{1000}{OT1} +\setfont\reducedtt\ttshape{9}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{900}{OT1} +\setfont\reducedit\itshape{9}{1000}{OT1IT} +\setfont\reducedsl\slshape{9}{1000}{OT1} +\setfont\reducedsf\sfshape{9}{1000}{OT1} +\setfont\reducedsc\scshape{10}{900}{OT1} +\setfont\reducedttsl\ttslshape{10}{900}{OT1TT} +\font\reducedi=cmmi9 +\font\reducedsy=cmsy9 +\def\reducedecsize{0900} + +\divide\parskip by 2 % reduce space between paragraphs +\textleading = 12pt % line spacing for 10pt CM +\textfonts % reset the current fonts +\rm +} % end of 10pt text font size definitions, \definetextfontsizex + + +% We provide the user-level command +% @fonttextsize 10 +% (or 11) to redefine the text font size. pt is assumed. +% +\def\xiword{11} +\def\xword{10} +\def\xwordpt{10pt} +% +\parseargdef\fonttextsize{% + \def\textsizearg{#1}% + %\wlog{doing @fonttextsize \textsizearg}% + % + % Set \globaldefs so that documents can use this inside @tex, since + % makeinfo 4.8 does not support it, but we need it nonetheless. + % + \begingroup \globaldefs=1 + \ifx\textsizearg\xword \definetextfontsizex + \else \ifx\textsizearg\xiword \definetextfontsizexi + \else + \errhelp=\EMsimple + \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} + \fi\fi + \endgroup +} + + +% In order for the font changes to affect most math symbols and letters, +% we have to define the \textfont of the standard families. Since +% texinfo doesn't allow for producing subscripts and superscripts except +% in the main text, we don't bother to reset \scriptfont and +% \scriptscriptfont (which would also require loading a lot more fonts). +% +\def\resetmathfonts{% + \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy + \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf + \textfont\ttfam=\tentt \textfont\sffam=\tensf +} + +% The font-changing commands redefine the meanings of \tenSTYLE, instead +% of just \STYLE. We do this because \STYLE needs to also set the +% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire +% \tenSTYLE to set the current font. +% +% Each font-changing command also sets the names \lsize (one size lower) +% and \lllsize (three sizes lower). These relative commands are used in +% the LaTeX logo and acronyms. +% +% This all needs generalizing, badly. +% +\def\textfonts{% + \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl + \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc + \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy + \let\tenttsl=\textttsl + \def\curfontsize{text}% + \def\lsize{reduced}\def\lllsize{smaller}% + \resetmathfonts \setleading{\textleading}} +\def\titlefonts{% + \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl + \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc + \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy + \let\tenttsl=\titlettsl + \def\curfontsize{title}% + \def\lsize{chap}\def\lllsize{subsec}% + \resetmathfonts \setleading{27pt}} +\def\titlefont#1{{\titlefonts\rmisbold #1}} +\def\chapfonts{% + \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl + \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc + \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy + \let\tenttsl=\chapttsl + \def\curfontsize{chap}% + \def\lsize{sec}\def\lllsize{text}% + \resetmathfonts \setleading{19pt}} +\def\secfonts{% + \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl + \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc + \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy + \let\tenttsl=\secttsl + \def\curfontsize{sec}% + \def\lsize{subsec}\def\lllsize{reduced}% + \resetmathfonts \setleading{16pt}} +\def\subsecfonts{% + \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl + \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc + \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy + \let\tenttsl=\ssecttsl + \def\curfontsize{ssec}% + \def\lsize{text}\def\lllsize{small}% + \resetmathfonts \setleading{15pt}} +\let\subsubsecfonts = \subsecfonts +\def\reducedfonts{% + \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl + \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc + \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy + \let\tenttsl=\reducedttsl + \def\curfontsize{reduced}% + \def\lsize{small}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallfonts{% + \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl + \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc + \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy + \let\tenttsl=\smallttsl + \def\curfontsize{small}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallerfonts{% + \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl + \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc + \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy + \let\tenttsl=\smallerttsl + \def\curfontsize{smaller}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{9.5pt}} + +% Fonts for short table of contents. +\setfont\shortcontrm\rmshape{12}{1000}{OT1} +\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 +\setfont\shortcontsl\slshape{12}{1000}{OT1} +\setfont\shortconttt\ttshape{12}{1000}{OT1TT} + +% Define these just so they can be easily changed for other fonts. +\def\angleleft{$\langle$} +\def\angleright{$\rangle$} + +% Set the fonts to use with the @small... environments. +\let\smallexamplefonts = \smallfonts + +% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample +% can fit this many characters: +% 8.5x11=86 smallbook=72 a4=90 a5=69 +% If we use \scriptfonts (8pt), then we can fit this many characters: +% 8.5x11=90+ smallbook=80 a4=90+ a5=77 +% For me, subjectively, the few extra characters that fit aren't worth +% the additional smallness of 8pt. So I'm making the default 9pt. +% +% By the way, for comparison, here's what fits with @example (10pt): +% 8.5x11=71 smallbook=60 a4=75 a5=58 +% --karl, 24jan03. + +% Set up the default fonts, so we can use them for creating boxes. +% +\definetextfontsizexi + + +\message{markup,} + +% Check if we are currently using a typewriter font. Since all the +% Computer Modern typewriter fonts have zero interword stretch (and +% shrink), and it is reasonable to expect all typewriter fonts to have +% this property, we can check that font parameter. +% +\def\ifmonospace{\ifdim\fontdimen3\font=0pt } + +% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will +% define and register \INITMACRO to be called on markup style changes. +% \INITMACRO can check \currentmarkupstyle for the innermost +% style and the set of \ifmarkupSTYLE switches for all styles +% currently in effect. +\newif\ifmarkupvar +\newif\ifmarkupsamp +\newif\ifmarkupkey +%\newif\ifmarkupfile % @file == @samp. +%\newif\ifmarkupoption % @option == @samp. +\newif\ifmarkupcode +\newif\ifmarkupkbd +%\newif\ifmarkupenv % @env == @code. +%\newif\ifmarkupcommand % @command == @code. +\newif\ifmarkuptex % @tex (and part of @math, for now). +\newif\ifmarkupexample +\newif\ifmarkupverb +\newif\ifmarkupverbatim + +\let\currentmarkupstyle\empty + +\def\setupmarkupstyle#1{% + \csname markup#1true\endcsname + \def\currentmarkupstyle{#1}% + \markupstylesetup +} + +\let\markupstylesetup\empty + +\def\defmarkupstylesetup#1{% + \expandafter\def\expandafter\markupstylesetup + \expandafter{\markupstylesetup #1}% + \def#1% +} + +% Markup style setup for left and right quotes. +\defmarkupstylesetup\markupsetuplq{% + \expandafter\let\expandafter \temp + \csname markupsetuplq\currentmarkupstyle\endcsname + \ifx\temp\relax \markupsetuplqdefault \else \temp \fi +} + +\defmarkupstylesetup\markupsetuprq{% + \expandafter\let\expandafter \temp + \csname markupsetuprq\currentmarkupstyle\endcsname + \ifx\temp\relax \markupsetuprqdefault \else \temp \fi +} + +{ +\catcode`\'=\active +\catcode`\`=\active + +\gdef\markupsetuplqdefault{\let`\lq} +\gdef\markupsetuprqdefault{\let'\rq} + +\gdef\markupsetcodequoteleft{\let`\codequoteleft} +\gdef\markupsetcodequoteright{\let'\codequoteright} +} + +\let\markupsetuplqcode \markupsetcodequoteleft +\let\markupsetuprqcode \markupsetcodequoteright +% +\let\markupsetuplqexample \markupsetcodequoteleft +\let\markupsetuprqexample \markupsetcodequoteright +% +\let\markupsetuplqkbd \markupsetcodequoteleft +\let\markupsetuprqkbd \markupsetcodequoteright +% +\let\markupsetuplqsamp \markupsetcodequoteleft +\let\markupsetuprqsamp \markupsetcodequoteright +% +\let\markupsetuplqverb \markupsetcodequoteleft +\let\markupsetuprqverb \markupsetcodequoteright +% +\let\markupsetuplqverbatim \markupsetcodequoteleft +\let\markupsetuprqverbatim \markupsetcodequoteright + +% Allow an option to not use regular directed right quote/apostrophe +% (char 0x27), but instead the undirected quote from cmtt (char 0x0d). +% The undirected quote is ugly, so don't make it the default, but it +% works for pasting with more pdf viewers (at least evince), the +% lilypond developers report. xpdf does work with the regular 0x27. +% +\def\codequoteright{% + \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax + \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax + '% + \else \char'15 \fi + \else \char'15 \fi +} +% +% and a similar option for the left quote char vs. a grave accent. +% Modern fonts display ASCII 0x60 as a grave accent, so some people like +% the code environments to do likewise. +% +\def\codequoteleft{% + \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax + \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax + % [Knuth] pp. 380,381,391 + % \relax disables Spanish ligatures ?` and !` of \tt font. + \relax`% + \else \char'22 \fi + \else \char'22 \fi +} + +% Commands to set the quote options. +% +\parseargdef\codequoteundirected{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETtxicodequoteundirected\endcsname + = t% + \else\ifx\temp\offword + \expandafter\let\csname SETtxicodequoteundirected\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}% + \fi\fi +} +% +\parseargdef\codequotebacktick{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETtxicodequotebacktick\endcsname + = t% + \else\ifx\temp\offword + \expandafter\let\csname SETtxicodequotebacktick\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}% + \fi\fi +} + +% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. +\def\noligaturesquoteleft{\relax\lq} + +% Count depth in font-changes, for error checks +\newcount\fontdepth \fontdepth=0 + +% Font commands. + +% #1 is the font command (\sl or \it), #2 is the text to slant. +% If we are in a monospaced environment, however, 1) always use \ttsl, +% and 2) do not add an italic correction. +\def\dosmartslant#1#2{% + \ifusingtt + {{\ttsl #2}\let\next=\relax}% + {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% + \next +} +\def\smartslanted{\dosmartslant\sl} +\def\smartitalic{\dosmartslant\it} + +% Output an italic correction unless \next (presumed to be the following +% character) is such as not to need one. +\def\smartitaliccorrection{% + \ifx\next,% + \else\ifx\next-% + \else\ifx\next.% + \else\ptexslash + \fi\fi\fi + \aftersmartic +} + +% Unconditional use \ttsl, and no ic. @var is set to this for defuns. +\def\ttslanted#1{{\ttsl #1}} + +% @cite is like \smartslanted except unconditionally use \sl. We never want +% ttsl for book titles, do we? +\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection} + +\def\aftersmartic{} +\def\var#1{% + \let\saveaftersmartic = \aftersmartic + \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% + \smartslanted{#1}% +} + +\let\i=\smartitalic +\let\slanted=\smartslanted +\let\dfn=\smartslanted +\let\emph=\smartitalic + +% Explicit font changes: @r, @sc, undocumented @ii. +\def\r#1{{\rm #1}} % roman font +\def\sc#1{{\smallcaps#1}} % smallcaps font +\def\ii#1{{\it #1}} % italic font + +% @b, explicit bold. Also @strong. +\def\b#1{{\bf #1}} +\let\strong=\b + +% @sansserif, explicit sans. +\def\sansserif#1{{\sf #1}} + +% We can't just use \exhyphenpenalty, because that only has effect at +% the end of a paragraph. Restore normal hyphenation at the end of the +% group within which \nohyphenation is presumably called. +% +\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} +\def\restorehyphenation{\hyphenchar\font = `- } + +% Set sfcode to normal for the chars that usually have another value. +% Can't use plain's \frenchspacing because it uses the `\x notation, and +% sometimes \x has an active definition that messes things up. +% +\catcode`@=11 + \def\plainfrenchspacing{% + \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m + \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m + \def\endofsentencespacefactor{1000}% for @. and friends + } + \def\plainnonfrenchspacing{% + \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 + \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 + \def\endofsentencespacefactor{3000}% for @. and friends + } +\catcode`@=\other +\def\endofsentencespacefactor{3000}% default + +% @t, explicit typewriter. +\def\t#1{% + {\tt \rawbackslash \plainfrenchspacing #1}% + \null +} + +% @samp. +\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} + +% @indicateurl is \samp, that is, with quotes. +\let\indicateurl=\samp + +% @code (and similar) prints in typewriter, but with spaces the same +% size as normal in the surrounding text, without hyphenation, etc. +% This is a subroutine for that. +\def\tclose#1{% + {% + % Change normal interword space to be same as for the current font. + \spaceskip = \fontdimen2\font + % + % Switch to typewriter. + \tt + % + % But `\ ' produces the large typewriter interword space. + \def\ {{\spaceskip = 0pt{} }}% + % + % Turn off hyphenation. + \nohyphenation + % + \rawbackslash + \plainfrenchspacing + #1% + }% + \null % reset spacefactor to 1000 +} + +% We *must* turn on hyphenation at `-' and `_' in @code. +% Otherwise, it is too hard to avoid overfull hboxes +% in the Emacs manual, the Library manual, etc. +% +% Unfortunately, TeX uses one parameter (\hyphenchar) to control +% both hyphenation at - and hyphenation within words. +% We must therefore turn them both off (\tclose does that) +% and arrange explicitly to hyphenate at a dash. +% -- rms. +{ + \catcode`\-=\active \catcode`\_=\active + \catcode`\'=\active \catcode`\`=\active + \global\let'=\rq \global\let`=\lq % default definitions + % + \global\def\code{\begingroup + \setupmarkupstyle{code}% + % The following should really be moved into \setupmarkupstyle handlers. + \catcode\dashChar=\active \catcode\underChar=\active + \ifallowcodebreaks + \let-\codedash + \let_\codeunder + \else + \let-\normaldash + \let_\realunder + \fi + \codex + } +} + +\def\codex #1{\tclose{#1}\endgroup} + +\def\normaldash{-} +\def\codedash{-\discretionary{}{}{}} +\def\codeunder{% + % this is all so @math{@code{var_name}+1} can work. In math mode, _ + % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) + % will therefore expand the active definition of _, which is us + % (inside @code that is), therefore an endless loop. + \ifusingtt{\ifmmode + \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. + \else\normalunderscore \fi + \discretionary{}{}{}}% + {\_}% +} + +% An additional complication: the above will allow breaks after, e.g., +% each of the four underscores in __typeof__. This is bad. +% @allowcodebreaks provides a document-level way to turn breaking at - +% and _ on and off. +% +\newif\ifallowcodebreaks \allowcodebreakstrue + +\def\keywordtrue{true} +\def\keywordfalse{false} + +\parseargdef\allowcodebreaks{% + \def\txiarg{#1}% + \ifx\txiarg\keywordtrue + \allowcodebreakstrue + \else\ifx\txiarg\keywordfalse + \allowcodebreaksfalse + \else + \errhelp = \EMsimple + \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% + \fi\fi +} + +% For @command, @env, @file, @option quotes seem unnecessary, +% so use \code rather than \samp. +\let\command=\code +\let\env=\code +\let\file=\code +\let\option=\code + +% @uref (abbreviation for `urlref') takes an optional (comma-separated) +% second argument specifying the text to display and an optional third +% arg as text to display instead of (rather than in addition to) the url +% itself. First (mandatory) arg is the url. +% (This \urefnobreak definition isn't used now, leaving it for a while +% for comparison.) +\def\urefnobreak#1{\dourefnobreak #1,,,\finish} +\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup + \unsepspaces + \pdfurl{#1}% + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt + \unhbox0 % third arg given, show only that + \else + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \ifpdf + \unhbox0 % PDF: 2nd arg given, show only it + \else + \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url + \fi + \else + \code{#1}% only url given, so show it + \fi + \fi + \endlink +\endgroup} + +% This \urefbreak definition is the active one. +\def\urefbreak{\begingroup \urefcatcodes \dourefbreak} +\let\uref=\urefbreak +\def\dourefbreak#1{\urefbreakfinish #1,,,\finish} +\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example + \unsepspaces + \pdfurl{#1}% + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt + \unhbox0 % third arg given, show only that + \else + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \ifpdf + \unhbox0 % PDF: 2nd arg given, show only it + \else + \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url + \fi + \else + \urefcode{#1}% only url given, so show it + \fi + \fi + \endlink +\endgroup} + +% Allow line breaks around only a few characters (only). +\def\urefcatcodes{% + \catcode\ampChar=\active \catcode\dotChar=\active + \catcode\hashChar=\active \catcode\questChar=\active + \catcode\slashChar=\active +} +{ + \urefcatcodes + % + \global\def\urefcode{\begingroup + \setupmarkupstyle{code}% + \urefcatcodes + \let&\urefcodeamp + \let.\urefcodedot + \let#\urefcodehash + \let?\urefcodequest + \let/\urefcodeslash + \codex + } + % + % By default, they are just regular characters. + \global\def&{\normalamp} + \global\def.{\normaldot} + \global\def#{\normalhash} + \global\def?{\normalquest} + \global\def/{\normalslash} +} + +% we put a little stretch before and after the breakable chars, to help +% line breaking of long url's. The unequal skips make look better in +% cmtt at least, especially for dots. +\def\urefprestretch{\urefprebreak \hskip0pt plus.13em } +\def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em } +% +\def\urefcodeamp{\urefprestretch \&\urefpoststretch} +\def\urefcodedot{\urefprestretch .\urefpoststretch} +\def\urefcodehash{\urefprestretch \#\urefpoststretch} +\def\urefcodequest{\urefprestretch ?\urefpoststretch} +\def\urefcodeslash{\futurelet\next\urefcodeslashfinish} +{ + \catcode`\/=\active + \global\def\urefcodeslashfinish{% + \urefprestretch \slashChar + % Allow line break only after the final / in a sequence of + % slashes, to avoid line break between the slashes in http://. + \ifx\next/\else \urefpoststretch \fi + } +} + +% One more complication: by default we'll break after the special +% characters, but some people like to break before the special chars, so +% allow that. Also allow no breaking at all, for manual control. +% +\parseargdef\urefbreakstyle{% + \def\txiarg{#1}% + \ifx\txiarg\wordnone + \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} + \else\ifx\txiarg\wordbefore + \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} + \else\ifx\txiarg\wordafter + \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} + \else + \errhelp = \EMsimple + \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% + \fi\fi\fi +} +\def\wordafter{after} +\def\wordbefore{before} +\def\wordnone{none} + +\urefbreakstyle after + +% @url synonym for @uref, since that's how everyone uses it. +% +\let\url=\uref + +% rms does not like angle brackets --karl, 17may97. +% So now @email is just like @uref, unless we are pdf. +% +%\def\email#1{\angleleft{\tt #1}\angleright} +\ifpdf + \def\email#1{\doemail#1,,\finish} + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces + \pdfurl{mailto:#1}% + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi + \endlink + \endgroup} +\else + \let\email=\uref +\fi + +% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), +% `example' (@kbd uses ttsl only inside of @example and friends), +% or `code' (@kbd uses normal tty font always). +\parseargdef\kbdinputstyle{% + \def\txiarg{#1}% + \ifx\txiarg\worddistinct + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% + \else\ifx\txiarg\wordexample + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% + \else\ifx\txiarg\wordcode + \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% + \else + \errhelp = \EMsimple + \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% + \fi\fi\fi +} +\def\worddistinct{distinct} +\def\wordexample{example} +\def\wordcode{code} + +% Default is `distinct'. +\kbdinputstyle distinct + +% @kbd is like @code, except that if the argument is just one @key command, +% then @kbd has no effect. +\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}} + +\def\xkey{\key} +\def\kbdsub#1#2#3\par{% + \def\one{#1}\def\three{#3}\def\threex{??}% + \ifx\one\xkey\ifx\threex\three \key{#2}% + \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi + \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi +} + +% definition of @key that produces a lozenge. Doesn't adjust to text size. +%\setfont\keyrm\rmshape{8}{1000}{OT1} +%\font\keysy=cmsy9 +%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% +% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% +% \vbox{\hrule\kern-0.4pt +% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% +% \kern-0.4pt\hrule}% +% \kern-.06em\raise0.4pt\hbox{\angleright}}}} + +% definition of @key with no lozenge. If the current font is already +% monospace, don't change it; that way, we respect @kbdinputstyle. But +% if it isn't monospace, then use \tt. +% +\def\key#1{{\setupmarkupstyle{key}% + \nohyphenation + \ifmonospace\else\tt\fi + #1}\null} + +% @clicksequence{File @click{} Open ...} +\def\clicksequence#1{\begingroup #1\endgroup} + +% @clickstyle @arrow (by default) +\parseargdef\clickstyle{\def\click{#1}} +\def\click{\arrow} + +% Typeset a dimension, e.g., `in' or `pt'. The only reason for the +% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. +% +\def\dmn#1{\thinspace #1} + +% @l was never documented to mean ``switch to the Lisp font'', +% and it is not used as such in any manual I can find. We need it for +% Polish suppressed-l. --karl, 22sep96. +%\def\l#1{{\li #1}\null} + +% @acronym for "FBI", "NATO", and the like. +% We print this one point size smaller, since it's intended for +% all-uppercase. +% +\def\acronym#1{\doacronym #1,,\finish} +\def\doacronym#1,#2,#3\finish{% + {\selectfonts\lsize #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi + \null % reset \spacefactor=1000 +} + +% @abbr for "Comput. J." and the like. +% No font change, but don't do end-of-sentence spacing. +% +\def\abbr#1{\doabbr #1,,\finish} +\def\doabbr#1,#2,#3\finish{% + {\plainfrenchspacing #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi + \null % reset \spacefactor=1000 +} + +% @asis just yields its argument. Used with @table, for example. +% +\def\asis#1{#1} + +% @math outputs its argument in math mode. +% +% One complication: _ usually means subscripts, but it could also mean +% an actual _ character, as in @math{@var{some_variable} + 1}. So make +% _ active, and distinguish by seeing if the current family is \slfam, +% which is what @var uses. +{ + \catcode`\_ = \active + \gdef\mathunderscore{% + \catcode`\_=\active + \def_{\ifnum\fam=\slfam \_\else\sb\fi}% + } +} +% Another complication: we want \\ (and @\) to output a math (or tt) \. +% FYI, plain.tex uses \\ as a temporary control sequence (for no +% particular reason), but this is not advertised and we don't care. +% +% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. +\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} +% +\def\math{% + \tex + \mathunderscore + \let\\ = \mathbackslash + \mathactive + % make the texinfo accent commands work in math mode + \let\"=\ddot + \let\'=\acute + \let\==\bar + \let\^=\hat + \let\`=\grave + \let\u=\breve + \let\v=\check + \let\~=\tilde + \let\dotaccent=\dot + $\finishmath +} +\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. + +% Some active characters (such as <) are spaced differently in math. +% We have to reset their definitions in case the @math was an argument +% to a command which sets the catcodes (such as @item or @section). +% +{ + \catcode`^ = \active + \catcode`< = \active + \catcode`> = \active + \catcode`+ = \active + \catcode`' = \active + \gdef\mathactive{% + \let^ = \ptexhat + \let< = \ptexless + \let> = \ptexgtr + \let+ = \ptexplus + \let' = \ptexquoteright + } +} + +% ctrl is no longer a Texinfo command, but leave this definition for fun. +\def\ctrl #1{{\tt \rawbackslash \hat}#1} + +% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. +% Ignore unless FMTNAME == tex; then it is like @iftex and @tex, +% except specified as a normal braced arg, so no newlines to worry about. +% +\def\outfmtnametex{tex} +% +\long\def\inlinefmt#1{\doinlinefmt #1,\finish} +\long\def\doinlinefmt#1,#2,\finish{% + \def\inlinefmtname{#1}% + \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi +} +% For raw, must switch into @tex before parsing the argument, to avoid +% setting catcodes prematurely. Doing it this way means that, for +% example, @inlineraw{html, foo{bar} gets a parse error instead of being +% ignored. But this isn't important because if people want a literal +% *right* brace they would have to use a command anyway, so they may as +% well use a command to get a left brace too. We could re-use the +% delimiter character idea from \verb, but it seems like overkill. +% +\long\def\inlineraw{\tex \doinlineraw} +\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish} +\def\doinlinerawtwo#1,#2,\finish{% + \def\inlinerawname{#1}% + \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi + \endgroup % close group opened by \tex. +} + + +\message{glyphs,} +% and logos. + +% @@ prints an @, as does @atchar{}. +\def\@{\char64 } +\let\atchar=\@ + +% @{ @} @lbracechar{} @rbracechar{} all generate brace characters. +% Unless we're in typewriter, use \ecfont because the CM text fonts do +% not have braces, and we don't want to switch into math. +\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}} +\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}} +\let\{=\mylbrace \let\lbracechar=\{ +\let\}=\myrbrace \let\rbracechar=\} +\begingroup + % Definitions to produce \{ and \} commands for indices, + % and @{ and @} for the aux/toc files. + \catcode`\{ = \other \catcode`\} = \other + \catcode`\[ = 1 \catcode`\] = 2 + \catcode`\! = 0 \catcode`\\ = \other + !gdef!lbracecmd[\{]% + !gdef!rbracecmd[\}]% + !gdef!lbraceatcmd[@{]% + !gdef!rbraceatcmd[@}]% +!endgroup + +% @comma{} to avoid , parsing problems. +\let\comma = , + +% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent +% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. +\let\, = \ptexc +\let\dotaccent = \ptexdot +\def\ringaccent#1{{\accent23 #1}} +\let\tieaccent = \ptext +\let\ubaraccent = \ptexb +\let\udotaccent = \d + +% Other special characters: @questiondown @exclamdown @ordf @ordm +% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. +\def\questiondown{?`} +\def\exclamdown{!`} +\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} +\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} + +% Dotless i and dotless j, used for accents. +\def\imacro{i} +\def\jmacro{j} +\def\dotless#1{% + \def\temp{#1}% + \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi + \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi + \else \errmessage{@dotless can be used only with i or j}% + \fi\fi +} + +% The \TeX{} logo, as in plain, but resetting the spacing so that a +% period following counts as ending a sentence. (Idea found in latex.) +% +\edef\TeX{\TeX \spacefactor=1000 } + +% @LaTeX{} logo. Not quite the same results as the definition in +% latex.ltx, since we use a different font for the raised A; it's most +% convenient for us to use an explicitly smaller font, rather than using +% the \scriptstyle font (since we don't reset \scriptstyle and +% \scriptscriptstyle). +% +\def\LaTeX{% + L\kern-.36em + {\setbox0=\hbox{T}% + \vbox to \ht0{\hbox{% + \ifx\textnominalsize\xwordpt + % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX. + % Revert to plain's \scriptsize, which is 7pt. + \count255=\the\fam $\fam\count255 \scriptstyle A$% + \else + % For 11pt, we can use our lllsize. + \selectfonts\lllsize A% + \fi + }% + \vss + }}% + \kern-.15em + \TeX +} + +% Some math mode symbols. +\def\bullet{$\ptexbullet$} +\def\geq{\ifmmode \ge\else $\ge$\fi} +\def\leq{\ifmmode \le\else $\le$\fi} +\def\minus{\ifmmode -\else $-$\fi} + +% @dots{} outputs an ellipsis using the current font. +% We do .5em per period so that it has the same spacing in the cm +% typewriter fonts as three actual period characters; on the other hand, +% in other typewriter fonts three periods are wider than 1.5em. So do +% whichever is larger. +% +\def\dots{% + \leavevmode + \setbox0=\hbox{...}% get width of three periods + \ifdim\wd0 > 1.5em + \dimen0 = \wd0 + \else + \dimen0 = 1.5em + \fi + \hbox to \dimen0{% + \hskip 0pt plus.25fil + .\hskip 0pt plus1fil + .\hskip 0pt plus1fil + .\hskip 0pt plus.5fil + }% +} + +% @enddots{} is an end-of-sentence ellipsis. +% +\def\enddots{% + \dots + \spacefactor=\endofsentencespacefactor +} + +% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. +% +% Since these characters are used in examples, they should be an even number of +% \tt widths. Each \tt character is 1en, so two makes it 1em. +% +\def\point{$\star$} +\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} +\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} +\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} +\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} +\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} + +% The @error{} command. +% Adapted from the TeXbook's \boxit. +% +\newbox\errorbox +% +{\tentt \global\dimen0 = 3em}% Width of the box. +\dimen2 = .55pt % Thickness of rules +% The text. (`r' is open on the right, `e' somewhat less so on the left.) +\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} +% +\setbox\errorbox=\hbox to \dimen0{\hfil + \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. + \advance\hsize by -2\dimen2 % Rules. + \vbox{% + \hrule height\dimen2 + \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. + \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. + \kern3pt\vrule width\dimen2}% Space to right. + \hrule height\dimen2} + \hfil} +% +\def\error{\leavevmode\lower.7ex\copy\errorbox} + +% @pounds{} is a sterling sign, which Knuth put in the CM italic font. +% +\def\pounds{{\it\$}} + +% @euro{} comes from a separate font, depending on the current style. +% We use the free feym* fonts from the eurosym package by Henrik +% Theiling, which support regular, slanted, bold and bold slanted (and +% "outlined" (blackboard board, sort of) versions, which we don't need). +% It is available from http://www.ctan.org/tex-archive/fonts/eurosym. +% +% Although only regular is the truly official Euro symbol, we ignore +% that. The Euro is designed to be slightly taller than the regular +% font height. +% +% feymr - regular +% feymo - slanted +% feybr - bold +% feybo - bold slanted +% +% There is no good (free) typewriter version, to my knowledge. +% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. +% Hmm. +% +% Also doesn't work in math. Do we need to do math with euro symbols? +% Hope not. +% +% +\def\euro{{\eurofont e}} +\def\eurofont{% + % We set the font at each command, rather than predefining it in + % \textfonts and the other font-switching commands, so that + % installations which never need the symbol don't have to have the + % font installed. + % + % There is only one designed size (nominal 10pt), so we always scale + % that to the current nominal size. + % + % By the way, simply using "at 1em" works for cmr10 and the like, but + % does not work for cmbx10 and other extended/shrunken fonts. + % + \def\eurosize{\csname\curfontsize nominalsize\endcsname}% + % + \ifx\curfontstyle\bfstylename + % bold: + \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize + \else + % regular: + \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize + \fi + \thiseurofont +} + +% Glyphs from the EC fonts. We don't use \let for the aliases, because +% sometimes we redefine the original macro, and the alias should reflect +% the redefinition. +% +% Use LaTeX names for the Icelandic letters. +\def\DH{{\ecfont \char"D0}} % Eth +\def\dh{{\ecfont \char"F0}} % eth +\def\TH{{\ecfont \char"DE}} % Thorn +\def\th{{\ecfont \char"FE}} % thorn +% +\def\guillemetleft{{\ecfont \char"13}} +\def\guillemotleft{\guillemetleft} +\def\guillemetright{{\ecfont \char"14}} +\def\guillemotright{\guillemetright} +\def\guilsinglleft{{\ecfont \char"0E}} +\def\guilsinglright{{\ecfont \char"0F}} +\def\quotedblbase{{\ecfont \char"12}} +\def\quotesinglbase{{\ecfont \char"0D}} +% +% This positioning is not perfect (see the ogonek LaTeX package), but +% we have the precomposed glyphs for the most common cases. We put the +% tests to use those glyphs in the single \ogonek macro so we have fewer +% dummy definitions to worry about for index entries, etc. +% +% ogonek is also used with other letters in Lithuanian (IOU), but using +% the precomposed glyphs for those is not so easy since they aren't in +% the same EC font. +\def\ogonek#1{{% + \def\temp{#1}% + \ifx\temp\macrocharA\Aogonek + \else\ifx\temp\macrochara\aogonek + \else\ifx\temp\macrocharE\Eogonek + \else\ifx\temp\macrochare\eogonek + \else + \ecfont \setbox0=\hbox{#1}% + \ifdim\ht0=1ex\accent"0C #1% + \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% + \fi + \fi\fi\fi\fi + }% +} +\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} +\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} +\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} +\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} +% +% Use the ec* fonts (cm-super in outline format) for non-CM glyphs. +\def\ecfont{% + % We can't distinguish serif/sans and italic/slanted, but this + % is used for crude hacks anyway (like adding French and German + % quotes to documents typeset with CM, where we lose kerning), so + % hopefully nobody will notice/care. + \edef\ecsize{\csname\curfontsize ecsize\endcsname}% + \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% + \ifmonospace + % typewriter: + \font\thisecfont = ectt\ecsize \space at \nominalsize + \else + \ifx\curfontstyle\bfstylename + % bold: + \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize + \else + % regular: + \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \fi + \fi + \thisecfont +} + +% @registeredsymbol - R in a circle. The font for the R should really +% be smaller yet, but lllsize is the best we can do for now. +% Adapted from the plain.tex definition of \copyright. +% +\def\registeredsymbol{% + $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% + \hfil\crcr\Orb}}% + }$% +} + +% @textdegree - the normal degrees sign. +% +\def\textdegree{$^\circ$} + +% Laurent Siebenmann reports \Orb undefined with: +% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 +% so we'll define it if necessary. +% +\ifx\Orb\thisisundefined +\def\Orb{\mathhexbox20D} +\fi + +% Quotes. +\chardef\quotedblleft="5C +\chardef\quotedblright=`\" +\chardef\quoteleft=`\` +\chardef\quoteright=`\' + + +\message{page headings,} + +\newskip\titlepagetopglue \titlepagetopglue = 1.5in +\newskip\titlepagebottomglue \titlepagebottomglue = 2pc + +% First the title page. Must do @settitle before @titlepage. +\newif\ifseenauthor +\newif\iffinishedtitlepage + +% Do an implicit @contents or @shortcontents after @end titlepage if the +% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. +% +\newif\ifsetcontentsaftertitlepage + \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue +\newif\ifsetshortcontentsaftertitlepage + \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue + +\parseargdef\shorttitlepage{% + \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% + \endgroup\page\hbox{}\page} + +\envdef\titlepage{% + % Open one extra group, as we want to close it in the middle of \Etitlepage. + \begingroup + \parindent=0pt \textfonts + % Leave some space at the very top of the page. + \vglue\titlepagetopglue + % No rule at page bottom unless we print one at the top with @title. + \finishedtitlepagetrue + % + % Most title ``pages'' are actually two pages long, with space + % at the top of the second. We don't want the ragged left on the second. + \let\oldpage = \page + \def\page{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + \let\page = \oldpage + \page + \null + }% +} + +\def\Etitlepage{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + % It is important to do the page break before ending the group, + % because the headline and footline are only empty inside the group. + % If we use the new definition of \page, we always get a blank page + % after the title page, which we certainly don't want. + \oldpage + \endgroup + % + % Need this before the \...aftertitlepage checks so that if they are + % in effect the toc pages will come out with page numbers. + \HEADINGSon + % + % If they want short, they certainly want long too. + \ifsetshortcontentsaftertitlepage + \shortcontents + \contents + \global\let\shortcontents = \relax + \global\let\contents = \relax + \fi + % + \ifsetcontentsaftertitlepage + \contents + \global\let\contents = \relax + \global\let\shortcontents = \relax + \fi +} + +\def\finishtitlepage{% + \vskip4pt \hrule height 2pt width \hsize + \vskip\titlepagebottomglue + \finishedtitlepagetrue +} + +% Settings used for typesetting titles: no hyphenation, no indentation, +% don't worry much about spacing, ragged right. This should be used +% inside a \vbox, and fonts need to be set appropriately first. Because +% it is always used for titles, nothing else, we call \rmisbold. \par +% should be specified before the end of the \vbox, since a vbox is a group. +% +\def\raggedtitlesettings{% + \rmisbold + \hyphenpenalty=10000 + \parindent=0pt + \tolerance=5000 + \ptexraggedright +} + +% Macros to be used within @titlepage: + +\let\subtitlerm=\tenrm +\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} + +\parseargdef\title{% + \checkenv\titlepage + \vbox{\titlefonts \raggedtitlesettings #1\par}% + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt +} + +\parseargdef\subtitle{% + \checkenv\titlepage + {\subtitlefont \rightline{#1}}% +} + +% @author should come last, but may come many times. +% It can also be used inside @quotation. +% +\parseargdef\author{% + \def\temp{\quotation}% + \ifx\thisenv\temp + \def\quotationauthor{#1}% printed in \Equotation. + \else + \checkenv\titlepage + \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi + {\secfonts\rmisbold \leftline{#1}}% + \fi +} + + +% Set up page headings and footings. + +\let\thispage=\folio + +\newtoks\evenheadline % headline on even pages +\newtoks\oddheadline % headline on odd pages +\newtoks\evenfootline % footline on even pages +\newtoks\oddfootline % footline on odd pages + +% Now make TeX use those variables +\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline + \else \the\evenheadline \fi}} +\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline + \else \the\evenfootline \fi}\HEADINGShook} +\let\HEADINGShook=\relax + +% Commands to set those variables. +% For example, this is what @headings on does +% @evenheading @thistitle|@thispage|@thischapter +% @oddheading @thischapter|@thispage|@thistitle +% @evenfooting @thisfile|| +% @oddfooting ||@thisfile + + +\def\evenheading{\parsearg\evenheadingxxx} +\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} +\def\evenheadingyyy #1\|#2\|#3\|#4\finish{% +\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddheading{\parsearg\oddheadingxxx} +\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} +\def\oddheadingyyy #1\|#2\|#3\|#4\finish{% +\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% + +\def\evenfooting{\parsearg\evenfootingxxx} +\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} +\def\evenfootingyyy #1\|#2\|#3\|#4\finish{% +\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddfooting{\parsearg\oddfootingxxx} +\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} +\def\oddfootingyyy #1\|#2\|#3\|#4\finish{% + \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% + % + % Leave some space for the footline. Hopefully ok to assume + % @evenfooting will not be used by itself. + \global\advance\pageheight by -12pt + \global\advance\vsize by -12pt +} + +\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} + +% @evenheadingmarks top \thischapter <- chapter at the top of a page +% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page +% +% The same set of arguments for: +% +% @oddheadingmarks +% @evenfootingmarks +% @oddfootingmarks +% @everyheadingmarks +% @everyfootingmarks + +\def\evenheadingmarks{\headingmarks{even}{heading}} +\def\oddheadingmarks{\headingmarks{odd}{heading}} +\def\evenfootingmarks{\headingmarks{even}{footing}} +\def\oddfootingmarks{\headingmarks{odd}{footing}} +\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} + \headingmarks{odd}{heading}{#1} } +\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} + \headingmarks{odd}{footing}{#1} } +% #1 = even/odd, #2 = heading/footing, #3 = top/bottom. +\def\headingmarks#1#2#3 {% + \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname + \global\expandafter\let\csname get#1#2marks\endcsname \temp +} + +\everyheadingmarks bottom +\everyfootingmarks bottom + +% @headings double turns headings on for double-sided printing. +% @headings single turns headings on for single-sided printing. +% @headings off turns them off. +% @headings on same as @headings double, retained for compatibility. +% @headings after turns on double-sided headings after this page. +% @headings doubleafter turns on double-sided headings after this page. +% @headings singleafter turns on single-sided headings after this page. +% By default, they are off at the start of a document, +% and turned `on' after @end titlepage. + +\def\headings #1 {\csname HEADINGS#1\endcsname} + +\def\headingsoff{% non-global headings elimination + \evenheadline={\hfil}\evenfootline={\hfil}% + \oddheadline={\hfil}\oddfootline={\hfil}% +} + +\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting +\HEADINGSoff % it's the default + +% When we turn headings on, set the page number to 1. +% For double-sided printing, put current file name in lower left corner, +% chapter name on inside top of right hand pages, document +% title on inside top of left hand pages, and page numbers on outside top +% edge of all pages. +\def\HEADINGSdouble{% +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} +\let\contentsalignmacro = \chappager + +% For single-sided printing, chapter title goes across top left of page, +% page number on top right. +\def\HEADINGSsingle{% +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} +\def\HEADINGSon{\HEADINGSdouble} + +\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} +\let\HEADINGSdoubleafter=\HEADINGSafter +\def\HEADINGSdoublex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} + +\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} +\def\HEADINGSsinglex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} + +% Subroutines used in generating headings +% This produces Day Month Year style of output. +% Only define if not already defined, in case a txi-??.tex file has set +% up a different format (e.g., txi-cs.tex does this). +\ifx\today\thisisundefined +\def\today{% + \number\day\space + \ifcase\month + \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr + \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug + \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec + \fi + \space\number\year} +\fi + +% @settitle line... specifies the title of the document, for headings. +% It generates no output of its own. +\def\thistitle{\putwordNoTitle} +\def\settitle{\parsearg{\gdef\thistitle}} + + +\message{tables,} +% Tables -- @table, @ftable, @vtable, @item(x). + +% default indentation of table text +\newdimen\tableindent \tableindent=.8in +% default indentation of @itemize and @enumerate text +\newdimen\itemindent \itemindent=.3in +% margin between end of table item and start of table text. +\newdimen\itemmargin \itemmargin=.1in + +% used internally for \itemindent minus \itemmargin +\newdimen\itemmax + +% Note @table, @ftable, and @vtable define @item, @itemx, etc., with +% these defs. +% They also define \itemindex +% to index the item name in whatever manner is desired (perhaps none). + +\newif\ifitemxneedsnegativevskip + +\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} + +\def\internalBitem{\smallbreak \parsearg\itemzzz} +\def\internalBitemx{\itemxpar \parsearg\itemzzz} + +\def\itemzzz #1{\begingroup % + \advance\hsize by -\rightskip + \advance\hsize by -\tableindent + \setbox0=\hbox{\itemindicate{#1}}% + \itemindex{#1}% + \nobreak % This prevents a break before @itemx. + % + % If the item text does not fit in the space we have, put it on a line + % by itself, and do not allow a page break either before or after that + % line. We do not start a paragraph here because then if the next + % command is, e.g., @kindex, the whatsit would get put into the + % horizontal list on a line by itself, resulting in extra blank space. + \ifdim \wd0>\itemmax + % + % Make this a paragraph so we get the \parskip glue and wrapping, + % but leave it ragged-right. + \begingroup + \advance\leftskip by-\tableindent + \advance\hsize by\tableindent + \advance\rightskip by0pt plus1fil\relax + \leavevmode\unhbox0\par + \endgroup + % + % We're going to be starting a paragraph, but we don't want the + % \parskip glue -- logically it's part of the @item we just started. + \nobreak \vskip-\parskip + % + % Stop a page break at the \parskip glue coming up. However, if + % what follows is an environment such as @example, there will be no + % \parskip glue; then the negative vskip we just inserted would + % cause the example and the item to crash together. So we use this + % bizarre value of 10001 as a signal to \aboveenvbreak to insert + % \parskip glue after all. Section titles are handled this way also. + % + \penalty 10001 + \endgroup + \itemxneedsnegativevskipfalse + \else + % The item text fits into the space. Start a paragraph, so that the + % following text (if any) will end up on the same line. + \noindent + % Do this with kerns and \unhbox so that if there is a footnote in + % the item text, it can migrate to the main vertical list and + % eventually be printed. + \nobreak\kern-\tableindent + \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 + \unhbox0 + \nobreak\kern\dimen0 + \endgroup + \itemxneedsnegativevskiptrue + \fi +} + +\def\item{\errmessage{@item while not in a list environment}} +\def\itemx{\errmessage{@itemx while not in a list environment}} + +% @table, @ftable, @vtable. +\envdef\table{% + \let\itemindex\gobble + \tablecheck{table}% +} +\envdef\ftable{% + \def\itemindex ##1{\doind {fn}{\code{##1}}}% + \tablecheck{ftable}% +} +\envdef\vtable{% + \def\itemindex ##1{\doind {vr}{\code{##1}}}% + \tablecheck{vtable}% +} +\def\tablecheck#1{% + \ifnum \the\catcode`\^^M=\active + \endgroup + \errmessage{This command won't work in this context; perhaps the problem is + that we are \inenvironment\thisenv}% + \def\next{\doignore{#1}}% + \else + \let\next\tablex + \fi + \next +} +\def\tablex#1{% + \def\itemindicate{#1}% + \parsearg\tabley +} +\def\tabley#1{% + {% + \makevalueexpandable + \edef\temp{\noexpand\tablez #1\space\space\space}% + \expandafter + }\temp \endtablez +} +\def\tablez #1 #2 #3 #4\endtablez{% + \aboveenvbreak + \ifnum 0#1>0 \advance \leftskip by #1\mil \fi + \ifnum 0#2>0 \tableindent=#2\mil \fi + \ifnum 0#3>0 \advance \rightskip by #3\mil \fi + \itemmax=\tableindent + \advance \itemmax by -\itemmargin + \advance \leftskip by \tableindent + \exdentamount=\tableindent + \parindent = 0pt + \parskip = \smallskipamount + \ifdim \parskip=0pt \parskip=2pt \fi + \let\item = \internalBitem + \let\itemx = \internalBitemx +} +\def\Etable{\endgraf\afterenvbreak} +\let\Eftable\Etable +\let\Evtable\Etable +\let\Eitemize\Etable +\let\Eenumerate\Etable + +% This is the counter used by @enumerate, which is really @itemize + +\newcount \itemno + +\envdef\itemize{\parsearg\doitemize} + +\def\doitemize#1{% + \aboveenvbreak + \itemmax=\itemindent + \advance\itemmax by -\itemmargin + \advance\leftskip by \itemindent + \exdentamount=\itemindent + \parindent=0pt + \parskip=\smallskipamount + \ifdim\parskip=0pt \parskip=2pt \fi + % + % Try typesetting the item mark that if the document erroneously says + % something like @itemize @samp (intending @table), there's an error + % right away at the @itemize. It's not the best error message in the + % world, but it's better than leaving it to the @item. This means if + % the user wants an empty mark, they have to say @w{} not just @w. + \def\itemcontents{#1}% + \setbox0 = \hbox{\itemcontents}% + % + % @itemize with no arg is equivalent to @itemize @bullet. + \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi + % + \let\item=\itemizeitem +} + +% Definition of @item while inside @itemize and @enumerate. +% +\def\itemizeitem{% + \advance\itemno by 1 % for enumerations + {\let\par=\endgraf \smallbreak}% reasonable place to break + {% + % If the document has an @itemize directly after a section title, a + % \nobreak will be last on the list, and \sectionheading will have + % done a \vskip-\parskip. In that case, we don't want to zero + % parskip, or the item text will crash with the heading. On the + % other hand, when there is normal text preceding the item (as there + % usually is), we do want to zero parskip, or there would be too much + % space. In that case, we won't have a \nobreak before. At least + % that's the theory. + \ifnum\lastpenalty<10000 \parskip=0in \fi + \noindent + \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% + % + \vadjust{\penalty 1200}}% not good to break after first line of item. + \flushcr +} + +% \splitoff TOKENS\endmark defines \first to be the first token in +% TOKENS, and \rest to be the remainder. +% +\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% + +% Allow an optional argument of an uppercase letter, lowercase letter, +% or number, to specify the first label in the enumerated list. No +% argument is the same as `1'. +% +\envparseargdef\enumerate{\enumeratey #1 \endenumeratey} +\def\enumeratey #1 #2\endenumeratey{% + % If we were given no argument, pretend we were given `1'. + \def\thearg{#1}% + \ifx\thearg\empty \def\thearg{1}\fi + % + % Detect if the argument is a single token. If so, it might be a + % letter. Otherwise, the only valid thing it can be is a number. + % (We will always have one token, because of the test we just made. + % This is a good thing, since \splitoff doesn't work given nothing at + % all -- the first parameter is undelimited.) + \expandafter\splitoff\thearg\endmark + \ifx\rest\empty + % Only one token in the argument. It could still be anything. + % A ``lowercase letter'' is one whose \lccode is nonzero. + % An ``uppercase letter'' is one whose \lccode is both nonzero, and + % not equal to itself. + % Otherwise, we assume it's a number. + % + % We need the \relax at the end of the \ifnum lines to stop TeX from + % continuing to look for a . + % + \ifnum\lccode\expandafter`\thearg=0\relax + \numericenumerate % a number (we hope) + \else + % It's a letter. + \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax + \lowercaseenumerate % lowercase letter + \else + \uppercaseenumerate % uppercase letter + \fi + \fi + \else + % Multiple tokens in the argument. We hope it's a number. + \numericenumerate + \fi +} + +% An @enumerate whose labels are integers. The starting integer is +% given in \thearg. +% +\def\numericenumerate{% + \itemno = \thearg + \startenumeration{\the\itemno}% +} + +% The starting (lowercase) letter is in \thearg. +\def\lowercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more lowercase letters in @enumerate; get a bigger + alphabet}% + \fi + \char\lccode\itemno + }% +} + +% The starting (uppercase) letter is in \thearg. +\def\uppercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more uppercase letters in @enumerate; get a bigger + alphabet} + \fi + \char\uccode\itemno + }% +} + +% Call \doitemize, adding a period to the first argument and supplying the +% common last two arguments. Also subtract one from the initial value in +% \itemno, since @item increments \itemno. +% +\def\startenumeration#1{% + \advance\itemno by -1 + \doitemize{#1.}\flushcr +} + +% @alphaenumerate and @capsenumerate are abbreviations for giving an arg +% to @enumerate. +% +\def\alphaenumerate{\enumerate{a}} +\def\capsenumerate{\enumerate{A}} +\def\Ealphaenumerate{\Eenumerate} +\def\Ecapsenumerate{\Eenumerate} + + +% @multitable macros +% Amy Hendrickson, 8/18/94, 3/6/96 +% +% @multitable ... @end multitable will make as many columns as desired. +% Contents of each column will wrap at width given in preamble. Width +% can be specified either with sample text given in a template line, +% or in percent of \hsize, the current width of text on page. + +% Table can continue over pages but will only break between lines. + +% To make preamble: +% +% Either define widths of columns in terms of percent of \hsize: +% @multitable @columnfractions .25 .3 .45 +% @item ... +% +% Numbers following @columnfractions are the percent of the total +% current hsize to be used for each column. You may use as many +% columns as desired. + + +% Or use a template: +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item ... +% using the widest term desired in each column. + +% Each new table line starts with @item, each subsequent new column +% starts with @tab. Empty columns may be produced by supplying @tab's +% with nothing between them for as many times as empty columns are needed, +% ie, @tab@tab@tab will produce two empty columns. + +% @item, @tab do not need to be on their own lines, but it will not hurt +% if they are. + +% Sample multitable: + +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item first col stuff @tab second col stuff @tab third col +% @item +% first col stuff +% @tab +% second col stuff +% @tab +% third col +% @item first col stuff @tab second col stuff +% @tab Many paragraphs of text may be used in any column. +% +% They will wrap at the width determined by the template. +% @item@tab@tab This will be in third column. +% @end multitable + +% Default dimensions may be reset by user. +% @multitableparskip is vertical space between paragraphs in table. +% @multitableparindent is paragraph indent in table. +% @multitablecolmargin is horizontal space to be left between columns. +% @multitablelinespace is space to leave between table items, baseline +% to baseline. +% 0pt means it depends on current normal line spacing. +% +\newskip\multitableparskip +\newskip\multitableparindent +\newdimen\multitablecolspace +\newskip\multitablelinespace +\multitableparskip=0pt +\multitableparindent=6pt +\multitablecolspace=12pt +\multitablelinespace=0pt + +% Macros used to set up halign preamble: +% +\let\endsetuptable\relax +\def\xendsetuptable{\endsetuptable} +\let\columnfractions\relax +\def\xcolumnfractions{\columnfractions} +\newif\ifsetpercent + +% #1 is the @columnfraction, usually a decimal number like .5, but might +% be just 1. We just use it, whatever it is. +% +\def\pickupwholefraction#1 {% + \global\advance\colcount by 1 + \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% + \setuptable +} + +\newcount\colcount +\def\setuptable#1{% + \def\firstarg{#1}% + \ifx\firstarg\xendsetuptable + \let\go = \relax + \else + \ifx\firstarg\xcolumnfractions + \global\setpercenttrue + \else + \ifsetpercent + \let\go\pickupwholefraction + \else + \global\advance\colcount by 1 + \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a + % separator; typically that is always in the input, anyway. + \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% + \fi + \fi + \ifx\go\pickupwholefraction + % Put the argument back for the \pickupwholefraction call, so + % we'll always have a period there to be parsed. + \def\go{\pickupwholefraction#1}% + \else + \let\go = \setuptable + \fi% + \fi + \go +} + +% multitable-only commands. +% +% @headitem starts a heading row, which we typeset in bold. +% Assignments have to be global since we are inside the implicit group +% of an alignment entry. \everycr resets \everytab so we don't have to +% undo it ourselves. +\def\headitemfont{\b}% for people to use in the template row; not changeable +\def\headitem{% + \checkenv\multitable + \crcr + \global\everytab={\bf}% can't use \headitemfont since the parsing differs + \the\everytab % for the first item +}% +% +% A \tab used to include \hskip1sp. But then the space in a template +% line is not enough. That is bad. So let's go back to just `&' until +% we again encounter the problem the 1sp was intended to solve. +% --karl, nathan@acm.org, 20apr99. +\def\tab{\checkenv\multitable &\the\everytab}% + +% @multitable ... @end multitable definitions: +% +\newtoks\everytab % insert after every tab. +% +\envdef\multitable{% + \vskip\parskip + \startsavinginserts + % + % @item within a multitable starts a normal row. + % We use \def instead of \let so that if one of the multitable entries + % contains an @itemize, we don't choke on the \item (seen as \crcr aka + % \endtemplate) expanding \doitemize. + \def\item{\crcr}% + % + \tolerance=9500 + \hbadness=9500 + \setmultitablespacing + \parskip=\multitableparskip + \parindent=\multitableparindent + \overfullrule=0pt + \global\colcount=0 + % + \everycr = {% + \noalign{% + \global\everytab={}% + \global\colcount=0 % Reset the column counter. + % Check for saved footnotes, etc. + \checkinserts + % Keeps underfull box messages off when table breaks over pages. + %\filbreak + % Maybe so, but it also creates really weird page breaks when the + % table breaks over pages. Wouldn't \vfil be better? Wait until the + % problem manifests itself, so it can be fixed for real --karl. + }% + }% + % + \parsearg\domultitable +} +\def\domultitable#1{% + % To parse everything between @multitable and @item: + \setuptable#1 \endsetuptable + % + % This preamble sets up a generic column definition, which will + % be used as many times as user calls for columns. + % \vtop will set a single line and will also let text wrap and + % continue for many paragraphs if desired. + \halign\bgroup &% + \global\advance\colcount by 1 + \multistrut + \vtop{% + % Use the current \colcount to find the correct column width: + \hsize=\expandafter\csname col\the\colcount\endcsname + % + % In order to keep entries from bumping into each other + % we will add a \leftskip of \multitablecolspace to all columns after + % the first one. + % + % If a template has been used, we will add \multitablecolspace + % to the width of each template entry. + % + % If the user has set preamble in terms of percent of \hsize we will + % use that dimension as the width of the column, and the \leftskip + % will keep entries from bumping into each other. Table will start at + % left margin and final column will justify at right margin. + % + % Make sure we don't inherit \rightskip from the outer environment. + \rightskip=0pt + \ifnum\colcount=1 + % The first column will be indented with the surrounding text. + \advance\hsize by\leftskip + \else + \ifsetpercent \else + % If user has not set preamble in terms of percent of \hsize + % we will advance \hsize by \multitablecolspace. + \advance\hsize by \multitablecolspace + \fi + % In either case we will make \leftskip=\multitablecolspace: + \leftskip=\multitablecolspace + \fi + % Ignoring space at the beginning and end avoids an occasional spurious + % blank line, when TeX decides to break the line at the space before the + % box from the multistrut, so the strut ends up on a line by itself. + % For example: + % @multitable @columnfractions .11 .89 + % @item @code{#} + % @tab Legal holiday which is valid in major parts of the whole country. + % Is automatically provided with highlighting sequences respectively + % marking characters. + \noindent\ignorespaces##\unskip\multistrut + }\cr +} +\def\Emultitable{% + \crcr + \egroup % end the \halign + \global\setpercentfalse +} + +\def\setmultitablespacing{% + \def\multistrut{\strut}% just use the standard line spacing + % + % Compute \multitablelinespace (if not defined by user) for use in + % \multitableparskip calculation. We used define \multistrut based on + % this, but (ironically) that caused the spacing to be off. + % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. +\ifdim\multitablelinespace=0pt +\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip +\global\advance\multitablelinespace by-\ht0 +\fi +% Test to see if parskip is larger than space between lines of +% table. If not, do nothing. +% If so, set to same dimension as multitablelinespace. +\ifdim\multitableparskip>\multitablelinespace +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller + % than skip between lines in the table. +\fi% +\ifdim\multitableparskip=0pt +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller + % than skip between lines in the table. +\fi} + + +\message{conditionals,} + +% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, +% @ifnotxml always succeed. They currently do nothing; we don't +% attempt to check whether the conditionals are properly nested. But we +% have to remember that they are conditionals, so that @end doesn't +% attempt to close an environment group. +% +\def\makecond#1{% + \expandafter\let\csname #1\endcsname = \relax + \expandafter\let\csname iscond.#1\endcsname = 1 +} +\makecond{iftex} +\makecond{ifnotdocbook} +\makecond{ifnothtml} +\makecond{ifnotinfo} +\makecond{ifnotplaintext} +\makecond{ifnotxml} + +% Ignore @ignore, @ifhtml, @ifinfo, and the like. +% +\def\direntry{\doignore{direntry}} +\def\documentdescription{\doignore{documentdescription}} +\def\docbook{\doignore{docbook}} +\def\html{\doignore{html}} +\def\ifdocbook{\doignore{ifdocbook}} +\def\ifhtml{\doignore{ifhtml}} +\def\ifinfo{\doignore{ifinfo}} +\def\ifnottex{\doignore{ifnottex}} +\def\ifplaintext{\doignore{ifplaintext}} +\def\ifxml{\doignore{ifxml}} +\def\ignore{\doignore{ignore}} +\def\menu{\doignore{menu}} +\def\xml{\doignore{xml}} + +% Ignore text until a line `@end #1', keeping track of nested conditionals. +% +% A count to remember the depth of nesting. +\newcount\doignorecount + +\def\doignore#1{\begingroup + % Scan in ``verbatim'' mode: + \obeylines + \catcode`\@ = \other + \catcode`\{ = \other + \catcode`\} = \other + % + % Make sure that spaces turn into tokens that match what \doignoretext wants. + \spaceisspace + % + % Count number of #1's that we've seen. + \doignorecount = 0 + % + % Swallow text until we reach the matching `@end #1'. + \dodoignore{#1}% +} + +{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. + \obeylines % + % + \gdef\dodoignore#1{% + % #1 contains the command name as a string, e.g., `ifinfo'. + % + % Define a command to find the next `@end #1'. + \long\def\doignoretext##1^^M@end #1{% + \doignoretextyyy##1^^M@#1\_STOP_}% + % + % And this command to find another #1 command, at the beginning of a + % line. (Otherwise, we would consider a line `@c @ifset', for + % example, to count as an @ifset for nesting.) + \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% + % + % And now expand that command. + \doignoretext ^^M% + }% +} + +\def\doignoreyyy#1{% + \def\temp{#1}% + \ifx\temp\empty % Nothing found. + \let\next\doignoretextzzz + \else % Found a nested condition, ... + \advance\doignorecount by 1 + \let\next\doignoretextyyy % ..., look for another. + % If we're here, #1 ends with ^^M\ifinfo (for example). + \fi + \next #1% the token \_STOP_ is present just after this macro. +} + +% We have to swallow the remaining "\_STOP_". +% +\def\doignoretextzzz#1{% + \ifnum\doignorecount = 0 % We have just found the outermost @end. + \let\next\enddoignore + \else % Still inside a nested condition. + \advance\doignorecount by -1 + \let\next\doignoretext % Look for the next @end. + \fi + \next +} + +% Finish off ignored text. +{ \obeylines% + % Ignore anything after the last `@end #1'; this matters in verbatim + % environments, where otherwise the newline after an ignored conditional + % would result in a blank line in the output. + \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% +} + + +% @set VAR sets the variable VAR to an empty value. +% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. +% +% Since we want to separate VAR from REST-OF-LINE (which might be +% empty), we can't just use \parsearg; we have to insert a space of our +% own to delimit the rest of the line, and then take it out again if we +% didn't need it. +% We rely on the fact that \parsearg sets \catcode`\ =10. +% +\parseargdef\set{\setyyy#1 \endsetyyy} +\def\setyyy#1 #2\endsetyyy{% + {% + \makevalueexpandable + \def\temp{#2}% + \edef\next{\gdef\makecsname{SET#1}}% + \ifx\temp\empty + \next{}% + \else + \setzzz#2\endsetzzz + \fi + }% +} +% Remove the trailing space \setxxx inserted. +\def\setzzz#1 \endsetzzz{\next{#1}} + +% @clear VAR clears (i.e., unsets) the variable VAR. +% +\parseargdef\clear{% + {% + \makevalueexpandable + \global\expandafter\let\csname SET#1\endcsname=\relax + }% +} + +% @value{foo} gets the text saved in variable foo. +\def\value{\begingroup\makevalueexpandable\valuexxx} +\def\valuexxx#1{\expandablevalue{#1}\endgroup} +{ + \catcode`\- = \active \catcode`\_ = \active + % + \gdef\makevalueexpandable{% + \let\value = \expandablevalue + % We don't want these characters active, ... + \catcode`\-=\other \catcode`\_=\other + % ..., but we might end up with active ones in the argument if + % we're called from @code, as @code{@value{foo-bar_}}, though. + % So \let them to their normal equivalents. + \let-\normaldash \let_\normalunderscore + } +} + +% We have this subroutine so that we can handle at least some @value's +% properly in indexes (we call \makevalueexpandable in \indexdummies). +% The command has to be fully expandable (if the variable is set), since +% the result winds up in the index file. This means that if the +% variable's value contains other Texinfo commands, it's almost certain +% it will fail (although perhaps we could fix that with sufficient work +% to do a one-level expansion on the result, instead of complete). +% +\def\expandablevalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + {[No value for ``#1'']}% + \message{Variable `#1', used in @value, is not set.}% + \else + \csname SET#1\endcsname + \fi +} + +% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined +% with @set. +% +% To get special treatment of `@end ifset,' call \makeond and the redefine. +% +\makecond{ifset} +\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} +\def\doifset#1#2{% + {% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname SET#2\endcsname\relax + #1% If not set, redefine \next. + \fi + \expandafter + }\next +} +\def\ifsetfail{\doignore{ifset}} + +% @ifclear VAR ... @end executes the `...' iff VAR has never been +% defined with @set, or has been undefined with @clear. +% +% The `\else' inside the `\doifset' parameter is a trick to reuse the +% above code: if the variable is not set, do nothing, if it is set, +% then redefine \next to \ifclearfail. +% +\makecond{ifclear} +\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} +\def\ifclearfail{\doignore{ifclear}} + +% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written +% without the @) is in fact defined. We can only feasibly check at the +% TeX level, so something like `mathcode' is going to considered +% defined even though it is not a Texinfo command. +% +\makecond{ifcommanddefined} +\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} +% +\def\doifcmddefined#1#2{{% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname #2\endcsname\relax + #1% If not defined, \let\next as above. + \fi + \expandafter + }\next +} +\def\ifcmddefinedfail{\doignore{ifcommanddefined}} + +% @ifcommandnotdefined CMD ... handled similar to @ifclear above. +\makecond{ifcommandnotdefined} +\def\ifcommandnotdefined{% + \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}} +\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}} + +% Set the `txicommandconditionals' variable, so documents have a way to +% test if the @ifcommand...defined conditionals are available. +\set txicommandconditionals + +% @dircategory CATEGORY -- specify a category of the dir file +% which this file should belong to. Ignore this in TeX. +\let\dircategory=\comment + +% @defininfoenclose. +\let\definfoenclose=\comment + + +\message{indexing,} +% Index generation facilities + +% Define \newwrite to be identical to plain tex's \newwrite +% except not \outer, so it can be used within macros and \if's. +\edef\newwrite{\makecsname{ptexnewwrite}} + +% \newindex {foo} defines an index named foo. +% It automatically defines \fooindex such that +% \fooindex ...rest of line... puts an entry in the index foo. +% It also defines \fooindfile to be the number of the output channel for +% the file that accumulates this index. The file's extension is foo. +% The name of an index should be no more than 2 characters long +% for the sake of vms. +% +\def\newindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 % Open the file + \fi + \expandafter\xdef\csname#1index\endcsname{% % Define @#1index + \noexpand\doindex{#1}} +} + +% @defindex foo == \newindex{foo} +% +\def\defindex{\parsearg\newindex} + +% Define @defcodeindex, like @defindex except put all entries in @code. +% +\def\defcodeindex{\parsearg\newcodeindex} +% +\def\newcodeindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 + \fi + \expandafter\xdef\csname#1index\endcsname{% + \noexpand\docodeindex{#1}}% +} + + +% @synindex foo bar makes index foo feed into index bar. +% Do this instead of @defindex foo if you don't want it as a separate index. +% +% @syncodeindex foo bar similar, but put all entries made for index foo +% inside @code. +% +\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} +\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} + +% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), +% #3 the target index (bar). +\def\dosynindex#1#2#3{% + % Only do \closeout if we haven't already done it, else we'll end up + % closing the target index. + \expandafter \ifx\csname donesynindex#2\endcsname \relax + % The \closeout helps reduce unnecessary open files; the limit on the + % Acorn RISC OS is a mere 16 files. + \expandafter\closeout\csname#2indfile\endcsname + \expandafter\let\csname donesynindex#2\endcsname = 1 + \fi + % redefine \fooindfile: + \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname + \expandafter\let\csname#2indfile\endcsname=\temp + % redefine \fooindex: + \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% +} + +% Define \doindex, the driver for all \fooindex macros. +% Argument #1 is generated by the calling \fooindex macro, +% and it is "foo", the name of the index. + +% \doindex just uses \parsearg; it calls \doind for the actual work. +% This is because \doind is more useful to call from other macros. + +% There is also \dosubind {index}{topic}{subtopic} +% which makes an entry in a two-level index such as the operation index. + +\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} +\def\singleindexer #1{\doind{\indexname}{#1}} + +% like the previous two, but they put @code around the argument. +\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} +\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} + +% Take care of Texinfo commands that can appear in an index entry. +% Since there are some commands we want to expand, and others we don't, +% we have to laboriously prevent expansion for those that we don't. +% +\def\indexdummies{% + \escapechar = `\\ % use backslash in output files. + \def\@{@}% change to @@ when we switch to @ as escape char in index files. + \def\ {\realbackslash\space }% + % + % Need these unexpandable (because we define \tt as a dummy) + % definitions when @{ or @} appear in index entry text. Also, more + % complicated, when \tex is in effect and \{ is a \delimiter again. + % We can't use \lbracecmd and \rbracecmd because texindex assumes + % braces and backslashes are used only as delimiters. Perhaps we + % should define @lbrace and @rbrace commands a la @comma. + \def\{{{\tt\char123}}% + \def\}{{\tt\char125}}% + % + % I don't entirely understand this, but when an index entry is + % generated from a macro call, the \endinput which \scanmacro inserts + % causes processing to be prematurely terminated. This is, + % apparently, because \indexsorttmp is fully expanded, and \endinput + % is an expandable command. The redefinition below makes \endinput + % disappear altogether for that purpose -- although logging shows that + % processing continues to some further point. On the other hand, it + % seems \endinput does not hurt in the printed index arg, since that + % is still getting written without apparent harm. + % + % Sample source (mac-idx3.tex, reported by Graham Percival to + % help-texinfo, 22may06): + % @macro funindex {WORD} + % @findex xyz + % @end macro + % ... + % @funindex commtest + % + % The above is not enough to reproduce the bug, but it gives the flavor. + % + % Sample whatsit resulting: + % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} + % + % So: + \let\endinput = \empty + % + % Do the redefinitions. + \commondummies +} + +% For the aux and toc files, @ is the escape character. So we want to +% redefine everything using @ as the escape character (instead of +% \realbackslash, still used for index files). When everything uses @, +% this will be simpler. +% +\def\atdummies{% + \def\@{@@}% + \def\ {@ }% + \let\{ = \lbraceatcmd + \let\} = \rbraceatcmd + % + % Do the redefinitions. + \commondummies + \otherbackslash +} + +% Called from \indexdummies and \atdummies. +% +\def\commondummies{% + % + % \definedummyword defines \#1 as \string\#1\space, thus effectively + % preventing its expansion. This is used only for control words, + % not control letters, because the \space would be incorrect for + % control characters, but is needed to separate the control word + % from whatever follows. + % + % For control letters, we have \definedummyletter, which omits the + % space. + % + % These can be used both for control words that take an argument and + % those that do not. If it is followed by {arg} in the input, then + % that will dutifully get written to the index (or wherever). + % + \def\definedummyword ##1{\def##1{\string##1\space}}% + \def\definedummyletter##1{\def##1{\string##1}}% + \let\definedummyaccent\definedummyletter + % + \commondummiesnofonts + % + \definedummyletter\_% + \definedummyletter\-% + % + % Non-English letters. + \definedummyword\AA + \definedummyword\AE + \definedummyword\DH + \definedummyword\L + \definedummyword\O + \definedummyword\OE + \definedummyword\TH + \definedummyword\aa + \definedummyword\ae + \definedummyword\dh + \definedummyword\exclamdown + \definedummyword\l + \definedummyword\o + \definedummyword\oe + \definedummyword\ordf + \definedummyword\ordm + \definedummyword\questiondown + \definedummyword\ss + \definedummyword\th + % + % Although these internal commands shouldn't show up, sometimes they do. + \definedummyword\bf + \definedummyword\gtr + \definedummyword\hat + \definedummyword\less + \definedummyword\sf + \definedummyword\sl + \definedummyword\tclose + \definedummyword\tt + % + \definedummyword\LaTeX + \definedummyword\TeX + % + % Assorted special characters. + \definedummyword\arrow + \definedummyword\bullet + \definedummyword\comma + \definedummyword\copyright + \definedummyword\registeredsymbol + \definedummyword\dots + \definedummyword\enddots + \definedummyword\entrybreak + \definedummyword\equiv + \definedummyword\error + \definedummyword\euro + \definedummyword\expansion + \definedummyword\geq + \definedummyword\guillemetleft + \definedummyword\guillemetright + \definedummyword\guilsinglleft + \definedummyword\guilsinglright + \definedummyword\lbracechar + \definedummyword\leq + \definedummyword\minus + \definedummyword\ogonek + \definedummyword\pounds + \definedummyword\point + \definedummyword\print + \definedummyword\quotedblbase + \definedummyword\quotedblleft + \definedummyword\quotedblright + \definedummyword\quoteleft + \definedummyword\quoteright + \definedummyword\quotesinglbase + \definedummyword\rbracechar + \definedummyword\result + \definedummyword\textdegree + % + % We want to disable all macros so that they are not expanded by \write. + \macrolist + % + \normalturnoffactive + % + % Handle some cases of @value -- where it does not contain any + % (non-fully-expandable) commands. + \makevalueexpandable +} + +% \commondummiesnofonts: common to \commondummies and \indexnofonts. +% +\def\commondummiesnofonts{% + % Control letters and accents. + \definedummyletter\!% + \definedummyaccent\"% + \definedummyaccent\'% + \definedummyletter\*% + \definedummyaccent\,% + \definedummyletter\.% + \definedummyletter\/% + \definedummyletter\:% + \definedummyaccent\=% + \definedummyletter\?% + \definedummyaccent\^% + \definedummyaccent\`% + \definedummyaccent\~% + \definedummyword\u + \definedummyword\v + \definedummyword\H + \definedummyword\dotaccent + \definedummyword\ogonek + \definedummyword\ringaccent + \definedummyword\tieaccent + \definedummyword\ubaraccent + \definedummyword\udotaccent + \definedummyword\dotless + % + % Texinfo font commands. + \definedummyword\b + \definedummyword\i + \definedummyword\r + \definedummyword\sansserif + \definedummyword\sc + \definedummyword\slanted + \definedummyword\t + % + % Commands that take arguments. + \definedummyword\abbr + \definedummyword\acronym + \definedummyword\anchor + \definedummyword\cite + \definedummyword\code + \definedummyword\command + \definedummyword\dfn + \definedummyword\dmn + \definedummyword\email + \definedummyword\emph + \definedummyword\env + \definedummyword\file + \definedummyword\image + \definedummyword\indicateurl + \definedummyword\inforef + \definedummyword\kbd + \definedummyword\key + \definedummyword\math + \definedummyword\option + \definedummyword\pxref + \definedummyword\ref + \definedummyword\samp + \definedummyword\strong + \definedummyword\tie + \definedummyword\uref + \definedummyword\url + \definedummyword\var + \definedummyword\verb + \definedummyword\w + \definedummyword\xref +} + +% \indexnofonts is used when outputting the strings to sort the index +% by, and when constructing control sequence names. It eliminates all +% control sequences and just writes whatever the best ASCII sort string +% would be for a given command (usually its argument). +% +\def\indexnofonts{% + % Accent commands should become @asis. + \def\definedummyaccent##1{\let##1\asis}% + % We can just ignore other control letters. + \def\definedummyletter##1{\let##1\empty}% + % All control words become @asis by default; overrides below. + \let\definedummyword\definedummyaccent + % + \commondummiesnofonts + % + % Don't no-op \tt, since it isn't a user-level command + % and is used in the definitions of the active chars like <, >, |, etc. + % Likewise with the other plain tex font commands. + %\let\tt=\asis + % + \def\ { }% + \def\@{@}% + \def\_{\normalunderscore}% + \def\-{}% @- shouldn't affect sorting + % + % Unfortunately, texindex is not prepared to handle braces in the + % content at all. So for index sorting, we map @{ and @} to strings + % starting with |, since that ASCII character is between ASCII { and }. + \def\{{|a}% + \def\lbracechar{|a}% + % + \def\}{|b}% + \def\rbracechar{|b}% + % + % Non-English letters. + \def\AA{AA}% + \def\AE{AE}% + \def\DH{DZZ}% + \def\L{L}% + \def\OE{OE}% + \def\O{O}% + \def\TH{ZZZ}% + \def\aa{aa}% + \def\ae{ae}% + \def\dh{dzz}% + \def\exclamdown{!}% + \def\l{l}% + \def\oe{oe}% + \def\ordf{a}% + \def\ordm{o}% + \def\o{o}% + \def\questiondown{?}% + \def\ss{ss}% + \def\th{zzz}% + % + \def\LaTeX{LaTeX}% + \def\TeX{TeX}% + % + % Assorted special characters. + % (The following {} will end up in the sort string, but that's ok.) + \def\arrow{->}% + \def\bullet{bullet}% + \def\comma{,}% + \def\copyright{copyright}% + \def\dots{...}% + \def\enddots{...}% + \def\equiv{==}% + \def\error{error}% + \def\euro{euro}% + \def\expansion{==>}% + \def\geq{>=}% + \def\guillemetleft{<<}% + \def\guillemetright{>>}% + \def\guilsinglleft{<}% + \def\guilsinglright{>}% + \def\leq{<=}% + \def\minus{-}% + \def\point{.}% + \def\pounds{pounds}% + \def\print{-|}% + \def\quotedblbase{"}% + \def\quotedblleft{"}% + \def\quotedblright{"}% + \def\quoteleft{`}% + \def\quoteright{'}% + \def\quotesinglbase{,}% + \def\registeredsymbol{R}% + \def\result{=>}% + \def\textdegree{o}% + % + \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax + \else \indexlquoteignore \fi + % + % We need to get rid of all macros, leaving only the arguments (if present). + % Of course this is not nearly correct, but it is the best we can do for now. + % makeinfo does not expand macros in the argument to @deffn, which ends up + % writing an index entry, and texindex isn't prepared for an index sort entry + % that starts with \. + % + % Since macro invocations are followed by braces, we can just redefine them + % to take a single TeX argument. The case of a macro invocation that + % goes to end-of-line is not handled. + % + \macrolist +} + +% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us +% ignore left quotes in the sort term. +{\catcode`\`=\active + \gdef\indexlquoteignore{\let`=\empty}} + +\let\indexbackslash=0 %overridden during \printindex. +\let\SETmarginindex=\relax % put index entries in margin (undocumented)? + +% Most index entries go through here, but \dosubind is the general case. +% #1 is the index name, #2 is the entry text. +\def\doind#1#2{\dosubind{#1}{#2}{}} + +% Workhorse for all \fooindexes. +% #1 is name of index, #2 is stuff to put there, #3 is subentry -- +% empty if called from \doind, as we usually are (the main exception +% is with most defuns, which call us directly). +% +\def\dosubind#1#2#3{% + \iflinks + {% + % Store the main index entry text (including the third arg). + \toks0 = {#2}% + % If third arg is present, precede it with a space. + \def\thirdarg{#3}% + \ifx\thirdarg\empty \else + \toks0 = \expandafter{\the\toks0 \space #3}% + \fi + % + \edef\writeto{\csname#1indfile\endcsname}% + % + \safewhatsit\dosubindwrite + }% + \fi +} + +% Write the entry in \toks0 to the index file: +% +\def\dosubindwrite{% + % Put the index entry in the margin if desired. + \ifx\SETmarginindex\relax\else + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% + \fi + % + % Remember, we are within a group. + \indexdummies % Must do this here, since \bf, etc expand at this stage + \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now + % so it will be output as is; and it will print as backslash. + % + % Process the index entry with all font commands turned off, to + % get the string to sort by. + {\indexnofonts + \edef\temp{\the\toks0}% need full expansion + \xdef\indexsorttmp{\temp}% + }% + % + % Set up the complete index entry, with both the sort key and + % the original text, including any font commands. We write + % three arguments to \entry to the .?? file (four in the + % subentry case), texindex reduces to two when writing the .??s + % sorted result. + \edef\temp{% + \write\writeto{% + \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% + }% + \temp +} + +% Take care of unwanted page breaks/skips around a whatsit: +% +% If a skip is the last thing on the list now, preserve it +% by backing up by \lastskip, doing the \write, then inserting +% the skip again. Otherwise, the whatsit generated by the +% \write or \pdfdest will make \lastskip zero. The result is that +% sequences like this: +% @end defun +% @tindex whatever +% @defun ... +% will have extra space inserted, because the \medbreak in the +% start of the @defun won't see the skip inserted by the @end of +% the previous defun. +% +% But don't do any of this if we're not in vertical mode. We +% don't want to do a \vskip and prematurely end a paragraph. +% +% Avoid page breaks due to these extra skips, too. +% +% But wait, there is a catch there: +% We'll have to check whether \lastskip is zero skip. \ifdim is not +% sufficient for this purpose, as it ignores stretch and shrink parts +% of the skip. The only way seems to be to check the textual +% representation of the skip. +% +% The following is almost like \def\zeroskipmacro{0.0pt} except that +% the ``p'' and ``t'' characters have catcode \other, not 11 (letter). +% +\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} +% +\newskip\whatsitskip +\newcount\whatsitpenalty +% +% ..., ready, GO: +% +\def\safewhatsit#1{\ifhmode + #1% + \else + % \lastskip and \lastpenalty cannot both be nonzero simultaneously. + \whatsitskip = \lastskip + \edef\lastskipmacro{\the\lastskip}% + \whatsitpenalty = \lastpenalty + % + % If \lastskip is nonzero, that means the last item was a + % skip. And since a skip is discardable, that means this + % -\whatsitskip glue we're inserting is preceded by a + % non-discardable item, therefore it is not a potential + % breakpoint, therefore no \nobreak needed. + \ifx\lastskipmacro\zeroskipmacro + \else + \vskip-\whatsitskip + \fi + % + #1% + % + \ifx\lastskipmacro\zeroskipmacro + % If \lastskip was zero, perhaps the last item was a penalty, and + % perhaps it was >=10000, e.g., a \nobreak. In that case, we want + % to re-insert the same penalty (values >10000 are used for various + % signals); since we just inserted a non-discardable item, any + % following glue (such as a \parskip) would be a breakpoint. For example: + % @deffn deffn-whatever + % @vindex index-whatever + % Description. + % would allow a break between the index-whatever whatsit + % and the "Description." paragraph. + \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi + \else + % On the other hand, if we had a nonzero \lastskip, + % this make-up glue would be preceded by a non-discardable item + % (the whatsit from the \write), so we must insert a \nobreak. + \nobreak\vskip\whatsitskip + \fi +\fi} + +% The index entry written in the file actually looks like +% \entry {sortstring}{page}{topic} +% or +% \entry {sortstring}{page}{topic}{subtopic} +% The texindex program reads in these files and writes files +% containing these kinds of lines: +% \initial {c} +% before the first topic whose initial is c +% \entry {topic}{pagelist} +% for a topic that is used without subtopics +% \primary {topic} +% for the beginning of a topic that is used with subtopics +% \secondary {subtopic}{pagelist} +% for each subtopic. + +% Define the user-accessible indexing commands +% @findex, @vindex, @kindex, @cindex. + +\def\findex {\fnindex} +\def\kindex {\kyindex} +\def\cindex {\cpindex} +\def\vindex {\vrindex} +\def\tindex {\tpindex} +\def\pindex {\pgindex} + +\def\cindexsub {\begingroup\obeylines\cindexsub} +{\obeylines % +\gdef\cindexsub "#1" #2^^M{\endgroup % +\dosubind{cp}{#2}{#1}}} + +% Define the macros used in formatting output of the sorted index material. + +% @printindex causes a particular index (the ??s file) to get printed. +% It does not print any chapter heading (usually an @unnumbered). +% +\parseargdef\printindex{\begingroup + \dobreak \chapheadingskip{10000}% + % + \smallfonts \rm + \tolerance = 9500 + \plainfrenchspacing + \everypar = {}% don't want the \kern\-parindent from indentation suppression. + % + % See if the index file exists and is nonempty. + % Change catcode of @ here so that if the index file contains + % \initial {@} + % as its first line, TeX doesn't complain about mismatched braces + % (because it thinks @} is a control sequence). + \catcode`\@ = 11 + \openin 1 \jobname.#1s + \ifeof 1 + % \enddoublecolumns gets confused if there is no text in the index, + % and it loses the chapter title and the aux file entries for the + % index. The easiest way to prevent this problem is to make sure + % there is some text. + \putwordIndexNonexistent + \else + % + % If the index file exists but is empty, then \openin leaves \ifeof + % false. We have to make TeX try to read something from the file, so + % it can discover if there is anything in it. + \read 1 to \temp + \ifeof 1 + \putwordIndexIsEmpty + \else + % Index files are almost Texinfo source, but we use \ as the escape + % character. It would be better to use @, but that's too big a change + % to make right now. + \def\indexbackslash{\backslashcurfont}% + \catcode`\\ = 0 + \escapechar = `\\ + \begindoublecolumns + \input \jobname.#1s + \enddoublecolumns + \fi + \fi + \closein 1 +\endgroup} + +% These macros are used by the sorted index file itself. +% Change them to control the appearance of the index. + +\def\initial#1{{% + % Some minor font changes for the special characters. + \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt + % + % Remove any glue we may have, we'll be inserting our own. + \removelastskip + % + % We like breaks before the index initials, so insert a bonus. + \nobreak + \vskip 0pt plus 3\baselineskip + \penalty 0 + \vskip 0pt plus -3\baselineskip + % + % Typeset the initial. Making this add up to a whole number of + % baselineskips increases the chance of the dots lining up from column + % to column. It still won't often be perfect, because of the stretch + % we need before each entry, but it's better. + % + % No shrink because it confuses \balancecolumns. + \vskip 1.67\baselineskip plus .5\baselineskip + \leftline{\secbf #1}% + % Do our best not to break after the initial. + \nobreak + \vskip .33\baselineskip plus .1\baselineskip +}} + +% \entry typesets a paragraph consisting of the text (#1), dot leaders, and +% then page number (#2) flushed to the right margin. It is used for index +% and table of contents entries. The paragraph is indented by \leftskip. +% +% A straightforward implementation would start like this: +% \def\entry#1#2{... +% But this freezes the catcodes in the argument, and can cause problems to +% @code, which sets - active. This problem was fixed by a kludge--- +% ``-'' was active throughout whole index, but this isn't really right. +% The right solution is to prevent \entry from swallowing the whole text. +% --kasal, 21nov03 +\def\entry{% + \begingroup + % + % Start a new paragraph if necessary, so our assignments below can't + % affect previous text. + \par + % + % Do not fill out the last line with white space. + \parfillskip = 0in + % + % No extra space above this paragraph. + \parskip = 0in + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % \hangindent is only relevant when the entry text and page number + % don't both fit on one line. In that case, bob suggests starting the + % dots pretty far over on the line. Unfortunately, a large + % indentation looks wrong when the entry text itself is broken across + % lines. So we use a small indentation and put up with long leaders. + % + % \hangafter is reset to 1 (which is the value we want) at the start + % of each paragraph, so we need not do anything with that. + \hangindent = 2em + % + % When the entry text needs to be broken, just fill out the first line + % with blank space. + \rightskip = 0pt plus1fil + % + % A bit of stretch before each entry for the benefit of balancing + % columns. + \vskip 0pt plus1pt + % + % When reading the text of entry, convert explicit line breaks + % from @* into spaces. The user might give these in long section + % titles, for instance. + \def\*{\unskip\space\ignorespaces}% + \def\entrybreak{\hfil\break}% + % + % Swallow the left brace of the text (first parameter): + \afterassignment\doentry + \let\temp = +} +\def\entrybreak{\unskip\space\ignorespaces}% +\def\doentry{% + \bgroup % Instead of the swallowed brace. + \noindent + \aftergroup\finishentry + % And now comes the text of the entry. +} +\def\finishentry#1{% + % #1 is the page number. + % + % The following is kludged to not output a line of dots in the index if + % there are no page numbers. The next person who breaks this will be + % cursed by a Unix daemon. + \setbox\boxA = \hbox{#1}% + \ifdim\wd\boxA = 0pt + \ % + \else + % + % If we must, put the page number on a line of its own, and fill out + % this line with blank space. (The \hfil is overwhelmed with the + % fill leaders glue in \indexdotfill if the page number does fit.) + \hfil\penalty50 + \null\nobreak\indexdotfill % Have leaders before the page number. + % + % The `\ ' here is removed by the implicit \unskip that TeX does as + % part of (the primitive) \par. Without it, a spurious underfull + % \hbox ensues. + \ifpdf + \pdfgettoks#1.% + \ \the\toksA + \else + \ #1% + \fi + \fi + \par + \endgroup +} + +% Like plain.tex's \dotfill, except uses up at least 1 em. +\def\indexdotfill{\cleaders + \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} + +\def\primary #1{\line{#1\hfil}} + +\newskip\secondaryindent \secondaryindent=0.5cm +\def\secondary#1#2{{% + \parfillskip=0in + \parskip=0in + \hangindent=1in + \hangafter=1 + \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill + \ifpdf + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \else + #2 + \fi + \par +}} + +% Define two-column mode, which we use to typeset indexes. +% Adapted from the TeXbook, page 416, which is to say, +% the manmac.tex format used to print the TeXbook itself. +\catcode`\@=11 + +\newbox\partialpage +\newdimen\doublecolumnhsize + +\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns + % Grab any single-column material above us. + \output = {% + % + % Here is a possibility not foreseen in manmac: if we accumulate a + % whole lot of material, we might end up calling this \output + % routine twice in a row (see the doublecol-lose test, which is + % essentially a couple of indexes with @setchapternewpage off). In + % that case we just ship out what is in \partialpage with the normal + % output routine. Generally, \partialpage will be empty when this + % runs and this will be a no-op. See the indexspread.tex test case. + \ifvoid\partialpage \else + \onepageout{\pagecontents\partialpage}% + \fi + % + \global\setbox\partialpage = \vbox{% + % Unvbox the main output page. + \unvbox\PAGE + \kern-\topskip \kern\baselineskip + }% + }% + \eject % run that output routine to set \partialpage + % + % Use the double-column output routine for subsequent pages. + \output = {\doublecolumnout}% + % + % Change the page size parameters. We could do this once outside this + % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 + % format, but then we repeat the same computation. Repeating a couple + % of assignments once per index is clearly meaningless for the + % execution time, so we may as well do it in one place. + % + % First we halve the line length, less a little for the gutter between + % the columns. We compute the gutter based on the line length, so it + % changes automatically with the paper format. The magic constant + % below is chosen so that the gutter has the same value (well, +-<1pt) + % as it did when we hard-coded it. + % + % We put the result in a separate register, \doublecolumhsize, so we + % can restore it in \pagesofar, after \hsize itself has (potentially) + % been clobbered. + % + \doublecolumnhsize = \hsize + \advance\doublecolumnhsize by -.04154\hsize + \divide\doublecolumnhsize by 2 + \hsize = \doublecolumnhsize + % + % Double the \vsize as well. (We don't need a separate register here, + % since nobody clobbers \vsize.) + \vsize = 2\vsize +} + +% The double-column output routine for all double-column pages except +% the last. +% +\def\doublecolumnout{% + \splittopskip=\topskip \splitmaxdepth=\maxdepth + % Get the available space for the double columns -- the normal + % (undoubled) page height minus any material left over from the + % previous page. + \dimen@ = \vsize + \divide\dimen@ by 2 + \advance\dimen@ by -\ht\partialpage + % + % box0 will be the left-hand column, box2 the right. + \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ + \onepageout\pagesofar + \unvbox255 + \penalty\outputpenalty +} +% +% Re-output the contents of the output page -- any previous material, +% followed by the two boxes we just split, in box0 and box2. +\def\pagesofar{% + \unvbox\partialpage + % + \hsize = \doublecolumnhsize + \wd0=\hsize \wd2=\hsize + \hbox to\pagewidth{\box0\hfil\box2}% +} +% +% All done with double columns. +\def\enddoublecolumns{% + % The following penalty ensures that the page builder is exercised + % _before_ we change the output routine. This is necessary in the + % following situation: + % + % The last section of the index consists only of a single entry. + % Before this section, \pagetotal is less than \pagegoal, so no + % break occurs before the last section starts. However, the last + % section, consisting of \initial and the single \entry, does not + % fit on the page and has to be broken off. Without the following + % penalty the page builder will not be exercised until \eject + % below, and by that time we'll already have changed the output + % routine to the \balancecolumns version, so the next-to-last + % double-column page will be processed with \balancecolumns, which + % is wrong: The two columns will go to the main vertical list, with + % the broken-off section in the recent contributions. As soon as + % the output routine finishes, TeX starts reconsidering the page + % break. The two columns and the broken-off section both fit on the + % page, because the two columns now take up only half of the page + % goal. When TeX sees \eject from below which follows the final + % section, it invokes the new output routine that we've set after + % \balancecolumns below; \onepageout will try to fit the two columns + % and the final section into the vbox of \pageheight (see + % \pagebody), causing an overfull box. + % + % Note that glue won't work here, because glue does not exercise the + % page builder, unlike penalties (see The TeXbook, pp. 280-281). + \penalty0 + % + \output = {% + % Split the last of the double-column material. Leave it on the + % current page, no automatic page break. + \balancecolumns + % + % If we end up splitting too much material for the current page, + % though, there will be another page break right after this \output + % invocation ends. Having called \balancecolumns once, we do not + % want to call it again. Therefore, reset \output to its normal + % definition right away. (We hope \balancecolumns will never be + % called on to balance too much material, but if it is, this makes + % the output somewhat more palatable.) + \global\output = {\onepageout{\pagecontents\PAGE}}% + }% + \eject + \endgroup % started in \begindoublecolumns + % + % \pagegoal was set to the doubled \vsize above, since we restarted + % the current page. We're now back to normal single-column + % typesetting, so reset \pagegoal to the normal \vsize (after the + % \endgroup where \vsize got restored). + \pagegoal = \vsize +} +% +% Called at the end of the double column material. +\def\balancecolumns{% + \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. + \dimen@ = \ht0 + \advance\dimen@ by \topskip + \advance\dimen@ by-\baselineskip + \divide\dimen@ by 2 % target to split to + %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% + \splittopskip = \topskip + % Loop until we get a decent breakpoint. + {% + \vbadness = 10000 + \loop + \global\setbox3 = \copy0 + \global\setbox1 = \vsplit3 to \dimen@ + \ifdim\ht3>\dimen@ + \global\advance\dimen@ by 1pt + \repeat + }% + %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% + \setbox0=\vbox to\dimen@{\unvbox1}% + \setbox2=\vbox to\dimen@{\unvbox3}% + % + \pagesofar +} +\catcode`\@ = \other + + +\message{sectioning,} +% Chapters, sections, etc. + +% Let's start with @part. +\outer\parseargdef\part{\partzzz{#1}} +\def\partzzz#1{% + \chapoddpage + \null + \vskip.3\vsize % move it down on the page a bit + \begingroup + \noindent \titlefonts\rmisbold #1\par % the text + \let\lastnode=\empty % no node to associate with + \writetocentry{part}{#1}{}% but put it in the toc + \headingsoff % no headline or footline on the part page + \chapoddpage + \endgroup +} + +% \unnumberedno is an oxymoron. But we count the unnumbered +% sections so that we can refer to them unambiguously in the pdf +% outlines by their "section number". We avoid collisions with chapter +% numbers by starting them at 10000. (If a document ever has 10000 +% chapters, we're in trouble anyway, I'm sure.) +\newcount\unnumberedno \unnumberedno = 10000 +\newcount\chapno +\newcount\secno \secno=0 +\newcount\subsecno \subsecno=0 +\newcount\subsubsecno \subsubsecno=0 + +% This counter is funny since it counts through charcodes of letters A, B, ... +\newcount\appendixno \appendixno = `\@ +% +% \def\appendixletter{\char\the\appendixno} +% We do the following ugly conditional instead of the above simple +% construct for the sake of pdftex, which needs the actual +% letter in the expansion, not just typeset. +% +\def\appendixletter{% + \ifnum\appendixno=`A A% + \else\ifnum\appendixno=`B B% + \else\ifnum\appendixno=`C C% + \else\ifnum\appendixno=`D D% + \else\ifnum\appendixno=`E E% + \else\ifnum\appendixno=`F F% + \else\ifnum\appendixno=`G G% + \else\ifnum\appendixno=`H H% + \else\ifnum\appendixno=`I I% + \else\ifnum\appendixno=`J J% + \else\ifnum\appendixno=`K K% + \else\ifnum\appendixno=`L L% + \else\ifnum\appendixno=`M M% + \else\ifnum\appendixno=`N N% + \else\ifnum\appendixno=`O O% + \else\ifnum\appendixno=`P P% + \else\ifnum\appendixno=`Q Q% + \else\ifnum\appendixno=`R R% + \else\ifnum\appendixno=`S S% + \else\ifnum\appendixno=`T T% + \else\ifnum\appendixno=`U U% + \else\ifnum\appendixno=`V V% + \else\ifnum\appendixno=`W W% + \else\ifnum\appendixno=`X X% + \else\ifnum\appendixno=`Y Y% + \else\ifnum\appendixno=`Z Z% + % The \the is necessary, despite appearances, because \appendixletter is + % expanded while writing the .toc file. \char\appendixno is not + % expandable, thus it is written literally, thus all appendixes come out + % with the same letter (or @) in the toc without it. + \else\char\the\appendixno + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} + +% Each @chapter defines these (using marks) as the number+name, number +% and name of the chapter. Page headings and footings can use +% these. @section does likewise. +\def\thischapter{} +\def\thischapternum{} +\def\thischaptername{} +\def\thissection{} +\def\thissectionnum{} +\def\thissectionname{} + +\newcount\absseclevel % used to calculate proper heading level +\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count + +% @raisesections: treat @section as chapter, @subsection as section, etc. +\def\raisesections{\global\advance\secbase by -1} +\let\up=\raisesections % original BFox name + +% @lowersections: treat @chapter as section, @section as subsection, etc. +\def\lowersections{\global\advance\secbase by 1} +\let\down=\lowersections % original BFox name + +% we only have subsub. +\chardef\maxseclevel = 3 +% +% A numbered section within an unnumbered changes to unnumbered too. +% To achieve this, remember the "biggest" unnum. sec. we are currently in: +\chardef\unnlevel = \maxseclevel +% +% Trace whether the current chapter is an appendix or not: +% \chapheadtype is "N" or "A", unnumbered chapters are ignored. +\def\chapheadtype{N} + +% Choose a heading macro +% #1 is heading type +% #2 is heading level +% #3 is text for heading +\def\genhead#1#2#3{% + % Compute the abs. sec. level: + \absseclevel=#2 + \advance\absseclevel by \secbase + % Make sure \absseclevel doesn't fall outside the range: + \ifnum \absseclevel < 0 + \absseclevel = 0 + \else + \ifnum \absseclevel > 3 + \absseclevel = 3 + \fi + \fi + % The heading type: + \def\headtype{#1}% + \if \headtype U% + \ifnum \absseclevel < \unnlevel + \chardef\unnlevel = \absseclevel + \fi + \else + % Check for appendix sections: + \ifnum \absseclevel = 0 + \edef\chapheadtype{\headtype}% + \else + \if \headtype A\if \chapheadtype N% + \errmessage{@appendix... within a non-appendix chapter}% + \fi\fi + \fi + % Check for numbered within unnumbered: + \ifnum \absseclevel > \unnlevel + \def\headtype{U}% + \else + \chardef\unnlevel = 3 + \fi + \fi + % Now print the heading: + \if \headtype U% + \ifcase\absseclevel + \unnumberedzzz{#3}% + \or \unnumberedseczzz{#3}% + \or \unnumberedsubseczzz{#3}% + \or \unnumberedsubsubseczzz{#3}% + \fi + \else + \if \headtype A% + \ifcase\absseclevel + \appendixzzz{#3}% + \or \appendixsectionzzz{#3}% + \or \appendixsubseczzz{#3}% + \or \appendixsubsubseczzz{#3}% + \fi + \else + \ifcase\absseclevel + \chapterzzz{#3}% + \or \seczzz{#3}% + \or \numberedsubseczzz{#3}% + \or \numberedsubsubseczzz{#3}% + \fi + \fi + \fi + \suppressfirstparagraphindent +} + +% an interface: +\def\numhead{\genhead N} +\def\apphead{\genhead A} +\def\unnmhead{\genhead U} + +% @chapter, @appendix, @unnumbered. Increment top-level counter, reset +% all lower-level sectioning counters to zero. +% +% Also set \chaplevelprefix, which we prepend to @float sequence numbers +% (e.g., figures), q.v. By default (before any chapter), that is empty. +\let\chaplevelprefix = \empty +% +\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz +\def\chapterzzz#1{% + % section resetting is \global in case the chapter is in a group, such + % as an @include file. + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\chapno by 1 + % + % Used for \float. + \gdef\chaplevelprefix{\the\chapno.}% + \resetallfloatnos + % + % \putwordChapter can contain complex things in translations. + \toks0=\expandafter{\putwordChapter}% + \message{\the\toks0 \space \the\chapno}% + % + % Write the actual heading. + \chapmacro{#1}{Ynumbered}{\the\chapno}% + % + % So @section and the like are numbered underneath this chapter. + \global\let\section = \numberedsec + \global\let\subsection = \numberedsubsec + \global\let\subsubsection = \numberedsubsubsec +} + +\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz +% +\def\appendixzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\appendixno by 1 + \gdef\chaplevelprefix{\appendixletter.}% + \resetallfloatnos + % + % \putwordAppendix can contain complex things in translations. + \toks0=\expandafter{\putwordAppendix}% + \message{\the\toks0 \space \appendixletter}% + % + \chapmacro{#1}{Yappendix}{\appendixletter}% + % + \global\let\section = \appendixsec + \global\let\subsection = \appendixsubsec + \global\let\subsubsection = \appendixsubsubsec +} + +% normally unnmhead0 calls unnumberedzzz: +\outer\parseargdef\unnumbered{\unnmhead0{#1}} +\def\unnumberedzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\unnumberedno by 1 + % + % Since an unnumbered has no number, no prefix for figures. + \global\let\chaplevelprefix = \empty + \resetallfloatnos + % + % This used to be simply \message{#1}, but TeX fully expands the + % argument to \message. Therefore, if #1 contained @-commands, TeX + % expanded them. For example, in `@unnumbered The @cite{Book}', TeX + % expanded @cite (which turns out to cause errors because \cite is meant + % to be executed, not expanded). + % + % Anyway, we don't want the fully-expanded definition of @cite to appear + % as a result of the \message, we just want `@cite' itself. We use + % \the to achieve this: TeX expands \the only once, + % simply yielding the contents of . (We also do this for + % the toc entries.) + \toks0 = {#1}% + \message{(\the\toks0)}% + % + \chapmacro{#1}{Ynothing}{\the\unnumberedno}% + % + \global\let\section = \unnumberedsec + \global\let\subsection = \unnumberedsubsec + \global\let\subsubsection = \unnumberedsubsubsec +} + +% @centerchap is like @unnumbered, but the heading is centered. +\outer\parseargdef\centerchap{% + % Well, we could do the following in a group, but that would break + % an assumption that \chapmacro is called at the outermost level. + % Thus we are safer this way: --kasal, 24feb04 + \let\centerparametersmaybe = \centerparameters + \unnmhead0{#1}% + \let\centerparametersmaybe = \relax +} + +% @top is like @unnumbered. +\let\top\unnumbered + +% Sections. +% +\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz +\def\seczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% +} + +% normally calls appendixsectionzzz: +\outer\parseargdef\appendixsection{\apphead1{#1}} +\def\appendixsectionzzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% +} +\let\appendixsec\appendixsection + +% normally calls unnumberedseczzz: +\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} +\def\unnumberedseczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% +} + +% Subsections. +% +% normally calls numberedsubseczzz: +\outer\parseargdef\numberedsubsec{\numhead2{#1}} +\def\numberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% +} + +% normally calls appendixsubseczzz: +\outer\parseargdef\appendixsubsec{\apphead2{#1}} +\def\appendixsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno}% +} + +% normally calls unnumberedsubseczzz: +\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} +\def\unnumberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno}% +} + +% Subsubsections. +% +% normally numberedsubsubseczzz: +\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} +\def\numberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynumbered}% + {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% normally appendixsubsubseczzz: +\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} +\def\appendixsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% normally unnumberedsubsubseczzz: +\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} +\def\unnumberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% These macros control what the section commands do, according +% to what kind of chapter we are in (ordinary, appendix, or unnumbered). +% Define them by default for a numbered chapter. +\let\section = \numberedsec +\let\subsection = \numberedsubsec +\let\subsubsection = \numberedsubsubsec + +% Define @majorheading, @heading and @subheading + +\def\majorheading{% + {\advance\chapheadingskip by 10pt \chapbreak }% + \parsearg\chapheadingzzz +} + +\def\chapheading{\chapbreak \parsearg\chapheadingzzz} +\def\chapheadingzzz#1{% + \vbox{\chapfonts \raggedtitlesettings #1\par}% + \nobreak\bigskip \nobreak + \suppressfirstparagraphindent +} + +% @heading, @subheading, @subsubheading. +\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} + +% These macros generate a chapter, section, etc. heading only +% (including whitespace, linebreaking, etc. around it), +% given all the information in convenient, parsed form. + +% Args are the skip and penalty (usually negative) +\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} + +% Parameter controlling skip before chapter headings (if needed) +\newskip\chapheadingskip + +% Define plain chapter starts, and page on/off switching for it. +\def\chapbreak{\dobreak \chapheadingskip {-4000}} +\def\chappager{\par\vfill\supereject} +% Because \domark is called before \chapoddpage, the filler page will +% get the headings for the next chapter, which is wrong. But we don't +% care -- we just disable all headings on the filler page. +\def\chapoddpage{% + \chappager + \ifodd\pageno \else + \begingroup + \headingsoff + \null + \chappager + \endgroup + \fi +} + +\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} + +\def\CHAPPAGoff{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chapbreak +\global\let\pagealignmacro=\chappager} + +\def\CHAPPAGon{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chappager +\global\let\pagealignmacro=\chappager +\global\def\HEADINGSon{\HEADINGSsingle}} + +\def\CHAPPAGodd{% +\global\let\contentsalignmacro = \chapoddpage +\global\let\pchapsepmacro=\chapoddpage +\global\let\pagealignmacro=\chapoddpage +\global\def\HEADINGSon{\HEADINGSdouble}} + +\CHAPPAGon + +% Chapter opening. +% +% #1 is the text, #2 is the section type (Ynumbered, Ynothing, +% Yappendix, Yomitfromtoc), #3 the chapter number. +% +% To test against our argument. +\def\Ynothingkeyword{Ynothing} +\def\Yomitfromtockeyword{Yomitfromtoc} +\def\Yappendixkeyword{Yappendix} +% +\def\chapmacro#1#2#3{% + % Insert the first mark before the heading break (see notes for \domark). + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs + \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% + \gdef\thissection{}}% + % + \def\temptype{#2}% + \ifx\temptype\Ynothingkeyword + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{\thischaptername}}% + \else\ifx\temptype\Yomitfromtockeyword + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{}}% + \else\ifx\temptype\Yappendixkeyword + \toks0={#1}% + \xdef\lastchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\appendixletter}% + % \noexpand\putwordAppendix avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thischapter{\noexpand\putwordAppendix{} + \noexpand\thischapternum: + \noexpand\thischaptername}% + }% + \else + \toks0={#1}% + \xdef\lastchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\the\chapno}% + % \noexpand\putwordChapter avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thischapter{\noexpand\putwordChapter{} + \noexpand\thischapternum: + \noexpand\thischaptername}% + }% + \fi\fi\fi + % + % Output the mark. Pass it through \safewhatsit, to take care of + % the preceding space. + \safewhatsit\domark + % + % Insert the chapter heading break. + \pchapsepmacro + % + % Now the second mark, after the heading break. No break points + % between here and the heading. + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs + \domark + % + {% + \chapfonts \rmisbold + % + % Have to define \lastsection before calling \donoderef, because the + % xref code eventually uses it. On the other hand, it has to be called + % after \pchapsepmacro, or the headline will change too soon. + \gdef\lastsection{#1}% + % + % Only insert the separating space if we have a chapter/appendix + % number, and don't print the unnumbered ``number''. + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unnchap}% + \else\ifx\temptype\Yomitfromtockeyword + \setbox0 = \hbox{}% contents like unnumbered, but no toc entry + \def\toctype{omit}% + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% + \def\toctype{app}% + \else + \setbox0 = \hbox{#3\enspace}% + \def\toctype{numchap}% + \fi\fi\fi + % + % Write the toc entry for this chapter. Must come before the + % \donoderef, because we include the current node name in the toc + % entry, and \donoderef resets it to empty. + \writetocentry{\toctype}{#1}{#3}% + % + % For pdftex, we have to write out the node definition (aka, make + % the pdfdest) after any page break, but before the actual text has + % been typeset. If the destination for the pdf outline is after the + % text, then jumping from the outline may wind up with the text not + % being visible, for instance under high magnification. + \donoderef{#2}% + % + % Typeset the actual heading. + \nobreak % Avoid page breaks at the interline glue. + \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe + \unhbox0 #1\par}% + }% + \nobreak\bigskip % no page break after a chapter title + \nobreak +} + +% @centerchap -- centered and unnumbered. +\let\centerparametersmaybe = \relax +\def\centerparameters{% + \advance\rightskip by 3\rightskip + \leftskip = \rightskip + \parfillskip = 0pt +} + + +% I don't think this chapter style is supported any more, so I'm not +% updating it with the new noderef stuff. We'll see. --karl, 11aug03. +% +\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} +% +\def\unnchfopen #1{% + \chapoddpage + \vbox{\chapfonts \raggedtitlesettings #1\par}% + \nobreak\bigskip\nobreak +} +\def\chfopen #1#2{\chapoddpage {\chapfonts +\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% +\par\penalty 5000 % +} +\def\centerchfopen #1{% + \chapoddpage + \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}% + \nobreak\bigskip \nobreak +} +\def\CHAPFopen{% + \global\let\chapmacro=\chfopen + \global\let\centerchapmacro=\centerchfopen} + + +% Section titles. These macros combine the section number parts and +% call the generic \sectionheading to do the printing. +% +\newskip\secheadingskip +\def\secheadingbreak{\dobreak \secheadingskip{-1000}} + +% Subsection titles. +\newskip\subsecheadingskip +\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} + +% Subsubsection titles. +\def\subsubsecheadingskip{\subsecheadingskip} +\def\subsubsecheadingbreak{\subsecheadingbreak} + + +% Print any size, any type, section title. +% +% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is +% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the +% section number. +% +\def\seckeyword{sec} +% +\def\sectionheading#1#2#3#4{% + {% + \checkenv{}% should not be in an environment. + % + % Switch to the right set of fonts. + \csname #2fonts\endcsname \rmisbold + % + \def\sectionlevel{#2}% + \def\temptype{#3}% + % + % Insert first mark before the heading break (see notes for \domark). + \let\prevsectiondefs=\lastsectiondefs + \ifx\temptype\Ynothingkeyword + \ifx\sectionlevel\seckeyword + \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% + \gdef\thissection{\thissectionname}}% + \fi + \else\ifx\temptype\Yomitfromtockeyword + % Don't redefine \thissection. + \else\ifx\temptype\Yappendixkeyword + \ifx\sectionlevel\seckeyword + \toks0={#1}% + \xdef\lastsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + % \noexpand\putwordSection avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thissection{\noexpand\putwordSection{} + \noexpand\thissectionnum: + \noexpand\thissectionname}% + }% + \fi + \else + \ifx\sectionlevel\seckeyword + \toks0={#1}% + \xdef\lastsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + % \noexpand\putwordSection avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thissection{\noexpand\putwordSection{} + \noexpand\thissectionnum: + \noexpand\thissectionname}% + }% + \fi + \fi\fi\fi + % + % Go into vertical mode. Usually we'll already be there, but we + % don't want the following whatsit to end up in a preceding paragraph + % if the document didn't happen to have a blank line. + \par + % + % Output the mark. Pass it through \safewhatsit, to take care of + % the preceding space. + \safewhatsit\domark + % + % Insert space above the heading. + \csname #2headingbreak\endcsname + % + % Now the second mark, after the heading break. No break points + % between here and the heading. + \let\prevsectiondefs=\lastsectiondefs + \domark + % + % Only insert the space after the number if we have a section number. + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unn}% + \gdef\lastsection{#1}% + \else\ifx\temptype\Yomitfromtockeyword + % for @headings -- no section number, don't include in toc, + % and don't redefine \lastsection. + \setbox0 = \hbox{}% + \def\toctype{omit}% + \let\sectionlevel=\empty + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{#4\enspace}% + \def\toctype{app}% + \gdef\lastsection{#1}% + \else + \setbox0 = \hbox{#4\enspace}% + \def\toctype{num}% + \gdef\lastsection{#1}% + \fi\fi\fi + % + % Write the toc entry (before \donoderef). See comments in \chapmacro. + \writetocentry{\toctype\sectionlevel}{#1}{#4}% + % + % Write the node reference (= pdf destination for pdftex). + % Again, see comments in \chapmacro. + \donoderef{#3}% + % + % Interline glue will be inserted when the vbox is completed. + % That glue will be a valid breakpoint for the page, since it'll be + % preceded by a whatsit (usually from the \donoderef, or from the + % \writetocentry if there was no node). We don't want to allow that + % break, since then the whatsits could end up on page n while the + % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. + \nobreak + % + % Output the actual section heading. + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright + \hangindent=\wd0 % zero if no section number + \unhbox0 #1}% + }% + % Add extra space after the heading -- half of whatever came above it. + % Don't allow stretch, though. + \kern .5 \csname #2headingskip\endcsname + % + % Do not let the kern be a potential breakpoint, as it would be if it + % was followed by glue. + \nobreak + % + % We'll almost certainly start a paragraph next, so don't let that + % glue accumulate. (Not a breakpoint because it's preceded by a + % discardable item.) However, when a paragraph is not started next + % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out + % or the negative glue will cause weirdly wrong output, typically + % obscuring the section heading with something else. + \vskip-\parskip + % + % This is so the last item on the main vertical list is a known + % \penalty > 10000, so \startdefun, etc., can recognize the situation + % and do the needful. + \penalty 10001 +} + + +\message{toc,} +% Table of contents. +\newwrite\tocfile + +% Write an entry to the toc file, opening it if necessary. +% Called from @chapter, etc. +% +% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} +% We append the current node name (if any) and page number as additional +% arguments for the \{chap,sec,...}entry macros which will eventually +% read this. The node name is used in the pdf outlines as the +% destination to jump to. +% +% We open the .toc file for writing here instead of at @setfilename (or +% any other fixed time) so that @contents can be anywhere in the document. +% But if #1 is `omit', then we don't do anything. This is used for the +% table of contents chapter openings themselves. +% +\newif\iftocfileopened +\def\omitkeyword{omit}% +% +\def\writetocentry#1#2#3{% + \edef\writetoctype{#1}% + \ifx\writetoctype\omitkeyword \else + \iftocfileopened\else + \immediate\openout\tocfile = \jobname.toc + \global\tocfileopenedtrue + \fi + % + \iflinks + {\atdummies + \edef\temp{% + \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% + \temp + }% + \fi + \fi + % + % Tell \shipout to create a pdf destination on each page, if we're + % writing pdf. These are used in the table of contents. We can't + % just write one on every page because the title pages are numbered + % 1 and 2 (the page numbers aren't printed), and so are the first + % two pages of the document. Thus, we'd have two destinations named + % `1', and two named `2'. + \ifpdf \global\pdfmakepagedesttrue \fi +} + + +% These characters do not print properly in the Computer Modern roman +% fonts, so we must take special care. This is more or less redundant +% with the Texinfo input format setup at the end of this file. +% +\def\activecatcodes{% + \catcode`\"=\active + \catcode`\$=\active + \catcode`\<=\active + \catcode`\>=\active + \catcode`\\=\active + \catcode`\^=\active + \catcode`\_=\active + \catcode`\|=\active + \catcode`\~=\active +} + + +% Read the toc file, which is essentially Texinfo input. +\def\readtocfile{% + \setupdatafile + \activecatcodes + \input \tocreadfilename +} + +\newskip\contentsrightmargin \contentsrightmargin=1in +\newcount\savepageno +\newcount\lastnegativepageno \lastnegativepageno = -1 + +% Prepare to read what we've written to \tocfile. +% +\def\startcontents#1{% + % If @setchapternewpage on, and @headings double, the contents should + % start on an odd page, unlike chapters. Thus, we maintain + % \contentsalignmacro in parallel with \pagealignmacro. + % From: Torbjorn Granlund + \contentsalignmacro + \immediate\closeout\tocfile + % + % Don't need to put `Contents' or `Short Contents' in the headline. + % It is abundantly clear what they are. + \chapmacro{#1}{Yomitfromtoc}{}% + % + \savepageno = \pageno + \begingroup % Set up to handle contents files properly. + \raggedbottom % Worry more about breakpoints than the bottom. + \advance\hsize by -\contentsrightmargin % Don't use the full line length. + % + % Roman numerals for page numbers. + \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi +} + +% redefined for the two-volume lispref. We always output on +% \jobname.toc even if this is redefined. +% +\def\tocreadfilename{\jobname.toc} + +% Normal (long) toc. +% +\def\contents{% + \startcontents{\putwordTOC}% + \openin 1 \tocreadfilename\space + \ifeof 1 \else + \readtocfile + \fi + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \ifeof 1 \else + \pdfmakeoutlines + \fi + \closein 1 + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno +} + +% And just the chapters. +\def\summarycontents{% + \startcontents{\putwordShortTOC}% + % + \let\partentry = \shortpartentry + \let\numchapentry = \shortchapentry + \let\appentry = \shortchapentry + \let\unnchapentry = \shortunnchapentry + % We want a true roman here for the page numbers. + \secfonts + \let\rm=\shortcontrm \let\bf=\shortcontbf + \let\sl=\shortcontsl \let\tt=\shortconttt + \rm + \hyphenpenalty = 10000 + \advance\baselineskip by 1pt % Open it up a little. + \def\numsecentry##1##2##3##4{} + \let\appsecentry = \numsecentry + \let\unnsecentry = \numsecentry + \let\numsubsecentry = \numsecentry + \let\appsubsecentry = \numsecentry + \let\unnsubsecentry = \numsecentry + \let\numsubsubsecentry = \numsecentry + \let\appsubsubsecentry = \numsecentry + \let\unnsubsubsecentry = \numsecentry + \openin 1 \tocreadfilename\space + \ifeof 1 \else + \readtocfile + \fi + \closein 1 + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno +} +\let\shortcontents = \summarycontents + +% Typeset the label for a chapter or appendix for the short contents. +% The arg is, e.g., `A' for an appendix, or `3' for a chapter. +% +\def\shortchaplabel#1{% + % This space should be enough, since a single number is .5em, and the + % widest letter (M) is 1em, at least in the Computer Modern fonts. + % But use \hss just in case. + % (This space doesn't include the extra space that gets added after + % the label; that gets put in by \shortchapentry above.) + % + % We'd like to right-justify chapter numbers, but that looks strange + % with appendix letters. And right-justifying numbers and + % left-justifying letters looks strange when there is less than 10 + % chapters. Have to read the whole toc once to know how many chapters + % there are before deciding ... + \hbox to 1em{#1\hss}% +} + +% These macros generate individual entries in the table of contents. +% The first argument is the chapter or section name. +% The last argument is the page number. +% The arguments in between are the chapter number, section number, ... + +% Parts, in the main contents. Replace the part number, which doesn't +% exist, with an empty box. Let's hope all the numbers have the same width. +% Also ignore the page number, which is conventionally not printed. +\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} +\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}} +% +% Parts, in the short toc. +\def\shortpartentry#1#2#3#4{% + \penalty-300 + \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip + \shortchapentry{{\bf #1}}{\numeralbox}{}{}% +} + +% Chapters, in the main contents. +\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} +% +% Chapters, in the short toc. +% See comments in \dochapentry re vbox and related settings. +\def\shortchapentry#1#2#3#4{% + \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% +} + +% Appendices, in the main contents. +% Need the word Appendix, and a fixed-size box. +% +\def\appendixbox#1{% + % We use M since it's probably the widest letter. + \setbox0 = \hbox{\putwordAppendix{} M}% + \hbox to \wd0{\putwordAppendix{} #1\hss}} +% +\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} + +% Unnumbered chapters. +\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} +\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} + +% Sections. +\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} +\let\appsecentry=\numsecentry +\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} + +% Subsections. +\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} +\let\appsubsecentry=\numsubsecentry +\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} + +% And subsubsections. +\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} +\let\appsubsubsecentry=\numsubsubsecentry +\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} + +% This parameter controls the indentation of the various levels. +% Same as \defaultparindent. +\newdimen\tocindent \tocindent = 15pt + +% Now for the actual typesetting. In all these, #1 is the text and #2 is the +% page number. +% +% If the toc has to be broken over pages, we want it to be at chapters +% if at all possible; hence the \penalty. +\def\dochapentry#1#2{% + \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip + \begingroup + \chapentryfonts + \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \endgroup + \nobreak\vskip .25\baselineskip plus.1\baselineskip +} + +\def\dosecentry#1#2{\begingroup + \secentryfonts \leftskip=\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsecentry#1#2{\begingroup + \subsecentryfonts \leftskip=2\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsubsecentry#1#2{\begingroup + \subsubsecentryfonts \leftskip=3\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +% We use the same \entry macro as for the index entries. +\let\tocentry = \entry + +% Space between chapter (or whatever) number and the title. +\def\labelspace{\hskip1em \relax} + +\def\dopageno#1{{\rm #1}} +\def\doshortpageno#1{{\rm #1}} + +\def\chapentryfonts{\secfonts \rm} +\def\secentryfonts{\textfonts} +\def\subsecentryfonts{\textfonts} +\def\subsubsecentryfonts{\textfonts} + + +\message{environments,} +% @foo ... @end foo. + +% @tex ... @end tex escapes into raw TeX temporarily. +% One exception: @ is still an escape character, so that @end tex works. +% But \@ or @@ will get a plain @ character. + +\envdef\tex{% + \setupmarkupstyle{tex}% + \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 + \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 + \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie + \catcode `\%=14 + \catcode `\+=\other + \catcode `\"=\other + \catcode `\|=\other + \catcode `\<=\other + \catcode `\>=\other + \catcode`\`=\other + \catcode`\'=\other + \escapechar=`\\ + % + % ' is active in math mode (mathcode"8000). So reset it, and all our + % other math active characters (just in case), to plain's definitions. + \mathactive + % + \let\b=\ptexb + \let\bullet=\ptexbullet + \let\c=\ptexc + \let\,=\ptexcomma + \let\.=\ptexdot + \let\dots=\ptexdots + \let\equiv=\ptexequiv + \let\!=\ptexexclam + \let\i=\ptexi + \let\indent=\ptexindent + \let\noindent=\ptexnoindent + \let\{=\ptexlbrace + \let\+=\tabalign + \let\}=\ptexrbrace + \let\/=\ptexslash + \let\*=\ptexstar + \let\t=\ptext + \expandafter \let\csname top\endcsname=\ptextop % outer + \let\frenchspacing=\plainfrenchspacing + % + \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% + \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% + \def\@{@}% +} +% There is no need to define \Etex. + +% Define @lisp ... @end lisp. +% @lisp environment forms a group so it can rebind things, +% including the definition of @end lisp (which normally is erroneous). + +% Amount to narrow the margins by for @lisp. +\newskip\lispnarrowing \lispnarrowing=0.4in + +% This is the definition that ^^M gets inside @lisp, @example, and other +% such environments. \null is better than a space, since it doesn't +% have any width. +\def\lisppar{\null\endgraf} + +% This space is always present above and below environments. +\newskip\envskipamount \envskipamount = 0pt + +% Make spacing and below environment symmetrical. We use \parskip here +% to help in doing that, since in @example-like environments \parskip +% is reset to zero; thus the \afterenvbreak inserts no space -- but the +% start of the next paragraph will insert \parskip. +% +\def\aboveenvbreak{{% + % =10000 instead of <10000 because of a special case in \itemzzz and + % \sectionheading, q.v. + \ifnum \lastpenalty=10000 \else + \advance\envskipamount by \parskip + \endgraf + \ifdim\lastskip<\envskipamount + \removelastskip + % it's not a good place to break if the last penalty was \nobreak + % or better ... + \ifnum\lastpenalty<10000 \penalty-50 \fi + \vskip\envskipamount + \fi + \fi +}} + +\let\afterenvbreak = \aboveenvbreak + +% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will +% also clear it, so that its embedded environments do the narrowing again. +\let\nonarrowing=\relax + +% @cartouche ... @end cartouche: draw rectangle w/rounded corners around +% environment contents. +\font\circle=lcircle10 +\newdimen\circthick +\newdimen\cartouter\newdimen\cartinner +\newskip\normbskip\newskip\normpskip\newskip\normlskip +\circthick=\fontdimen8\circle +% +\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth +\def\ctr{{\hskip 6pt\circle\char'010}} +\def\cbl{{\circle\char'012\hskip -6pt}} +\def\cbr{{\hskip 6pt\circle\char'011}} +\def\carttop{\hbox to \cartouter{\hskip\lskip + \ctl\leaders\hrule height\circthick\hfil\ctr + \hskip\rskip}} +\def\cartbot{\hbox to \cartouter{\hskip\lskip + \cbl\leaders\hrule height\circthick\hfil\cbr + \hskip\rskip}} +% +\newskip\lskip\newskip\rskip + +\envdef\cartouche{% + \ifhmode\par\fi % can't be in the midst of a paragraph. + \startsavinginserts + \lskip=\leftskip \rskip=\rightskip + \leftskip=0pt\rightskip=0pt % we want these *outside*. + \cartinner=\hsize \advance\cartinner by-\lskip + \advance\cartinner by-\rskip + \cartouter=\hsize + \advance\cartouter by 18.4pt % allow for 3pt kerns on either + % side, and for 6pt waste from + % each corner char, and rule thickness + \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip + % Flag to tell @lisp, etc., not to narrow margin. + \let\nonarrowing = t% + % + % If this cartouche directly follows a sectioning command, we need the + % \parskip glue (backspaced over by default) or the cartouche can + % collide with the section heading. + \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi + % + \vbox\bgroup + \baselineskip=0pt\parskip=0pt\lineskip=0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \kern3pt + \hsize=\cartinner + \baselineskip=\normbskip + \lineskip=\normlskip + \parskip=\normpskip + \vskip -\parskip + \comment % For explanation, see the end of def\group. +} +\def\Ecartouche{% + \ifhmode\par\fi + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup + \checkinserts +} + + +% This macro is called at the beginning of all the @example variants, +% inside a group. +\newdimen\nonfillparindent +\def\nonfillstart{% + \aboveenvbreak + \hfuzz = 12pt % Don't be fussy + \sepspaces % Make spaces be word-separators rather than space tokens. + \let\par = \lisppar % don't ignore blank lines + \obeylines % each line of input is a line of output + \parskip = 0pt + % Turn off paragraph indentation but redefine \indent to emulate + % the normal \indent. + \nonfillparindent=\parindent + \parindent = 0pt + \let\indent\nonfillindent + % + \emergencystretch = 0pt % don't try to avoid overfull boxes + \ifx\nonarrowing\relax + \advance \leftskip by \lispnarrowing + \exdentamount=\lispnarrowing + \else + \let\nonarrowing = \relax + \fi + \let\exdent=\nofillexdent +} + +\begingroup +\obeyspaces +% We want to swallow spaces (but not other tokens) after the fake +% @indent in our nonfill-environments, where spaces are normally +% active and set to @tie, resulting in them not being ignored after +% @indent. +\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% +\gdef\nonfillindentcheck{% +\ifx\temp % +\expandafter\nonfillindentgobble% +\else% +\leavevmode\nonfillindentbox% +\fi% +}% +\endgroup +\def\nonfillindentgobble#1{\nonfillindent} +\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} + +% If you want all examples etc. small: @set dispenvsize small. +% If you want even small examples the full size: @set dispenvsize nosmall. +% This affects the following displayed environments: +% @example, @display, @format, @lisp +% +\def\smallword{small} +\def\nosmallword{nosmall} +\let\SETdispenvsize\relax +\def\setnormaldispenv{% + \ifx\SETdispenvsize\smallword + % end paragraph for sake of leading, in case document has no blank + % line. This is redundant with what happens in \aboveenvbreak, but + % we need to do it before changing the fonts, and it's inconvenient + % to change the fonts afterward. + \ifnum \lastpenalty=10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} +\def\setsmalldispenv{% + \ifx\SETdispenvsize\nosmallword + \else + \ifnum \lastpenalty=10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} + +% We often define two environments, @foo and @smallfoo. +% Let's do it in one command. #1 is the env name, #2 the definition. +\def\makedispenvdef#1#2{% + \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}% + \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}% + \expandafter\let\csname E#1\endcsname \afterenvbreak + \expandafter\let\csname Esmall#1\endcsname \afterenvbreak +} + +% Define two environment synonyms (#1 and #2) for an environment. +\def\maketwodispenvdef#1#2#3{% + \makedispenvdef{#1}{#3}% + \makedispenvdef{#2}{#3}% +} +% +% @lisp: indented, narrowed, typewriter font; +% @example: same as @lisp. +% +% @smallexample and @smalllisp: use smaller fonts. +% Originally contributed by Pavel@xerox. +% +\maketwodispenvdef{lisp}{example}{% + \nonfillstart + \tt\setupmarkupstyle{example}% + \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. + \gobble % eat return +} +% @display/@smalldisplay: same as @lisp except keep current font. +% +\makedispenvdef{display}{% + \nonfillstart + \gobble +} + +% @format/@smallformat: same as @display except don't narrow margins. +% +\makedispenvdef{format}{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} + +% @flushleft: same as @format, but doesn't obey \SETdispenvsize. +\envdef\flushleft{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} +\let\Eflushleft = \afterenvbreak + +% @flushright. +% +\envdef\flushright{% + \let\nonarrowing = t% + \nonfillstart + \advance\leftskip by 0pt plus 1fill\relax + \gobble +} +\let\Eflushright = \afterenvbreak + + +% @raggedright does more-or-less normal line breaking but no right +% justification. From plain.tex. +\envdef\raggedright{% + \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax +} +\let\Eraggedright\par + +\envdef\raggedleft{% + \parindent=0pt \leftskip0pt plus2em + \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt + \hbadness=10000 % Last line will usually be underfull, so turn off + % badness reporting. +} +\let\Eraggedleft\par + +\envdef\raggedcenter{% + \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em + \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt + \hbadness=10000 % Last line will usually be underfull, so turn off + % badness reporting. +} +\let\Eraggedcenter\par + + +% @quotation does normal linebreaking (hence we can't use \nonfillstart) +% and narrows the margins. We keep \parskip nonzero in general, since +% we're doing normal filling. So, when using \aboveenvbreak and +% \afterenvbreak, temporarily make \parskip 0. +% +\makedispenvdef{quotation}{\quotationstart} +% +\def\quotationstart{% + \indentedblockstart % same as \indentedblock, but increase right margin too. + \ifx\nonarrowing\relax + \advance\rightskip by \lispnarrowing + \fi + \parsearg\quotationlabel +} + +% We have retained a nonzero parskip for the environment, since we're +% doing normal filling. +% +\def\Equotation{% + \par + \ifx\quotationauthor\thisisundefined\else + % indent a bit. + \leftline{\kern 2\leftskip \sl ---\quotationauthor}% + \fi + {\parskip=0pt \afterenvbreak}% +} +\def\Esmallquotation{\Equotation} + +% If we're given an argument, typeset it in bold with a colon after. +\def\quotationlabel#1{% + \def\temp{#1}% + \ifx\temp\empty \else + {\bf #1: }% + \fi +} + +% @indentedblock is like @quotation, but indents only on the left and +% has no optional argument. +% +\makedispenvdef{indentedblock}{\indentedblockstart} +% +\def\indentedblockstart{% + {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip + \parindent=0pt + % + % @cartouche defines \nonarrowing to inhibit narrowing at next level down. + \ifx\nonarrowing\relax + \advance\leftskip by \lispnarrowing + \exdentamount = \lispnarrowing + \else + \let\nonarrowing = \relax + \fi +} + +% Keep a nonzero parskip for the environment, since we're doing normal filling. +% +\def\Eindentedblock{% + \par + {\parskip=0pt \afterenvbreak}% +} +\def\Esmallindentedblock{\Eindentedblock} + + +% LaTeX-like @verbatim...@end verbatim and @verb{...} +% If we want to allow any as delimiter, +% we need the curly braces so that makeinfo sees the @verb command, eg: +% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org +% +% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. +% +% [Knuth] p.344; only we need to do the other characters Texinfo sets +% active too. Otherwise, they get lost as the first character on a +% verbatim line. +\def\dospecials{% + \do\ \do\\\do\{\do\}\do\$\do\&% + \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% + \do\<\do\>\do\|\do\@\do+\do\"% + % Don't do the quotes -- if we do, @set txicodequoteundirected and + % @set txicodequotebacktick will not have effect on @verb and + % @verbatim, and ?` and !` ligatures won't get disabled. + %\do\`\do\'% +} +% +% [Knuth] p. 380 +\def\uncatcodespecials{% + \def\do##1{\catcode`##1=\other}\dospecials} +% +% Setup for the @verb command. +% +% Eight spaces for a tab +\begingroup + \catcode`\^^I=\active + \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} +\endgroup +% +\def\setupverb{% + \tt % easiest (and conventionally used) font for verbatim + \def\par{\leavevmode\endgraf}% + \setupmarkupstyle{verb}% + \tabeightspaces + % Respect line breaks, + % print special symbols as themselves, and + % make each space count + % must do in this order: + \obeylines \uncatcodespecials \sepspaces +} + +% Setup for the @verbatim environment +% +% Real tab expansion. +\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount +% +% We typeset each line of the verbatim in an \hbox, so we can handle +% tabs. The \global is in case the verbatim line starts with an accent, +% or some other command that starts with a begin-group. Otherwise, the +% entire \verbbox would disappear at the corresponding end-group, before +% it is typeset. Meanwhile, we can't have nested verbatim commands +% (can we?), so the \global won't be overwriting itself. +\newbox\verbbox +\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup} +% +\begingroup + \catcode`\^^I=\active + \gdef\tabexpand{% + \catcode`\^^I=\active + \def^^I{\leavevmode\egroup + \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab + \divide\dimen\verbbox by\tabw + \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw + \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw + \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox + }% + } +\endgroup + +% start the verbatim environment. +\def\setupverbatim{% + \let\nonarrowing = t% + \nonfillstart + \tt % easiest (and conventionally used) font for verbatim + % The \leavevmode here is for blank lines. Otherwise, we would + % never \starttabox and the \egroup would end verbatim mode. + \def\par{\leavevmode\egroup\box\verbbox\endgraf}% + \tabexpand + \setupmarkupstyle{verbatim}% + % Respect line breaks, + % print special symbols as themselves, and + % make each space count. + % Must do in this order: + \obeylines \uncatcodespecials \sepspaces + \everypar{\starttabbox}% +} + +% Do the @verb magic: verbatim text is quoted by unique +% delimiter characters. Before first delimiter expect a +% right brace, after last delimiter expect closing brace: +% +% \def\doverb'{'#1'}'{#1} +% +% [Knuth] p. 382; only eat outer {} +\begingroup + \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other + \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] +\endgroup +% +\def\verb{\begingroup\setupverb\doverb} +% +% +% Do the @verbatim magic: define the macro \doverbatim so that +% the (first) argument ends when '@end verbatim' is reached, ie: +% +% \def\doverbatim#1@end verbatim{#1} +% +% For Texinfo it's a lot easier than for LaTeX, +% because texinfo's \verbatim doesn't stop at '\end{verbatim}': +% we need not redefine '\', '{' and '}'. +% +% Inspired by LaTeX's verbatim command set [latex.ltx] +% +\begingroup + \catcode`\ =\active + \obeylines % + % ignore everything up to the first ^^M, that's the newline at the end + % of the @verbatim input line itself. Otherwise we get an extra blank + % line in the output. + \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% + % We really want {...\end verbatim} in the body of the macro, but + % without the active space; thus we have to use \xdef and \gobble. +\endgroup +% +\envdef\verbatim{% + \setupverbatim\doverbatim +} +\let\Everbatim = \afterenvbreak + + +% @verbatiminclude FILE - insert text of file in verbatim environment. +% +\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} +% +\def\doverbatiminclude#1{% + {% + \makevalueexpandable + \setupverbatim + \indexnofonts % Allow `@@' and other weird things in file names. + \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% + \input #1 + \afterenvbreak + }% +} + +% @copying ... @end copying. +% Save the text away for @insertcopying later. +% +% We save the uninterpreted tokens, rather than creating a box. +% Saving the text in a box would be much easier, but then all the +% typesetting commands (@smallbook, font changes, etc.) have to be done +% beforehand -- and a) we want @copying to be done first in the source +% file; b) letting users define the frontmatter in as flexible order as +% possible is very desirable. +% +\def\copying{\checkenv{}\begingroup\scanargctxt\docopying} +\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} +% +\def\insertcopying{% + \begingroup + \parindent = 0pt % paragraph indentation looks wrong on title page + \scanexp\copyingtext + \endgroup +} + + +\message{defuns,} +% @defun etc. + +\newskip\defbodyindent \defbodyindent=.4in +\newskip\defargsindent \defargsindent=50pt +\newskip\deflastargmargin \deflastargmargin=18pt +\newcount\defunpenalty + +% Start the processing of @deffn: +\def\startdefun{% + \ifnum\lastpenalty<10000 + \medbreak + \defunpenalty=10003 % Will keep this @deffn together with the + % following @def command, see below. + \else + % If there are two @def commands in a row, we'll have a \nobreak, + % which is there to keep the function description together with its + % header. But if there's nothing but headers, we need to allow a + % break somewhere. Check specifically for penalty 10002, inserted + % by \printdefunline, instead of 10000, since the sectioning + % commands also insert a nobreak penalty, and we don't want to allow + % a break between a section heading and a defun. + % + % As a further refinement, we avoid "club" headers by signalling + % with penalty of 10003 after the very first @deffn in the + % sequence (see above), and penalty of 10002 after any following + % @def command. + \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi + % + % Similarly, after a section heading, do not allow a break. + % But do insert the glue. + \medskip % preceded by discardable penalty, so not a breakpoint + \fi + % + \parindent=0in + \advance\leftskip by \defbodyindent + \exdentamount=\defbodyindent +} + +\def\dodefunx#1{% + % First, check whether we are in the right environment: + \checkenv#1% + % + % As above, allow line break if we have multiple x headers in a row. + % It's not a great place, though. + \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi + % + % And now, it's time to reuse the body of the original defun: + \expandafter\gobbledefun#1% +} +\def\gobbledefun#1\startdefun{} + +% \printdefunline \deffnheader{text} +% +\def\printdefunline#1#2{% + \begingroup + % call \deffnheader: + #1#2 \endheader + % common ending: + \interlinepenalty = 10000 + \advance\rightskip by 0pt plus 1fil\relax + \endgraf + \nobreak\vskip -\parskip + \penalty\defunpenalty % signal to \startdefun and \dodefunx + % Some of the @defun-type tags do not enable magic parentheses, + % rendering the following check redundant. But we don't optimize. + \checkparencounts + \endgroup +} + +\def\Edefun{\endgraf\medbreak} + +% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; +% the only thing remaining is to define \deffnheader. +% +\def\makedefun#1{% + \expandafter\let\csname E#1\endcsname = \Edefun + \edef\temp{\noexpand\domakedefun + \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% + \temp +} + +% \domakedefun \deffn \deffnx \deffnheader +% +% Define \deffn and \deffnx, without parameters. +% \deffnheader has to be defined explicitly. +% +\def\domakedefun#1#2#3{% + \envdef#1{% + \startdefun + \doingtypefnfalse % distinguish typed functions from all else + \parseargusing\activeparens{\printdefunline#3}% + }% + \def#2{\dodefunx#1}% + \def#3% +} + +\newif\ifdoingtypefn % doing typed function? +\newif\ifrettypeownline % typeset return type on its own line? + +% @deftypefnnewline on|off says whether the return type of typed functions +% are printed on their own line. This affects @deftypefn, @deftypefun, +% @deftypeop, and @deftypemethod. +% +\parseargdef\deftypefnnewline{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETtxideftypefnnl\endcsname + = \empty + \else\ifx\temp\offword + \expandafter\let\csname SETtxideftypefnnl\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @txideftypefnnl value `\temp', + must be on|off}% + \fi\fi +} + +% Untyped functions: + +% @deffn category name args +\makedefun{deffn}{\deffngeneral{}} + +% @deffn category class name args +\makedefun{defop}#1 {\defopon{#1\ \putwordon}} + +% \defopon {category on}class name args +\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deffngeneral {subind}category name args +% +\def\deffngeneral#1#2 #3 #4\endheader{% + % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. + \dosubind{fn}{\code{#3}}{#1}% + \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% +} + +% Typed functions: + +% @deftypefn category type name args +\makedefun{deftypefn}{\deftypefngeneral{}} + +% @deftypeop category class type name args +\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} + +% \deftypeopon {category on}class type name args +\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deftypefngeneral {subind}category type name args +% +\def\deftypefngeneral#1#2 #3 #4 #5\endheader{% + \dosubind{fn}{\code{#4}}{#1}% + \doingtypefntrue + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +% Typed variables: + +% @deftypevr category type var args +\makedefun{deftypevr}{\deftypecvgeneral{}} + +% @deftypecv category class type var args +\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} + +% \deftypecvof {category of}class type var args +\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } + +% \deftypecvgeneral {subind}category type var args +% +\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% + \dosubind{vr}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +% Untyped variables: + +% @defvr category var args +\makedefun{defvr}#1 {\deftypevrheader{#1} {} } + +% @defcv category class var args +\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} + +% \defcvof {category of}class var args +\def\defcvof#1#2 {\deftypecvof{#1}#2 {} } + +% Types: + +% @deftp category name args +\makedefun{deftp}#1 #2 #3\endheader{% + \doind{tp}{\code{#2}}% + \defname{#1}{}{#2}\defunargs{#3\unskip}% +} + +% Remaining @defun-like shortcuts: +\makedefun{defun}{\deffnheader{\putwordDeffunc} } +\makedefun{defmac}{\deffnheader{\putwordDefmac} } +\makedefun{defspec}{\deffnheader{\putwordDefspec} } +\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } +\makedefun{defvar}{\defvrheader{\putwordDefvar} } +\makedefun{defopt}{\defvrheader{\putwordDefopt} } +\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } +\makedefun{defmethod}{\defopon\putwordMethodon} +\makedefun{deftypemethod}{\deftypeopon\putwordMethodon} +\makedefun{defivar}{\defcvof\putwordInstanceVariableof} +\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} + +% \defname, which formats the name of the @def (not the args). +% #1 is the category, such as "Function". +% #2 is the return type, if any. +% #3 is the function name. +% +% We are followed by (but not passed) the arguments, if any. +% +\def\defname#1#2#3{% + \par + % Get the values of \leftskip and \rightskip as they were outside the @def... + \advance\leftskip by -\defbodyindent + % + % Determine if we are typesetting the return type of a typed function + % on a line by itself. + \rettypeownlinefalse + \ifdoingtypefn % doing a typed function specifically? + % then check user option for putting return type on its own line: + \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else + \rettypeownlinetrue + \fi + \fi + % + % How we'll format the category name. Putting it in brackets helps + % distinguish it from the body text that may end up on the next line + % just below it. + \def\temp{#1}% + \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} + % + % Figure out line sizes for the paragraph shape. We'll always have at + % least two. + \tempnum = 2 + % + % The first line needs space for \box0; but if \rightskip is nonzero, + % we need only space for the part of \box0 which exceeds it: + \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip + % + % If doing a return type on its own line, we'll have another line. + \ifrettypeownline + \advance\tempnum by 1 + \def\maybeshapeline{0in \hsize}% + \else + \def\maybeshapeline{}% + \fi + % + % The continuations: + \dimen2=\hsize \advance\dimen2 by -\defargsindent + % + % The final paragraph shape: + \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2 + % + % Put the category name at the right margin. + \noindent + \hbox to 0pt{% + \hfil\box0 \kern-\hsize + % \hsize has to be shortened this way: + \kern\leftskip + % Intentionally do not respect \rightskip, since we need the space. + }% + % + % Allow all lines to be underfull without complaint: + \tolerance=10000 \hbadness=10000 + \exdentamount=\defbodyindent + {% + % defun fonts. We use typewriter by default (used to be bold) because: + % . we're printing identifiers, they should be in tt in principle. + % . in languages with many accents, such as Czech or French, it's + % common to leave accents off identifiers. The result looks ok in + % tt, but exceedingly strange in rm. + % . we don't want -- and --- to be treated as ligatures. + % . this still does not fix the ?` and !` ligatures, but so far no + % one has made identifiers using them :). + \df \tt + \def\temp{#2}% text of the return type + \ifx\temp\empty\else + \tclose{\temp}% typeset the return type + \ifrettypeownline + % put return type on its own line; prohibit line break following: + \hfil\vadjust{\nobreak}\break + \else + \space % type on same line, so just followed by a space + \fi + \fi % no return type + #3% output function name + }% + {\rm\enskip}% hskip 0.5 em of \tenrm + % + \boldbrax + % arguments will be output next, if any. +} + +% Print arguments in slanted roman (not ttsl), inconsistently with using +% tt for the name. This is because literal text is sometimes needed in +% the argument list (groff manual), and ttsl and tt are not very +% distinguishable. Prevent hyphenation at `-' chars. +% +\def\defunargs#1{% + % use sl by default (not ttsl), + % tt for the names. + \df \sl \hyphenchar\font=0 + % + % On the other hand, if an argument has two dashes (for instance), we + % want a way to get ttsl. We used to recommend @var for that, so + % leave the code in, but it's strange for @var to lead to typewriter. + % Nowadays we recommend @code, since the difference between a ttsl hyphen + % and a tt hyphen is pretty tiny. @code also disables ?` !`. + \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% + #1% + \sl\hyphenchar\font=45 +} + +% We want ()&[] to print specially on the defun line. +% +\def\activeparens{% + \catcode`\(=\active \catcode`\)=\active + \catcode`\[=\active \catcode`\]=\active + \catcode`\&=\active +} + +% Make control sequences which act like normal parenthesis chars. +\let\lparen = ( \let\rparen = ) + +% Be sure that we always have a definition for `(', etc. For example, +% if the fn name has parens in it, \boldbrax will not be in effect yet, +% so TeX would otherwise complain about undefined control sequence. +{ + \activeparens + \global\let(=\lparen \global\let)=\rparen + \global\let[=\lbrack \global\let]=\rbrack + \global\let& = \& + + \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} + \gdef\magicamp{\let&=\amprm} +} + +\newcount\parencount + +% If we encounter &foo, then turn on ()-hacking afterwards +\newif\ifampseen +\def\amprm#1 {\ampseentrue{\bf\ }} + +\def\parenfont{% + \ifampseen + % At the first level, print parens in roman, + % otherwise use the default font. + \ifnum \parencount=1 \rm \fi + \else + % The \sf parens (in \boldbrax) actually are a little bolder than + % the contained text. This is especially needed for [ and ] . + \sf + \fi +} +\def\infirstlevel#1{% + \ifampseen + \ifnum\parencount=1 + #1% + \fi + \fi +} +\def\bfafterword#1 {#1 \bf} + +\def\opnr{% + \global\advance\parencount by 1 + {\parenfont(}% + \infirstlevel \bfafterword +} +\def\clnr{% + {\parenfont)}% + \infirstlevel \sl + \global\advance\parencount by -1 +} + +\newcount\brackcount +\def\lbrb{% + \global\advance\brackcount by 1 + {\bf[}% +} +\def\rbrb{% + {\bf]}% + \global\advance\brackcount by -1 +} + +\def\checkparencounts{% + \ifnum\parencount=0 \else \badparencount \fi + \ifnum\brackcount=0 \else \badbrackcount \fi +} +% these should not use \errmessage; the glibc manual, at least, actually +% has such constructs (when documenting function pointers). +\def\badparencount{% + \message{Warning: unbalanced parentheses in @def...}% + \global\parencount=0 +} +\def\badbrackcount{% + \message{Warning: unbalanced square brackets in @def...}% + \global\brackcount=0 +} + + +\message{macros,} +% @macro. + +% To do this right we need a feature of e-TeX, \scantokens, +% which we arrange to emulate with a temporary file in ordinary TeX. +\ifx\eTeXversion\thisisundefined + \newwrite\macscribble + \def\scantokens#1{% + \toks0={#1}% + \immediate\openout\macscribble=\jobname.tmp + \immediate\write\macscribble{\the\toks0}% + \immediate\closeout\macscribble + \input \jobname.tmp + } +\fi + +\def\scanmacro#1{\begingroup + \newlinechar`\^^M + \let\xeatspaces\eatspaces + % + % Undo catcode changes of \startcontents and \doprintindex + % When called from @insertcopying or (short)caption, we need active + % backslash to get it printed correctly. Previously, we had + % \catcode`\\=\other instead. We'll see whether a problem appears + % with macro expansion. --kasal, 19aug04 + \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ + % + % ... and for \example: + \spaceisspace + % + % The \empty here causes a following catcode 5 newline to be eaten as + % part of reading whitespace after a control sequence. It does not + % eat a catcode 13 newline. There's no good way to handle the two + % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX + % would then have different behavior). See the Macro Details node in + % the manual for the workaround we recommend for macros and + % line-oriented commands. + % + \scantokens{#1\empty}% +\endgroup} + +\def\scanexp#1{% + \edef\temp{\noexpand\scanmacro{#1}}% + \temp +} + +\newcount\paramno % Count of parameters +\newtoks\macname % Macro name +\newif\ifrecursive % Is it recursive? + +% List of all defined macros in the form +% \definedummyword\macro1\definedummyword\macro2... +% Currently is also contains all @aliases; the list can be split +% if there is a need. +\def\macrolist{} + +% Add the macro to \macrolist +\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} +\def\addtomacrolistxxx#1{% + \toks0 = \expandafter{\macrolist\definedummyword#1}% + \xdef\macrolist{\the\toks0}% +} + +% Utility routines. +% This does \let #1 = #2, with \csnames; that is, +% \let \csname#1\endcsname = \csname#2\endcsname +% (except of course we have to play expansion games). +% +\def\cslet#1#2{% + \expandafter\let + \csname#1\expandafter\endcsname + \csname#2\endcsname +} + +% Trim leading and trailing spaces off a string. +% Concepts from aro-bend problem 15 (see CTAN). +{\catcode`\@=11 +\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} +\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} +\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} +\def\unbrace#1{#1} +\unbrace{\gdef\trim@@@ #1 } #2@{#1} +} + +% Trim a single trailing ^^M off a string. +{\catcode`\^^M=\other \catcode`\Q=3% +\gdef\eatcr #1{\eatcra #1Q^^MQ}% +\gdef\eatcra#1^^MQ{\eatcrb#1Q}% +\gdef\eatcrb#1Q#2Q{#1}% +} + +% Macro bodies are absorbed as an argument in a context where +% all characters are catcode 10, 11 or 12, except \ which is active +% (as in normal texinfo). It is necessary to change the definition of \ +% to recognize macro arguments; this is the job of \mbodybackslash. +% +% Non-ASCII encodings make 8-bit characters active, so un-activate +% them to avoid their expansion. Must do this non-globally, to +% confine the change to the current group. +% +% It's necessary to have hard CRs when the macro is executed. This is +% done by making ^^M (\endlinechar) catcode 12 when reading the macro +% body, and then making it the \newlinechar in \scanmacro. +% +\def\scanctxt{% used as subroutine + \catcode`\"=\other + \catcode`\+=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\@=\other + \catcode`\^=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\~=\other + \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi +} + +\def\scanargctxt{% used for copying and captions, not macros. + \scanctxt + \catcode`\\=\other + \catcode`\^^M=\other +} + +\def\macrobodyctxt{% used for @macro definitions + \scanctxt + \catcode`\{=\other + \catcode`\}=\other + \catcode`\^^M=\other + \usembodybackslash +} + +\def\macroargctxt{% used when scanning invocations + \scanctxt + \catcode`\\=0 +} +% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes" +% for the single characters \ { }. Thus, we end up with the "commands" +% that would be written @\ @{ @} in a Texinfo document. +% +% We already have @{ and @}. For @\, we define it here, and only for +% this purpose, to produce a typewriter backslash (so, the @\ that we +% define for @math can't be used with @macro calls): +% +\def\\{\normalbackslash}% +% +% We would like to do this for \, too, since that is what makeinfo does. +% But it is not possible, because Texinfo already has a command @, for a +% cedilla accent. Documents must use @comma{} instead. +% +% \anythingelse will almost certainly be an error of some kind. + + +% \mbodybackslash is the definition of \ in @macro bodies. +% It maps \foo\ => \csname macarg.foo\endcsname => #N +% where N is the macro parameter number. +% We define \csname macarg.\endcsname to be \realbackslash, so +% \\ in macro replacement text gets you a backslash. +% +{\catcode`@=0 @catcode`@\=@active + @gdef@usembodybackslash{@let\=@mbodybackslash} + @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} +} +\expandafter\def\csname macarg.\endcsname{\realbackslash} + +\def\margbackslash#1{\char`\#1 } + +\def\macro{\recursivefalse\parsearg\macroxxx} +\def\rmacro{\recursivetrue\parsearg\macroxxx} + +\def\macroxxx#1{% + \getargs{#1}% now \macname is the macname and \argl the arglist + \ifx\argl\empty % no arguments + \paramno=0\relax + \else + \expandafter\parsemargdef \argl;% + \if\paramno>256\relax + \ifx\eTeXversion\thisisundefined + \errhelp = \EMsimple + \errmessage{You need eTeX to compile a file with macros with more than 256 arguments} + \fi + \fi + \fi + \if1\csname ismacro.\the\macname\endcsname + \message{Warning: redefining \the\macname}% + \else + \expandafter\ifx\csname \the\macname\endcsname \relax + \else \errmessage{Macro name \the\macname\space already defined}\fi + \global\cslet{macsave.\the\macname}{\the\macname}% + \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% + \addtomacrolist{\the\macname}% + \fi + \begingroup \macrobodyctxt + \ifrecursive \expandafter\parsermacbody + \else \expandafter\parsemacbody + \fi} + +\parseargdef\unmacro{% + \if1\csname ismacro.#1\endcsname + \global\cslet{#1}{macsave.#1}% + \global\expandafter\let \csname ismacro.#1\endcsname=0% + % Remove the macro name from \macrolist: + \begingroup + \expandafter\let\csname#1\endcsname \relax + \let\definedummyword\unmacrodo + \xdef\macrolist{\macrolist}% + \endgroup + \else + \errmessage{Macro #1 not defined}% + \fi +} + +% Called by \do from \dounmacro on each macro. The idea is to omit any +% macro definitions that have been changed to \relax. +% +\def\unmacrodo#1{% + \ifx #1\relax + % remove this + \else + \noexpand\definedummyword \noexpand#1% + \fi +} + +% This makes use of the obscure feature that if the last token of a +% is #, then the preceding argument is delimited by +% an opening brace, and that opening brace is not consumed. +\def\getargs#1{\getargsxxx#1{}} +\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} +\def\getmacname#1 #2\relax{\macname={#1}} +\def\getmacargs#1{\def\argl{#1}} + +% For macro processing make @ a letter so that we can make Texinfo private macro names. +\edef\texiatcatcode{\the\catcode`\@} +\catcode `@=11\relax + +% Parse the optional {params} list. Set up \paramno and \paramlist +% so \defmacro knows what to do. Define \macarg.BLAH for each BLAH +% in the params list to some hook where the argument si to be expanded. If +% there are less than 10 arguments that hook is to be replaced by ##N where N +% is the position in that list, that is to say the macro arguments are to be +% defined `a la TeX in the macro body. +% +% That gets used by \mbodybackslash (above). +% +% We need to get `macro parameter char #' into several definitions. +% The technique used is stolen from LaTeX: let \hash be something +% unexpandable, insert that wherever you need a #, and then redefine +% it to # just before using the token list produced. +% +% The same technique is used to protect \eatspaces till just before +% the macro is used. +% +% If there are 10 or more arguments, a different technique is used, where the +% hook remains in the body, and when macro is to be expanded the body is +% processed again to replace the arguments. +% +% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the +% argument N value and then \edef the body (nothing else will expand because of +% the catcode regime underwhich the body was input). +% +% If you compile with TeX (not eTeX), and you have macros with 10 or more +% arguments, you need that no macro has more than 256 arguments, otherwise an +% error is produced. +\def\parsemargdef#1;{% + \paramno=0\def\paramlist{}% + \let\hash\relax + \let\xeatspaces\relax + \parsemargdefxxx#1,;,% + % In case that there are 10 or more arguments we parse again the arguments + % list to set new definitions for the \macarg.BLAH macros corresponding to + % each BLAH argument. It was anyhow needed to parse already once this list + % in order to count the arguments, and as macros with at most 9 arguments + % are by far more frequent than macro with 10 or more arguments, defining + % twice the \macarg.BLAH macros does not cost too much processing power. + \ifnum\paramno<10\relax\else + \paramno0\relax + \parsemmanyargdef@@#1,;,% 10 or more arguments + \fi +} +\def\parsemargdefxxx#1,{% + \if#1;\let\next=\relax + \else \let\next=\parsemargdefxxx + \advance\paramno by 1 + \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname + {\xeatspaces{\hash\the\paramno}}% + \edef\paramlist{\paramlist\hash\the\paramno,}% + \fi\next} + +\def\parsemmanyargdef@@#1,{% + \if#1;\let\next=\relax + \else + \let\next=\parsemmanyargdef@@ + \edef\tempb{\eatspaces{#1}}% + \expandafter\def\expandafter\tempa + \expandafter{\csname macarg.\tempb\endcsname}% + % Note that we need some extra \noexpand\noexpand, this is because we + % don't want \the to be expanded in the \parsermacbody as it uses an + % \xdef . + \expandafter\edef\tempa + {\noexpand\noexpand\noexpand\the\toks\the\paramno}% + \advance\paramno by 1\relax + \fi\next} + +% These two commands read recursive and nonrecursive macro bodies. +% (They're different since rec and nonrec macros end differently.) +% + +\catcode `\@\texiatcatcode +\long\def\parsemacbody#1@end macro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\long\def\parsermacbody#1@end rmacro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\catcode `\@=11\relax + +\let\endargs@\relax +\let\nil@\relax +\def\nilm@{\nil@}% +\long\def\nillm@{\nil@}% + +% This macro is expanded during the Texinfo macro expansion, not during its +% definition. It gets all the arguments values and assigns them to macros +% macarg.ARGNAME +% +% #1 is the macro name +% #2 is the list of argument names +% #3 is the list of argument values +\def\getargvals@#1#2#3{% + \def\macargdeflist@{}% + \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion. + \def\paramlist{#2,\nil@}% + \def\macroname{#1}% + \begingroup + \macroargctxt + \def\argvaluelist{#3,\nil@}% + \def\@tempa{#3}% + \ifx\@tempa\empty + \setemptyargvalues@ + \else + \getargvals@@ + \fi +} + +% +\def\getargvals@@{% + \ifx\paramlist\nilm@ + % Some sanity check needed here that \argvaluelist is also empty. + \ifx\argvaluelist\nillm@ + \else + \errhelp = \EMsimple + \errmessage{Too many arguments in macro `\macroname'!}% + \fi + \let\next\macargexpandinbody@ + \else + \ifx\argvaluelist\nillm@ + % No more arguments values passed to macro. Set remaining named-arg + % macros to empty. + \let\next\setemptyargvalues@ + \else + % pop current arg name into \@tempb + \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}% + \expandafter\@tempa\expandafter{\paramlist}% + % pop current argument value into \@tempc + \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}% + \expandafter\@tempa\expandafter{\argvaluelist}% + % Here \@tempb is the current arg name and \@tempc is the current arg value. + % First place the new argument macro definition into \@tempd + \expandafter\macname\expandafter{\@tempc}% + \expandafter\let\csname macarg.\@tempb\endcsname\relax + \expandafter\def\expandafter\@tempe\expandafter{% + \csname macarg.\@tempb\endcsname}% + \edef\@tempd{\long\def\@tempe{\the\macname}}% + \push@\@tempd\macargdeflist@ + \let\next\getargvals@@ + \fi + \fi + \next +} + +\def\push@#1#2{% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter#2% + \expandafter\expandafter\expandafter{% + \expandafter#1#2}% +} + +% Replace arguments by their values in the macro body, and place the result +% in macro \@tempa +\def\macvalstoargs@{% + % To do this we use the property that token registers that are \the'ed + % within an \edef expand only once. So we are going to place all argument + % values into respective token registers. + % + % First we save the token context, and initialize argument numbering. + \begingroup + \paramno0\relax + % Then, for each argument number #N, we place the corresponding argument + % value into a new token list register \toks#N + \expandafter\putargsintokens@\saveparamlist@,;,% + % Then, we expand the body so that argument are replaced by their + % values. The trick for values not to be expanded themselves is that they + % are within tokens and that tokens expand only once in an \edef . + \edef\@tempc{\csname mac.\macroname .body\endcsname}% + % Now we restore the token stack pointer to free the token list registers + % which we have used, but we make sure that expanded body is saved after + % group. + \expandafter + \endgroup + \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% + } + +\def\macargexpandinbody@{% + %% Define the named-macro outside of this group and then close this group. + \expandafter + \endgroup + \macargdeflist@ + % First the replace in body the macro arguments by their values, the result + % is in \@tempa . + \macvalstoargs@ + % Then we point at the \norecurse or \gobble (for recursive) macro value + % with \@tempb . + \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname + % Depending on whether it is recursive or not, we need some tailing + % \egroup . + \ifx\@tempb\gobble + \let\@tempc\relax + \else + \let\@tempc\egroup + \fi + % And now we do the real job: + \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}% + \@tempd +} + +\def\putargsintokens@#1,{% + \if#1;\let\next\relax + \else + \let\next\putargsintokens@ + % First we allocate the new token list register, and give it a temporary + % alias \@tempb . + \toksdef\@tempb\the\paramno + % Then we place the argument value into that token list register. + \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname + \expandafter\@tempb\expandafter{\@tempa}% + \advance\paramno by 1\relax + \fi + \next +} + +% Save the token stack pointer into macro #1 +\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}} +% Restore the token stack pointer from number in macro #1 +\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax} +% newtoks that can be used non \outer . +\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi} + +% Tailing missing arguments are set to empty +\def\setemptyargvalues@{% + \ifx\paramlist\nilm@ + \let\next\macargexpandinbody@ + \else + \expandafter\setemptyargvaluesparser@\paramlist\endargs@ + \let\next\setemptyargvalues@ + \fi + \next +} + +\def\setemptyargvaluesparser@#1,#2\endargs@{% + \expandafter\def\expandafter\@tempa\expandafter{% + \expandafter\def\csname macarg.#1\endcsname{}}% + \push@\@tempa\macargdeflist@ + \def\paramlist{#2}% +} + +% #1 is the element target macro +% #2 is the list macro +% #3,#4\endargs@ is the list value +\def\pop@#1#2#3,#4\endargs@{% + \def#1{#3}% + \def#2{#4}% +} +\long\def\longpop@#1#2#3,#4\endargs@{% + \long\def#1{#3}% + \long\def#2{#4}% +} + +% This defines a Texinfo @macro. There are eight cases: recursive and +% nonrecursive macros of zero, one, up to nine, and many arguments. +% Much magic with \expandafter here. +% \xdef is used so that macro definitions will survive the file +% they're defined in; @include reads the file inside a group. +% +\def\defmacro{% + \let\hash=##% convert placeholders to macro parameter chars + \ifrecursive + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\scanmacro{\temp}}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup\noexpand\scanmacro{\temp}}% + \else + \ifnum\paramno<10\relax % at most 9 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{\egroup\noexpand\scanmacro{\temp}}% + \else % 10 or more + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\getargvals@{\the\macname}{\argl}% + }% + \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp + \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble + \fi + \fi + \else + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % at most 9 + \ifnum\paramno<10\relax + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \expandafter\noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % 10 or more: + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\getargvals@{\the\macname}{\argl}% + }% + \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp + \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse + \fi + \fi + \fi} + +\catcode `\@\texiatcatcode\relax + +\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} + +% \braceorline decides whether the next nonwhitespace character is a +% {. If so it reads up to the closing }, if not, it reads the whole +% line. Whatever was read is then fed to the next control sequence +% as an argument (by \parsebrace or \parsearg). +% +\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} +\def\braceorlinexxx{% + \ifx\nchar\bgroup\else + \expandafter\parsearg + \fi \macnamexxx} + + +% @alias. +% We need some trickery to remove the optional spaces around the equal +% sign. Make them active and then expand them all to nothing. +% +\def\alias{\parseargusing\obeyspaces\aliasxxx} +\def\aliasxxx #1{\aliasyyy#1\relax} +\def\aliasyyy #1=#2\relax{% + {% + \expandafter\let\obeyedspace=\empty + \addtomacrolist{#1}% + \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% + }% + \next +} + + +\message{cross references,} + +\newwrite\auxfile +\newif\ifhavexrefs % True if xref values are known. +\newif\ifwarnedxrefs % True if we warned once that they aren't known. + +% @inforef is relatively simple. +\def\inforef #1{\inforefzzz #1,,,,**} +\def\inforefzzz #1,#2,#3,#4**{% + \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, + node \samp{\ignorespaces#1{}}} + +% @node's only job in TeX is to define \lastnode, which is used in +% cross-references. The @node line might or might not have commas, and +% might or might not have spaces before the first comma, like: +% @node foo , bar , ... +% We don't want such trailing spaces in the node name. +% +\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} +% +% also remove a trailing comma, in case of something like this: +% @node Help-Cross, , , Cross-refs +\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} +\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} + +\let\nwnode=\node +\let\lastnode=\empty + +% Write a cross-reference definition for the current node. #1 is the +% type (Ynumbered, Yappendix, Ynothing). +% +\def\donoderef#1{% + \ifx\lastnode\empty\else + \setref{\lastnode}{#1}% + \global\let\lastnode=\empty + \fi +} + +% @anchor{NAME} -- define xref target at arbitrary point. +% +\newcount\savesfregister +% +\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} +\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} +\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} + +% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an +% anchor), which consists of three parts: +% 1) NAME-title - the current sectioning name taken from \lastsection, +% or the anchor name. +% 2) NAME-snt - section number and type, passed as the SNT arg, or +% empty for anchors. +% 3) NAME-pg - the page number. +% +% This is called from \donoderef, \anchor, and \dofloat. In the case of +% floats, there is an additional part, which is not written here: +% 4) NAME-lof - the text as it should appear in a @listoffloats. +% +\def\setref#1#2{% + \pdfmkdest{#1}% + \iflinks + {% + \atdummies % preserve commands, but don't expand them + \edef\writexrdef##1##2{% + \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef + ##1}{##2}}% these are parameters of \writexrdef + }% + \toks0 = \expandafter{\lastsection}% + \immediate \writexrdef{title}{\the\toks0 }% + \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. + \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout + }% + \fi +} + +% @xrefautosectiontitle on|off says whether @section(ing) names are used +% automatically in xrefs, if the third arg is not explicitly specified. +% This was provided as a "secret" @set xref-automatic-section-title +% variable, now it's official. +% +\parseargdef\xrefautomaticsectiontitle{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETxref-automatic-section-title\endcsname + = \empty + \else\ifx\temp\offword + \expandafter\let\csname SETxref-automatic-section-title\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @xrefautomaticsectiontitle value `\temp', + must be on|off}% + \fi\fi +} + +% +% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is +% the node name, #2 the name of the Info cross-reference, #3 the printed +% node name, #4 the name of the Info file, #5 the name of the printed +% manual. All but the node name can be omitted. +% +\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} +\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} +\def\ref#1{\xrefX[#1,,,,,,,]} +% +\newbox\toprefbox +\newbox\printedrefnamebox +\newbox\infofilenamebox +\newbox\printedmanualbox +% +\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup + \unsepspaces + % + % Get args without leading/trailing spaces. + \def\printedrefname{\ignorespaces #3}% + \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}% + % + \def\infofilename{\ignorespaces #4}% + \setbox\infofilenamebox = \hbox{\infofilename\unskip}% + % + \def\printedmanual{\ignorespaces #5}% + \setbox\printedmanualbox = \hbox{\printedmanual\unskip}% + % + % If the printed reference name (arg #3) was not explicitly given in + % the @xref, figure out what we want to use. + \ifdim \wd\printedrefnamebox = 0pt + % No printed node name was explicitly given. + \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax + % Not auto section-title: use node name inside the square brackets. + \def\printedrefname{\ignorespaces #1}% + \else + % Auto section-title: use chapter/section title inside + % the square brackets if we have it. + \ifdim \wd\printedmanualbox > 0pt + % It is in another manual, so we don't have it; use node name. + \def\printedrefname{\ignorespaces #1}% + \else + \ifhavexrefs + % We (should) know the real title if we have the xref values. + \def\printedrefname{\refx{#1-title}{}}% + \else + % Otherwise just copy the Info node name. + \def\printedrefname{\ignorespaces #1}% + \fi% + \fi + \fi + \fi + % + % Make link in pdf output. + \ifpdf + {\indexnofonts + \turnoffactive + \makevalueexpandable + % This expands tokens, so do it after making catcode changes, so _ + % etc. don't get their TeX definitions. This ignores all spaces in + % #4, including (wrongly) those in the middle of the filename. + \getfilename{#4}% + % + % This (wrongly) does not take account of leading or trailing + % spaces in #1, which should be ignored. + \edef\pdfxrefdest{#1}% + \ifx\pdfxrefdest\empty + \def\pdfxrefdest{Top}% no empty targets + \else + \txiescapepdf\pdfxrefdest % escape PDF special chars + \fi + % + \leavevmode + \startlink attr{/Border [0 0 0]}% + \ifnum\filenamelength>0 + goto file{\the\filename.pdf} name{\pdfxrefdest}% + \else + goto name{\pdfmkpgn{\pdfxrefdest}}% + \fi + }% + \setcolor{\linkcolor}% + \fi + % + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". We distinguish them by the + % LABEL-title being set to a magic string. + {% + % Have to otherify everything special to allow the \csname to + % include an _ in the xref name, etc. + \indexnofonts + \turnoffactive + \expandafter\global\expandafter\let\expandafter\Xthisreftitle + \csname XR#1-title\endcsname + }% + \iffloat\Xthisreftitle + % If the user specified the print name (third arg) to the ref, + % print it instead of our usual "Figure 1.2". + \ifdim\wd\printedrefnamebox = 0pt + \refx{#1-snt}{}% + \else + \printedrefname + \fi + % + % If the user also gave the printed manual name (fifth arg), append + % "in MANUALNAME". + \ifdim \wd\printedmanualbox > 0pt + \space \putwordin{} \cite{\printedmanual}% + \fi + \else + % node/anchor (non-float) references. + % + % If we use \unhbox to print the node names, TeX does not insert + % empty discretionaries after hyphens, which means that it will not + % find a line break at a hyphen in a node names. Since some manuals + % are best written with fairly long node names, containing hyphens, + % this is a loss. Therefore, we give the text of the node name + % again, so it is as if TeX is seeing it for the first time. + % + \ifdim \wd\printedmanualbox > 0pt + % Cross-manual reference with a printed manual name. + % + \crossmanualxref{\cite{\printedmanual\unskip}}% + % + \else\ifdim \wd\infofilenamebox > 0pt + % Cross-manual reference with only an info filename (arg 4), no + % printed manual name (arg 5). This is essentially the same as + % the case above; we output the filename, since we have nothing else. + % + \crossmanualxref{\code{\infofilename\unskip}}% + % + \else + % Reference within this manual. + % + % _ (for example) has to be the character _ for the purposes of the + % control sequence corresponding to the node, but it has to expand + % into the usual \leavevmode...\vrule stuff for purposes of + % printing. So we \turnoffactive for the \refx-snt, back on for the + % printing, back off for the \refx-pg. + {\turnoffactive + % Only output a following space if the -snt ref is nonempty; for + % @unnumbered and @anchor, it won't be. + \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + }% + % output the `[mynode]' via the macro below so it can be overridden. + \xrefprintnodename\printedrefname + % + % But we always want a comma and a space: + ,\space + % + % output the `page 3'. + \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + \fi\fi + \fi + \endlink +\endgroup} + +% Output a cross-manual xref to #1. Used just above (twice). +% +% Only include the text "Section ``foo'' in" if the foo is neither +% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply +% "see The Foo Manual", the idea being to refer to the whole manual. +% +% But, this being TeX, we can't easily compare our node name against the +% string "Top" while ignoring the possible spaces before and after in +% the input. By adding the arbitrary 7sp below, we make it much less +% likely that a real node name would have the same width as "Top" (e.g., +% in a monospaced font). Hopefully it will never happen in practice. +% +% For the same basic reason, we retypeset the "Top" at every +% reference, since the current font is indeterminate. +% +\def\crossmanualxref#1{% + \setbox\toprefbox = \hbox{Top\kern7sp}% + \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}% + \ifdim \wd2 > 7sp % nonempty? + \ifdim \wd2 = \wd\toprefbox \else % same as Top? + \putwordSection{} ``\printedrefname'' \putwordin{}\space + \fi + \fi + #1% +} + +% This macro is called from \xrefX for the `[nodename]' part of xref +% output. It's a separate macro only so it can be changed more easily, +% since square brackets don't work well in some documents. Particularly +% one that Bob is working on :). +% +\def\xrefprintnodename#1{[#1]} + +% Things referred to by \setref. +% +\def\Ynothing{} +\def\Yomitfromtoc{} +\def\Ynumbered{% + \ifnum\secno=0 + \putwordChapter@tie \the\chapno + \else \ifnum\subsecno=0 + \putwordSection@tie \the\chapno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno + \else + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} +\def\Yappendix{% + \ifnum\secno=0 + \putwordAppendix@tie @char\the\appendixno{}% + \else \ifnum\subsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno + \else + \putwordSection@tie + @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} + +% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. +% If its value is nonempty, SUFFIX is output afterward. +% +\def\refx#1#2{% + {% + \indexnofonts + \otherbackslash + \expandafter\global\expandafter\let\expandafter\thisrefX + \csname XR#1\endcsname + }% + \ifx\thisrefX\relax + % If not defined, say something at least. + \angleleft un\-de\-fined\angleright + \iflinks + \ifhavexrefs + {\toks0 = {#1}% avoid expansion of possibly-complex value + \message{\linenumber Undefined cross reference `\the\toks0'.}}% + \else + \ifwarnedxrefs\else + \global\warnedxrefstrue + \message{Cross reference values unknown; you must run TeX again.}% + \fi + \fi + \fi + \else + % It's defined, so just use it. + \thisrefX + \fi + #2% Output the suffix in any case. +} + +% This is the macro invoked by entries in the aux file. Usually it's +% just a \def (we prepend XR to the control sequence name to avoid +% collisions). But if this is a float type, we have more work to do. +% +\def\xrdef#1#2{% + {% The node name might contain 8-bit characters, which in our current + % implementation are changed to commands like @'e. Don't let these + % mess up the control sequence name. + \indexnofonts + \turnoffactive + \xdef\safexrefname{#1}% + }% + % + \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref + % + % Was that xref control sequence that we just defined for a float? + \expandafter\iffloat\csname XR\safexrefname\endcsname + % it was a float, and we have the (safe) float type in \iffloattype. + \expandafter\let\expandafter\floatlist + \csname floatlist\iffloattype\endcsname + % + % Is this the first time we've seen this float type? + \expandafter\ifx\floatlist\relax + \toks0 = {\do}% yes, so just \do + \else + % had it before, so preserve previous elements in list. + \toks0 = \expandafter{\floatlist\do}% + \fi + % + % Remember this xref in the control sequence \floatlistFLOATTYPE, + % for later use in \listoffloats. + \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 + {\safexrefname}}% + \fi +} + +% Read the last existing aux file, if any. No error if none exists. +% +\def\tryauxfile{% + \openin 1 \jobname.aux + \ifeof 1 \else + \readdatafile{aux}% + \global\havexrefstrue + \fi + \closein 1 +} + +\def\setupdatafile{% + \catcode`\^^@=\other + \catcode`\^^A=\other + \catcode`\^^B=\other + \catcode`\^^C=\other + \catcode`\^^D=\other + \catcode`\^^E=\other + \catcode`\^^F=\other + \catcode`\^^G=\other + \catcode`\^^H=\other + \catcode`\^^K=\other + \catcode`\^^L=\other + \catcode`\^^N=\other + \catcode`\^^P=\other + \catcode`\^^Q=\other + \catcode`\^^R=\other + \catcode`\^^S=\other + \catcode`\^^T=\other + \catcode`\^^U=\other + \catcode`\^^V=\other + \catcode`\^^W=\other + \catcode`\^^X=\other + \catcode`\^^Z=\other + \catcode`\^^[=\other + \catcode`\^^\=\other + \catcode`\^^]=\other + \catcode`\^^^=\other + \catcode`\^^_=\other + % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. + % in xref tags, i.e., node names. But since ^^e4 notation isn't + % supported in the main text, it doesn't seem desirable. Furthermore, + % that is not enough: for node names that actually contain a ^ + % character, we would end up writing a line like this: 'xrdef {'hat + % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first + % argument, and \hat is not an expandable control sequence. It could + % all be worked out, but why? Either we support ^^ or we don't. + % + % The other change necessary for this was to define \auxhat: + % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter + % and then to call \auxhat in \setq. + % + \catcode`\^=\other + % + % Special characters. Should be turned off anyway, but... + \catcode`\~=\other + \catcode`\[=\other + \catcode`\]=\other + \catcode`\"=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\$=\other + \catcode`\#=\other + \catcode`\&=\other + \catcode`\%=\other + \catcode`+=\other % avoid \+ for paranoia even though we've turned it off + % + % This is to support \ in node names and titles, since the \ + % characters end up in a \csname. It's easier than + % leaving it active and making its active definition an actual \ + % character. What I don't understand is why it works in the *value* + % of the xrdef. Seems like it should be a catcode12 \, and that + % should not typeset properly. But it works, so I'm moving on for + % now. --karl, 15jan04. + \catcode`\\=\other + % + % Make the characters 128-255 be printing characters. + {% + \count1=128 + \def\loop{% + \catcode\count1=\other + \advance\count1 by 1 + \ifnum \count1<256 \loop \fi + }% + }% + % + % @ is our escape character in .aux files, and we need braces. + \catcode`\{=1 + \catcode`\}=2 + \catcode`\@=0 +} + +\def\readdatafile#1{% +\begingroup + \setupdatafile + \input\jobname.#1 +\endgroup} + + +\message{insertions,} +% including footnotes. + +\newcount \footnoteno + +% The trailing space in the following definition for supereject is +% vital for proper filling; pages come out unaligned when you do a +% pagealignmacro call if that space before the closing brace is +% removed. (Generally, numeric constants should always be followed by a +% space to prevent strange expansion errors.) +\def\supereject{\par\penalty -20000\footnoteno =0 } + +% @footnotestyle is meaningful for Info output only. +\let\footnotestyle=\comment + +{\catcode `\@=11 +% +% Auto-number footnotes. Otherwise like plain. +\gdef\footnote{% + \let\indent=\ptexindent + \let\noindent=\ptexnoindent + \global\advance\footnoteno by \@ne + \edef\thisfootno{$^{\the\footnoteno}$}% + % + % In case the footnote comes at the end of a sentence, preserve the + % extra spacing after we do the footnote number. + \let\@sf\empty + \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi + % + % Remove inadvertent blank space before typesetting the footnote number. + \unskip + \thisfootno\@sf + \dofootnote +}% + +% Don't bother with the trickery in plain.tex to not require the +% footnote text as a parameter. Our footnotes don't need to be so general. +% +% Oh yes, they do; otherwise, @ifset (and anything else that uses +% \parseargline) fails inside footnotes because the tokens are fixed when +% the footnote is read. --karl, 16nov96. +% +\gdef\dofootnote{% + \insert\footins\bgroup + % We want to typeset this text as a normal paragraph, even if the + % footnote reference occurs in (for example) a display environment. + % So reset some parameters. + \hsize=\pagewidth + \interlinepenalty\interfootnotelinepenalty + \splittopskip\ht\strutbox % top baseline for broken footnotes + \splitmaxdepth\dp\strutbox + \floatingpenalty\@MM + \leftskip\z@skip + \rightskip\z@skip + \spaceskip\z@skip + \xspaceskip\z@skip + \parindent\defaultparindent + % + \smallfonts \rm + % + % Because we use hanging indentation in footnotes, a @noindent appears + % to exdent this text, so make it be a no-op. makeinfo does not use + % hanging indentation so @noindent can still be needed within footnote + % text after an @example or the like (not that this is good style). + \let\noindent = \relax + % + % Hang the footnote text off the number. Use \everypar in case the + % footnote extends for more than one paragraph. + \everypar = {\hang}% + \textindent{\thisfootno}% + % + % Don't crash into the line above the footnote text. Since this + % expands into a box, it must come within the paragraph, lest it + % provide a place where TeX can split the footnote. + \footstrut + % + % Invoke rest of plain TeX footnote routine. + \futurelet\next\fo@t +} +}%end \catcode `\@=11 + +% In case a @footnote appears in a vbox, save the footnote text and create +% the real \insert just after the vbox finished. Otherwise, the insertion +% would be lost. +% Similarly, if a @footnote appears inside an alignment, save the footnote +% text to a box and make the \insert when a row of the table is finished. +% And the same can be done for other insert classes. --kasal, 16nov03. + +% Replace the \insert primitive by a cheating macro. +% Deeper inside, just make sure that the saved insertions are not spilled +% out prematurely. +% +\def\startsavinginserts{% + \ifx \insert\ptexinsert + \let\insert\saveinsert + \else + \let\checkinserts\relax + \fi +} + +% This \insert replacement works for both \insert\footins{foo} and +% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. +% +\def\saveinsert#1{% + \edef\next{\noexpand\savetobox \makeSAVEname#1}% + \afterassignment\next + % swallow the left brace + \let\temp = +} +\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} +\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} + +\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} + +\def\placesaveins#1{% + \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname + {\box#1}% +} + +% eat @SAVE -- beware, all of them have catcode \other: +{ + \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) + \gdef\gobblesave @SAVE{} +} + +% initialization: +\def\newsaveins #1{% + \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% + \next +} +\def\newsaveinsX #1{% + \csname newbox\endcsname #1% + \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts + \checksaveins #1}% +} + +% initialize: +\let\checkinserts\empty +\newsaveins\footins +\newsaveins\margin + + +% @image. We use the macros from epsf.tex to support this. +% If epsf.tex is not installed and @image is used, we complain. +% +% Check for and read epsf.tex up front. If we read it only at @image +% time, we might be inside a group, and then its definitions would get +% undone and the next image would fail. +\openin 1 = epsf.tex +\ifeof 1 \else + % Do not bother showing banner with epsf.tex v2.7k (available in + % doc/epsf.tex and on ctan). + \def\epsfannounce{\toks0 = }% + \input epsf.tex +\fi +\closein 1 +% +% We will only complain once about lack of epsf.tex. +\newif\ifwarnednoepsf +\newhelp\noepsfhelp{epsf.tex must be installed for images to + work. It is also included in the Texinfo distribution, or you can get + it from ftp://tug.org/tex/epsf.tex.} +% +\def\image#1{% + \ifx\epsfbox\thisisundefined + \ifwarnednoepsf \else + \errhelp = \noepsfhelp + \errmessage{epsf.tex not found, images will be ignored}% + \global\warnednoepsftrue + \fi + \else + \imagexxx #1,,,,,\finish + \fi +} +% +% Arguments to @image: +% #1 is (mandatory) image filename; we tack on .eps extension. +% #2 is (optional) width, #3 is (optional) height. +% #4 is (ignored optional) html alt text. +% #5 is (ignored optional) extension. +% #6 is just the usual extra ignored arg for parsing stuff. +\newif\ifimagevmode +\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup + \catcode`\^^M = 5 % in case we're inside an example + \normalturnoffactive % allow _ et al. in names + % If the image is by itself, center it. + \ifvmode + \imagevmodetrue + \else \ifx\centersub\centerV + % for @center @image, we need a vbox so we can have our vertical space + \imagevmodetrue + \vbox\bgroup % vbox has better behavior than vtop herev + \fi\fi + % + \ifimagevmode + \nobreak\medskip + % Usually we'll have text after the image which will insert + % \parskip glue, so insert it here too to equalize the space + % above and below. + \nobreak\vskip\parskip + \nobreak + \fi + % + % Leave vertical mode so that indentation from an enclosing + % environment such as @quotation is respected. + % However, if we're at the top level, we don't want the + % normal paragraph indentation. + % On the other hand, if we are in the case of @center @image, we don't + % want to start a paragraph, which will create a hsize-width box and + % eradicate the centering. + \ifx\centersub\centerV\else \noindent \fi + % + % Output the image. + \ifpdf + \dopdfimage{#1}{#2}{#3}% + \else + % \epsfbox itself resets \epsf?size at each figure. + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi + \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi + \epsfbox{#1.eps}% + \fi + % + \ifimagevmode + \medskip % space after a standalone image + \fi + \ifx\centersub\centerV \egroup \fi +\endgroup} + + +% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, +% etc. We don't actually implement floating yet, we always include the +% float "here". But it seemed the best name for the future. +% +\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} + +% There may be a space before second and/or third parameter; delete it. +\def\eatcommaspace#1, {#1,} + +% #1 is the optional FLOATTYPE, the text label for this float, typically +% "Figure", "Table", "Example", etc. Can't contain commas. If omitted, +% this float will not be numbered and cannot be referred to. +% +% #2 is the optional xref label. Also must be present for the float to +% be referable. +% +% #3 is the optional positioning argument; for now, it is ignored. It +% will somehow specify the positions allowed to float to (here, top, bottom). +% +% We keep a separate counter for each FLOATTYPE, which we reset at each +% chapter-level command. +\let\resetallfloatnos=\empty +% +\def\dofloat#1,#2,#3,#4\finish{% + \let\thiscaption=\empty + \let\thisshortcaption=\empty + % + % don't lose footnotes inside @float. + % + % BEWARE: when the floats start float, we have to issue warning whenever an + % insert appears inside a float which could possibly float. --kasal, 26may04 + % + \startsavinginserts + % + % We can't be used inside a paragraph. + \par + % + \vtop\bgroup + \def\floattype{#1}% + \def\floatlabel{#2}% + \def\floatloc{#3}% we do nothing with this yet. + % + \ifx\floattype\empty + \let\safefloattype=\empty + \else + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + \fi + % + % If label is given but no type, we handle that as the empty type. + \ifx\floatlabel\empty \else + % We want each FLOATTYPE to be numbered separately (Figure 1, + % Table 1, Figure 2, ...). (And if no label, no number.) + % + \expandafter\getfloatno\csname\safefloattype floatno\endcsname + \global\advance\floatno by 1 + % + {% + % This magic value for \lastsection is output by \setref as the + % XREFLABEL-title value. \xrefX uses it to distinguish float + % labels (which have a completely different output format) from + % node and anchor labels. And \xrdef uses it to construct the + % lists of floats. + % + \edef\lastsection{\floatmagic=\safefloattype}% + \setref{\floatlabel}{Yfloat}% + }% + \fi + % + % start with \parskip glue, I guess. + \vskip\parskip + % + % Don't suppress indentation if a float happens to start a section. + \restorefirstparagraphindent +} + +% we have these possibilities: +% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap +% @float Foo,lbl & no caption: Foo 1.1 +% @float Foo & @caption{Cap}: Foo: Cap +% @float Foo & no caption: Foo +% @float ,lbl & Caption{Cap}: 1.1: Cap +% @float ,lbl & no caption: 1.1 +% @float & @caption{Cap}: Cap +% @float & no caption: +% +\def\Efloat{% + \let\floatident = \empty + % + % In all cases, if we have a float type, it comes first. + \ifx\floattype\empty \else \def\floatident{\floattype}\fi + % + % If we have an xref label, the number comes next. + \ifx\floatlabel\empty \else + \ifx\floattype\empty \else % if also had float type, need tie first. + \appendtomacro\floatident{\tie}% + \fi + % the number. + \appendtomacro\floatident{\chaplevelprefix\the\floatno}% + \fi + % + % Start the printed caption with what we've constructed in + % \floatident, but keep it separate; we need \floatident again. + \let\captionline = \floatident + % + \ifx\thiscaption\empty \else + \ifx\floatident\empty \else + \appendtomacro\captionline{: }% had ident, so need a colon between + \fi + % + % caption text. + \appendtomacro\captionline{\scanexp\thiscaption}% + \fi + % + % If we have anything to print, print it, with space before. + % Eventually this needs to become an \insert. + \ifx\captionline\empty \else + \vskip.5\parskip + \captionline + % + % Space below caption. + \vskip\parskip + \fi + % + % If have an xref label, write the list of floats info. Do this + % after the caption, to avoid chance of it being a breakpoint. + \ifx\floatlabel\empty \else + % Write the text that goes in the lof to the aux file as + % \floatlabel-lof. Besides \floatident, we include the short + % caption if specified, else the full caption if specified, else nothing. + {% + \atdummies + % + % since we read the caption text in the macro world, where ^^M + % is turned into a normal character, we have to scan it back, so + % we don't write the literal three characters "^^M" into the aux file. + \scanexp{% + \xdef\noexpand\gtemp{% + \ifx\thisshortcaption\empty + \thiscaption + \else + \thisshortcaption + \fi + }% + }% + \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident + \ifx\gtemp\empty \else : \gtemp \fi}}% + }% + \fi + \egroup % end of \vtop + % + % place the captured inserts + % + % BEWARE: when the floats start floating, we have to issue warning + % whenever an insert appears inside a float which could possibly + % float. --kasal, 26may04 + % + \checkinserts +} + +% Append the tokens #2 to the definition of macro #1, not expanding either. +% +\def\appendtomacro#1#2{% + \expandafter\def\expandafter#1\expandafter{#1#2}% +} + +% @caption, @shortcaption +% +\def\caption{\docaption\thiscaption} +\def\shortcaption{\docaption\thisshortcaption} +\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} +\def\defcaption#1#2{\egroup \def#1{#2}} + +% The parameter is the control sequence identifying the counter we are +% going to use. Create it if it doesn't exist and assign it to \floatno. +\def\getfloatno#1{% + \ifx#1\relax + % Haven't seen this figure type before. + \csname newcount\endcsname #1% + % + % Remember to reset this floatno at the next chap. + \expandafter\gdef\expandafter\resetallfloatnos + \expandafter{\resetallfloatnos #1=0 }% + \fi + \let\floatno#1% +} + +% \setref calls this to get the XREFLABEL-snt value. We want an @xref +% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we +% first read the @float command. +% +\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% + +% Magic string used for the XREFLABEL-title value, so \xrefX can +% distinguish floats from other xref types. +\def\floatmagic{!!float!!} + +% #1 is the control sequence we are passed; we expand into a conditional +% which is true if #1 represents a float ref. That is, the magic +% \lastsection value which we \setref above. +% +\def\iffloat#1{\expandafter\doiffloat#1==\finish} +% +% #1 is (maybe) the \floatmagic string. If so, #2 will be the +% (safe) float type for this float. We set \iffloattype to #2. +% +\def\doiffloat#1=#2=#3\finish{% + \def\temp{#1}% + \def\iffloattype{#2}% + \ifx\temp\floatmagic +} + +% @listoffloats FLOATTYPE - print a list of floats like a table of contents. +% +\parseargdef\listoffloats{% + \def\floattype{#1}% floattype + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + % + % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. + \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax + \ifhavexrefs + % if the user said @listoffloats foo but never @float foo. + \message{\linenumber No `\safefloattype' floats to list.}% + \fi + \else + \begingroup + \leftskip=\tocindent % indent these entries like a toc + \let\do=\listoffloatsdo + \csname floatlist\safefloattype\endcsname + \endgroup + \fi +} + +% This is called on each entry in a list of floats. We're passed the +% xref label, in the form LABEL-title, which is how we save it in the +% aux file. We strip off the -title and look up \XRLABEL-lof, which +% has the text we're supposed to typeset here. +% +% Figures without xref labels will not be included in the list (since +% they won't appear in the aux file). +% +\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} +\def\listoffloatsdoentry#1-title\finish{{% + % Can't fully expand XR#1-lof because it can contain anything. Just + % pass the control sequence. On the other hand, XR#1-pg is just the + % page number, and we want to fully expand that so we can get a link + % in pdf output. + \toksA = \expandafter{\csname XR#1-lof\endcsname}% + % + % use the same \entry macro we use to generate the TOC and index. + \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% + \writeentry +}} + + +\message{localization,} + +% For single-language documents, @documentlanguage is usually given very +% early, just after @documentencoding. Single argument is the language +% (de) or locale (de_DE) abbreviation. +% +{ + \catcode`\_ = \active + \globaldefs=1 +\parseargdef\documentlanguage{\begingroup + \let_=\normalunderscore % normal _ character for filenames + \tex % read txi-??.tex file in plain TeX. + % Read the file by the name they passed if it exists. + \openin 1 txi-#1.tex + \ifeof 1 + \documentlanguagetrywithoutunderscore{#1_\finish}% + \else + \globaldefs = 1 % everything in the txi-LL files needs to persist + \input txi-#1.tex + \fi + \closein 1 + \endgroup % end raw TeX +\endgroup} +% +% If they passed de_DE, and txi-de_DE.tex doesn't exist, +% try txi-de.tex. +% +\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% + \openin 1 txi-#1.tex + \ifeof 1 + \errhelp = \nolanghelp + \errmessage{Cannot read language file txi-#1.tex}% + \else + \globaldefs = 1 % everything in the txi-LL files needs to persist + \input txi-#1.tex + \fi + \closein 1 +} +}% end of special _ catcode +% +\newhelp\nolanghelp{The given language definition file cannot be found or +is empty. Maybe you need to install it? Putting it in the current +directory should work if nowhere else does.} + +% This macro is called from txi-??.tex files; the first argument is the +% \language name to set (without the "\lang@" prefix), the second and +% third args are \{left,right}hyphenmin. +% +% The language names to pass are determined when the format is built. +% See the etex.log file created at that time, e.g., +% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. +% +% With TeX Live 2008, etex now includes hyphenation patterns for all +% available languages. This means we can support hyphenation in +% Texinfo, at least to some extent. (This still doesn't solve the +% accented characters problem.) +% +\catcode`@=11 +\def\txisetlanguage#1#2#3{% + % do not set the language if the name is undefined in the current TeX. + \expandafter\ifx\csname lang@#1\endcsname \relax + \message{no patterns for #1}% + \else + \global\language = \csname lang@#1\endcsname + \fi + % but there is no harm in adjusting the hyphenmin values regardless. + \global\lefthyphenmin = #2\relax + \global\righthyphenmin = #3\relax +} + +% Helpers for encodings. +% Set the catcode of characters 128 through 255 to the specified number. +% +\def\setnonasciicharscatcode#1{% + \count255=128 + \loop\ifnum\count255<256 + \global\catcode\count255=#1\relax + \advance\count255 by 1 + \repeat +} + +\def\setnonasciicharscatcodenonglobal#1{% + \count255=128 + \loop\ifnum\count255<256 + \catcode\count255=#1\relax + \advance\count255 by 1 + \repeat +} + +% @documentencoding sets the definition of non-ASCII characters +% according to the specified encoding. +% +\parseargdef\documentencoding{% + % Encoding being declared for the document. + \def\declaredencoding{\csname #1.enc\endcsname}% + % + % Supported encodings: names converted to tokens in order to be able + % to compare them with \ifx. + \def\ascii{\csname US-ASCII.enc\endcsname}% + \def\latnine{\csname ISO-8859-15.enc\endcsname}% + \def\latone{\csname ISO-8859-1.enc\endcsname}% + \def\lattwo{\csname ISO-8859-2.enc\endcsname}% + \def\utfeight{\csname UTF-8.enc\endcsname}% + % + \ifx \declaredencoding \ascii + \asciichardefs + % + \else \ifx \declaredencoding \lattwo + \setnonasciicharscatcode\active + \lattwochardefs + % + \else \ifx \declaredencoding \latone + \setnonasciicharscatcode\active + \latonechardefs + % + \else \ifx \declaredencoding \latnine + \setnonasciicharscatcode\active + \latninechardefs + % + \else \ifx \declaredencoding \utfeight + \setnonasciicharscatcode\active + \utfeightchardefs + % + \else + \message{Unknown document encoding #1, ignoring.}% + % + \fi % utfeight + \fi % latnine + \fi % latone + \fi % lattwo + \fi % ascii +} + +% A message to be logged when using a character that isn't available +% the default font encoding (OT1). +% +\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} + +% Take account of \c (plain) vs. \, (Texinfo) difference. +\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} + +% First, make active non-ASCII characters in order for them to be +% correctly categorized when TeX reads the replacement text of +% macros containing the character definitions. +\setnonasciicharscatcode\active +% +% Latin1 (ISO-8859-1) character definitions. +\def\latonechardefs{% + \gdef^^a0{\tie} + \gdef^^a1{\exclamdown} + \gdef^^a2{\missingcharmsg{CENT SIGN}} + \gdef^^a3{{\pounds}} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\missingcharmsg{YEN SIGN}} + \gdef^^a6{\missingcharmsg{BROKEN BAR}} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\copyright} + \gdef^^aa{\ordf} + \gdef^^ab{\guillemetleft} + \gdef^^ac{$\lnot$} + \gdef^^ad{\-} + \gdef^^ae{\registeredsymbol} + \gdef^^af{\={}} + % + \gdef^^b0{\textdegree} + \gdef^^b1{$\pm$} + \gdef^^b2{$^2$} + \gdef^^b3{$^3$} + \gdef^^b4{\'{}} + \gdef^^b5{$\mu$} + \gdef^^b6{\P} + % + \gdef^^b7{$^.$} + \gdef^^b8{\cedilla\ } + \gdef^^b9{$^1$} + \gdef^^ba{\ordm} + % + \gdef^^bb{\guillemetright} + \gdef^^bc{$1\over4$} + \gdef^^bd{$1\over2$} + \gdef^^be{$3\over4$} + \gdef^^bf{\questiondown} + % + \gdef^^c0{\`A} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\~A} + \gdef^^c4{\"A} + \gdef^^c5{\ringaccent A} + \gdef^^c6{\AE} + \gdef^^c7{\cedilla C} + \gdef^^c8{\`E} + \gdef^^c9{\'E} + \gdef^^ca{\^E} + \gdef^^cb{\"E} + \gdef^^cc{\`I} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\"I} + % + \gdef^^d0{\DH} + \gdef^^d1{\~N} + \gdef^^d2{\`O} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\~O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\O} + \gdef^^d9{\`U} + \gdef^^da{\'U} + \gdef^^db{\^U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\TH} + \gdef^^df{\ss} + % + \gdef^^e0{\`a} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\~a} + \gdef^^e4{\"a} + \gdef^^e5{\ringaccent a} + \gdef^^e6{\ae} + \gdef^^e7{\cedilla c} + \gdef^^e8{\`e} + \gdef^^e9{\'e} + \gdef^^ea{\^e} + \gdef^^eb{\"e} + \gdef^^ec{\`{\dotless i}} + \gdef^^ed{\'{\dotless i}} + \gdef^^ee{\^{\dotless i}} + \gdef^^ef{\"{\dotless i}} + % + \gdef^^f0{\dh} + \gdef^^f1{\~n} + \gdef^^f2{\`o} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\~o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\o} + \gdef^^f9{\`u} + \gdef^^fa{\'u} + \gdef^^fb{\^u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\th} + \gdef^^ff{\"y} +} + +% Latin9 (ISO-8859-15) encoding character definitions. +\def\latninechardefs{% + % Encoding is almost identical to Latin1. + \latonechardefs + % + \gdef^^a4{\euro} + \gdef^^a6{\v S} + \gdef^^a8{\v s} + \gdef^^b4{\v Z} + \gdef^^b8{\v z} + \gdef^^bc{\OE} + \gdef^^bd{\oe} + \gdef^^be{\"Y} +} + +% Latin2 (ISO-8859-2) character definitions. +\def\lattwochardefs{% + \gdef^^a0{\tie} + \gdef^^a1{\ogonek{A}} + \gdef^^a2{\u{}} + \gdef^^a3{\L} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\v L} + \gdef^^a6{\'S} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\v S} + \gdef^^aa{\cedilla S} + \gdef^^ab{\v T} + \gdef^^ac{\'Z} + \gdef^^ad{\-} + \gdef^^ae{\v Z} + \gdef^^af{\dotaccent Z} + % + \gdef^^b0{\textdegree} + \gdef^^b1{\ogonek{a}} + \gdef^^b2{\ogonek{ }} + \gdef^^b3{\l} + \gdef^^b4{\'{}} + \gdef^^b5{\v l} + \gdef^^b6{\'s} + \gdef^^b7{\v{}} + \gdef^^b8{\cedilla\ } + \gdef^^b9{\v s} + \gdef^^ba{\cedilla s} + \gdef^^bb{\v t} + \gdef^^bc{\'z} + \gdef^^bd{\H{}} + \gdef^^be{\v z} + \gdef^^bf{\dotaccent z} + % + \gdef^^c0{\'R} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\u A} + \gdef^^c4{\"A} + \gdef^^c5{\'L} + \gdef^^c6{\'C} + \gdef^^c7{\cedilla C} + \gdef^^c8{\v C} + \gdef^^c9{\'E} + \gdef^^ca{\ogonek{E}} + \gdef^^cb{\"E} + \gdef^^cc{\v E} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\v D} + % + \gdef^^d0{\DH} + \gdef^^d1{\'N} + \gdef^^d2{\v N} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\H O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\v R} + \gdef^^d9{\ringaccent U} + \gdef^^da{\'U} + \gdef^^db{\H U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\cedilla T} + \gdef^^df{\ss} + % + \gdef^^e0{\'r} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\u a} + \gdef^^e4{\"a} + \gdef^^e5{\'l} + \gdef^^e6{\'c} + \gdef^^e7{\cedilla c} + \gdef^^e8{\v c} + \gdef^^e9{\'e} + \gdef^^ea{\ogonek{e}} + \gdef^^eb{\"e} + \gdef^^ec{\v e} + \gdef^^ed{\'{\dotless{i}}} + \gdef^^ee{\^{\dotless{i}}} + \gdef^^ef{\v d} + % + \gdef^^f0{\dh} + \gdef^^f1{\'n} + \gdef^^f2{\v n} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\H o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\v r} + \gdef^^f9{\ringaccent u} + \gdef^^fa{\'u} + \gdef^^fb{\H u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\cedilla t} + \gdef^^ff{\dotaccent{}} +} + +% UTF-8 character definitions. +% +% This code to support UTF-8 is based on LaTeX's utf8.def, with some +% changes for Texinfo conventions. It is included here under the GPL by +% permission from Frank Mittelbach and the LaTeX team. +% +\newcount\countUTFx +\newcount\countUTFy +\newcount\countUTFz + +\gdef\UTFviiiTwoOctets#1#2{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\endcsname} +% +\gdef\UTFviiiThreeOctets#1#2#3{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} +% +\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} + +\gdef\UTFviiiDefined#1{% + \ifx #1\relax + \message{\linenumber Unicode char \string #1 not defined for Texinfo}% + \else + \expandafter #1% + \fi +} + +\begingroup + \catcode`\~13 + \catcode`\"12 + + \def\UTFviiiLoop{% + \global\catcode\countUTFx\active + \uccode`\~\countUTFx + \uppercase\expandafter{\UTFviiiTmp}% + \advance\countUTFx by 1 + \ifnum\countUTFx < \countUTFy + \expandafter\UTFviiiLoop + \fi} + + \countUTFx = "C2 + \countUTFy = "E0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiTwoOctets\string~}} + \UTFviiiLoop + + \countUTFx = "E0 + \countUTFy = "F0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiThreeOctets\string~}} + \UTFviiiLoop + + \countUTFx = "F0 + \countUTFy = "F4 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiFourOctets\string~}} + \UTFviiiLoop +\endgroup + +\begingroup + \catcode`\"=12 + \catcode`\<=12 + \catcode`\.=12 + \catcode`\,=12 + \catcode`\;=12 + \catcode`\!=12 + \catcode`\~=13 + + \gdef\DeclareUnicodeCharacter#1#2{% + \countUTFz = "#1\relax + %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% + \begingroup + \parseXMLCharref + \def\UTFviiiTwoOctets##1##2{% + \csname u8:##1\string ##2\endcsname}% + \def\UTFviiiThreeOctets##1##2##3{% + \csname u8:##1\string ##2\string ##3\endcsname}% + \def\UTFviiiFourOctets##1##2##3##4{% + \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% + \expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \gdef\UTFviiiTmp{#2}% + \endgroup} + + \gdef\parseXMLCharref{% + \ifnum\countUTFz < "A0\relax + \errhelp = \EMsimple + \errmessage{Cannot define Unicode char value < 00A0}% + \else\ifnum\countUTFz < "800\relax + \parseUTFviiiA,% + \parseUTFviiiB C\UTFviiiTwoOctets.,% + \else\ifnum\countUTFz < "10000\relax + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% + \else + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiA!% + \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% + \fi\fi\fi + } + + \gdef\parseUTFviiiA#1{% + \countUTFx = \countUTFz + \divide\countUTFz by 64 + \countUTFy = \countUTFz + \multiply\countUTFz by 64 + \advance\countUTFx by -\countUTFz + \advance\countUTFx by 128 + \uccode `#1\countUTFx + \countUTFz = \countUTFy} + + \gdef\parseUTFviiiB#1#2#3#4{% + \advance\countUTFz by "#10\relax + \uccode `#3\countUTFz + \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} +\endgroup + +\def\utfeightchardefs{% + \DeclareUnicodeCharacter{00A0}{\tie} + \DeclareUnicodeCharacter{00A1}{\exclamdown} + \DeclareUnicodeCharacter{00A3}{\pounds} + \DeclareUnicodeCharacter{00A8}{\"{ }} + \DeclareUnicodeCharacter{00A9}{\copyright} + \DeclareUnicodeCharacter{00AA}{\ordf} + \DeclareUnicodeCharacter{00AB}{\guillemetleft} + \DeclareUnicodeCharacter{00AD}{\-} + \DeclareUnicodeCharacter{00AE}{\registeredsymbol} + \DeclareUnicodeCharacter{00AF}{\={ }} + + \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} + \DeclareUnicodeCharacter{00B4}{\'{ }} + \DeclareUnicodeCharacter{00B8}{\cedilla{ }} + \DeclareUnicodeCharacter{00BA}{\ordm} + \DeclareUnicodeCharacter{00BB}{\guillemetright} + \DeclareUnicodeCharacter{00BF}{\questiondown} + + \DeclareUnicodeCharacter{00C0}{\`A} + \DeclareUnicodeCharacter{00C1}{\'A} + \DeclareUnicodeCharacter{00C2}{\^A} + \DeclareUnicodeCharacter{00C3}{\~A} + \DeclareUnicodeCharacter{00C4}{\"A} + \DeclareUnicodeCharacter{00C5}{\AA} + \DeclareUnicodeCharacter{00C6}{\AE} + \DeclareUnicodeCharacter{00C7}{\cedilla{C}} + \DeclareUnicodeCharacter{00C8}{\`E} + \DeclareUnicodeCharacter{00C9}{\'E} + \DeclareUnicodeCharacter{00CA}{\^E} + \DeclareUnicodeCharacter{00CB}{\"E} + \DeclareUnicodeCharacter{00CC}{\`I} + \DeclareUnicodeCharacter{00CD}{\'I} + \DeclareUnicodeCharacter{00CE}{\^I} + \DeclareUnicodeCharacter{00CF}{\"I} + + \DeclareUnicodeCharacter{00D0}{\DH} + \DeclareUnicodeCharacter{00D1}{\~N} + \DeclareUnicodeCharacter{00D2}{\`O} + \DeclareUnicodeCharacter{00D3}{\'O} + \DeclareUnicodeCharacter{00D4}{\^O} + \DeclareUnicodeCharacter{00D5}{\~O} + \DeclareUnicodeCharacter{00D6}{\"O} + \DeclareUnicodeCharacter{00D8}{\O} + \DeclareUnicodeCharacter{00D9}{\`U} + \DeclareUnicodeCharacter{00DA}{\'U} + \DeclareUnicodeCharacter{00DB}{\^U} + \DeclareUnicodeCharacter{00DC}{\"U} + \DeclareUnicodeCharacter{00DD}{\'Y} + \DeclareUnicodeCharacter{00DE}{\TH} + \DeclareUnicodeCharacter{00DF}{\ss} + + \DeclareUnicodeCharacter{00E0}{\`a} + \DeclareUnicodeCharacter{00E1}{\'a} + \DeclareUnicodeCharacter{00E2}{\^a} + \DeclareUnicodeCharacter{00E3}{\~a} + \DeclareUnicodeCharacter{00E4}{\"a} + \DeclareUnicodeCharacter{00E5}{\aa} + \DeclareUnicodeCharacter{00E6}{\ae} + \DeclareUnicodeCharacter{00E7}{\cedilla{c}} + \DeclareUnicodeCharacter{00E8}{\`e} + \DeclareUnicodeCharacter{00E9}{\'e} + \DeclareUnicodeCharacter{00EA}{\^e} + \DeclareUnicodeCharacter{00EB}{\"e} + \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} + \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} + \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} + \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} + + \DeclareUnicodeCharacter{00F0}{\dh} + \DeclareUnicodeCharacter{00F1}{\~n} + \DeclareUnicodeCharacter{00F2}{\`o} + \DeclareUnicodeCharacter{00F3}{\'o} + \DeclareUnicodeCharacter{00F4}{\^o} + \DeclareUnicodeCharacter{00F5}{\~o} + \DeclareUnicodeCharacter{00F6}{\"o} + \DeclareUnicodeCharacter{00F8}{\o} + \DeclareUnicodeCharacter{00F9}{\`u} + \DeclareUnicodeCharacter{00FA}{\'u} + \DeclareUnicodeCharacter{00FB}{\^u} + \DeclareUnicodeCharacter{00FC}{\"u} + \DeclareUnicodeCharacter{00FD}{\'y} + \DeclareUnicodeCharacter{00FE}{\th} + \DeclareUnicodeCharacter{00FF}{\"y} + + \DeclareUnicodeCharacter{0100}{\=A} + \DeclareUnicodeCharacter{0101}{\=a} + \DeclareUnicodeCharacter{0102}{\u{A}} + \DeclareUnicodeCharacter{0103}{\u{a}} + \DeclareUnicodeCharacter{0104}{\ogonek{A}} + \DeclareUnicodeCharacter{0105}{\ogonek{a}} + \DeclareUnicodeCharacter{0106}{\'C} + \DeclareUnicodeCharacter{0107}{\'c} + \DeclareUnicodeCharacter{0108}{\^C} + \DeclareUnicodeCharacter{0109}{\^c} + \DeclareUnicodeCharacter{0118}{\ogonek{E}} + \DeclareUnicodeCharacter{0119}{\ogonek{e}} + \DeclareUnicodeCharacter{010A}{\dotaccent{C}} + \DeclareUnicodeCharacter{010B}{\dotaccent{c}} + \DeclareUnicodeCharacter{010C}{\v{C}} + \DeclareUnicodeCharacter{010D}{\v{c}} + \DeclareUnicodeCharacter{010E}{\v{D}} + + \DeclareUnicodeCharacter{0112}{\=E} + \DeclareUnicodeCharacter{0113}{\=e} + \DeclareUnicodeCharacter{0114}{\u{E}} + \DeclareUnicodeCharacter{0115}{\u{e}} + \DeclareUnicodeCharacter{0116}{\dotaccent{E}} + \DeclareUnicodeCharacter{0117}{\dotaccent{e}} + \DeclareUnicodeCharacter{011A}{\v{E}} + \DeclareUnicodeCharacter{011B}{\v{e}} + \DeclareUnicodeCharacter{011C}{\^G} + \DeclareUnicodeCharacter{011D}{\^g} + \DeclareUnicodeCharacter{011E}{\u{G}} + \DeclareUnicodeCharacter{011F}{\u{g}} + + \DeclareUnicodeCharacter{0120}{\dotaccent{G}} + \DeclareUnicodeCharacter{0121}{\dotaccent{g}} + \DeclareUnicodeCharacter{0124}{\^H} + \DeclareUnicodeCharacter{0125}{\^h} + \DeclareUnicodeCharacter{0128}{\~I} + \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} + \DeclareUnicodeCharacter{012A}{\=I} + \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} + \DeclareUnicodeCharacter{012C}{\u{I}} + \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} + + \DeclareUnicodeCharacter{0130}{\dotaccent{I}} + \DeclareUnicodeCharacter{0131}{\dotless{i}} + \DeclareUnicodeCharacter{0132}{IJ} + \DeclareUnicodeCharacter{0133}{ij} + \DeclareUnicodeCharacter{0134}{\^J} + \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} + \DeclareUnicodeCharacter{0139}{\'L} + \DeclareUnicodeCharacter{013A}{\'l} + + \DeclareUnicodeCharacter{0141}{\L} + \DeclareUnicodeCharacter{0142}{\l} + \DeclareUnicodeCharacter{0143}{\'N} + \DeclareUnicodeCharacter{0144}{\'n} + \DeclareUnicodeCharacter{0147}{\v{N}} + \DeclareUnicodeCharacter{0148}{\v{n}} + \DeclareUnicodeCharacter{014C}{\=O} + \DeclareUnicodeCharacter{014D}{\=o} + \DeclareUnicodeCharacter{014E}{\u{O}} + \DeclareUnicodeCharacter{014F}{\u{o}} + + \DeclareUnicodeCharacter{0150}{\H{O}} + \DeclareUnicodeCharacter{0151}{\H{o}} + \DeclareUnicodeCharacter{0152}{\OE} + \DeclareUnicodeCharacter{0153}{\oe} + \DeclareUnicodeCharacter{0154}{\'R} + \DeclareUnicodeCharacter{0155}{\'r} + \DeclareUnicodeCharacter{0158}{\v{R}} + \DeclareUnicodeCharacter{0159}{\v{r}} + \DeclareUnicodeCharacter{015A}{\'S} + \DeclareUnicodeCharacter{015B}{\'s} + \DeclareUnicodeCharacter{015C}{\^S} + \DeclareUnicodeCharacter{015D}{\^s} + \DeclareUnicodeCharacter{015E}{\cedilla{S}} + \DeclareUnicodeCharacter{015F}{\cedilla{s}} + + \DeclareUnicodeCharacter{0160}{\v{S}} + \DeclareUnicodeCharacter{0161}{\v{s}} + \DeclareUnicodeCharacter{0162}{\cedilla{t}} + \DeclareUnicodeCharacter{0163}{\cedilla{T}} + \DeclareUnicodeCharacter{0164}{\v{T}} + + \DeclareUnicodeCharacter{0168}{\~U} + \DeclareUnicodeCharacter{0169}{\~u} + \DeclareUnicodeCharacter{016A}{\=U} + \DeclareUnicodeCharacter{016B}{\=u} + \DeclareUnicodeCharacter{016C}{\u{U}} + \DeclareUnicodeCharacter{016D}{\u{u}} + \DeclareUnicodeCharacter{016E}{\ringaccent{U}} + \DeclareUnicodeCharacter{016F}{\ringaccent{u}} + + \DeclareUnicodeCharacter{0170}{\H{U}} + \DeclareUnicodeCharacter{0171}{\H{u}} + \DeclareUnicodeCharacter{0174}{\^W} + \DeclareUnicodeCharacter{0175}{\^w} + \DeclareUnicodeCharacter{0176}{\^Y} + \DeclareUnicodeCharacter{0177}{\^y} + \DeclareUnicodeCharacter{0178}{\"Y} + \DeclareUnicodeCharacter{0179}{\'Z} + \DeclareUnicodeCharacter{017A}{\'z} + \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} + \DeclareUnicodeCharacter{017C}{\dotaccent{z}} + \DeclareUnicodeCharacter{017D}{\v{Z}} + \DeclareUnicodeCharacter{017E}{\v{z}} + + \DeclareUnicodeCharacter{01C4}{D\v{Z}} + \DeclareUnicodeCharacter{01C5}{D\v{z}} + \DeclareUnicodeCharacter{01C6}{d\v{z}} + \DeclareUnicodeCharacter{01C7}{LJ} + \DeclareUnicodeCharacter{01C8}{Lj} + \DeclareUnicodeCharacter{01C9}{lj} + \DeclareUnicodeCharacter{01CA}{NJ} + \DeclareUnicodeCharacter{01CB}{Nj} + \DeclareUnicodeCharacter{01CC}{nj} + \DeclareUnicodeCharacter{01CD}{\v{A}} + \DeclareUnicodeCharacter{01CE}{\v{a}} + \DeclareUnicodeCharacter{01CF}{\v{I}} + + \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} + \DeclareUnicodeCharacter{01D1}{\v{O}} + \DeclareUnicodeCharacter{01D2}{\v{o}} + \DeclareUnicodeCharacter{01D3}{\v{U}} + \DeclareUnicodeCharacter{01D4}{\v{u}} + + \DeclareUnicodeCharacter{01E2}{\={\AE}} + \DeclareUnicodeCharacter{01E3}{\={\ae}} + \DeclareUnicodeCharacter{01E6}{\v{G}} + \DeclareUnicodeCharacter{01E7}{\v{g}} + \DeclareUnicodeCharacter{01E8}{\v{K}} + \DeclareUnicodeCharacter{01E9}{\v{k}} + + \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} + \DeclareUnicodeCharacter{01F1}{DZ} + \DeclareUnicodeCharacter{01F2}{Dz} + \DeclareUnicodeCharacter{01F3}{dz} + \DeclareUnicodeCharacter{01F4}{\'G} + \DeclareUnicodeCharacter{01F5}{\'g} + \DeclareUnicodeCharacter{01F8}{\`N} + \DeclareUnicodeCharacter{01F9}{\`n} + \DeclareUnicodeCharacter{01FC}{\'{\AE}} + \DeclareUnicodeCharacter{01FD}{\'{\ae}} + \DeclareUnicodeCharacter{01FE}{\'{\O}} + \DeclareUnicodeCharacter{01FF}{\'{\o}} + + \DeclareUnicodeCharacter{021E}{\v{H}} + \DeclareUnicodeCharacter{021F}{\v{h}} + + \DeclareUnicodeCharacter{0226}{\dotaccent{A}} + \DeclareUnicodeCharacter{0227}{\dotaccent{a}} + \DeclareUnicodeCharacter{0228}{\cedilla{E}} + \DeclareUnicodeCharacter{0229}{\cedilla{e}} + \DeclareUnicodeCharacter{022E}{\dotaccent{O}} + \DeclareUnicodeCharacter{022F}{\dotaccent{o}} + + \DeclareUnicodeCharacter{0232}{\=Y} + \DeclareUnicodeCharacter{0233}{\=y} + \DeclareUnicodeCharacter{0237}{\dotless{j}} + + \DeclareUnicodeCharacter{02DB}{\ogonek{ }} + + \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} + \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} + \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} + \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} + \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} + \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} + \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} + \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} + \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} + \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} + \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} + \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} + + \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} + \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} + + \DeclareUnicodeCharacter{1E20}{\=G} + \DeclareUnicodeCharacter{1E21}{\=g} + \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} + \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} + \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} + \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} + \DeclareUnicodeCharacter{1E26}{\"H} + \DeclareUnicodeCharacter{1E27}{\"h} + + \DeclareUnicodeCharacter{1E30}{\'K} + \DeclareUnicodeCharacter{1E31}{\'k} + \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} + \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} + \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} + \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} + \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} + \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} + \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} + \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} + \DeclareUnicodeCharacter{1E3E}{\'M} + \DeclareUnicodeCharacter{1E3F}{\'m} + + \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} + \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} + \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} + \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} + \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} + \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} + \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} + \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} + \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} + \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} + + \DeclareUnicodeCharacter{1E54}{\'P} + \DeclareUnicodeCharacter{1E55}{\'p} + \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} + \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} + \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} + \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} + \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} + \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} + \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} + \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} + + \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} + \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} + \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} + \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} + \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} + \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} + \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} + \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} + \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} + \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} + + \DeclareUnicodeCharacter{1E7C}{\~V} + \DeclareUnicodeCharacter{1E7D}{\~v} + \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} + \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} + + \DeclareUnicodeCharacter{1E80}{\`W} + \DeclareUnicodeCharacter{1E81}{\`w} + \DeclareUnicodeCharacter{1E82}{\'W} + \DeclareUnicodeCharacter{1E83}{\'w} + \DeclareUnicodeCharacter{1E84}{\"W} + \DeclareUnicodeCharacter{1E85}{\"w} + \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} + \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} + \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} + \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} + \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} + \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} + \DeclareUnicodeCharacter{1E8C}{\"X} + \DeclareUnicodeCharacter{1E8D}{\"x} + \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} + \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} + + \DeclareUnicodeCharacter{1E90}{\^Z} + \DeclareUnicodeCharacter{1E91}{\^z} + \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} + \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} + \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} + \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} + \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} + \DeclareUnicodeCharacter{1E97}{\"t} + \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} + \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} + + \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} + \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} + + \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} + \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} + \DeclareUnicodeCharacter{1EBC}{\~E} + \DeclareUnicodeCharacter{1EBD}{\~e} + + \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} + \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} + \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} + \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} + + \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} + \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} + + \DeclareUnicodeCharacter{1EF2}{\`Y} + \DeclareUnicodeCharacter{1EF3}{\`y} + \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} + + \DeclareUnicodeCharacter{1EF8}{\~Y} + \DeclareUnicodeCharacter{1EF9}{\~y} + + \DeclareUnicodeCharacter{2013}{--} + \DeclareUnicodeCharacter{2014}{---} + \DeclareUnicodeCharacter{2018}{\quoteleft} + \DeclareUnicodeCharacter{2019}{\quoteright} + \DeclareUnicodeCharacter{201A}{\quotesinglbase} + \DeclareUnicodeCharacter{201C}{\quotedblleft} + \DeclareUnicodeCharacter{201D}{\quotedblright} + \DeclareUnicodeCharacter{201E}{\quotedblbase} + \DeclareUnicodeCharacter{2022}{\bullet} + \DeclareUnicodeCharacter{2026}{\dots} + \DeclareUnicodeCharacter{2039}{\guilsinglleft} + \DeclareUnicodeCharacter{203A}{\guilsinglright} + \DeclareUnicodeCharacter{20AC}{\euro} + + \DeclareUnicodeCharacter{2192}{\expansion} + \DeclareUnicodeCharacter{21D2}{\result} + + \DeclareUnicodeCharacter{2212}{\minus} + \DeclareUnicodeCharacter{2217}{\point} + \DeclareUnicodeCharacter{2261}{\equiv} +}% end of \utfeightchardefs + + +% US-ASCII character definitions. +\def\asciichardefs{% nothing need be done + \relax +} + +% Make non-ASCII characters printable again for compatibility with +% existing Texinfo documents that may use them, even without declaring a +% document encoding. +% +\setnonasciicharscatcode \other + + +\message{formatting,} + +\newdimen\defaultparindent \defaultparindent = 15pt + +\chapheadingskip = 15pt plus 4pt minus 2pt +\secheadingskip = 12pt plus 3pt minus 2pt +\subsecheadingskip = 9pt plus 2pt minus 2pt + +% Prevent underfull vbox error messages. +\vbadness = 10000 + +% Don't be very finicky about underfull hboxes, either. +\hbadness = 6666 + +% Following George Bush, get rid of widows and orphans. +\widowpenalty=10000 +\clubpenalty=10000 + +% Use TeX 3.0's \emergencystretch to help line breaking, but if we're +% using an old version of TeX, don't do anything. We want the amount of +% stretch added to depend on the line length, hence the dependence on +% \hsize. We call this whenever the paper size is set. +% +\def\setemergencystretch{% + \ifx\emergencystretch\thisisundefined + % Allow us to assign to \emergencystretch anyway. + \def\emergencystretch{\dimen0}% + \else + \emergencystretch = .15\hsize + \fi +} + +% Parameters in order: 1) textheight; 2) textwidth; +% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; +% 7) physical page height; 8) physical page width. +% +% We also call \setleading{\textleading}, so the caller should define +% \textleading. The caller should also set \parskip. +% +\def\internalpagesizes#1#2#3#4#5#6#7#8{% + \voffset = #3\relax + \topskip = #6\relax + \splittopskip = \topskip + % + \vsize = #1\relax + \advance\vsize by \topskip + \outervsize = \vsize + \advance\outervsize by 2\topandbottommargin + \pageheight = \vsize + % + \hsize = #2\relax + \outerhsize = \hsize + \advance\outerhsize by 0.5in + \pagewidth = \hsize + % + \normaloffset = #4\relax + \bindingoffset = #5\relax + % + \ifpdf + \pdfpageheight #7\relax + \pdfpagewidth #8\relax + % if we don't reset these, they will remain at "1 true in" of + % whatever layout pdftex was dumped with. + \pdfhorigin = 1 true in + \pdfvorigin = 1 true in + \fi + % + \setleading{\textleading} + % + \parindent = \defaultparindent + \setemergencystretch +} + +% @letterpaper (the default). +\def\letterpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \textleading = 13.2pt + % + % If page is nothing but text, make it come out even. + \internalpagesizes{607.2pt}{6in}% that's 46 lines + {\voffset}{.25in}% + {\bindingoffset}{36pt}% + {11in}{8.5in}% +}} + +% Use @smallbook to reset parameters for 7x9.25 trim size. +\def\smallbook{{\globaldefs = 1 + \parskip = 2pt plus 1pt + \textleading = 12pt + % + \internalpagesizes{7.5in}{5in}% + {-.2in}{0in}% + {\bindingoffset}{16pt}% + {9.25in}{7in}% + % + \lispnarrowing = 0.3in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = .5cm +}} + +% Use @smallerbook to reset parameters for 6x9 trim size. +% (Just testing, parameters still in flux.) +\def\smallerbook{{\globaldefs = 1 + \parskip = 1.5pt plus 1pt + \textleading = 12pt + % + \internalpagesizes{7.4in}{4.8in}% + {-.2in}{-.4in}% + {0pt}{14pt}% + {9in}{6in}% + % + \lispnarrowing = 0.25in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = .4cm +}} + +% Use @afourpaper to print on European A4 paper. +\def\afourpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \textleading = 13.2pt + % + % Double-side printing via postscript on Laserjet 4050 + % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. + % To change the settings for a different printer or situation, adjust + % \normaloffset until the front-side and back-side texts align. Then + % do the same for \bindingoffset. You can set these for testing in + % your texinfo source file like this: + % @tex + % \global\normaloffset = -6mm + % \global\bindingoffset = 10mm + % @end tex + \internalpagesizes{673.2pt}{160mm}% that's 51 lines + {\voffset}{\hoffset}% + {\bindingoffset}{44pt}% + {297mm}{210mm}% + % + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = 5mm +}} + +% Use @afivepaper to print on European A5 paper. +% From romildo@urano.iceb.ufop.br, 2 July 2000. +% He also recommends making @example and @lisp be small. +\def\afivepaper{{\globaldefs = 1 + \parskip = 2pt plus 1pt minus 0.1pt + \textleading = 12.5pt + % + \internalpagesizes{160mm}{120mm}% + {\voffset}{\hoffset}% + {\bindingoffset}{8pt}% + {210mm}{148mm}% + % + \lispnarrowing = 0.2in + \tolerance = 800 + \hfuzz = 1.2pt + \contentsrightmargin = 0pt + \defbodyindent = 2mm + \tableindent = 12mm +}} + +% A specific text layout, 24x15cm overall, intended for A4 paper. +\def\afourlatex{{\globaldefs = 1 + \afourpaper + \internalpagesizes{237mm}{150mm}% + {\voffset}{4.6mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + % + % Must explicitly reset to 0 because we call \afourpaper. + \globaldefs = 0 +}} + +% Use @afourwide to print on A4 paper in landscape format. +\def\afourwide{{\globaldefs = 1 + \afourpaper + \internalpagesizes{241mm}{165mm}% + {\voffset}{-2.95mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + \globaldefs = 0 +}} + +% @pagesizes TEXTHEIGHT[,TEXTWIDTH] +% Perhaps we should allow setting the margins, \topskip, \parskip, +% and/or leading, also. Or perhaps we should compute them somehow. +% +\parseargdef\pagesizes{\pagesizesyyy #1,,\finish} +\def\pagesizesyyy#1,#2,#3\finish{{% + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi + \globaldefs = 1 + % + \parskip = 3pt plus 2pt minus 1pt + \setleading{\textleading}% + % + \dimen0 = #1\relax + \advance\dimen0 by \voffset + % + \dimen2 = \hsize + \advance\dimen2 by \normaloffset + % + \internalpagesizes{#1}{\hsize}% + {\voffset}{\normaloffset}% + {\bindingoffset}{44pt}% + {\dimen0}{\dimen2}% +}} + +% Set default to letter. +% +\letterpaper + + +\message{and turning on texinfo input format.} + +\def^^L{\par} % remove \outer, so ^L can appear in an @comment + +% DEL is a comment character, in case @c does not suffice. +\catcode`\^^? = 14 + +% Define macros to output various characters with catcode for normal text. +\catcode`\"=\other \def\normaldoublequote{"} +\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix +\catcode`\+=\other \def\normalplus{+} +\catcode`\<=\other \def\normalless{<} +\catcode`\>=\other \def\normalgreater{>} +\catcode`\^=\other \def\normalcaret{^} +\catcode`\_=\other \def\normalunderscore{_} +\catcode`\|=\other \def\normalverticalbar{|} +\catcode`\~=\other \def\normaltilde{~} + +% This macro is used to make a character print one way in \tt +% (where it can probably be output as-is), and another way in other fonts, +% where something hairier probably needs to be done. +% +% #1 is what to print if we are indeed using \tt; #2 is what to print +% otherwise. Since all the Computer Modern typewriter fonts have zero +% interword stretch (and shrink), and it is reasonable to expect all +% typewriter fonts to have this, we can check that font parameter. +% +\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} + +% Same as above, but check for italic font. Actually this also catches +% non-italic slanted fonts since it is impossible to distinguish them from +% italic fonts. But since this is only used by $ and it uses \sl anyway +% this is not a problem. +\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} + +% Turn off all special characters except @ +% (and those which the user can use as if they were ordinary). +% Most of these we simply print from the \tt font, but for some, we can +% use math or other variants that look better in normal text. + +\catcode`\"=\active +\def\activedoublequote{{\tt\char34}} +\let"=\activedoublequote +\catcode`\~=\active +\def~{{\tt\char126}} +\chardef\hat=`\^ +\catcode`\^=\active +\def^{{\tt \hat}} + +\catcode`\_=\active +\def_{\ifusingtt\normalunderscore\_} +\let\realunder=_ +% Subroutine for the previous macro. +\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } + +\catcode`\|=\active +\def|{{\tt\char124}} +\chardef \less=`\< +\catcode`\<=\active +\def<{{\tt \less}} +\chardef \gtr=`\> +\catcode`\>=\active +\def>{{\tt \gtr}} +\catcode`\+=\active +\def+{{\tt \char 43}} +\catcode`\$=\active +\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix + +% If a .fmt file is being used, characters that might appear in a file +% name cannot be active until we have parsed the command line. +% So turn them off again, and have \everyjob (or @setfilename) turn them on. +% \otherifyactive is called near the end of this file. +\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} + +% Used sometimes to turn off (effectively) the active characters even after +% parsing them. +\def\turnoffactive{% + \normalturnoffactive + \otherbackslash +} + +\catcode`\@=0 + +% \backslashcurfont outputs one backslash character in current font, +% as in \char`\\. +\global\chardef\backslashcurfont=`\\ +\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work + +% \realbackslash is an actual character `\' with catcode other, and +% \doublebackslash is two of them (for the pdf outlines). +{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} + +% In texinfo, backslash is an active character; it prints the backslash +% in fixed width font. +\catcode`\\=\active % @ for escape char from now on. + +% The story here is that in math mode, the \char of \backslashcurfont +% ends up printing the roman \ from the math symbol font (because \char +% in math mode uses the \mathcode, and plain.tex sets +% \mathcode`\\="026E). It seems better for @backslashchar{} to always +% print a typewriter backslash, hence we use an explicit \mathchar, +% which is the decimal equivalent of "715c (class 7, e.g., use \fam; +% ignored family value; char position "5C). We can't use " for the +% usual hex value because it has already been made active. +@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} +@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents. + +% On startup, @fixbackslash assigns: +% @let \ = @normalbackslash +% \rawbackslash defines an active \ to do \backslashcurfont. +% \otherbackslash defines an active \ to be a literal `\' character with +% catcode other. We switch back and forth between these. +@gdef@rawbackslash{@let\=@backslashcurfont} +@gdef@otherbackslash{@let\=@realbackslash} + +% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of +% the literal character `\'. Also revert - to its normal character, in +% case the active - from code has slipped in. +% +{@catcode`- = @active + @gdef@normalturnoffactive{% + @let-=@normaldash + @let"=@normaldoublequote + @let$=@normaldollar %$ font-lock fix + @let+=@normalplus + @let<=@normalless + @let>=@normalgreater + @let\=@normalbackslash + @let^=@normalcaret + @let_=@normalunderscore + @let|=@normalverticalbar + @let~=@normaltilde + @markupsetuplqdefault + @markupsetuprqdefault + @unsepspaces + } +} + +% Make _ and + \other characters, temporarily. +% This is canceled by @fixbackslash. +@otherifyactive + +% If a .fmt file is being used, we don't want the `\input texinfo' to show up. +% That is what \eatinput is for; after that, the `\' should revert to printing +% a backslash. +% +@gdef@eatinput input texinfo{@fixbackslash} +@global@let\ = @eatinput + +% On the other hand, perhaps the file did not have a `\input texinfo'. Then +% the first `\' in the file would cause an error. This macro tries to fix +% that, assuming it is called before the first `\' could plausibly occur. +% Also turn back on active characters that might appear in the input +% file name, in case not using a pre-dumped format. +% +@gdef@fixbackslash{% + @ifx\@eatinput @let\ = @normalbackslash @fi + @catcode`+=@active + @catcode`@_=@active +} + +% Say @foo, not \foo, in error messages. +@escapechar = `@@ + +% These (along with & and #) are made active for url-breaking, so need +% active definitions as the normal characters. +@def@normaldot{.} +@def@normalquest{?} +@def@normalslash{/} + +% These look ok in all fonts, so just make them not special. +% @hashchar{} gets its own user-level command, because of #line. +@catcode`@& = @other @def@normalamp{&} +@catcode`@# = @other @def@normalhash{#} +@catcode`@% = @other @def@normalpercent{%} + +@let @hashchar = @normalhash + +@c Finally, make ` and ' active, so that txicodequoteundirected and +@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we +@c don't make ` and ' active, @code will not get them as active chars. +@c Do this last of all since we use ` in the previous @catcode assignments. +@catcode`@'=@active +@catcode`@`=@active +@markupsetuplqdefault +@markupsetuprqdefault + +@c Local variables: +@c eval: (add-hook 'write-file-hooks 'time-stamp) +@c page-delimiter: "^\\\\message" +@c time-stamp-start: "def\\\\texinfoversion{" +@c time-stamp-format: "%:y-%02m-%02d.%02H" +@c time-stamp-end: "}" +@c End: + +@c vim:sw=2: + +@ignore + arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 +@end ignore diff -Nru cloog-0.18.2/osl/ChangeLog cloog-0.18.4/osl/ChangeLog --- cloog-0.18.2/osl/ChangeLog 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/ChangeLog 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,2 @@ +See Git's log at +https://github.com/periscop/openscop diff -Nru cloog-0.18.2/osl/configure cloog-0.18.4/osl/configure --- cloog-0.18.2/osl/configure 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/configure 2015-07-24 12:29:31.000000000 +0000 @@ -0,0 +1,15310 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for osl 0.9.0. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: cedric.bastoul@u-psud.fr,pouchet@cse.ohio-state.edu +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='osl' +PACKAGE_TARNAME='osl' +PACKAGE_VERSION='0.9.0' +PACKAGE_STRING='osl 0.9.0' +PACKAGE_BUGREPORT='cedric.bastoul@u-psud.fr,pouchet@cse.ohio-state.edu' +PACKAGE_URL='' + +ac_unique_file="include/osl/macros.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +VERSION_REVISION +VERSION_MINOR +VERSION_MAJOR +abs_top_srcdir +ac_aux_dir +CFLAGS_WARN +PRTDIAG +GENERATE_DOC_FALSE +GENERATE_DOC_TRUE +TEXI2PDF +DOXYGEN +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +DLLTOOL +OBJDUMP +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +CD +LN_S +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_portable_binary +with_gcc_arch +with_gmp +with_gmp_prefix +with_gmp_exec_prefix +with_gmp_builddir +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures osl 0.9.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/osl] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of osl 0.9.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-portable-binary + disable compiler optimizations that would produce + unportable binaries + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + --with-gcc-arch= use architecture for gcc -march/-mtune, + instead of guessing + --with-gmp=no|system|build + Which gmp to use [default=system] + --with-gmp-prefix=DIR Prefix of gmp installation + --with-gmp-exec-prefix=DIR + Exec prefix of gmp installation + --with-gmp-builddir=DIR Location of gmp builddir + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +osl configure 0.9.0 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ppppppppppppppppppppppppppppppppppppppp ## +## Report this to cedric.bastoul@u-psud.fr ## +## ppppppppppppppppppppppppppppppppppppppp ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by osl $as_me 0.9.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_aux_dir= +for ac_dir in autoconf "$srcdir"/autoconf; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in autoconf \"$srcdir\"/autoconf" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + + +am__api_version='1.14' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='osl' + VERSION='0.9.0' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +# Extract the first word of "cd", so it can be a program name with args. +set dummy cd; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CD"; then + ac_cv_prog_CD="$CD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CD="" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CD=$ac_cv_prog_CD +if test -n "$CD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CD" >&5 +$as_echo "$CD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.2' +macro_revision='1.3337' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + link_all_deplibs=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + +for ac_prog in doxygen +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DOXYGEN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DOXYGEN"; then + ac_cv_prog_DOXYGEN="$DOXYGEN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DOXYGEN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DOXYGEN=$ac_cv_prog_DOXYGEN +if test -n "$DOXYGEN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 +$as_echo "$DOXYGEN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DOXYGEN" && break +done +test -n "$DOXYGEN" || DOXYGEN="doxygen" + +for ac_prog in texi2pdf +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_TEXI2PDF+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$TEXI2PDF"; then + ac_cv_prog_TEXI2PDF="$TEXI2PDF" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_TEXI2PDF="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +TEXI2PDF=$ac_cv_prog_TEXI2PDF +if test -n "$TEXI2PDF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEXI2PDF" >&5 +$as_echo "$TEXI2PDF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$TEXI2PDF" && break +done +test -n "$TEXI2PDF" || TEXI2PDF="texi2pdf" + + if test -n "$TEXI2PDF" -a -n "$DOXYGEN"; then + GENERATE_DOC_TRUE= + GENERATE_DOC_FALSE='#' +else + GENERATE_DOC_TRUE='#' + GENERATE_DOC_FALSE= +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler vendor" >&5 +$as_echo_n "checking for C compiler vendor... " >&6; } +if ${ax_cv_c_compiler_vendor+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_c_compiler_vendor=unknown + # note: don't check for gcc first since some other compilers define __GNUC__ + for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do + vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#if !($vencpp) + thisisanerror; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ax_cv_c_compiler_vendor=`echo $ventest | cut -d: -f1`; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_vendor" >&5 +$as_echo "$ax_cv_c_compiler_vendor" >&6; } + + + + + + +# Check whether --enable-portable-binary was given. +if test "${enable_portable_binary+set}" = set; then : + enableval=$enable_portable_binary; acx_maxopt_portable=$withval +else + acx_maxopt_portable=no +fi + + +# Try to determine "good" native compiler flags if none specified via CFLAGS +if test "$ac_test_CFLAGS" != "set"; then + CFLAGS="" + case $ax_cv_c_compiler_vendor in + dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host" + if test "x$acx_maxopt_portable" = xno; then + CFLAGS="$CFLAGS -arch host" + fi;; + + sun) CFLAGS="-native -fast -xO5 -dalign" + if test "x$acx_maxopt_portable" = xyes; then + CFLAGS="$CFLAGS -xarch=generic" + fi;; + + hp) CFLAGS="+Oall +Optrs_ansi +DSnative" + if test "x$acx_maxopt_portable" = xyes; then + CFLAGS="$CFLAGS +DAportable" + fi;; + + ibm) if test "x$acx_maxopt_portable" = xno; then + xlc_opt="-qarch=auto -qtune=auto" + else + xlc_opt="-qtune=auto" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $xlc_opt" >&5 +$as_echo_n "checking whether C compiler accepts $xlc_opt... " >&6; } +ax_save_FLAGS=$CFLAGS + CFLAGS="$xlc_opt" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval `$as_echo "ax_cv_c_flags_$xlc_opt" | $as_tr_sh`=yes +else + eval `$as_echo "ax_cv_c_flags_$xlc_opt" | $as_tr_sh`=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$ax_save_FLAGS +eval ax_check_compiler_flags=$`$as_echo "ax_cv_c_flags_$xlc_opt" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 +$as_echo "$ax_check_compiler_flags" >&6; } +if test "x$ax_check_compiler_flags" = xyes; then + CFLAGS="-O3 -qansialias -w $xlc_opt" +else + CFLAGS="-O3 -qansialias -w" + echo "******************************************************" + echo "* You seem to have the IBM C compiler. It is *" + echo "* recommended for best performance that you use: *" + echo "* *" + echo "* CFLAGS=-O3 -qarch=xxx -qtune=xxx -qansialias -w *" + echo "* ^^^ ^^^ *" + echo "* where xxx is pwr2, pwr3, 604, or whatever kind of *" + echo "* CPU you have. (Set the CFLAGS environment var. *" + echo "* and re-run configure.) For more info, man cc. *" + echo "******************************************************" +fi + + ;; + + intel) CFLAGS="-O3 -ansi_alias" + if test "x$acx_maxopt_portable" = xno; then + icc_archflag=unknown + icc_flags="" + case $host_cpu in + i686*|x86_64*) + # icc accepts gcc assembly syntax, so these should work: + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 0 output" >&5 +$as_echo_n "checking for x86 cpuid 0 output... " >&6; } +if ${ax_cv_gcc_x86_cpuid_0+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ax_cv_gcc_x86_cpuid_0=unknown +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + int op = 0, eax, ebx, ecx, edx; + FILE *f; + __asm__("cpuid" + : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) + : "a" (op)); + f = fopen("conftest_cpuid", "w"); if (!f) return 1; + fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); + fclose(f); + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ax_cv_gcc_x86_cpuid_0=`cat conftest_cpuid`; rm -f conftest_cpuid +else + ax_cv_gcc_x86_cpuid_0=unknown; rm -f conftest_cpuid +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_0" >&5 +$as_echo "$ax_cv_gcc_x86_cpuid_0" >&6; } +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 1 output" >&5 +$as_echo_n "checking for x86 cpuid 1 output... " >&6; } +if ${ax_cv_gcc_x86_cpuid_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ax_cv_gcc_x86_cpuid_1=unknown +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + int op = 1, eax, ebx, ecx, edx; + FILE *f; + __asm__("cpuid" + : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) + : "a" (op)); + f = fopen("conftest_cpuid", "w"); if (!f) return 1; + fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); + fclose(f); + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ax_cv_gcc_x86_cpuid_1=`cat conftest_cpuid`; rm -f conftest_cpuid +else + ax_cv_gcc_x86_cpuid_1=unknown; rm -f conftest_cpuid +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_1" >&5 +$as_echo "$ax_cv_gcc_x86_cpuid_1" >&6; } +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + case $ax_cv_gcc_x86_cpuid_0 in # see AX_GCC_ARCHFLAG + *:756e6547:*:*) # Intel + case $ax_cv_gcc_x86_cpuid_1 in + *6a?:*[234]:*:*|*6[789b]?:*:*:*) icc_flags="-xK";; + *f3[347]:*:*:*|*f41347:*:*:*) icc_flags="-xP -xN -xW -xK";; + *f??:*:*:*) icc_flags="-xN -xW -xK";; + esac ;; + esac ;; + esac + if test "x$icc_flags" != x; then + for flag in $icc_flags; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +$as_echo_n "checking whether C compiler accepts $flag... " >&6; } +ax_save_FLAGS=$CFLAGS + CFLAGS="$flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval `$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh`=yes +else + eval `$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh`=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$ax_save_FLAGS +eval ax_check_compiler_flags=$`$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 +$as_echo "$ax_check_compiler_flags" >&6; } +if test "x$ax_check_compiler_flags" = xyes; then + icc_archflag=$flag; break +else + : +fi + + done + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icc architecture flag" >&5 +$as_echo_n "checking for icc architecture flag... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $icc_archflag" >&5 +$as_echo "$icc_archflag" >&6; } + if test "x$icc_archflag" != xunknown; then + CFLAGS="$CFLAGS $icc_archflag" + fi + fi + ;; + + gnu) + # default optimization flags for gcc on all systems + CFLAGS="-O3 -fomit-frame-pointer" + + # -malign-double for x86 systems + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -malign-double" >&5 +$as_echo_n "checking whether C compiler accepts -malign-double... " >&6; } +if ${ax_cv_c_flags__malign_double+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_save_FLAGS=$CFLAGS + CFLAGS="-malign-double" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ax_cv_c_flags__malign_double=yes +else + ax_cv_c_flags__malign_double=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$ax_save_FLAGS +fi + +eval ax_check_compiler_flags=$ax_cv_c_flags__malign_double +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 +$as_echo "$ax_check_compiler_flags" >&6; } +if test "x$ax_check_compiler_flags" = xyes; then + CFLAGS="$CFLAGS -malign-double" +else + : +fi + + + # -fstrict-aliasing for gcc-2.95+ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstrict-aliasing" >&5 +$as_echo_n "checking whether C compiler accepts -fstrict-aliasing... " >&6; } +if ${ax_cv_c_flags__fstrict_aliasing+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_save_FLAGS=$CFLAGS + CFLAGS="-fstrict-aliasing" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ax_cv_c_flags__fstrict_aliasing=yes +else + ax_cv_c_flags__fstrict_aliasing=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$ax_save_FLAGS +fi + +eval ax_check_compiler_flags=$ax_cv_c_flags__fstrict_aliasing +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 +$as_echo "$ax_check_compiler_flags" >&6; } +if test "x$ax_check_compiler_flags" = xyes; then + CFLAGS="$CFLAGS -fstrict-aliasing" +else + : +fi + + + # note that we enable "unsafe" fp optimization with other compilers, too + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ffast-math" >&5 +$as_echo_n "checking whether C compiler accepts -ffast-math... " >&6; } +if ${ax_cv_c_flags__ffast_math+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_save_FLAGS=$CFLAGS + CFLAGS="-ffast-math" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ax_cv_c_flags__ffast_math=yes +else + ax_cv_c_flags__ffast_math=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$ax_save_FLAGS +fi + +eval ax_check_compiler_flags=$ax_cv_c_flags__ffast_math +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 +$as_echo "$ax_check_compiler_flags" >&6; } +if test "x$ax_check_compiler_flags" = xyes; then + CFLAGS="$CFLAGS -ffast-math" +else + : +fi + + + + + + +# Check whether --with-gcc-arch was given. +if test "${with_gcc_arch+set}" = set; then : + withval=$with_gcc_arch; ax_gcc_arch=$withval +else + ax_gcc_arch=yes +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc architecture flag" >&5 +$as_echo_n "checking for gcc architecture flag... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 +$as_echo "" >&6; } +if ${ax_cv_gcc_archflag+:} false; then : + $as_echo_n "(cached) " >&6 +else + +ax_cv_gcc_archflag="unknown" + +if test "$GCC" = yes; then + +if test "x$ax_gcc_arch" = xyes; then +ax_gcc_arch="" +if test "$cross_compiling" = no; then +case $host_cpu in + i[3456]86*|x86_64*) # use cpuid codes, in part from x86info-1.7 by D. Jones + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 0 output" >&5 +$as_echo_n "checking for x86 cpuid 0 output... " >&6; } +if ${ax_cv_gcc_x86_cpuid_0+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ax_cv_gcc_x86_cpuid_0=unknown +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + int op = 0, eax, ebx, ecx, edx; + FILE *f; + __asm__("cpuid" + : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) + : "a" (op)); + f = fopen("conftest_cpuid", "w"); if (!f) return 1; + fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); + fclose(f); + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ax_cv_gcc_x86_cpuid_0=`cat conftest_cpuid`; rm -f conftest_cpuid +else + ax_cv_gcc_x86_cpuid_0=unknown; rm -f conftest_cpuid +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_0" >&5 +$as_echo "$ax_cv_gcc_x86_cpuid_0" >&6; } +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 1 output" >&5 +$as_echo_n "checking for x86 cpuid 1 output... " >&6; } +if ${ax_cv_gcc_x86_cpuid_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ax_cv_gcc_x86_cpuid_1=unknown +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + int op = 1, eax, ebx, ecx, edx; + FILE *f; + __asm__("cpuid" + : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) + : "a" (op)); + f = fopen("conftest_cpuid", "w"); if (!f) return 1; + fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); + fclose(f); + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ax_cv_gcc_x86_cpuid_1=`cat conftest_cpuid`; rm -f conftest_cpuid +else + ax_cv_gcc_x86_cpuid_1=unknown; rm -f conftest_cpuid +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_1" >&5 +$as_echo "$ax_cv_gcc_x86_cpuid_1" >&6; } +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + case $ax_cv_gcc_x86_cpuid_0 in + *:756e6547:*:*) # Intel + case $ax_cv_gcc_x86_cpuid_1 in + *5[48]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;; + *5??:*:*:*) ax_gcc_arch=pentium ;; + *6[3456]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; + *6a?:*[01]:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; + *6a?:*[234]:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; + *6[9d]?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;; + *6[78b]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; + *6??:*:*:*) ax_gcc_arch=pentiumpro ;; + *f3[347]:*:*:*|*f41347:*:*:*) + case $host_cpu in + x86_64*) ax_gcc_arch="nocona pentium4 pentiumpro" ;; + *) ax_gcc_arch="prescott pentium4 pentiumpro" ;; + esac ;; + *f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro";; + esac ;; + *:68747541:*:*) # AMD + case $ax_cv_gcc_x86_cpuid_1 in + *5[67]?:*:*:*) ax_gcc_arch=k6 ;; + *5[8d]?:*:*:*) ax_gcc_arch="k6-2 k6" ;; + *5[9]?:*:*:*) ax_gcc_arch="k6-3 k6" ;; + *60?:*:*:*) ax_gcc_arch=k7 ;; + *6[12]?:*:*:*) ax_gcc_arch="athlon k7" ;; + *6[34]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;; + *67?:*:*:*) ax_gcc_arch="athlon-4 athlon k7" ;; + *6[68a]?:*:*:*) + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 0x80000006 output" >&5 +$as_echo_n "checking for x86 cpuid 0x80000006 output... " >&6; } +if ${ax_cv_gcc_x86_cpuid_0x80000006+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ax_cv_gcc_x86_cpuid_0x80000006=unknown +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + int op = 0x80000006, eax, ebx, ecx, edx; + FILE *f; + __asm__("cpuid" + : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) + : "a" (op)); + f = fopen("conftest_cpuid", "w"); if (!f) return 1; + fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); + fclose(f); + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ax_cv_gcc_x86_cpuid_0x80000006=`cat conftest_cpuid`; rm -f conftest_cpuid +else + ax_cv_gcc_x86_cpuid_0x80000006=unknown; rm -f conftest_cpuid +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_0x80000006" >&5 +$as_echo "$ax_cv_gcc_x86_cpuid_0x80000006" >&6; } +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + # L2 cache size + case $ax_cv_gcc_x86_cpuid_0x80000006 in + *:*:*[1-9a-f]??????:*) # (L2 = ecx >> 16) >= 256 + ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;; + *) ax_gcc_arch="athlon-4 athlon k7" ;; + esac ;; + *f[4cef8b]?:*:*:*) ax_gcc_arch="athlon64 k8" ;; + *f5?:*:*:*) ax_gcc_arch="opteron k8" ;; + *f7?:*:*:*) ax_gcc_arch="athlon-fx opteron k8" ;; + *f??:*:*:*) ax_gcc_arch="k8" ;; + esac ;; + *:746e6543:*:*) # IDT + case $ax_cv_gcc_x86_cpuid_1 in + *54?:*:*:*) ax_gcc_arch=winchip-c6 ;; + *58?:*:*:*) ax_gcc_arch=winchip2 ;; + *6[78]?:*:*:*) ax_gcc_arch=c3 ;; + *69?:*:*:*) ax_gcc_arch="c3-2 c3" ;; + esac ;; + esac + if test x"$ax_gcc_arch" = x; then # fallback + case $host_cpu in + i586*) ax_gcc_arch=pentium ;; + i686*) ax_gcc_arch=pentiumpro ;; + esac + fi + ;; + + sparc*) + # Extract the first word of "prtdiag", so it can be a program name with args. +set dummy prtdiag; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PRTDIAG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PRTDIAG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PRTDIAG="$PRTDIAG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PRTDIAG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PRTDIAG" && ac_cv_path_PRTDIAG="prtdiag" + ;; +esac +fi +PRTDIAG=$ac_cv_path_PRTDIAG +if test -n "$PRTDIAG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PRTDIAG" >&5 +$as_echo "$PRTDIAG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null` + cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters` + case $cputype in + *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;; + *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;; + *ultrasparc*) ax_gcc_arch="ultrasparc v9" ;; + *supersparc*|*tms390z5[05]*) ax_gcc_arch="supersparc v8" ;; + *hypersparc*|*rt62[056]*) ax_gcc_arch="hypersparc v8" ;; + *cypress*) ax_gcc_arch=cypress ;; + esac ;; + + alphaev5) ax_gcc_arch=ev5 ;; + alphaev56) ax_gcc_arch=ev56 ;; + alphapca56) ax_gcc_arch="pca56 ev56" ;; + alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;; + alphaev6) ax_gcc_arch=ev6 ;; + alphaev67) ax_gcc_arch=ev67 ;; + alphaev68) ax_gcc_arch="ev68 ev67" ;; + alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;; + alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;; + alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;; + + powerpc*) + cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | sed 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null` + cputype=`echo $cputype | sed -e 's/ppc//g;s/ *//g'` + case $cputype in + *750*) ax_gcc_arch="750 G3" ;; + *740[0-9]*) ax_gcc_arch="$cputype 7400 G4" ;; + *74[4-5][0-9]*) ax_gcc_arch="$cputype 7450 G4" ;; + *74[0-9][0-9]*) ax_gcc_arch="$cputype G4" ;; + *970*) ax_gcc_arch="970 G5 power4";; + *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";; + *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";; + 603ev|8240) ax_gcc_arch="$cputype 603e 603";; + *) ax_gcc_arch=$cputype ;; + esac + ax_gcc_arch="$ax_gcc_arch powerpc" + ;; +esac +fi # not cross-compiling +fi # guess arch + +if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then +for arch in $ax_gcc_arch; do + if test "x$acx_maxopt_portable" = xyes; then # if we require portable code + flags="-mtune=$arch" + # -mcpu=$arch and m$arch generate nonportable code on every arch except + # x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr. + case $host_cpu in i*86|x86_64*) flags="$flags -mcpu=$arch -m$arch";; esac + else + flags="-march=$arch -mcpu=$arch -m$arch" + fi + for flag in $flags; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +$as_echo_n "checking whether C compiler accepts $flag... " >&6; } +ax_save_FLAGS=$CFLAGS + CFLAGS="$flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval `$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh`=yes +else + eval `$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh`=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$ax_save_FLAGS +eval ax_check_compiler_flags=$`$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 +$as_echo "$ax_check_compiler_flags" >&6; } +if test "x$ax_check_compiler_flags" = xyes; then + ax_cv_gcc_archflag=$flag; break +else + : +fi + + done + test "x$ax_cv_gcc_archflag" = xunknown || break +done +fi + +fi # $GCC=yes + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc architecture flag" >&5 +$as_echo_n "checking for gcc architecture flag... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_archflag" >&5 +$as_echo "$ax_cv_gcc_archflag" >&6; } +if test "x$ax_cv_gcc_archflag" = xunknown; then + : +else + CFLAGS="$CFLAGS $ax_cv_gcc_archflag" +fi + + ;; + esac + + if test -z "$CFLAGS"; then + echo "" + echo "********************************************************" + echo "* WARNING: Don't know the best CFLAGS for this system *" + echo "* Use ./configure CFLAGS=... to specify your own flags *" + echo "* (otherwise, a default of CFLAGS=-O3 will be used) *" + echo "********************************************************" + echo "" + CFLAGS="-O3" + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS" >&5 +$as_echo_n "checking whether C compiler accepts $CFLAGS... " >&6; } +ax_save_FLAGS=$CFLAGS + CFLAGS="$CFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval `$as_echo "ax_cv_c_flags_$CFLAGS" | $as_tr_sh`=yes +else + eval `$as_echo "ax_cv_c_flags_$CFLAGS" | $as_tr_sh`=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$ax_save_FLAGS +eval ax_check_compiler_flags=$`$as_echo "ax_cv_c_flags_$CFLAGS" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 +$as_echo "$ax_check_compiler_flags" >&6; } +if test "x$ax_check_compiler_flags" = xyes; then + : +else + + echo "" + echo "********************************************************" + echo "* WARNING: The guessed CFLAGS don't seem to work with *" + echo "* your compiler. *" + echo "* Use ./configure CFLAGS=... to specify your own flags *" + echo "********************************************************" + echo "" + CFLAGS="" + +fi + + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS_WARN for maximum warnings" >&5 +$as_echo_n "checking CFLAGS_WARN for maximum warnings... " >&6; } +if ${ac_cv_cflags_warn_all+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_cflags_warn_all="no, unknown" + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_save_CFLAGS="$CFLAGS" +for ac_arg in "-pedantic % -Wall" "-xstrconst % -v" "-std1 % -verbose -w0 -warnprotos" "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" "-ansi -ansiE % -fullwarn" "+ESlit % +w1" "-Xc % -pvctl,fullmsg" "-h conform % -h msglevel 2" # +do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_cflags_warn_all=`echo $ac_arg | sed -e 's,.*% *,,'` ; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done + CFLAGS="$ac_save_CFLAGS" + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags_warn_all" >&5 +$as_echo "$ac_cv_cflags_warn_all" >&6; } +case ".$ac_cv_cflags_warn_all" in + .ok|.ok,*) ;; + .|.no|.no,*) + ;; + *) + if echo " $CFLAGS_WARN " | grep " $ac_cv_cflags_warn_all " 2>&1 >/dev/null + then { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS_WARN does contain \$ac_cv_cflags_warn_all"; } >&5 + (: CFLAGS_WARN does contain $ac_cv_cflags_warn_all) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + else { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS_WARN=\"\$CFLAGS_WARN \$ac_cv_cflags_warn_all\""; } >&5 + (: CFLAGS_WARN="$CFLAGS_WARN $ac_cv_cflags_warn_all") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + CFLAGS_WARN="$CFLAGS_WARN $ac_cv_cflags_warn_all" + fi + ;; +esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +for ac_header in errno.h stddef.h stdlib.h string.h strings.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_func in strtol +do : + ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" +if test "x$ac_cv_func_strtol" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRTOL 1 +_ACEOF + +fi +done + + + + + +gmp_flag="OSL_GMP_IS_HERE" + + + +# Check whether --with-gmp was given. +if test "${with_gmp+set}" = set; then : + withval=$with_gmp; +fi + +case "system" in +no|system|build) + +# Check whether --with-gmp_prefix was given. +if test "${with_gmp_prefix+set}" = set; then : + withval=$with_gmp_prefix; +fi + + +# Check whether --with-gmp_exec_prefix was given. +if test "${with_gmp_exec_prefix+set}" = set; then : + withval=$with_gmp_exec_prefix; +fi + +esac + +# Check whether --with-gmp_builddir was given. +if test "${with_gmp_builddir+set}" = set; then : + withval=$with_gmp_builddir; +fi + +if test "x$with_gmp_prefix" != "x" -a "x$with_gmp_exec_prefix" = "x"; then + with_gmp_exec_prefix=$with_gmp_prefix +fi +if test "x$with_gmp_prefix" != "x" -o "x$with_gmp_exec_prefix" != "x"; then + if test "x$with_gmp" != "x" -a "x$with_gmp" != "xyes" -a "x$with_gmp" != "xsystem"; then + as_fn_error $? "Setting $with_gmp_prefix implies use of system gmp" "$LINENO" 5 + fi + with_gmp="system" +fi +if test "x$with_gmp_builddir" != "x"; then + if test "x$with_gmp" != "x" -a "x$with_gmp" != "xyes" -a "x$with_gmp" != "xbuild"; then + as_fn_error $? "Setting $with_gmp_builddir implies use of build gmp" "$LINENO" 5 + fi + with_gmp="build" + gmp_srcdir=`echo @abs_srcdir@ | $with_gmp_builddir/config.status --file=-` + { $as_echo "$as_me:${as_lineno-$LINENO}: gmp sources in $gmp_srcdir" >&5 +$as_echo "$as_me: gmp sources in $gmp_srcdir" >&6;} +fi +if test "x$with_gmp_exec_prefix" != "x"; then + export PKG_CONFIG_PATH="$with_gmp_exec_prefix/lib/pkgconfig${PKG_CONFIG_PATH+:$PKG_CONFIG_PATH}" +fi +case "$with_gmp" in +no|system|build) + ;; +*) + case "system" in + bundled) + if test -d $srcdir/.git -a \ + -d $srcdir/gmp -a \ + ! -d $srcdir/gmp/.git; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: git repo detected, but submodule gmp not initialized" >&5 +$as_echo "$as_me: WARNING: git repo detected, but submodule gmp not initialized" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You may want to run" >&5 +$as_echo "$as_me: WARNING: You may want to run" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: git submodule init" >&5 +$as_echo "$as_me: WARNING: git submodule init" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: git submodule update" >&5 +$as_echo "$as_me: WARNING: git submodule update" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: sh autogen.sh" >&5 +$as_echo "$as_me: WARNING: sh autogen.sh" >&2;} + fi + if test -f $srcdir/gmp/configure; then + with_gmp="bundled" + else + with_gmp="no" + fi + ;; + *) + with_gmp="system" + ;; + esac + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which gmp to use" >&5 +$as_echo_n "checking which gmp to use... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_gmp" >&5 +$as_echo "$with_gmp" >&6; } + + + +case "$with_gmp" in +build) + CPPFLAGS="-D$gmp_flag -I$gmp_srcdir -I$with_gmp_builddir $CPPFLAGS" + LIBS="$with_gmp_builddir/libgmp.la $LIBS" + LDFLAGS="-L$with_gmp_builddir $LDFLAGS" + ;; +system) + CPPFLAGS="-D$gmp_flag $CPPFLAGS" + LIBS="-lgmp $LIBS" + if test "x$with_gmp_prefix" != "x"; then + CPPFLAGS="-I$with_gmp_prefix/include $CPPFLAGS" + LDFLAGS="-L$with_gmp_prefix/lib $LDFLAGS" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __gmpz_init in -lgmp" >&5 +$as_echo_n "checking for __gmpz_init in -lgmp... " >&6; } +if ${ac_cv_lib_gmp___gmpz_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgmp $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char __gmpz_init (); +int +main () +{ +return __gmpz_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_gmp___gmpz_init=yes +else + ac_cv_lib_gmp___gmpz_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gmp___gmpz_init" >&5 +$as_echo "$ac_cv_lib_gmp___gmpz_init" >&6; } +if test "x$ac_cv_lib_gmp___gmpz_init" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGMP 1 +_ACEOF + + LIBS="-lgmp $LIBS" + +else + as_fn_error $? "\"Can't find gmp library.\"" "$LINENO" 5 +fi + + ;; +esac +case "$with_gmp" in +build|system) + ac_fn_c_check_header_mongrel "$LINENO" "gmp.h" "ac_cv_header_gmp_h" "$ac_includes_default" +if test "x$ac_cv_header_gmp_h" = xyes; then : + +else + as_fn_error $? "\"Can't find gmp headers.\"" "$LINENO" 5 +fi + + + ;; +esac + + + + + + + + + + + +ac_config_files="$ac_config_files Makefile doc/Makefile doc/Doxyfile include/osl/scop.h tests/Makefile" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GENERATE_DOC_TRUE}" && test -z "${GENERATE_DOC_FALSE}"; then + as_fn_error $? "conditional \"GENERATE_DOC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by osl $as_me 0.9.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +osl config.status 0.9.0 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "doc/Doxyfile") CONFIG_FILES="$CONFIG_FILES doc/Doxyfile" ;; + "include/osl/scop.h") CONFIG_FILES="$CONFIG_FILES include/osl/scop.h" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + "Makefile":F) test -z "$CONFIG_HEADERS" || echo timestamp > source/stamp-h.in ;; + "doc/Makefile":F) test -z "$CONFIG_HEADERS" || echo timestamp > source/stamp-h.in ;; + "doc/Doxyfile":F) test -z "$CONFIG_HEADERS" || echo timestamp > source/stamp-h.in ;; + "include/osl/scop.h":F) test -z "$CONFIG_HEADERS" || echo timestamp > source/stamp-h.in ;; + "tests/Makefile":F) test -z "$CONFIG_HEADERS" || echo timestamp > source/stamp-h.in ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + + +echo " /*-----------------------------------------------*" +echo " * OpenScop Library configuration is OK *" +echo " *-----------------------------------------------*/" +echo "It appears that your system is OK to start the OpenScop Library compilation." +echo "You need now to type \"make\". Then type \"make install\" to install it on your" +echo "system (log as root if necessary)." diff -Nru cloog-0.18.2/osl/configure.ac cloog-0.18.4/osl/configure.ac --- cloog-0.18.2/osl/configure.ac 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/configure.ac 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,191 @@ +dnl +dnl /*+------------------------------------------------------------------** +dnl ** OpenScop Library ** +dnl **------------------------------------------------------------------** +dnl ** configure.in ** +dnl **------------------------------------------------------------------** +dnl ** First version: 30/04/2008 ** +dnl **------------------------------------------------------------------** +dnl +dnl +dnl ************************************************************************** +dnl * OpenScop: Structures and formats for polyhedral tools to talk together * +dnl ************************************************************************** +dnl * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * +dnl * / / / // // // // / / / // // / / // / /|,_, * +dnl * / / / // // // // / / / // // / / // / / / /\ * +dnl * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * +dnl * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * +dnl * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * +dnl * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * +dnl * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * +dnl * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * +dnl * | I | | | | e | | | | | | | | | | | | | \ \ \ * +dnl * | T | | | | | | | | | | | | | | | | | \ \ \ * +dnl * | E | | | | | | | | | | | | | | | | | \ \ \ * +dnl * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * +dnl * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * +dnl * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * +dnl * * +dnl * Copyright (C) 2008 University Paris-Sud 11 and INRIA * +dnl * * +dnl * (3-clause BSD license) * +dnl * Redistribution and use in source and binary forms, with or without * +dnl * modification, are permitted provided that the following conditions * +dnl * are met: * +dnl * * +dnl * 1. Redistributions of source code must retain the above copyright * +dnl * notice, this list of conditions and the following disclaimer. * +dnl * 2. Redistributions in binary form must reproduce the above copyright * +dnl * notice, this list of conditions and the following disclaimer in the * +dnl * documentation and/or other materials provided with the distribution.* +dnl * 3. The name of the author may not be used to endorse or promote * +dnl * products derived from this software without specific prior written * +dnl * permission. * +dnl * * +dnl * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * +dnl * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +dnl * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +dnl * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, * +dnl * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +dnl * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * +dnl * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * +dnl * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * +dnl * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * +dnl * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * +dnl * POSSIBILITY OF SUCH DAMAGE. * +dnl * * +dnl * OpenScop Library, a library to manipulate OpenScop formats and data * +dnl * structures. Written by: * +dnl * Cedric Bastoul and * +dnl * Louis-Noel Pouchet * +dnl * * +dnl **************************************************************************/ +dnl +dnl Input file for autoconf to build a configuration shellscript. + +m4_define([version_major], [0]) +m4_define([version_minor], [9]) +m4_define([version_revision], [0]) + +AC_PREREQ(2.53) +dnl Fill here the @bug email adress. +AC_INIT([osl], [version_major.version_minor.version_revision], + [cedric.bastoul@u-psud.fr,pouchet@cse.ohio-state.edu]) +dnl A common file, which serve as a test. +AC_CONFIG_SRCDIR([include/osl/macros.h]) +dnl Put as most as possible configuration files to an auxialiry +dnl directory. +AC_CONFIG_AUX_DIR([autoconf]) +AC_CONFIG_MACRO_DIR([m4]) + +dnl Initialize automake. +AM_INIT_AUTOMAKE([foreign]) +m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) + + +dnl /************************************************************************** +dnl * Checking * +dnl **************************************************************************/ + + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_CHECK_PROG(CD, cd) +AC_PROG_INSTALL +AC_PROG_LIBTOOL + +AC_CHECK_PROGS(DOXYGEN, doxygen, doxygen, []) +AC_CHECK_PROGS(TEXI2PDF, texi2pdf, texi2pdf, []) +AM_CONDITIONAL(GENERATE_DOC, test -n "$TEXI2PDF" -a -n "$DOXYGEN") + +AX_CC_MAXOPT +AC_SUBST(CFLAGS_WARN) +AX_CFLAGS_WARN_ALL(CFLAGS_WARN) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_SIZE_T + +dnl Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([errno.h stddef.h stdlib.h string.h strings.h unistd.h]) + +dnl Checks for library functions. +AC_CHECK_FUNCS(strtol) + + +dnl /************************************************************************** +dnl * Option setting * +dnl **************************************************************************/ + +dnl /************************************************************************** +dnl * Where is GMP? * +dnl **************************************************************************/ + +gmp_flag="OSL_GMP_IS_HERE" +AX_SUBMODULE(gmp,no|system|build,system) + +case "$with_gmp" in +build) + CPPFLAGS="-D$gmp_flag -I$gmp_srcdir -I$with_gmp_builddir $CPPFLAGS" + LIBS="$with_gmp_builddir/libgmp.la $LIBS" + LDFLAGS="-L$with_gmp_builddir $LDFLAGS" + ;; +system) + CPPFLAGS="-D$gmp_flag $CPPFLAGS" + LIBS="-lgmp $LIBS" + if test "x$with_gmp_prefix" != "x"; then + CPPFLAGS="-I$with_gmp_prefix/include $CPPFLAGS" + LDFLAGS="-L$with_gmp_prefix/lib $LDFLAGS" + fi + dnl AC_CHECK_LIB doesn't use LDFLAGS --> not suitable for the build case. + AC_CHECK_LIB(gmp, + __gmpz_init, + [], + [AC_MSG_ERROR("Can't find gmp library.")]) + ;; +esac +case "$with_gmp" in +build|system) + AC_CHECK_HEADER(gmp.h, + [], + [AC_MSG_ERROR("Can't find gmp headers.")]) + ;; +esac + + +dnl /************************************************************************** +dnl * Substitutions * +dnl **************************************************************************/ + + +dnl Substitutions to do. +AC_SUBST(ac_aux_dir) +AC_SUBST(abs_top_srcdir) + +AC_SUBST(VERSION_MAJOR) +AC_SUBST(VERSION_MINOR) +AC_SUBST(VERSION_REVISION) + +dnl Configure Makefiles. +AC_CONFIG_FILES([ + Makefile + doc/Makefile + doc/Doxyfile + include/osl/scop.h + tests/Makefile + ], + [test -z "$CONFIG_HEADERS" || echo timestamp > source/stamp-h.in]) + +AC_OUTPUT + + +echo " /*-----------------------------------------------*" +echo " * OpenScop Library configuration is OK *" +echo " *-----------------------------------------------*/" +echo "It appears that your system is OK to start the OpenScop Library compilation." +echo "You need now to type \"make\". Then type \"make install\" to install it on your" +echo "system (log as root if necessary)." diff -Nru cloog-0.18.2/osl/COPYING cloog-0.18.4/osl/COPYING --- cloog-0.18.2/osl/COPYING 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/COPYING 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,16 @@ +BSD 3-Clause License + +Copyright (c) 2011-2013, University Paris-Sud and Inria +Copyright (c) 2013-2014, University of Strasbourg and Inria + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -Nru cloog-0.18.2/osl/doc/Doxyfile.in cloog-0.18.4/osl/doc/Doxyfile.in --- cloog-0.18.2/osl/doc/Doxyfile.in 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/doc/Doxyfile.in 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,1294 @@ +# Doxyfile 1.5.3 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file that +# follow. The default is UTF-8 which is also the encoding used for all text before +# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into +# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of +# possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = OpenScop + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = @PACKAGE_VERSION@ + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = htmldoc + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, +# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, +# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, +# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = YES + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = YES + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = YES + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to +# include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be extracted +# and appear in the documentation as a namespace called 'anonymous_namespace{file}', +# where file will be replaced with the base name of the file that contains the anonymous +# namespace. By default anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from the +# version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = YES + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text " + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @top_srcdir@/source @top_srcdir@/include/osl include/osl/scop.h + +# This tag can be used to specify the character encoding of the source files that +# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default +# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. +# See http://www.gnu.org/software/libiconv for the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the output. +# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, +# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH +# then you must also enable this option. If you don't then doxygen will produce +# a warning and turn it on anyway + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentstion. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 1 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = osl_ + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = YES + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to +# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to +# specify the directory where the mscgen tool resides. If left empty the tool is assumed to +# be found in the default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will +# generate a caller dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = /usr/bin/ + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the number +# of direct children of the root node in a graph is already larger than +# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, which results in a white background. +# Warning: Depending on the platform used, enabling this option may lead to +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to +# read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO Binary files /tmp/8LKHgB0qpE/cloog-0.18.2/osl/doc/htmldoc.tar.gz and /tmp/yy4tVJh_7V/cloog-0.18.4/osl/doc/htmldoc.tar.gz differ diff -Nru cloog-0.18.2/osl/doc/images/basic1.eps cloog-0.18.4/osl/doc/images/basic1.eps --- cloog-0.18.2/osl/doc/images/basic1.eps 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/doc/images/basic1.eps 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,332 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: basic1.fig +%%Creator: fig2dev Version 3.2 Patchlevel 5-alpha7 +%%CreationDate: Fri May 9 15:48:25 2008 +%%For: cedb@localhost (Bastoul Cedric) +%%BoundingBox: 0 0 347 303 +%Magnification: 1.0000 +%%EndComments +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {0 setgray} bind def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col2 {0.000 1.000 0.000 srgb} bind def +/col3 {0.000 1.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col5 {1.000 0.000 1.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col8 {0.000 0.000 0.560 srgb} bind def +/col9 {0.000 0.000 0.690 srgb} bind def +/col10 {0.000 0.000 0.820 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col14 {0.000 0.820 0.000 srgb} bind def +/col15 {0.000 0.560 0.560 srgb} bind def +/col16 {0.000 0.690 0.690 srgb} bind def +/col17 {0.000 0.820 0.820 srgb} bind def +/col18 {0.560 0.000 0.000 srgb} bind def +/col19 {0.690 0.000 0.000 srgb} bind def +/col20 {0.820 0.000 0.000 srgb} bind def +/col21 {0.560 0.000 0.560 srgb} bind def +/col22 {0.690 0.000 0.690 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def +/col24 {0.500 0.190 0.000 srgb} bind def +/col25 {0.630 0.250 0.000 srgb} bind def +/col26 {0.750 0.380 0.000 srgb} bind def +/col27 {1.000 0.500 0.500 srgb} bind def +/col28 {1.000 0.630 0.630 srgb} bind def +/col29 {1.000 0.750 0.750 srgb} bind def +/col30 {1.000 0.880 0.880 srgb} bind def +/col31 {1.000 0.840 0.000 srgb} bind def + +end +save +newpath 0 303 moveto 0 0 lineto 347 0 lineto 347 303 lineto closepath clip newpath +-152.1 333.9 translate +1 -1 scale + +/cp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def + /DrawEllipse { + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y tr xrad yrad sc 0 0 1 startangle endangle arc + closepath + savematrix setmatrix + } def + +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def + +$F2psBegin +10 setmiterlimit +0 slj 0 slc + 0.06000 0.06000 sc +% +% Fig objects follow +% +% +% here starts figure with depth 51 +% Polyline +0 slj +0 slc +0.000 slw +n 4200 1500 m 4200 3900 l 6675 3900 l 6675 1500 l + cp gs col7 0.75 shd ef gr +% Ellipse +7.500 slw + [15 45] 45 sd +1 slc +n 5400 3900 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4800 3900 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4200 3300 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4800 3300 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4200 2700 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4200 3900 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6000 3900 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6600 3900 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6600 3300 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6000 3300 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 5400 3300 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4800 2700 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 5400 2700 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6000 2700 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6600 2700 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6000 2100 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 5400 2100 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4800 2100 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4200 2100 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4200 1500 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4800 1500 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 5400 1500 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6600 2100 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6000 1500 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6653 1522 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Polyline +0 slc +gs clippath +6970 5160 m 7215 5160 l 7215 5040 l 6970 5040 l 6970 5040 l 7150 5100 l 6970 5160 l cp +eoclip +n 3000 5100 m + 7200 5100 l gs col0 s gr gr + +% arrowhead +15.000 slw +n 6970 5160 m 7150 5100 l 6970 5040 l 6970 5160 l cp gs 0.00 setgray ef gr col0 s +% Polyline +7.500 slw +gs clippath +3060 1130 m 3060 885 l 2940 885 l 2940 1130 l 2940 1130 l 3000 950 l 3060 1130 l cp +eoclip +n 3000 5100 m + 3000 900 l gs col0 s gr gr + +% arrowhead +15.000 slw +n 3060 1130 m 3000 950 l 2940 1130 l 3060 1130 l cp gs 0.00 setgray ef gr col0 s +% Polyline +7.500 slw +n 3000 4500 m + 2925 4500 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 3000 3900 m + 2925 3900 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 3000 3300 m + 2925 3300 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 3600 5100 m + 3600 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 4200 5100 m + 4200 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 5400 5100 m + 5400 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 4800 5100 m + 4800 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 6000 5100 m + 6000 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 6600 5100 m + 6600 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 3000 2700 m + 2925 2700 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 3000 1500 m + 2925 1500 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 3000 2100 m + 2925 2100 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline + [15 45] 45 sd +n 3000 1500 m + 7200 1500 l gs col0 s gr [] 0 sd +% Polyline + [15 45] 45 sd +n 3000 3900 m + 7200 3900 l gs col0 s gr [] 0 sd +% Polyline + [15 45] 45 sd +n 4200 5100 m + 4200 900 l gs col0 s gr [] 0 sd +% Polyline + [15 45] 45 sd +n 6675 5100 m + 6675 900 l gs col0 s gr [] 0 sd +/Times-Bold ff 433.33 scf sf +2625 4650 m +gs 1 -1 sc (1) col0 sh gr +/Times-Bold ff 433.33 scf sf +2625 4050 m +gs 1 -1 sc (2) col0 sh gr +/Times-Bold ff 433.33 scf sf +3525 5550 m +gs 1 -1 sc (1) col0 sh gr +/Times-Bold ff 433.33 scf sf +2700 1050 m +gs 1 -1 sc (j) col0 sh gr +/Times-Bold ff 433.33 scf sf +4125 5550 m +gs 1 -1 sc (2) col0 sh gr +/Times-Roman ff 433.33 scf sf +3825 825 m +gs 1 -1 sc (i>=2) col0 sh gr +/Times-Bold ff 433.33 scf sf +2550 1575 m +gs 1 -1 sc (N) col0 sh gr +/Times-Bold ff 433.33 scf sf +6450 5550 m +gs 1 -1 sc (N) col0 sh gr +/Times-Bold ff 433.33 scf sf +7275 5475 m +gs 1 -1 sc (i) col0 sh gr +/Times-Roman ff 433.33 scf sf +6300 900 m +gs 1 -1 sc (i<=N) col0 sh gr +/Times-Roman ff 433.33 scf sf +7350 1575 m +gs 1 -1 sc (j<=N) col0 sh gr +/Times-Roman ff 433.33 scf sf +7350 3975 m +gs 1 -1 sc (j>=2) col0 sh gr +% here ends figure; +$F2psEnd +rs +showpage +%%Trailer +%EOF diff -Nru cloog-0.18.2/osl/doc/images/basic1.fig cloog-0.18.4/osl/doc/images/basic1.fig --- cloog-0.18.2/osl/doc/images/basic1.fig 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/doc/images/basic1.fig 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,86 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha5 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 5400 3900 75 75 5400 3900 5400 3975 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4800 3900 75 75 4800 3900 4800 3975 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4200 3300 75 75 4200 3300 4200 3375 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4800 3300 75 75 4800 3300 4800 3375 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4200 2700 75 75 4200 2700 4200 2775 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4200 3900 75 75 4200 3900 4200 3975 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6000 3900 75 75 6000 3900 6000 3975 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6600 3900 75 75 6600 3900 6600 3975 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6600 3300 75 75 6600 3300 6600 3375 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6000 3300 75 75 6000 3300 6000 3375 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 5400 3300 75 75 5400 3300 5400 3375 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4800 2700 75 75 4800 2700 4800 2775 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 5400 2700 75 75 5400 2700 5400 2775 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6000 2700 75 75 6000 2700 6000 2775 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6600 2700 75 75 6600 2700 6600 2775 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6000 2100 75 75 6000 2100 6000 2175 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 5400 2100 75 75 5400 2100 5400 2175 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4800 2100 75 75 4800 2100 4800 2175 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4200 2100 75 75 4200 2100 4200 2175 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4200 1500 75 75 4200 1500 4200 1575 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4800 1500 75 75 4800 1500 4800 1575 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 5400 1500 75 75 5400 1500 5400 1575 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6600 2100 75 75 6600 2100 6600 2175 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6000 1500 75 75 6000 1500 6000 1575 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6653 1522 75 75 6653 1522 6653 1597 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 180.00 + 3000 5100 7200 5100 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 180.00 + 3000 5100 3000 900 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3000 4500 2925 4500 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3000 3900 2925 3900 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3000 3300 2925 3300 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3600 5100 3600 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 4200 5100 4200 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 5400 5100 5400 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 4800 5100 4800 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 6000 5100 6000 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 6600 5100 6600 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3000 2700 2925 2700 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3000 1500 2925 1500 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3000 2100 2925 2100 +2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 0 0 2 + 3000 1500 7200 1500 +2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 0 0 2 + 3000 3900 7200 3900 +2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 0 0 2 + 4200 5100 4200 900 +2 3 0 0 0 7 51 -1 15 0.000 0 0 -1 0 0 5 + 4200 1500 4200 3900 6675 3900 6675 1500 4200 1500 +2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 0 0 2 + 6675 5100 6675 900 +4 0 0 50 -1 2 26 0.0000 0 285 225 2625 4650 1\001 +4 0 0 50 -1 2 26 0.0000 0 285 225 2625 4050 2\001 +4 0 0 50 -1 2 26 0.0000 0 285 225 3525 5550 1\001 +4 0 0 50 -1 2 26 0.0000 0 375 150 2700 1050 j\001 +4 0 0 50 -1 2 26 0.0000 0 285 225 4125 5550 2\001 +4 0 0 50 -1 0 26 0.0000 0 285 825 3825 825 i>=2\001 +4 0 0 50 -1 2 26 0.0000 0 285 315 2550 1575 N\001 +4 0 0 50 -1 2 26 0.0000 0 285 315 6450 5550 N\001 +4 0 0 50 -1 2 26 0.0000 0 285 120 7275 5475 i\001 +4 0 0 50 -1 0 26 0.0000 0 285 915 6300 900 i<=N\001 +4 0 0 50 -1 0 26 0.0000 0 375 915 7350 1575 j<=N\001 +4 0 0 50 -1 0 26 0.0000 0 375 825 7350 3975 j>=2\001 Binary files /tmp/8LKHgB0qpE/cloog-0.18.2/osl/doc/images/basic1.jpg and /tmp/yy4tVJh_7V/cloog-0.18.4/osl/doc/images/basic1.jpg differ Binary files /tmp/8LKHgB0qpE/cloog-0.18.2/osl/doc/images/basic1.pdf and /tmp/yy4tVJh_7V/cloog-0.18.4/osl/doc/images/basic1.pdf differ diff -Nru cloog-0.18.2/osl/doc/images/basic1.txt cloog-0.18.4/osl/doc/images/basic1.txt --- cloog-0.18.2/osl/doc/images/basic1.txt 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/doc/images/basic1.txt 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,12 @@ + j^ i>=2 i<=N + | | | + | | | +N-+-********--j<=N + | ******** + | ******** + | ******** +2-+-********--j>=2 + | | | +0-+-+------+--->i + | | | + 0 2 N diff -Nru cloog-0.18.2/osl/doc/images/basic2.eps cloog-0.18.4/osl/doc/images/basic2.eps --- cloog-0.18.2/osl/doc/images/basic2.eps 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/doc/images/basic2.eps 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,256 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: basic2.fig +%%Creator: fig2dev Version 3.2 Patchlevel 5-alpha7 +%%CreationDate: Sat May 10 21:23:40 2008 +%%For: cedb@localhost (Bastoul Cedric) +%%BoundingBox: 0 0 260 235 +%Magnification: 1.0000 +%%EndComments +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {0 setgray} bind def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col2 {0.000 1.000 0.000 srgb} bind def +/col3 {0.000 1.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col5 {1.000 0.000 1.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col8 {0.000 0.000 0.560 srgb} bind def +/col9 {0.000 0.000 0.690 srgb} bind def +/col10 {0.000 0.000 0.820 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col14 {0.000 0.820 0.000 srgb} bind def +/col15 {0.000 0.560 0.560 srgb} bind def +/col16 {0.000 0.690 0.690 srgb} bind def +/col17 {0.000 0.820 0.820 srgb} bind def +/col18 {0.560 0.000 0.000 srgb} bind def +/col19 {0.690 0.000 0.000 srgb} bind def +/col20 {0.820 0.000 0.000 srgb} bind def +/col21 {0.560 0.000 0.560 srgb} bind def +/col22 {0.690 0.000 0.690 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def +/col24 {0.500 0.190 0.000 srgb} bind def +/col25 {0.630 0.250 0.000 srgb} bind def +/col26 {0.750 0.380 0.000 srgb} bind def +/col27 {1.000 0.500 0.500 srgb} bind def +/col28 {1.000 0.630 0.630 srgb} bind def +/col29 {1.000 0.750 0.750 srgb} bind def +/col30 {1.000 0.880 0.880 srgb} bind def +/col31 {1.000 0.840 0.000 srgb} bind def + +end +save +newpath 0 235 moveto 0 0 lineto 260 0 lineto 260 235 lineto closepath clip newpath +-156.6 333.9 translate +1 -1 scale + +/cp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def + /DrawEllipse { + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y tr xrad yrad sc 0 0 1 startangle endangle arc + closepath + savematrix setmatrix + } def + +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def + +$F2psBegin +10 setmiterlimit +0 slj 0 slc + 0.06000 0.06000 sc +% +% Fig objects follow +% +% +% here starts figure with depth 51 +% Polyline +0 slj +0 slc +0.000 slw +n 4200 2700 m 4200 3900 l 5400 3900 l 5400 2700 l + cp gs col7 0.75 shd ef gr +% Ellipse +7.500 slw + [15 45] 45 sd +1 slc +n 5400 3900 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4800 3900 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4200 3300 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4800 3300 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4200 2700 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4200 3900 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 5400 3300 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4800 2700 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 5400 2700 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Polyline +0 slc +gs clippath +5770 5160 m 6015 5160 l 6015 5040 l 5770 5040 l 5770 5040 l 5950 5100 l 5770 5160 l cp +eoclip +n 3000 5100 m + 6000 5100 l gs col0 s gr gr + +% arrowhead +15.000 slw +n 5770 5160 m 5950 5100 l 5770 5040 l 5770 5160 l cp gs 0.00 setgray ef gr col0 s +% Polyline +7.500 slw +gs clippath +3060 2330 m 3060 2085 l 2940 2085 l 2940 2330 l 2940 2330 l 3000 2150 l 3060 2330 l cp +eoclip +n 3000 5100 m + 3000 2100 l gs col0 s gr gr + +% arrowhead +15.000 slw +n 3060 2330 m 3000 2150 l 2940 2330 l 3060 2330 l cp gs 0.00 setgray ef gr col0 s +% Polyline +7.500 slw +n 3000 4500 m + 2925 4500 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 3000 3900 m + 2925 3900 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 3000 3300 m + 2925 3300 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 3600 5100 m + 3600 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 4200 5100 m + 4200 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 5400 5100 m + 5400 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 4800 5100 m + 4800 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 3000 2700 m + 2925 2700 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline + [15 45] 45 sd +n 3000 3900 m + 6000 3900 l gs col0 s gr [] 0 sd +% Polyline + [15 45] 45 sd +n 4200 5100 m + 4200 2100 l gs col0 s gr [] 0 sd +% Polyline + [15 45] 45 sd +n 5400 5175 m + 5400 2100 l gs col0 s gr [] 0 sd +% Polyline + [15 45] 45 sd +n 3000 2700 m + 6000 2700 l gs col0 s gr [] 0 sd +/Times-Bold ff 433.33 scf sf +2625 4650 m +gs 1 -1 sc (1) col0 sh gr +/Times-Bold ff 433.33 scf sf +2625 4050 m +gs 1 -1 sc (2) col0 sh gr +/Times-Bold ff 433.33 scf sf +3525 5550 m +gs 1 -1 sc (1) col0 sh gr +/Times-Bold ff 433.33 scf sf +4125 5550 m +gs 1 -1 sc (2) col0 sh gr +/Times-Bold ff 433.33 scf sf +5250 5550 m +gs 1 -1 sc (4) col0 sh gr +/Times-Bold ff 433.33 scf sf +2625 2850 m +gs 1 -1 sc (4) col0 sh gr +/Times-Bold ff 433.33 scf sf +2700 2175 m +gs 1 -1 sc (j) col0 sh gr +/Times-Roman ff 433.33 scf sf +3825 1950 m +gs 1 -1 sc (i>=2) col0 sh gr +/Times-Roman ff 433.33 scf sf +5025 1950 m +gs 1 -1 sc (i<=4) col0 sh gr +/Times-Roman ff 433.33 scf sf +6075 3975 m +gs 1 -1 sc (j>=2) col0 sh gr +/Times-Roman ff 433.33 scf sf +6075 2775 m +gs 1 -1 sc (j<=4) col0 sh gr +/Times-Bold ff 433.33 scf sf +6000 5550 m +gs 1 -1 sc (i) col0 sh gr +% here ends figure; +$F2psEnd +rs +showpage +%%Trailer +%EOF diff -Nru cloog-0.18.2/osl/doc/images/basic2.fig cloog-0.18.4/osl/doc/images/basic2.fig --- cloog-0.18.2/osl/doc/images/basic2.fig 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/doc/images/basic2.fig 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,62 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha5 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 5400 3900 75 75 5400 3900 5400 3975 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4800 3900 75 75 4800 3900 4800 3975 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4200 3300 75 75 4200 3300 4200 3375 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4800 3300 75 75 4800 3300 4800 3375 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4200 2700 75 75 4200 2700 4200 2775 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4200 3900 75 75 4200 3900 4200 3975 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 5400 3300 75 75 5400 3300 5400 3375 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4800 2700 75 75 4800 2700 4800 2775 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 5400 2700 75 75 5400 2700 5400 2775 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 180.00 + 3000 5100 6000 5100 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 180.00 + 3000 5100 3000 2100 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3000 4500 2925 4500 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3000 3900 2925 3900 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3000 3300 2925 3300 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3600 5100 3600 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 4200 5100 4200 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 5400 5100 5400 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 4800 5100 4800 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3000 2700 2925 2700 +2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 0 0 2 + 3000 3900 6000 3900 +2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 0 0 2 + 4200 5100 4200 2100 +2 3 0 0 0 7 51 -1 15 0.000 0 0 -1 0 0 5 + 4200 2700 4200 3900 5400 3900 5400 2700 4200 2700 +2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 0 0 2 + 5400 5175 5400 2100 +2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 0 0 2 + 3000 2700 6000 2700 +4 0 0 50 -1 2 26 0.0000 0 285 225 2625 4650 1\001 +4 0 0 50 -1 2 26 0.0000 0 285 225 2625 4050 2\001 +4 0 0 50 -1 2 26 0.0000 0 285 225 3525 5550 1\001 +4 0 0 50 -1 2 26 0.0000 0 285 225 4125 5550 2\001 +4 0 0 50 -1 2 26 0.0000 0 285 225 5250 5550 4\001 +4 0 0 50 -1 2 26 0.0000 0 285 225 2625 2850 4\001 +4 0 0 50 -1 2 26 0.0000 0 375 150 2700 2175 j\001 +4 0 0 50 -1 0 26 0.0000 0 285 825 3825 1950 i>=2\001 +4 0 0 50 -1 0 26 0.0000 0 285 825 5025 1950 i<=4\001 +4 0 0 50 -1 0 26 0.0000 0 375 825 6075 3975 j>=2\001 +4 0 0 50 -1 0 26 0.0000 0 375 825 6075 2775 j<=4\001 +4 0 0 50 -1 2 26 0.0000 0 285 120 6000 5550 i\001 Binary files /tmp/8LKHgB0qpE/cloog-0.18.2/osl/doc/images/basic2.jpg and /tmp/yy4tVJh_7V/cloog-0.18.4/osl/doc/images/basic2.jpg differ Binary files /tmp/8LKHgB0qpE/cloog-0.18.2/osl/doc/images/basic2.pdf and /tmp/yy4tVJh_7V/cloog-0.18.4/osl/doc/images/basic2.pdf differ diff -Nru cloog-0.18.2/osl/doc/images/basic2.txt cloog-0.18.4/osl/doc/images/basic2.txt --- cloog-0.18.2/osl/doc/images/basic2.txt 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/doc/images/basic2.txt 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,10 @@ + j^ i>=2 + | | i<=4 + | | | +4-+-***--j<=4 + | *** +2-+-***--j>=2 + | | | +0-+-+-+--->i + | | | + 0 2 4 diff -Nru cloog-0.18.2/osl/doc/images/basic.eps cloog-0.18.4/osl/doc/images/basic.eps --- cloog-0.18.2/osl/doc/images/basic.eps 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/doc/images/basic.eps 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,402 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: basic.fig +%%Creator: fig2dev Version 3.2 Patchlevel 4 +%%CreationDate: Thu Nov 17 16:54:54 2005 +%%For: bastoul@ulysse.futurs.inria.fr (Cedric Bastoul) +%%BoundingBox: 0 0 445 301 +%%Magnification: 1.0000 +%%EndComments +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {0 setgray} bind def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col2 {0.000 1.000 0.000 srgb} bind def +/col3 {0.000 1.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col5 {1.000 0.000 1.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col8 {0.000 0.000 0.560 srgb} bind def +/col9 {0.000 0.000 0.690 srgb} bind def +/col10 {0.000 0.000 0.820 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col14 {0.000 0.820 0.000 srgb} bind def +/col15 {0.000 0.560 0.560 srgb} bind def +/col16 {0.000 0.690 0.690 srgb} bind def +/col17 {0.000 0.820 0.820 srgb} bind def +/col18 {0.560 0.000 0.000 srgb} bind def +/col19 {0.690 0.000 0.000 srgb} bind def +/col20 {0.820 0.000 0.000 srgb} bind def +/col21 {0.560 0.000 0.560 srgb} bind def +/col22 {0.690 0.000 0.690 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def +/col24 {0.500 0.190 0.000 srgb} bind def +/col25 {0.630 0.250 0.000 srgb} bind def +/col26 {0.750 0.380 0.000 srgb} bind def +/col27 {1.000 0.500 0.500 srgb} bind def +/col28 {1.000 0.630 0.630 srgb} bind def +/col29 {1.000 0.750 0.750 srgb} bind def +/col30 {1.000 0.880 0.880 srgb} bind def +/col31 {1.000 0.840 0.000 srgb} bind def + +end +save +newpath 0 301 moveto 0 0 lineto 445 0 lineto 445 301 lineto closepath clip newpath +-153.0 333.0 translate +1 -1 scale + +/cp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def +/reencdict 12 dict def /ReEncode { reencdict begin +/newcodesandnames exch def /newfontname exch def /basefontname exch def +/basefontdict basefontname findfont def /newfont basefontdict maxlength dict def +basefontdict { exch dup /FID ne { dup /Encoding eq +{ exch dup length array copy newfont 3 1 roll put } +{ exch newfont 3 1 roll put } ifelse } { pop pop } ifelse } forall +newfont /FontName newfontname put newcodesandnames aload pop +128 1 255 { newfont /Encoding get exch /.notdef put } for +newcodesandnames length 2 idiv { newfont /Encoding get 3 1 roll put } repeat +newfontname newfont definefont pop end } def +/isovec [ +8#055 /minus 8#200 /grave 8#201 /acute 8#202 /circumflex 8#203 /tilde +8#204 /macron 8#205 /breve 8#206 /dotaccent 8#207 /dieresis +8#210 /ring 8#211 /cedilla 8#212 /hungarumlaut 8#213 /ogonek 8#214 /caron +8#220 /dotlessi 8#230 /oe 8#231 /OE +8#240 /space 8#241 /exclamdown 8#242 /cent 8#243 /sterling +8#244 /currency 8#245 /yen 8#246 /brokenbar 8#247 /section 8#250 /dieresis +8#251 /copyright 8#252 /ordfeminine 8#253 /guillemotleft 8#254 /logicalnot +8#255 /hyphen 8#256 /registered 8#257 /macron 8#260 /degree 8#261 /plusminus +8#262 /twosuperior 8#263 /threesuperior 8#264 /acute 8#265 /mu 8#266 /paragraph +8#267 /periodcentered 8#270 /cedilla 8#271 /onesuperior 8#272 /ordmasculine +8#273 /guillemotright 8#274 /onequarter 8#275 /onehalf +8#276 /threequarters 8#277 /questiondown 8#300 /Agrave 8#301 /Aacute +8#302 /Acircumflex 8#303 /Atilde 8#304 /Adieresis 8#305 /Aring +8#306 /AE 8#307 /Ccedilla 8#310 /Egrave 8#311 /Eacute +8#312 /Ecircumflex 8#313 /Edieresis 8#314 /Igrave 8#315 /Iacute +8#316 /Icircumflex 8#317 /Idieresis 8#320 /Eth 8#321 /Ntilde 8#322 /Ograve +8#323 /Oacute 8#324 /Ocircumflex 8#325 /Otilde 8#326 /Odieresis 8#327 /multiply +8#330 /Oslash 8#331 /Ugrave 8#332 /Uacute 8#333 /Ucircumflex +8#334 /Udieresis 8#335 /Yacute 8#336 /Thorn 8#337 /germandbls 8#340 /agrave +8#341 /aacute 8#342 /acircumflex 8#343 /atilde 8#344 /adieresis 8#345 /aring +8#346 /ae 8#347 /ccedilla 8#350 /egrave 8#351 /eacute +8#352 /ecircumflex 8#353 /edieresis 8#354 /igrave 8#355 /iacute +8#356 /icircumflex 8#357 /idieresis 8#360 /eth 8#361 /ntilde 8#362 /ograve +8#363 /oacute 8#364 /ocircumflex 8#365 /otilde 8#366 /odieresis 8#367 /divide +8#370 /oslash 8#371 /ugrave 8#372 /uacute 8#373 /ucircumflex +8#374 /udieresis 8#375 /yacute 8#376 /thorn 8#377 /ydieresis] def +/Times-Bold /Times-Bold-iso isovec ReEncode +/Times-Roman /Times-Roman-iso isovec ReEncode + /DrawEllipse { + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y tr xrad yrad sc 0 0 1 startangle endangle arc + closepath + savematrix setmatrix + } def + +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def + +$F2psBegin +10 setmiterlimit +0 slj 0 slc + 0.06000 0.06000 sc +% +% Fig objects follow +% +% +% here starts figure with depth 51 +% Polyline +n 4200 1500 m 4200 3900 l 8400 3900 l 6000 1500 l + cp gs col7 0.75 shd ef gr +% Ellipse +7.500 slw + [15 45] 45 sd +1 slc +n 5400 3900 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4800 3900 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4200 3300 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4800 3300 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4200 2700 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4200 3900 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6000 3900 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6600 3900 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 7200 3900 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 7800 3900 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 7200 3300 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6600 3300 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6000 3300 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 5400 3300 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4800 2700 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 5400 2700 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6000 2700 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6600 2700 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6000 2100 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 5400 2100 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4800 2100 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4200 2100 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4200 1500 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 4800 1500 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 5400 1500 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 7800 3300 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 8400 3900 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 7200 2700 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6600 2100 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Ellipse + [15 45] 45 sd +n 6000 1500 75 75 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr + [] 0 sd +% Polyline +0 slc +gs clippath +9615 5160 m 9615 5040 l 9395 5040 l 9575 5100 l 9395 5160 l cp +eoclip +n 3000 5100 m + 9600 5100 l gs col0 s gr gr + +% arrowhead +15.000 slw +n 9395 5160 m 9575 5100 l 9395 5040 l 9395 5160 l cp gs 0.00 setgray ef gr col0 s +% Polyline +7.500 slw +gs clippath +3060 885 m 2940 885 l 2940 1105 l 3000 925 l 3060 1105 l cp +eoclip +n 3000 5100 m + 3000 900 l gs col0 s gr gr + +% arrowhead +15.000 slw +n 3060 1105 m 3000 925 l 2940 1105 l 3060 1105 l cp gs 0.00 setgray ef gr col0 s +% Polyline +7.500 slw +n 3000 4500 m + 2925 4500 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 3000 3900 m + 2925 3900 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 3000 3300 m + 2925 3300 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 3600 5100 m + 3600 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 4200 5100 m + 4200 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 5400 5100 m + 5400 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 4800 5100 m + 4800 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 6000 5100 m + 6000 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 6600 5100 m + 6600 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 3000 2700 m + 2925 2700 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 3000 1500 m + 2925 1500 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 3000 2100 m + 2925 2100 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline + [15 45] 45 sd +n 3000 1500 m + 9000 1500 l gs col0 s gr [] 0 sd +% Polyline + [15 45] 45 sd +n 8400 5100 m + 8400 900 l gs col0 s gr [] 0 sd +% Polyline +n 7200 5100 m + 7200 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 7800 5100 m + 7800 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline +n 8400 5100 m + 8400 5175 l gs 0.00 setgray ef gr gs col0 s gr +% Polyline + [15 45] 45 sd +n 3000 3900 m + 9000 3900 l gs col0 s gr [] 0 sd +% Polyline + [15 45] 45 sd +n 5400 900 m + 9600 5100 l gs col0 s gr [] 0 sd +% Polyline + [15 45] 45 sd +n 4200 5100 m + 4200 900 l gs col0 s gr [] 0 sd +/Times-Bold-iso ff 390.00 scf sf +2625 4650 m +gs 1 -1 sc (1) col0 sh gr +/Times-Bold-iso ff 390.00 scf sf +2625 4050 m +gs 1 -1 sc (2) col0 sh gr +/Times-Bold-iso ff 390.00 scf sf +3525 5550 m +gs 1 -1 sc (1) col0 sh gr +/Times-Bold-iso ff 390.00 scf sf +2700 1050 m +gs 1 -1 sc (j) col0 sh gr +/Times-Roman-iso ff 390.00 scf sf +8025 825 m +gs 1 -1 sc (i<=n) col0 sh gr +/Times-Bold-iso ff 390.00 scf sf +4125 5550 m +gs 1 -1 sc (2) col0 sh gr +/Times-Bold-iso ff 390.00 scf sf +8325 5550 m +gs 1 -1 sc (n) col0 sh gr +/Times-Bold-iso ff 390.00 scf sf +2550 1575 m +gs 1 -1 sc (m) col0 sh gr +/Times-Roman-iso ff 390.00 scf sf +9075 3975 m +gs 1 -1 sc (j>=2) col0 sh gr +/Times-Roman-iso ff 390.00 scf sf +9075 1575 m +gs 1 -1 sc (j<=m) col0 sh gr +/Times-Bold-iso ff 390.00 scf sf +9450 5475 m +gs 1 -1 sc (i) col0 sh gr +/Times-Roman-iso ff 390.00 scf sf +3825 825 m +gs 1 -1 sc (i>=2) col0 sh gr +/Times-Roman-iso ff 390.00 scf sf +4875 825 m +gs 1 -1 sc (j<=n+2-i) col0 sh gr +% here ends figure; +$F2psEnd +rs +showpage diff -Nru cloog-0.18.2/osl/doc/images/basic.fig cloog-0.18.4/osl/doc/images/basic.fig --- cloog-0.18.2/osl/doc/images/basic.fig 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/doc/images/basic.fig 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,100 @@ +#FIG 3.2 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 5400 3900 75 75 5400 3900 5400 3975 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4800 3900 75 75 4800 3900 4800 3975 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4200 3300 75 75 4200 3300 4200 3375 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4800 3300 75 75 4800 3300 4800 3375 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4200 2700 75 75 4200 2700 4200 2775 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4200 3900 75 75 4200 3900 4200 3975 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6000 3900 75 75 6000 3900 6000 3975 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6600 3900 75 75 6600 3900 6600 3975 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 7200 3900 75 75 7200 3900 7200 3975 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 7800 3900 75 75 7800 3900 7800 3975 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 7200 3300 75 75 7200 3300 7200 3375 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6600 3300 75 75 6600 3300 6600 3375 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6000 3300 75 75 6000 3300 6000 3375 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 5400 3300 75 75 5400 3300 5400 3375 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4800 2700 75 75 4800 2700 4800 2775 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 5400 2700 75 75 5400 2700 5400 2775 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6000 2700 75 75 6000 2700 6000 2775 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6600 2700 75 75 6600 2700 6600 2775 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6000 2100 75 75 6000 2100 6000 2175 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 5400 2100 75 75 5400 2100 5400 2175 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4800 2100 75 75 4800 2100 4800 2175 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4200 2100 75 75 4200 2100 4200 2175 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4200 1500 75 75 4200 1500 4200 1575 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 4800 1500 75 75 4800 1500 4800 1575 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 5400 1500 75 75 5400 1500 5400 1575 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 7800 3300 75 75 7800 3300 7800 3375 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 8400 3900 75 75 8400 3900 8400 3975 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 7200 2700 75 75 7200 2700 7200 2775 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6600 2100 75 75 6600 2100 6600 2175 +1 3 2 1 0 0 50 -1 20 3.000 1 0.0000 6000 1500 75 75 6000 1500 6000 1575 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 180.00 + 3000 5100 9600 5100 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 180.00 + 3000 5100 3000 900 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3000 4500 2925 4500 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3000 3900 2925 3900 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3000 3300 2925 3300 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3600 5100 3600 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 4200 5100 4200 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 5400 5100 5400 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 4800 5100 4800 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 6000 5100 6000 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 6600 5100 6600 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3000 2700 2925 2700 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3000 1500 2925 1500 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 3000 2100 2925 2100 +2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 0 0 2 + 3000 1500 9000 1500 +2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 0 0 2 + 8400 5100 8400 900 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 7200 5100 7200 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 7800 5100 7800 5175 +2 1 0 1 0 0 50 -1 20 3.000 0 0 -1 0 0 2 + 8400 5100 8400 5175 +2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 0 0 2 + 3000 3900 9000 3900 +2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 0 0 2 + 5400 900 9600 5100 +2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 0 0 2 + 4200 5100 4200 900 +2 3 0 0 0 7 51 -1 15 0.000 0 0 -1 0 0 5 + 4200 1500 4200 3900 8400 3900 6000 1500 4200 1500 +4 0 0 50 -1 2 26 0.0000 0 270 195 2625 4650 1\001 +4 0 0 50 -1 2 26 0.0000 0 270 195 2625 4050 2\001 +4 0 0 50 -1 2 26 0.0000 0 270 195 3525 5550 1\001 +4 0 0 50 -1 2 26 0.0000 0 345 135 2700 1050 j\001 +4 0 0 50 -1 0 26 0.0000 0 270 750 8025 825 i<=n\001 +4 0 0 50 -1 2 26 0.0000 0 270 195 4125 5550 2\001 +4 0 0 50 -1 2 26 0.0000 0 180 225 8325 5550 n\001 +4 0 0 50 -1 2 26 0.0000 0 180 330 2550 1575 m\001 +4 0 0 50 -1 0 26 0.0000 0 360 750 9075 3975 j>=2\001 +4 0 0 50 -1 0 26 0.0000 0 360 855 9075 1575 j<=m\001 +4 0 0 50 -1 2 26 0.0000 0 270 105 9450 5475 i\001 +4 0 0 50 -1 0 26 0.0000 0 270 750 3825 825 i>=2\001 +4 0 0 50 -1 0 26 0.0000 0 360 1410 4875 825 j<=n+2-i\001 Binary files /tmp/8LKHgB0qpE/cloog-0.18.2/osl/doc/images/basic.jpg and /tmp/yy4tVJh_7V/cloog-0.18.4/osl/doc/images/basic.jpg differ Binary files /tmp/8LKHgB0qpE/cloog-0.18.2/osl/doc/images/basic.pdf and /tmp/yy4tVJh_7V/cloog-0.18.4/osl/doc/images/basic.pdf differ diff -Nru cloog-0.18.2/osl/doc/images/basic.txt cloog-0.18.4/osl/doc/images/basic.txt --- cloog-0.18.2/osl/doc/images/basic.txt 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/doc/images/basic.txt 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,13 @@ + j^ i>=2 + | | j<=n+2-i + | |\ | i<=n + | | \ | +m-+-****---+-j<=m + | ***** | + | ****** | + | *******| +2-+-********-j>=2 + | | |\ +0-+-+------+--->i + | | | + 0 2 n diff -Nru cloog-0.18.2/osl/doc/images/tree.eps cloog-0.18.4/osl/doc/images/tree.eps --- cloog-0.18.2/osl/doc/images/tree.eps 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/doc/images/tree.eps 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,258 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: tree.eps +%%Creator: fig2dev Version 3.2 Patchlevel 3c +%%CreationDate: Fri Sep 6 10:09:40 2002 +%%For: bastoul@whisky (Cedric Bastoul) +%%BoundingBox: 0 0 388 312 +%%Magnification: 1.0000 +%%EndComments +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {0 setgray} bind def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col2 {0.000 1.000 0.000 srgb} bind def +/col3 {0.000 1.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col5 {1.000 0.000 1.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col8 {0.000 0.000 0.560 srgb} bind def +/col9 {0.000 0.000 0.690 srgb} bind def +/col10 {0.000 0.000 0.820 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col14 {0.000 0.820 0.000 srgb} bind def +/col15 {0.000 0.560 0.560 srgb} bind def +/col16 {0.000 0.690 0.690 srgb} bind def +/col17 {0.000 0.820 0.820 srgb} bind def +/col18 {0.560 0.000 0.000 srgb} bind def +/col19 {0.690 0.000 0.000 srgb} bind def +/col20 {0.820 0.000 0.000 srgb} bind def +/col21 {0.560 0.000 0.560 srgb} bind def +/col22 {0.690 0.000 0.690 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def +/col24 {0.500 0.190 0.000 srgb} bind def +/col25 {0.630 0.250 0.000 srgb} bind def +/col26 {0.750 0.380 0.000 srgb} bind def +/col27 {1.000 0.500 0.500 srgb} bind def +/col28 {1.000 0.630 0.630 srgb} bind def +/col29 {1.000 0.750 0.750 srgb} bind def +/col30 {1.000 0.880 0.880 srgb} bind def +/col31 {1.000 0.840 0.000 srgb} bind def + +end +save +newpath 0 312 moveto 0 0 lineto 388 0 lineto 388 312 lineto closepath clip newpath +-165.0 369.0 translate +1 -1 scale + +/cp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def + /DrawEllipse { + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y tr xrad yrad sc 0 0 1 startangle endangle arc + closepath + savematrix setmatrix + } def + +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def + +$F2psBegin +%%Page: 1 1 +10 setmiterlimit + 0.06000 0.06000 sc +% +% Fig objects follow +% +7.500 slw +% Ellipse +n 5400 1200 237 237 0 360 DrawEllipse gs col0 s gr + +% Ellipse +n 3000 3600 237 237 0 360 DrawEllipse gs col0 s gr + +% Ellipse +n 7800 3600 237 237 0 360 DrawEllipse gs col0 s gr + +% Ellipse +n 6600 4800 237 237 0 360 DrawEllipse gs col0 s gr + +% Ellipse +n 5400 2325 237 237 0 360 DrawEllipse gs col0 s gr + +% Polyline +gs clippath +5355 2115 m 5445 2115 l 5445 1888 l 5400 2068 l 5355 1888 l cp +eoclip +n 5400 1425 m + 5400 2100 l gs col0 s gr gr + +% arrowhead +15.000 slw +n 5355 1888 m 5400 2068 l 5445 1888 l 5355 1888 l cp gs 0.00 setgray ef gr col0 s +% Polyline +7.500 slw +gs clippath +5355 3390 m 5445 3390 l 5445 3163 l 5400 3343 l 5355 3163 l cp +eoclip +n 5400 2550 m + 5400 3375 l gs col0 s gr gr + +% arrowhead +15.000 slw +n 5355 3163 m 5400 3343 l 5445 3163 l 5355 3163 l cp gs 0.00 setgray ef gr col0 s +% Polyline +7.500 slw +gs clippath +2955 4590 m 3045 4590 l 3045 4363 l 3000 4543 l 2955 4363 l cp +eoclip +n 3000 3825 m + 3000 4575 l gs col0 s gr gr + +% arrowhead +15.000 slw +n 2955 4363 m 3000 4543 l 3045 4363 l 2955 4363 l cp gs 0.00 setgray ef gr col0 s +% Polyline +7.500 slw +gs clippath +6563 4544 m 6611 4621 l 6803 4500 l 6627 4558 l 6755 4424 l cp +eoclip +n 7800 3825 m + 6600 4575 l gs col0 s gr gr + +% arrowhead +15.000 slw +n 6755 4424 m 6627 4558 l 6803 4500 l 6755 4424 l cp gs 0.00 setgray ef gr col0 s +% Polyline +7.500 slw +gs clippath +8988 4621 m 9036 4544 l 8844 4424 l 8973 4558 l 8796 4500 l cp +eoclip +n 7800 3825 m + 9000 4575 l gs col0 s gr gr + +% arrowhead +15.000 slw +n 8796 4500 m 8973 4558 l 8844 4424 l 8796 4500 l cp gs 0.00 setgray ef gr col0 s +% Polyline +7.500 slw +gs clippath +6555 5790 m 6645 5790 l 6645 5563 l 6600 5743 l 6555 5563 l cp +eoclip +n 6600 5025 m + 6600 5775 l gs col0 s gr gr + +% arrowhead +15.000 slw +n 6555 5563 m 6600 5743 l 6645 5563 l 6555 5563 l cp gs 0.00 setgray ef gr col0 s +% Polyline +7.500 slw +gs clippath +7802 3411 m 7831 3326 l 7615 3253 l 7772 3354 l 7587 3338 l cp +eoclip +n 5400 2550 m + 7803 3364 l gs col0 s gr gr + +% arrowhead +15.000 slw +n 7587 3338 m 7772 3354 l 7615 3253 l 7587 3338 l cp gs 0.00 setgray ef gr col0 s +% Polyline +7.500 slw +gs clippath +2971 3337 m 3000 3422 l 3215 3348 l 3031 3364 l 3186 3262 l cp +eoclip +n 5400 2550 m + 3000 3375 l gs col0 s gr gr + +% arrowhead +15.000 slw +n 3186 3262 m 3031 3364 l 3215 3348 l 3186 3262 l cp gs 0.00 setgray ef gr col0 s +/Times-Roman ff 330.00 scf sf +3075 4200 m +gs 1 -1 sc (0) col0 sh gr +/Times-Roman ff 330.00 scf sf +6675 5400 m +gs 1 -1 sc (0) col0 sh gr +/Times-Roman ff 330.00 scf sf +5475 3000 m +gs 1 -1 sc (1) col0 sh gr +/Times-Roman ff 330.00 scf sf +3825 3000 m +gs 1 -1 sc (0) col0 sh gr +/Times-Roman ff 330.00 scf sf +6900 3000 m +gs 1 -1 sc (2) col0 sh gr +/Times-Roman ff 330.00 scf sf +6975 4200 m +gs 1 -1 sc (0) col0 sh gr +/Times-Roman ff 330.00 scf sf +8475 4200 m +gs 1 -1 sc (1) col0 sh gr +/Times-Roman ff 330.00 scf sf +5475 1800 m +gs 1 -1 sc (0) col0 sh gr +/Times-Roman ff 330.00 scf sf +2850 4950 m +gs 1 -1 sc (S1) col0 sh gr +/Times-Roman ff 330.00 scf sf +5250 3750 m +gs 1 -1 sc (S2) col0 sh gr +/Times-Roman ff 330.00 scf sf +6450 6150 m +gs 1 -1 sc (S3) col0 sh gr +/Times-Roman ff 330.00 scf sf +8850 4950 m +gs 1 -1 sc (S4) col0 sh gr +/Times-Roman ff 330.00 scf sf +5355 2430 m +gs 1 -1 sc (i) col0 sh gr +/Times-Roman ff 330.00 scf sf +2963 3667 m +gs 1 -1 sc (j) col0 sh gr +/Times-Roman ff 330.00 scf sf +7763 3675 m +gs 1 -1 sc (j) col0 sh gr +/Times-Roman ff 330.00 scf sf +6533 4890 m +gs 1 -1 sc (k) col0 sh gr +$F2psEnd +rs diff -Nru cloog-0.18.2/osl/doc/images/tree.fig cloog-0.18.4/osl/doc/images/tree.fig --- cloog-0.18.2/osl/doc/images/tree.fig 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/doc/images/tree.fig 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,54 @@ +#FIG 3.2 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5400 1200 237 237 5400 1200 5625 1275 +1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 3000 3600 237 237 3000 3600 3225 3675 +1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 7800 3600 237 237 7800 3600 8025 3675 +1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 6600 4800 237 237 6600 4800 6825 4875 +1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5400 2325 237 237 5400 2325 5625 2400 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 90.00 180.00 + 5400 1425 5400 2100 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 90.00 180.00 + 5400 2550 5400 3375 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 90.00 180.00 + 3000 3825 3000 4575 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 90.00 180.00 + 7800 3825 6600 4575 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 90.00 180.00 + 7800 3825 9000 4575 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 90.00 180.00 + 6600 5025 6600 5775 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 90.00 180.00 + 5400 2550 7803 3364 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 90.00 180.00 + 5400 2550 3000 3375 +4 0 0 50 0 0 22 0.0000 0 225 150 3075 4200 0\001 +4 0 0 50 0 0 22 0.0000 0 225 150 6675 5400 0\001 +4 0 0 50 0 0 22 0.0000 0 225 150 5475 3000 1\001 +4 0 0 50 0 0 22 0.0000 0 225 150 3825 3000 0\001 +4 0 0 50 0 0 22 0.0000 0 225 150 6900 3000 2\001 +4 0 0 50 0 0 22 0.0000 0 225 150 6975 4200 0\001 +4 0 0 50 0 0 22 0.0000 0 225 150 8475 4200 1\001 +4 0 0 50 0 0 22 0.0000 0 225 150 5475 1800 0\001 +4 0 0 50 0 0 22 0.0000 0 225 345 2850 4950 S1\001 +4 0 0 50 0 0 22 0.0000 0 225 345 5250 3750 S2\001 +4 0 0 50 0 0 22 0.0000 0 225 345 6450 6150 S3\001 +4 0 0 50 0 0 22 0.0000 0 225 345 8850 4950 S4\001 +4 0 0 50 0 0 22 0.0000 0 225 90 5355 2430 i\001 +4 0 0 50 0 0 22 0.0000 0 300 90 2963 3667 j\001 +4 0 0 50 0 0 22 0.0000 0 300 90 7763 3675 j\001 +4 0 0 50 0 0 22 0.0000 0 225 150 6533 4890 k\001 Binary files /tmp/8LKHgB0qpE/cloog-0.18.2/osl/doc/images/tree.jpg and /tmp/yy4tVJh_7V/cloog-0.18.4/osl/doc/images/tree.jpg differ Binary files /tmp/8LKHgB0qpE/cloog-0.18.2/osl/doc/images/tree.pdf and /tmp/yy4tVJh_7V/cloog-0.18.4/osl/doc/images/tree.pdf differ diff -Nru cloog-0.18.2/osl/doc/images/tree.txt cloog-0.18.4/osl/doc/images/tree.txt --- cloog-0.18.2/osl/doc/images/tree.txt 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/doc/images/tree.txt 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,25 @@ + * + | + |0 + | + V + i + | + +-----+-----+ + | | | + |0 |1 |2 + | | | + V V V + j S2 j + | | + |0 +--+--+ + | | | + V |0 |1 + S1 | | + V V + k S4 + | + |0 + | + V + S3 diff -Nru cloog-0.18.2/osl/doc/Makefile.am cloog-0.18.4/osl/doc/Makefile.am --- cloog-0.18.2/osl/doc/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/doc/Makefile.am 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,141 @@ +# +# /*+------------------------------------------------------------------** +# ** OpenScop Library ** +# **------------------------------------------------------------------** +# ** makefile.am ** +# **------------------------------------------------------------------** +# ** First version: 30/04/2008 ** +# **------------------------------------------------------------------** +# +# +# *************************************************************************** +# * OpenScop: Structures and formats for polyhedral tools to talk together * +# *************************************************************************** +# * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * +# * / / / // // // // / / / // // / / // / /|,_, * +# * / / / // // // // / / / // // / / // / / / /\ * +# * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * +# * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * +# * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * +# * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * +# * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * +# * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * +# * | I | | | | e | | | | | | | | | | | | | \ \ \ * +# * | T | | | | e | | | | | | | | | | | | | \ \ \ * +# * | E | | | | | | | | | | | | | | | | | \ \ \ * +# * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * +# * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * +# * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * +# * * +# * Copyright (C) 2008 University Paris-Sud and INRIA * +# * * +# * (3-clause BSD license) * +# * * +# * Redistribution and use in source and binary forms, with or without * +# * modification, are permitted provided that the following conditions * +# * are met: * +# * * +# * 1. Redistributions of source code must retain the above copyright * +# * notice, this list of conditions and the following disclaimer. * +# * 2. Redistributions in binary form must reproduce the above copyright * +# * notice, this list of conditions and the following disclaimer in the * +# * documentation and/or other materials provided with the distribution. * +# * 3. The name of the author may not be used to endorse or promote * +# * products derived from this software without specific prior written * +# * permission. * +# * * +# * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * +# * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +# * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +# * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, * +# * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +# * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * +# * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * +# * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * +# * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * +# * POSSIBILITY OF SUCH DAMAGE. * +# * * +# * OpenScop Library, a library to manipulate OpenScop formats and data * +# * structures. Written by: * +# * Cedric Bastoul and * +# * Louis-Noel Pouchet * +# * * +# ***************************************************************************/ +# +# Makefile.am (or makefile if generated) of the OpenScop Library. +# Makefile.am is not a makefile, you must run the 'autogen.sh' THEN the +# configure shellscript to generate the Makefile thanks to this file. + + +############################################################################# + +MAINTAINERCLEANFILES = \ + Makefile.in \ + htmldoc.tar.gz \ + openscop.pdf \ + openscop.cp \ + openscop.fn \ + openscop.info \ + openscop.ky \ + openscop.pg \ + openscop.toc \ + openscop.tp \ + openscop.vr \ + openscop.aux \ + openscop.log \ + openscop.doc + +clean-local: + -rm -rf htmldoc + +EXTRA_DIST = \ + htmldoc.tar.gz \ + openscop.pdf \ + S4.cloog \ + images/basic.eps \ + images/basic.fig \ + images/basic.jpg \ + images/basic.pdf \ + images/basic.txt \ + images/basic1.eps \ + images/basic1.fig \ + images/basic1.jpg \ + images/basic1.pdf \ + images/basic1.txt \ + images/basic2.eps \ + images/basic2.fig \ + images/basic2.jpg \ + images/basic2.pdf \ + images/basic2.txt \ + images/tree.eps \ + images/tree.fig \ + images/tree.jpg \ + images/tree.pdf \ + images/tree.txt + +if GENERATE_DOC +# Unfortunately the following is not supported conditionaly +# info_TEXINFOS = openscop.texi + +openscop.pdf: openscop.texi \ + images/basic.pdf \ + images/basic1.pdf \ + images/basic2.pdf \ + images/tree.pdf + $(TEXI2PDF) openscop.texi + +DOCDIR = htmldoc +DOXYFILE = Doxyfile +DOXYGENTOOL = @DOXYGEN@ + +# The following requires a fixed version of the Emacs 19.30 etags. +ETAGS_ARGS = --lang=none \ + --regex='/^@node[ \t]+\([^,]+\)/\1/' $(srcdir)/doc/openscop.texi +TAGS_DEPENDENCIES = openscop.texi $(DOXYFILE).in + +htmldoc.tar.gz: + mkdir -p $(top_srcdir)/doc/htmldoc + $(DOXYGENTOOL) $(DOXYFILE) + tar czf htmldoc.tar.gz htmldoc +endif diff -Nru cloog-0.18.2/osl/doc/Makefile.in cloog-0.18.4/osl/doc/Makefile.in --- cloog-0.18.2/osl/doc/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/doc/Makefile.in 2015-07-24 11:59:27.000000000 +0000 @@ -0,0 +1,643 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# /*+------------------------------------------------------------------** +# ** OpenScop Library ** +# **------------------------------------------------------------------** +# ** makefile.am ** +# **------------------------------------------------------------------** +# ** First version: 30/04/2008 ** +# **------------------------------------------------------------------** +# +# +# *************************************************************************** +# * OpenScop: Structures and formats for polyhedral tools to talk together * +# *************************************************************************** +# * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * +# * / / / // // // // / / / // // / / // / /|,_, * +# * / / / // // // // / / / // // / / // / / / /\ * +# * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * +# * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * +# * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * +# * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * +# * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * +# * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * +# * | I | | | | e | | | | | | | | | | | | | \ \ \ * +# * | T | | | | e | | | | | | | | | | | | | \ \ \ * +# * | E | | | | | | | | | | | | | | | | | \ \ \ * +# * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * +# * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * +# * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * +# * * +# * Copyright (C) 2008 University Paris-Sud and INRIA * +# * * +# * (3-clause BSD license) * +# * * +# * Redistribution and use in source and binary forms, with or without * +# * modification, are permitted provided that the following conditions * +# * are met: * +# * * +# * 1. Redistributions of source code must retain the above copyright * +# * notice, this list of conditions and the following disclaimer. * +# * 2. Redistributions in binary form must reproduce the above copyright * +# * notice, this list of conditions and the following disclaimer in the * +# * documentation and/or other materials provided with the distribution. * +# * 3. The name of the author may not be used to endorse or promote * +# * products derived from this software without specific prior written * +# * permission. * +# * * +# * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * +# * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +# * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +# * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, * +# * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +# * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * +# * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * +# * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * +# * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * +# * POSSIBILITY OF SUCH DAMAGE. * +# * * +# * OpenScop Library, a library to manipulate OpenScop formats and data * +# * structures. Written by: * +# * Cedric Bastoul and * +# * Louis-Noel Pouchet * +# * * +# ***************************************************************************/ +# +# Makefile.am (or makefile if generated) of the OpenScop Library. +# Makefile.am is not a makefile, you must run the 'autogen.sh' THEN the +# configure shellscript to generate the Makefile thanks to this file. + +############################################################################# +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = doc +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(srcdir)/Doxyfile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cc_maxopt.m4 \ + $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ + $(top_srcdir)/m4/ax_check_compiler_flags.m4 \ + $(top_srcdir)/m4/ax_compiler_vendor.m4 \ + $(top_srcdir)/m4/ax_gcc_archflag.m4 \ + $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ + $(top_srcdir)/m4/ax_submodule.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = Doxyfile +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CD = @CD@ +CFLAGS = @CFLAGS@ +CFLAGS_WARN = @CFLAGS_WARN@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOXYGEN = @DOXYGEN@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PRTDIAG = @PRTDIAG@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TEXI2PDF = @TEXI2PDF@ +VERSION = @VERSION@ +VERSION_MAJOR = @VERSION_MAJOR@ +VERSION_MINOR = @VERSION_MINOR@ +VERSION_REVISION = @VERSION_REVISION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +MAINTAINERCLEANFILES = \ + Makefile.in \ + htmldoc.tar.gz \ + openscop.pdf \ + openscop.cp \ + openscop.fn \ + openscop.info \ + openscop.ky \ + openscop.pg \ + openscop.toc \ + openscop.tp \ + openscop.vr \ + openscop.aux \ + openscop.log \ + openscop.doc + +EXTRA_DIST = \ + htmldoc.tar.gz \ + openscop.pdf \ + S4.cloog \ + images/basic.eps \ + images/basic.fig \ + images/basic.jpg \ + images/basic.pdf \ + images/basic.txt \ + images/basic1.eps \ + images/basic1.fig \ + images/basic1.jpg \ + images/basic1.pdf \ + images/basic1.txt \ + images/basic2.eps \ + images/basic2.fig \ + images/basic2.jpg \ + images/basic2.pdf \ + images/basic2.txt \ + images/tree.eps \ + images/tree.fig \ + images/tree.jpg \ + images/tree.pdf \ + images/tree.txt + +@GENERATE_DOC_TRUE@DOCDIR = htmldoc +@GENERATE_DOC_TRUE@DOXYFILE = Doxyfile +@GENERATE_DOC_TRUE@DOXYGENTOOL = @DOXYGEN@ + +# The following requires a fixed version of the Emacs 19.30 etags. +@GENERATE_DOC_TRUE@ETAGS_ARGS = --lang=none \ +@GENERATE_DOC_TRUE@ --regex='/^@node[ \t]+\([^,]+\)/\1/' $(srcdir)/doc/openscop.texi + +@GENERATE_DOC_TRUE@TAGS_DEPENDENCIES = openscop.texi $(DOXYFILE).in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign doc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-local cscopelist-am ctags ctags-am \ + distclean distclean-generic distclean-libtool distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + + +clean-local: + -rm -rf htmldoc + +# Unfortunately the following is not supported conditionaly +# info_TEXINFOS = openscop.texi + +@GENERATE_DOC_TRUE@openscop.pdf: openscop.texi \ +@GENERATE_DOC_TRUE@ images/basic.pdf \ +@GENERATE_DOC_TRUE@ images/basic1.pdf \ +@GENERATE_DOC_TRUE@ images/basic2.pdf \ +@GENERATE_DOC_TRUE@ images/tree.pdf +@GENERATE_DOC_TRUE@ $(TEXI2PDF) openscop.texi + +@GENERATE_DOC_TRUE@htmldoc.tar.gz: +@GENERATE_DOC_TRUE@ mkdir -p $(top_srcdir)/doc/htmldoc +@GENERATE_DOC_TRUE@ $(DOXYGENTOOL) $(DOXYFILE) +@GENERATE_DOC_TRUE@ tar czf htmldoc.tar.gz htmldoc + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Binary files /tmp/8LKHgB0qpE/cloog-0.18.2/osl/doc/openscop.pdf and /tmp/yy4tVJh_7V/cloog-0.18.4/osl/doc/openscop.pdf differ diff -Nru cloog-0.18.2/osl/doc/S4.cloog cloog-0.18.4/osl/doc/S4.cloog --- cloog-0.18.2/osl/doc/S4.cloog 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/doc/S4.cloog 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,44 @@ +# language: C +c + +# no parameters +0 2 +0 + +1 # One statement + +1 +# D = {i, j | 2<=i<=4 2<=j<=4} +4 4 +# i j 1 +1 1 0 -2 +1 -1 0 4 +1 0 1 -2 +1 0 -1 4 +0 0 0 +0 + +1 # Scattering function + +# T = (j+2,3i+j) +2 6 +# t1 t2 i j 1 +0 1 0 0 -1 0 +0 0 1 -1 0 0 + +1 +t1 t2 + +############################# + + +# T = (j,i) +2 6 +# t1 t2 i j 1 +0 1 0 0 -1 0 +0 0 1 -1 0 0 + +2 6 +# t1 t2 i j 1 +0 1 0 0 -1 -2 +0 0 1 -3 -1 0 diff -Nru cloog-0.18.2/osl/include/osl/body.h cloog-0.18.4/osl/include/osl/body.h --- cloog-0.18.2/osl/include/osl/body.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/body.h 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,131 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** body.h ** + **-----------------------------------------------------------------** + ** First version: 25/06/2011 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_BODY_H +# define OSL_BODY_H + +# include +# include +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + +# define OSL_URI_BODY "body" + +/** + * The osl_body_t structure stores a statement body in a textual form. + * The complete original expression (directly copy-pasted from the original + * code) is in the expression field while the textual forms of the original + * iterators are in the iterators field. They may be used for substitutions + * inside the expression. + */ +struct osl_body { + osl_strings_p iterators; /**< Original iterators */ + osl_strings_p expression; /**< Original statement expression */ +}; +typedef struct osl_body osl_body_t; +typedef struct osl_body * osl_body_p; +typedef struct osl_body const osl_const_body_t; +typedef struct osl_body * const osl_body_const_p; +typedef struct osl_body const * osl_const_body_p; +typedef struct osl_body const * const osl_const_body_const_p; + + +/*---------------------------------------------------------------------------+ + | Structure display function | + +---------------------------------------------------------------------------*/ +void osl_body_idump(FILE *, osl_body_p, int); +void osl_body_dump(FILE *, osl_body_p); +char * osl_body_sprint(osl_body_p); +void osl_body_print(FILE *, osl_body_p); + +// SCoPLib Compatibility +void osl_body_print_scoplib(FILE * file, osl_body_p body); + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_body_p osl_body_sread(char **); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_body_p osl_body_malloc(); +void osl_body_free(osl_body_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +osl_body_p osl_body_clone(osl_body_p); +int osl_body_equal(osl_body_p, osl_body_p); +osl_interface_p osl_body_interface(); + +# if defined(__cplusplus) + } +# endif +#endif /* define OSL_BODY_H */ diff -Nru cloog-0.18.2/osl/include/osl/extensions/arrays.h cloog-0.18.4/osl/include/osl/extensions/arrays.h --- cloog-0.18.2/osl/include/osl/extensions/arrays.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/extensions/arrays.h 2014-10-02 15:41:04.000000000 +0000 @@ -0,0 +1,131 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/arrays.h ** + **-----------------------------------------------------------------** + ** First version: 07/12/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_ARRAYS_H +# define OSL_ARRAYS_H + +# include +# include +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + + +# define OSL_URI_ARRAYS "arrays" + + +/** + * The osl_arrays_t structure stores a set of array textual names in + * the extension part of the OpenScop representation. Each name has a + * name string and an identifier: the ith name as name string names[i] + * and identifier id[i]. + */ +struct osl_arrays { + int nb_names; /**< Number of names. */ + int * id; /**< Array of nb_names identifiers. */ + char ** names; /**< Array of nb_names names. */ +}; +typedef struct osl_arrays osl_arrays_t; +typedef struct osl_arrays * osl_arrays_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_arrays_idump(FILE *, osl_arrays_p, int); +void osl_arrays_dump(FILE *, osl_arrays_p); +char * osl_arrays_sprint(osl_arrays_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_arrays_p osl_arrays_sread(char **); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_arrays_p osl_arrays_malloc(); +void osl_arrays_free(osl_arrays_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +osl_arrays_p osl_arrays_clone(osl_arrays_p); +int osl_arrays_equal(osl_arrays_p, osl_arrays_p); +osl_strings_p osl_arrays_to_strings(osl_arrays_p); +int osl_arrays_add(osl_arrays_p, int, char*); +size_t osl_arrays_get_index_from_id(osl_arrays_p, int); +size_t osl_arrays_get_index_from_name(osl_arrays_p, char*); +osl_interface_p osl_arrays_interface(); + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_ARRAYS_H */ diff -Nru cloog-0.18.2/osl/include/osl/extensions/clay.h cloog-0.18.4/osl/include/osl/extensions/clay.h --- cloog-0.18.2/osl/include/osl/extensions/clay.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/extensions/clay.h 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,123 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/clay.h ** + **-----------------------------------------------------------------** + ** First version: 09/05/2012 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_CLAY_H +# define OSL_CLAY_H + +# include +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + + +# define OSL_URI_CLAY "clay" + + +/** + * The osl_clay_t structure stores a clay extention to the core + * OpenScop representation. It is simply a 0-terminated string. + */ +struct osl_clay { + char * script; /**< Clay script as a 0-terminated string. */ +}; +typedef struct osl_clay osl_clay_t; +typedef struct osl_clay * osl_clay_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_clay_idump(FILE *, osl_clay_p, int); +void osl_clay_dump(FILE *, osl_clay_p); +char * osl_clay_sprint(osl_clay_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_clay_p osl_clay_sread(char **); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_clay_p osl_clay_malloc(); +void osl_clay_free(osl_clay_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +osl_clay_p osl_clay_clone(osl_clay_p); +int osl_clay_equal(osl_clay_p, osl_clay_p); +osl_interface_p osl_clay_interface(); + + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_CLAY_H */ diff -Nru cloog-0.18.2/osl/include/osl/extensions/comment.h cloog-0.18.4/osl/include/osl/extensions/comment.h --- cloog-0.18.2/osl/include/osl/extensions/comment.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/extensions/comment.h 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,123 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/comment.h ** + **-----------------------------------------------------------------** + ** First version: 07/12/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_COMMENT_H +# define OSL_COMMENT_H + +# include +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + + +# define OSL_URI_COMMENT "comment" + + +/** + * The osl_comment_t structure stores a comment extention to the core + * OpenScop representation. It is simply a 0-terminated string. + */ +struct osl_comment { + char * comment; /**< A comment message as a 0-terminated string. */ +}; +typedef struct osl_comment osl_comment_t; +typedef struct osl_comment * osl_comment_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_comment_idump(FILE *, osl_comment_p, int); +void osl_comment_dump(FILE *, osl_comment_p); +char * osl_comment_sprint(osl_comment_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_comment_p osl_comment_sread(char **); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_comment_p osl_comment_malloc(); +void osl_comment_free(osl_comment_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +osl_comment_p osl_comment_clone(osl_comment_p); +int osl_comment_equal(osl_comment_p, osl_comment_p); +osl_interface_p osl_comment_interface(); + + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_COMMENT_H */ diff -Nru cloog-0.18.2/osl/include/osl/extensions/coordinates.h cloog-0.18.4/osl/include/osl/extensions/coordinates.h --- cloog-0.18.2/osl/include/osl/extensions/coordinates.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/extensions/coordinates.h 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,130 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/coordinates.h ** + **-----------------------------------------------------------------** + ** First version: 07/12/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_COORDINATES_H +# define OSL_COORDINATES_H + +# include +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + + +# define OSL_URI_COORDINATES "coordinates" + + +/** + * The osl_coordinates_t structure stores a coordinates extension to the core + * OpenScop representation. It provides information about the SCoP location in + * the original source file (file name, starting and ending lines/columns, + * indentation level). + */ +struct osl_coordinates { + char* name; /**< File name (may include the file path as well). */ + int line_start; /**< Starting line of the SCoP. */ + int line_end; /**< Ending line of the SCoP. */ + int column_start; /**< Starting column of the SCoP in the starting line. */ + int column_end; /**< Ending column of the SCoP in the ending line. */ + int indent; /**< Indentation (number of spaces starting each line).*/ +}; +typedef struct osl_coordinates osl_coordinates_t; +typedef struct osl_coordinates* osl_coordinates_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_coordinates_idump(FILE*, osl_coordinates_p, int); +void osl_coordinates_dump(FILE*, osl_coordinates_p); +char* osl_coordinates_sprint(osl_coordinates_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_coordinates_p osl_coordinates_sread(char**); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_coordinates_p osl_coordinates_malloc(); +void osl_coordinates_free(osl_coordinates_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +osl_coordinates_p osl_coordinates_clone(osl_coordinates_p); +int osl_coordinates_equal(osl_coordinates_p, osl_coordinates_p); +osl_interface_p osl_coordinates_interface(); + + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_COORDINATES_H */ diff -Nru cloog-0.18.2/osl/include/osl/extensions/dependence.h cloog-0.18.4/osl/include/osl/extensions/dependence.h --- cloog-0.18.2/osl/include/osl/extensions/dependence.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/extensions/dependence.h 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,212 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/dependence.h ** + **-----------------------------------------------------------------** + ** First version: 02/07/2012 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#ifndef OSL_DEPENDENCE_H +# define OSL_DEPENDENCE_H + +# include +# include +# include +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + + +# define OSL_URI_DEPENDENCE "dependence" + +# define OSL_DEPENDENCE_RAW 1 +# define OSL_DEPENDENCE_WAR 2 +# define OSL_DEPENDENCE_WAW 3 +# define OSL_DEPENDENCE_RAR 4 +# define OSL_DEPENDENCE_RAW_SCALPRIV 5 + + +# define OSL_DEPENDENCE_EQUAL 1 +# define OSL_DEPENDENCE_POSIT 2 +# define OSL_DEPENDENCE_LATER 3 +# define OSL_DEPENDENCE_NEVER 4 + +# define OSL_DEPENDENCE_ASSIGNMENT 1 +# define OSL_DEPENDENCE_P_REDUCTION 2 +# define OSL_DEPENDENCE_M_REDUCTION 3 +# define OSL_DEPENDENCE_T_REDUCTION 4 + +/** + * osl_dependence structure: + * this structure contains all the informations about a data dependence, it is + * also a node of the linked list of all dependences of the dependence graph. + + + Dependence domain structure + ________________________________________________________________ + / source (output) | target (input) | local dims \ + __ |_________________|_________________|_______________________________|_____________ + / eq | output | output | output | output |ld dom |ld acc |ld dom |ld acc | | \ + | in | domain | access | domain | access |source |source |target |target |parameters | 1 | + ________________|____|________|________|________|________|_______|_______|_______|_______|___________|___| + |Domain source | X | X : | : | X : | : | X | X | + |________________|____|________:________|________:________|_______:_______|_______:_______|___________|___| + |Domain target | X | : | X : | : | X : | X | X | + |________________|____|________:________|________:________|_______:_______|_______:_______|___________|___| + |Access source | X | X : X | : | : X | : | X | X | + |________________|____|________:________|________:________|_______:_______|_______:_______|___________|___| + |Access target | X | : | X : X | : | : X | X | X | + |________________|____|________:________|________:________|_______:_______|_______:_______|___________|___| + |Access equality | | : Id | : -Id | : | : | | | + |________________|____|________:________|________:________|_______:_______|_______:_______|___________|___| | 0 : 0..depth-1 + |Precedence | X | Id : | -Id : | : | : | | X | <--| 0|-1 : depth + \________________|____|________:________|________:________|_______:_______|_______:_______|___________|___/ + + (1) (2) (3) (4) (5) (6) (7) (8) + */ +struct osl_dependence { + int label_source; + int label_target; + int ref_source; /**< Position of source reference in the array access list. */ + int ref_target; /**< Position of target reference in the array access list. */ + int depth; /**< Dependence level. */ + int type; /**< Dependence type: a dependence from source + * to target can be: + * - OSL_DEPENDENCE_UNSET if the dependence type + * is still not set, + * - OSL_DEPENDENCE_RAW if source writes M and + * target read M (flow-dependence), + * - OSL_DEPENDENCE_WAR if source reads M and + * target writes M (anti-dependence), + * - OSL_DEPENDENCE_WAW if source writes M and + * target writes M too (output-dependence) + * - OSL_DEPENDENCE_RAR if source reads M and + * target reads M too (input-dependence). + */ + osl_relation_p domain; /**< Dependence polyhedron. */ + + /* Other useful information */ + + int source_nb_output_dims_domain; // (1) + int source_nb_output_dims_access; // (2) + + int target_nb_output_dims_domain; // (3) + int target_nb_output_dims_access; // (4) + + int source_nb_local_dims_domain; // (5) + int source_nb_local_dims_access; // (6) + int target_nb_local_dims_domain; // (7) + int target_nb_local_dims_access; // (8) + + void* usr; /**< User field, for library users + convenience. */ + struct osl_dependence * next; /**< Pointer to next dependence */ + + /* These attributes are not filled by osl + * You can use the function candl_dependence_init_fields of CandL + */ + + osl_relation_p ref_source_access_ptr; /**< Pointer to the source access. */ + osl_relation_p ref_target_access_ptr; /**< Pointer to the target access. */ + + osl_statement_p stmt_source_ptr; /**< Pointer to source statement. */ + osl_statement_p stmt_target_ptr; /**< Pointer to target statement. */ +}; + +typedef struct osl_dependence osl_dependence_t; +typedef struct osl_dependence * osl_dependence_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_dependence_idump(FILE *, osl_dependence_p, int); +void osl_dependence_dump(FILE *, osl_dependence_p); +char * osl_dependence_sprint(osl_dependence_p); +void osl_dependence_print(FILE *, osl_dependence_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_dependence_p osl_dependence_sread(char **); +osl_dependence_p osl_dependence_psread(char **, int); + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_dependence_p osl_dependence_malloc(); +void osl_dependence_free(osl_dependence_p); + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +osl_dependence_p osl_dependence_clone(osl_dependence_p); +int osl_dependence_equal(osl_dependence_p, osl_dependence_p); +void osl_dependence_add(osl_dependence_p*, osl_dependence_p*, + osl_dependence_p); +int osl_nb_dependences(osl_dependence_p); +osl_interface_p osl_dependence_interface(); + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_DEPENDENCE_H */ diff -Nru cloog-0.18.2/osl/include/osl/extensions/extbody.h cloog-0.18.4/osl/include/osl/extensions/extbody.h --- cloog-0.18.2/osl/include/osl/extensions/extbody.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/extensions/extbody.h 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,133 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/extbody.h ** + **-----------------------------------------------------------------** + ** First version: 07/12/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_EXTBODY_H +# define OSL_EXTBODY_H + +# include +# include +# include +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + + +# define OSL_URI_EXTBODY "extbody" + + +/** + * The osl_extbody_t structure stores the coordinates of each access in the + * body. osl_extbody is replaced by the simple body. + */ +struct osl_extbody { + osl_body_p body; + int nb_access; /**< Nb of access. */ + int * start; /**< Array of nb_access start. */ + int * length; /**< Array of nb_access length. */ +}; +typedef struct osl_extbody osl_extbody_t; +typedef struct osl_extbody * osl_extbody_p; +typedef struct osl_extbody const osl_const_extbody_t; +typedef struct osl_extbody * const osl_extbody_const_p; +typedef struct osl_extbody const * osl_const_extbody_p; +typedef struct osl_extbody const * const osl_const_extbody_const_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_extbody_idump(FILE *, osl_extbody_p, int); +void osl_extbody_dump(FILE *, osl_extbody_p); +char * osl_extbody_sprint(osl_extbody_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_extbody_p osl_extbody_sread(char **); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_extbody_p osl_extbody_malloc(); +void osl_extbody_free(osl_extbody_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +osl_extbody_p osl_extbody_clone(osl_extbody_p); +int osl_extbody_equal(osl_extbody_p, + osl_extbody_p); +osl_interface_p osl_extbody_interface(); +void osl_extbody_add(osl_extbody_p, int, int); + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_EXTBODY_H */ diff -Nru cloog-0.18.2/osl/include/osl/extensions/irregular.h cloog-0.18.4/osl/include/osl/extensions/irregular.h --- cloog-0.18.2/osl/include/osl/extensions/irregular.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/extensions/irregular.h 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,149 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/irregular.h ** + **-----------------------------------------------------------------** + ** First version: 07/12/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_IRREGULAR_H +# define OSL_IRREGULAR_H + +# include +# include +# include +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + + +# define OSL_URI_IRREGULAR "irregular" +# define OSL_TAG_IRREGULAR_START "<"OSL_URI_IRREGULAR">" +# define OSL_TAG_IRREGULAR_STOP "" + + +/** + * The osl_irregular_t structure stores an irregular extension to the core + * OpenScop representation. It contains a list of predicates (in their textual + * representation), and for each statement, its list of associated predicates. + * The list of predicates contains both control and exit predicates (see + * Benabderrhamane et al.'s paper at CC'2010), control predicates are listed + * first, then come exit predicates. + */ +struct osl_irregular { + // List of predicates (textual representation). + int nb_control; /**< Number of control predicates in the SCoP. */ + int nb_exit; /**< Number of exit predicates in the SCoP. */ + int * nb_iterators; /**< nb_iterators[i]: #iterators for ith predicate. */ + char *** iterators; /**< iterators[i]: array of (nb_control + nb_exit) + arrays of nb_iterators[i] strings. Each element + corresponds to the list of original iterators + for the ith predicate. */ + char ** body; /**< body[i]: original source code of ith predicate. */ + + // List of associated predicates for each statement. + int nb_statements; /**< Number of statements in the SCoP. */ + int * nb_predicates; /**< nb_predicates[i]: #predicates for ith statement. */ + int ** predicates; /**< predicates[i]: array of nb_predicates[i] predicates + corresponding to the list of predicates associated + to the ith statement. */ +}; +typedef struct osl_irregular osl_irregular_t; +typedef struct osl_irregular * osl_irregular_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_irregular_idump(FILE *, osl_irregular_p, int); +void osl_irregular_dump(FILE *, osl_irregular_p); +char * osl_irregular_sprint(osl_irregular_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_irregular_p osl_irregular_sread(char **); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_irregular_p osl_irregular_malloc(); +void osl_irregular_free(osl_irregular_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +osl_irregular_p osl_irregular_clone(osl_irregular_p); +int osl_irregular_equal(osl_irregular_p, osl_irregular_p); +osl_irregular_p osl_irregular_add_control(osl_irregular_p, char**, int, char*); +osl_irregular_p osl_irregular_add_exit(osl_irregular_p, char**, int, char*); +osl_irregular_p osl_irregular_add_predicates(osl_irregular_p, int*, int); +osl_interface_p osl_irregular_interface(); + + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_IRREGULAR_H */ diff -Nru cloog-0.18.2/osl/include/osl/extensions/loop.h cloog-0.18.4/osl/include/osl/extensions/loop.h --- cloog-0.18.2/osl/include/osl/extensions/loop.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/extensions/loop.h 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,145 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/loop.h ** + **-----------------------------------------------------------------** + ** First version: 03/06/2013 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_LOOP_H +# define OSL_LOOP_H + +# include +# include +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + + +# define OSL_URI_LOOP "loop" + +//loop direcrives +# define OSL_LOOP_DIRECTIVE_NONE 0 +# define OSL_LOOP_DIRECTIVE_PARALLEL 1 +# define OSL_LOOP_DIRECTIVE_MPI 2 +# define OSL_LOOP_DIRECTIVE_VECTOR 4 + + + +/** + * The osl_loop_t structure stores information about loops in the program + * in the extension part of the OpenScop representation. Containing the + * information about the statements in the loop, its iterator and openmp + * directives, it serves to communicate such information among different + * tools in the polyhedral chain. + */ +struct osl_loop { + char * iter; /**< \brief \0 terminated iterator name */ + int nb_stmts; /**< \brief Number of statements in the loop */ + int * stmt_ids; /**< \brief Array of statement identifiers. */ + char * private_vars; /**< \brief \0 terminated variable names */ + int directive; /**< \brief the OpenMP directive to implement */ + struct osl_loop * next; +}; +typedef struct osl_loop osl_loop_t; +typedef struct osl_loop * osl_loop_p; + + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_loop_idump(FILE * file, osl_loop_p loop, int level); +void osl_loop_dump(FILE * file, osl_loop_p loop); +char * osl_loop_sprint(osl_loop_p loop); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_loop_p osl_loop_sread(char ** input); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_loop_p osl_loop_malloc(); +void osl_loop_free(osl_loop_p loop); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +osl_loop_p osl_loop_clone_one(osl_loop_p loop); +osl_loop_p osl_loop_clone(osl_loop_p loop); +int osl_loop_equal_one(osl_loop_p a1, osl_loop_p a2); +int osl_loop_equal(osl_loop_p a1, osl_loop_p a2); +osl_strings_p osl_loop_to_strings(osl_loop_p); +osl_interface_p osl_loop_interface(); + +void osl_loop_add(osl_loop_p loop, osl_loop_p *ll); +int osl_loop_count(osl_loop_p ll); + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_LOOP_H */ diff -Nru cloog-0.18.2/osl/include/osl/extensions/null.h cloog-0.18.4/osl/include/osl/extensions/null.h --- cloog-0.18.2/osl/include/osl/extensions/null.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/extensions/null.h 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,123 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/null.h ** + **-----------------------------------------------------------------** + ** First version: 28/06/2012 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_NULL_H +# define OSL_NULL_H + +# include +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + + +# define OSL_URI_NULL "null" + + +/** + * The osl_null_t structure stores a null extention to the core + * OpenScop representation. It contains simply nothing. + */ +struct osl_null { + int fake_member_to_disable_warning; +}; +typedef struct osl_null osl_null_t; +typedef struct osl_null * osl_null_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_null_idump(FILE *, osl_null_p, int); +void osl_null_dump(FILE *, osl_null_p); +char * osl_null_sprint(osl_null_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_null_p osl_null_sread(char **); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_null_p osl_null_malloc(); +void osl_null_free(osl_null_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +osl_null_p osl_null_clone(osl_null_p); +int osl_null_equal(osl_null_p, osl_null_p); +osl_interface_p osl_null_interface(); + + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_NULL_H */ diff -Nru cloog-0.18.2/osl/include/osl/extensions/pluto_unroll.h cloog-0.18.4/osl/include/osl/extensions/pluto_unroll.h --- cloog-0.18.2/osl/include/osl/extensions/pluto_unroll.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/extensions/pluto_unroll.h 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,139 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/pluto_unroll.h ** + **-----------------------------------------------------------------** + ** First version: 26/06/2014 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2014 Inria * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_PLUTO_UNROLL_H +#define OSL_PLUTO_UNROLL_H + + +#include +#include + +#include "../strings.h" +#include "../interface.h" + + +#if defined(__cplusplus) +extern "C" + { +#endif + + +#define OSL_URI_PLUTO_UNROLL "pluto_unroll" + + +/** + * The osl_pluto_unroll_t structure stores the pluto_unroll + * that Pluto wants to unroll + */ +struct osl_pluto_unroll { + char* iter; /**< \brief \0 terminated iterator name */ + bool jam; /**< \brief true if jam, false otherwise */ + unsigned int factor; /**< \brief unroll factor */ + struct osl_pluto_unroll * next; /**< \brief next { iter, jam, factor } */ +}; +typedef struct osl_pluto_unroll osl_pluto_unroll_t; +typedef struct osl_pluto_unroll * osl_pluto_unroll_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_pluto_unroll_idump(FILE *, osl_pluto_unroll_p, int); +void osl_pluto_unroll_dump(FILE *, osl_pluto_unroll_p); +char * osl_pluto_unroll_sprint(osl_pluto_unroll_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_pluto_unroll_p osl_pluto_unroll_sread(char**); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_pluto_unroll_p osl_pluto_unroll_malloc(); +void osl_pluto_unroll_free(osl_pluto_unroll_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +void osl_pluto_unroll_fill(osl_pluto_unroll_p, + char const * const, + bool const, int const); +osl_pluto_unroll_p osl_pluto_unroll_clone(osl_pluto_unroll_p); +int osl_pluto_unroll_equal_one(osl_pluto_unroll_p, + osl_pluto_unroll_p); +int osl_pluto_unroll_equal(osl_pluto_unroll_p, + osl_pluto_unroll_p); +osl_strings_p osl_pluto_unroll_to_strings(osl_pluto_unroll_p); +osl_interface_p osl_pluto_unroll_interface(); + + +#if defined(__cplusplus) + } +#endif + + +#endif /* define OSL_PLUTO_UNROLL_H */ diff -Nru cloog-0.18.2/osl/include/osl/extensions/scatnames.h cloog-0.18.4/osl/include/osl/extensions/scatnames.h --- cloog-0.18.2/osl/include/osl/extensions/scatnames.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/extensions/scatnames.h 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,127 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/scatnames.h ** + **-----------------------------------------------------------------** + ** First version: 03/12/2011 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_SCATNAMES_H +# define OSL_SCATNAMES_H + +# include +# include +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + + +# define OSL_URI_SCATNAMES "scatnames" + + +/** + * The osl_scatnames_t structure stores a scatnames extention to the core + * OpenScop representation. It is devoted to store the scattering dimension + * names in a textual form. The names are stored using an osl_strings_t + * structure and their order in the array corresponds to their dimension + * order. + */ +struct osl_scatnames { + osl_strings_p names; /**< List of textual scattering dimension names. */ +}; +typedef struct osl_scatnames osl_scatnames_t; +typedef struct osl_scatnames * osl_scatnames_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_scatnames_idump(FILE *, osl_scatnames_p, int); +void osl_scatnames_dump(FILE *, osl_scatnames_p); +char * osl_scatnames_sprint(osl_scatnames_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_scatnames_p osl_scatnames_sread(char **); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_scatnames_p osl_scatnames_malloc(); +void osl_scatnames_free(osl_scatnames_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +osl_scatnames_p osl_scatnames_clone(osl_scatnames_p); +int osl_scatnames_equal(osl_scatnames_p, osl_scatnames_p); +osl_interface_p osl_scatnames_interface(); + + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_SCATNAMES_H */ diff -Nru cloog-0.18.2/osl/include/osl/extensions/symbols.h cloog-0.18.4/osl/include/osl/extensions/symbols.h --- cloog-0.18.2/osl/include/osl/extensions/symbols.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/extensions/symbols.h 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,137 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/symbols.h ** + **-----------------------------------------------------------------** + ** First version: 07/03/2012 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * Prasanth Chatharasi * + * * + *****************************************************************************/ + + +#ifndef OSL_SYMBOLS_H +# define OSL_SYMBOLS_H + +# include +# include +# include +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + +# define OSL_URI_SYMBOLS "symbols" + +/** + * The osl_symbols_t structure stores information regarding the symbols. + */ +struct osl_symbols { + int type; /**< Symbol type (variable, iterator...) */ + int generated; /**< Flag to determine its origin */ + int nb_dims; /**< Number of array dimensions */ + osl_generic_p identifier; /**< Symbol identifier */ + osl_generic_p datatype; /**< Symbol Datatype (int, float...) */ + osl_generic_p scope; /**< Scope of symbol */ + osl_generic_p extent; /**< Limits of dimensions in Symbol */ + + void* usr; /**< A user defined field */ + struct osl_symbols* next; +}; +typedef struct osl_symbols osl_symbols_t; +typedef struct osl_symbols* osl_symbols_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_symbols_idump(FILE *, osl_symbols_p, int); +void osl_symbols_dump(FILE *, osl_symbols_p); +char * osl_symbols_sprint(osl_symbols_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_symbols_p osl_symbols_sread(char **); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_symbols_p osl_symbols_malloc(); +void osl_symbols_free(osl_symbols_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +void osl_symbols_add(osl_symbols_p*, osl_symbols_p); +osl_symbols_p osl_symbols_nclone(osl_symbols_p, int); +osl_symbols_p osl_symbols_clone(osl_symbols_p); +int osl_symbols_equal(osl_symbols_p, osl_symbols_p); +osl_symbols_p osl_symbols_lookup(osl_symbols_p, osl_generic_p); +osl_symbols_p osl_symbols_remove(osl_symbols_p*, osl_symbols_p); +int osl_symbols_get_nb_symbols(osl_symbols_p); +osl_interface_p osl_symbols_interface(); + + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_SYMBOLS_H */ diff -Nru cloog-0.18.2/osl/include/osl/extensions/textual.h cloog-0.18.4/osl/include/osl/extensions/textual.h --- cloog-0.18.2/osl/include/osl/extensions/textual.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/extensions/textual.h 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,123 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/textual.h ** + **-----------------------------------------------------------------** + ** First version: 15/07/2011 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_TEXTUAL_H +# define OSL_TEXTUAL_H + +# include +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + + +# define OSL_URI_TEXTUAL "textual" + + +/** + * The osl_textual_t structure stores the complete textual + * representation of the scop extension field. It is a special case of + * extension since it does not require start and end tag. + */ +struct osl_textual { + char * textual; /**< Full extension string as a 0-terminated string. */ +}; +typedef struct osl_textual osl_textual_t; +typedef struct osl_textual * osl_textual_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_textual_idump(FILE *, osl_textual_p, int); +void osl_textual_dump(FILE *, osl_textual_p); +char * osl_textual_sprint(osl_textual_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_textual_p osl_textual_sread(char **); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_textual_p osl_textual_malloc(); +void osl_textual_free(osl_textual_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +osl_textual_p osl_textual_clone(osl_textual_p); +int osl_textual_equal(osl_textual_p, osl_textual_p); +osl_interface_p osl_textual_interface(); + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_TEXTUAL_H */ diff -Nru cloog-0.18.2/osl/include/osl/generic.h cloog-0.18.4/osl/include/osl/generic.h --- cloog-0.18.2/osl/include/osl/generic.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/generic.h 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,141 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** generic.h ** + **-----------------------------------------------------------------** + ** First version: 26/11/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_generic_H +# define OSL_generic_H + +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + + +/** + * The osl_generic_t structure stores OpenScop data and operations with + * no pre-defined type. The information is accessible through the data pointer + * while the type and operations are accessible through the interface pointer. + * A generic is a also a node of a NULL-terminated linked list of generics. + */ +struct osl_generic { + void * data; /**< Pointer to the data. */ + osl_interface_p interface; /**< Interface to work with the data. */ + struct osl_generic * next; /**< Pointer to the next generic. */ +}; +typedef struct osl_generic osl_generic_t; +typedef struct osl_generic * osl_generic_p; +typedef struct osl_generic const osl_const_generic_t; +typedef struct osl_generic * const osl_generic_const_p; +typedef struct osl_generic const * osl_const_generic_p; +typedef struct osl_generic const * const osl_const_generic_const_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_generic_idump(FILE *, osl_generic_p, int); +void osl_generic_dump(FILE *, osl_generic_p); +void osl_generic_print(FILE *, osl_generic_p); +char* osl_generic_sprint(osl_generic_p); + +// SCoPLib Compatibility +void osl_generic_print_options_scoplib(FILE *, osl_generic_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_generic_p osl_generic_sread(char **, osl_interface_p); +osl_generic_p osl_generic_sread_one(char **, osl_interface_p); +osl_generic_p osl_generic_read_one(FILE *, osl_interface_p); +osl_generic_p osl_generic_read(FILE *, osl_interface_p); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +void osl_generic_add(osl_generic_p*, osl_generic_p); +void osl_generic_remove_node(osl_generic_p*, osl_generic_p); +void osl_generic_remove(osl_generic_p*, char *); +osl_generic_p osl_generic_malloc(); +void osl_generic_free(osl_generic_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +int osl_generic_number(osl_generic_p); +osl_generic_p osl_generic_clone(osl_generic_p); +int osl_generic_equal(osl_generic_p, osl_generic_p); +int osl_generic_has_URI(osl_const_generic_const_p, + char const * const); +void * osl_generic_lookup(osl_generic_p, char const * const); +osl_generic_p osl_generic_shell(void *, osl_interface_p); + + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_generic_H */ diff -Nru cloog-0.18.2/osl/include/osl/interface.h cloog-0.18.4/osl/include/osl/interface.h --- cloog-0.18.2/osl/include/osl/interface.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/interface.h 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,138 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** interface.h ** + **-----------------------------------------------------------------** + ** First version: 15/07/2011 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_INTERFACE_H +# define OSL_INTERFACE_H + +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + + +typedef void (*osl_idump_f) (FILE *, void *, int); +typedef char * (*osl_sprint_f)(void *); +typedef void * (*osl_sread_f) (char **); +typedef void * (*osl_malloc_f)(); +typedef void (*osl_free_f) (void *); +typedef void * (*osl_clone_f) (void *); +typedef int (*osl_equal_f) (void *, void *); + + +/** + * The osl_interface structure stores the URI and base + * functions pointers an openscop object implementation has to offer. It + * is a node in a NULL-terminated list of interfaces. + */ +struct osl_interface { + char * URI; /**< Unique identifier string */ + osl_idump_f idump; /**< Pointer to idump function */ + osl_sprint_f sprint; /**< Pointer to sprint function */ + osl_sread_f sread; /**< Pointer to sread function */ + osl_malloc_f malloc; /**< Pointer to malloc function */ + osl_free_f free; /**< Pointer to free function */ + osl_clone_f clone; /**< Pointer to clone function */ + osl_equal_f equal; /**< Pointer to equal function */ + struct osl_interface * next; /**< Next interface in the list */ +}; +typedef struct osl_interface osl_interface_t; +typedef struct osl_interface * osl_interface_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_interface_idump(FILE *, osl_interface_p, int); +void osl_interface_dump(FILE *, osl_interface_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +void osl_interface_add(osl_interface_p *, osl_interface_p); +osl_interface_p osl_interface_malloc(); +void osl_interface_free(osl_interface_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +int osl_interface_number(osl_interface_p); +osl_interface_p osl_interface_nclone(osl_interface_p, int); +osl_interface_p osl_interface_clone(osl_interface_p); +int osl_interface_equal(osl_interface_p, osl_interface_p); +osl_interface_p osl_interface_lookup(osl_interface_p, char *); +osl_interface_p osl_interface_get_default_registry(); + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_INTERFACE_H */ diff -Nru cloog-0.18.2/osl/include/osl/int.h cloog-0.18.4/osl/include/osl/int.h --- cloog-0.18.2/osl/include/osl/int.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/int.h 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,178 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** int.h ** + **-----------------------------------------------------------------** + ** First version: 18/07/2011 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_INT_H +# define OSL_INT_H + +# ifdef OSL_GMP_IS_HERE +# include +# endif + +# if defined(__cplusplus) +extern "C" + { +# endif + +/** + * The osl_int_t union stores an OpenScop integer element. + */ +union osl_int { + long int sp; /**< Single precision int */ + long long dp; /**< Double precision int */ +#ifdef OSL_GMP_IS_HERE + mpz_t* mp; /**< Pointer to a multiple precision int */ +#else + void* mp; /**< Pointer to a multiple precision int */ +#endif +}; +typedef union osl_int osl_int_t; +typedef union osl_int * osl_int_p; +typedef union osl_int const osl_const_int_t; +typedef union osl_int * const osl_int_const_p; +typedef union osl_int const * osl_const_int_p; +typedef union osl_int const * const osl_const_int_const_p; + + +/*+*************************************************************************** + * Basic Functions * + *****************************************************************************/ + + +int osl_int_is_precision_supported(int); +void osl_int_dump_precision(FILE *, int); +void osl_int_init(int, osl_int_const_p); +osl_int_p osl_int_malloc(int); +void osl_int_assign(int, osl_int_const_p, osl_const_int_t); +void osl_int_set_si(int, osl_int_const_p, int); +int osl_int_get_si(int, osl_const_int_t); +double osl_int_get_d(int, osl_const_int_t); +void osl_int_init_set(int, osl_int_const_p, osl_const_int_t); +void osl_int_init_set_si(int, osl_int_const_p, int); +void osl_int_swap(int, osl_int_const_p, osl_int_const_p); +void osl_int_clear(int, osl_int_const_p); +void osl_int_free(int, osl_int_const_p); +void osl_int_print(FILE *, int, osl_const_int_t); +void osl_int_sprint(char *, int, osl_const_int_t); +void osl_int_sprint_txt(char *, int, osl_const_int_t); +int osl_int_sscanf(char*, int, osl_int_const_p); +void osl_int_sread(char **, int, osl_int_const_p); + + +/*+*************************************************************************** + * Arithmetic Operations * + *****************************************************************************/ + + +void osl_int_increment(int, osl_int_const_p, osl_const_int_t); +void osl_int_decrement(int, osl_int_const_p, osl_const_int_t); +void osl_int_add(int, osl_int_const_p, osl_const_int_t, osl_const_int_t); +void osl_int_add_si(int, osl_int_const_p, osl_const_int_t, int); +void osl_int_sub(int, osl_int_const_p, osl_const_int_t, osl_const_int_t); +void osl_int_mul(int, osl_int_const_p, osl_const_int_t, osl_const_int_t); +void osl_int_mul_si(int, osl_int_const_p, osl_const_int_t, int); +void osl_int_div_exact(int const, osl_int_const_p, + osl_const_int_t, osl_const_int_t); +void osl_int_floor_div_q(int const, osl_int_const_p, + osl_const_int_t, osl_const_int_t); +void osl_int_floor_div_r(int const, osl_int_const_p, + osl_const_int_t, osl_const_int_t); +void osl_int_floor_div_q_r(int const, osl_int_const_p, osl_int_const_p, + osl_const_int_t, osl_const_int_t); +void osl_int_mod(int const, osl_int_const_p, + osl_const_int_t, osl_const_int_t); +void osl_int_gcd(int const, osl_int_const_p, + osl_const_int_t, osl_const_int_t); +void osl_int_oppose(int, osl_int_const_p, osl_const_int_t); +void osl_int_abs(int, osl_int_const_p, osl_const_int_t); +size_t osl_int_size_in_base_2(int const, osl_const_int_t); +size_t osl_int_size_in_base_10(int const, osl_const_int_t); + + +/*+*************************************************************************** + * Conditional Operations * + *****************************************************************************/ + + +int osl_int_eq(int, osl_const_int_t, osl_const_int_t); +int osl_int_ne(int, osl_const_int_t, osl_const_int_t); +int osl_int_pos(int, osl_const_int_t); +int osl_int_neg(int, osl_const_int_t); +int osl_int_zero(int, osl_const_int_t); +int osl_int_one(int, osl_const_int_t); +int osl_int_mone(int, osl_const_int_t); +int osl_int_divisible(int, osl_const_int_t, osl_const_int_t); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +void osl_int_set_precision(int const, int const, osl_int_p); + + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_INT_H */ diff -Nru cloog-0.18.2/osl/include/osl/macros.h cloog-0.18.4/osl/include/osl/macros.h --- cloog-0.18.2/osl/include/osl/macros.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/macros.h 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,186 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** macros.h ** + **-----------------------------------------------------------------** + ** First version: 30/04/2008 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_MACROS_H +# define OSL_MACROS_H + +# include "util.h" + + +# define OSL_DEBUG 0 // 1 for debug mode, 0 otherwise. + +# define OSL_URI_SCOP "OpenScop" + +# define OSL_PRECISION_ENV "OSL_PRECISION" +# define OSL_PRECISION_ENV_SP "32" +# define OSL_PRECISION_ENV_DP "64" +# define OSL_PRECISION_ENV_MP "0" +# define OSL_PRECISION_SP 32 +# define OSL_PRECISION_DP 64 +# define OSL_PRECISION_MP 0 + +# define OSL_FMT_SP "%4ld" +# define OSL_FMT_DP "%4lld" +# define OSL_FMT_MP "%4s" +# define OSL_FMT_LENGTH 4 // Should be the same as FMT_*P. +# define OSL_FMT_TXT_SP "%ld" +# define OSL_FMT_TXT_DP "%lld" +# define OSL_FMT_TXT_MP "%s" + + +# define OSL_BACKEND_C 0 +# define OSL_BACKEND_FORTRAN 1 +# define OSL_UNDEFINED -1 +# define OSL_MAX_STRING 2048 +# define OSL_MIN_STRING 100 +# define OSL_MAX_ARRAYS 128 + +# define OSL_TYPE_GENERIC 0 +# define OSL_TYPE_STRING 1 +# define OSL_TYPE_CONTEXT 2 +# define OSL_TYPE_DOMAIN 3 +# define OSL_TYPE_SCATTERING 4 +# define OSL_TYPE_ACCESS 5 +# define OSL_TYPE_READ 6 +# define OSL_TYPE_WRITE 7 +# define OSL_TYPE_MAY_WRITE 8 + +# define OSL_FAKE_ARRAY "fakearray" + +# define OSL_SYMBOL_TYPE_ITERATOR 1 +# define OSL_SYMBOL_TYPE_PARAMETER 2 +# define OSL_SYMBOL_TYPE_ARRAY 3 +# define OSL_SYMBOL_TYPE_FUNCTION 4 + +# define OSL_STRING_UNDEFINED "UNDEFINED" +# define OSL_STRING_CONTEXT "CONTEXT" +# define OSL_STRING_DOMAIN "DOMAIN" +# define OSL_STRING_SCATTERING "SCATTERING" +# define OSL_STRING_READ "READ" +# define OSL_STRING_WRITE "WRITE" +# define OSL_STRING_MAY_WRITE "MAY_WRITE" + +/*+*************************************************************************** + * UTILITY MACROS * + *****************************************************************************/ + +# define OSL_coucou(n) \ + do { \ + int i = n +0; \ + fprintf(stderr,"[osl] Coucou %d (%s).\n", i, __func__); \ + } while (0) + +# define OSL_debug(msg) \ + do { \ + if (OSL_DEBUG) \ + fprintf(stderr,"[osl] Debug: " msg " (%s).\n", __func__); \ + } while (0) + +# define OSL_info(msg) \ + do { \ + fprintf(stderr,"[osl] Info: " msg " (%s).\n", __func__); \ + } while (0) + +# define OSL_warning(msg) \ + do { \ + fprintf(stderr,"[osl] Warning: " msg " (%s).\n", __func__); \ + } while (0) + +# define OSL_error(msg) \ + do { \ + fprintf(stderr,"[osl] Error: " msg " (%s).\n", __func__); \ + exit(1); \ + } while (0) + +# define OSL_overflow(msg) OSL_error(msg) + +# define OSL_malloc(ptr, type, size) \ + do { \ + if (((ptr) = (type)malloc(size)) == NULL) \ + OSL_error("memory overflow"); \ + } while (0) + +# define OSL_realloc(ptr, type, size) \ + do { \ + if (((ptr) = (type)realloc(ptr, size)) == NULL) \ + OSL_error("memory overflow"); \ + } while (0) + +# define OSL_strdup(destination, source) \ + do { \ + if (source != NULL) { \ + if (((destination) = osl_util_strdup(source)) == NULL) \ + OSL_error("memory overflow"); \ + } \ + else { \ + destination = NULL; \ + OSL_warning("strdup of a NULL string"); \ + } \ + } while (0) + +# define OSL_max(x,y) ((x) > (y)? (x) : (y)) + +# define OSL_min(x,y) ((x) < (y)? (x) : (y)) + + +#endif /* define OSL_MACROS_H */ diff -Nru cloog-0.18.2/osl/include/osl/names.h cloog-0.18.4/osl/include/osl/names.h --- cloog-0.18.2/osl/include/osl/names.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/names.h 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,124 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/names.h ** + **-----------------------------------------------------------------** + ** First version: 18/05/2011 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_NAMES_H +# define OSL_NAMES_H + +# include +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + + +/** + * The osl_names_t structure stores the various names (names of iterators, + * parameters...) necessary to generate a code from the OpenScop data + * structure. + */ +struct osl_names { + osl_strings_p parameters; /**< Parameter names */ + osl_strings_p iterators; /**< Iterator names */ + osl_strings_p scatt_dims; /**< Scattering dimension names */ + osl_strings_p local_dims; /**< Local dimension names */ + osl_strings_p arrays; /**< Array names */ +}; +typedef struct osl_names osl_names_t; +typedef struct osl_names * osl_names_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_names_idump(FILE *, osl_names_p, int); +void osl_names_dump(FILE *, osl_names_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_names_p osl_names_malloc(); +void osl_names_free(osl_names_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +osl_names_p osl_names_clone(osl_names_p); +osl_names_p osl_names_generate(char *, int, char *, int, + char *, int, char *, int, + char *, int); + + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_NAMES_H */ diff -Nru cloog-0.18.2/osl/include/osl/osl.h cloog-0.18.4/osl/include/osl/osl.h --- cloog-0.18.2/osl/include/osl/osl.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/osl.h 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,121 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** osl.h ** + **-----------------------------------------------------------------** + ** First version: 11/05/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_OSL_H +# define OSL_OSL_H + +/* List of reserved OpenScop URIs: + * - arrays + * - body + * - clay + * - comment + * - coordinates + * - dependence + * - extbody + * - generic + * - int + * - interface + * - irregular + * - null + * - openscop + * - relation + * - relation_list + * - scatnames + * - scop + * - statement + * - strings + * - symbols + * - textual + * - vector + */ + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# include +# include +# include + + +#endif /* define OSL_OSL_H */ diff -Nru cloog-0.18.2/osl/include/osl/relation.h cloog-0.18.4/osl/include/osl/relation.h --- cloog-0.18.2/osl/include/osl/relation.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/relation.h 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,210 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** relation.h ** + **-----------------------------------------------------------------** + ** First version: 30/04/2008 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_RELATION_H +# define OSL_RELATION_H + +# include +# include +# include +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + +# define OSL_URI_RELATION "relation" + +/** + * The osl_relation_t structure stores a union of relations. It is a + * NULL-terminated linked list of relations. Each relation is described + * using a matrix where each row represents a linear constraint. The entries + * of each row are organised in the following order: + * - An equality/inequality tag: 0 means the row corresponds to an + * equality constraint == 0, 1 means it is an inequality >= 0. + * - The coefficients of the output dimensions. + * - The coefficients of the input dimensions (0 for a set). + * - The coefficients of the local (existentially quantified) dimensions. + * - The coefficients of the parameters. + * - The coefficient of the constant. + * Thus we have the following invariant: nb_columns = + * 1 + nb_output_dims + nb_input_dims + dims + nb_parameters + 1. + * Moreover we use the following conventions: + * - Sets (e.g., iteration domains) are the images of relations with a + * zero-dimensional domain, hence the number of input dimensions is 0. + * - The first output dimension of any access relations corresponds to + * the name of the array. + * The type field may provide some semantics about the relation, it may be: + * - Undefined : OSL_UNDEFINED, + * - An iteration domain : OSL_TYPE_DOMAIN, + * - A scattering relation : OSL_TYPE_SCATTERING, + * - An access relation : OSL_TYPE_ACCESS. + */ +struct osl_relation { + int type; /**< Semantics about the relation */ + int precision; /**< Precision of relation matrix elements*/ + int nb_rows; /**< Number of rows */ + int nb_columns; /**< Number of columns */ + int nb_output_dims; /**< Number of output dimensions */ + int nb_input_dims; /**< Number of input dimensions */ + int nb_local_dims; /**< Number of local (existentially + quantified) dimensions */ + int nb_parameters; /**< Number of parameters */ + osl_int_t** m; /**< An array of pointers to the beginning + of each row of the relation matrix */ + void* usr; /**< User-managed field, untouched by osl */ + struct osl_relation * next; /**< Pointer to the next relation in the + union of relations (NULL if none) */ +}; +typedef struct osl_relation osl_relation_t; +typedef struct osl_relation * osl_relation_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_relation_idump(FILE *, osl_relation_p, int); +void osl_relation_dump(FILE *, osl_relation_p); +char * osl_relation_expression(osl_relation_p relation, + int row, char ** names); +char * osl_relation_spprint_polylib(osl_relation_p, osl_names_p); +char * osl_relation_spprint(osl_relation_p, osl_names_p); +void osl_relation_pprint(FILE *, osl_relation_p, osl_names_p); +char * osl_relation_sprint(osl_relation_p); +void osl_relation_print(FILE *, osl_relation_p); + +// SCoPLib Compatibility +char * osl_relation_spprint_polylib_scoplib(osl_relation_p, + osl_names_p, int, int); +char * osl_relation_spprint_scoplib(osl_relation_p, osl_names_p, + int, int); +void osl_relation_pprint_scoplib(FILE *, osl_relation_p, + osl_names_p, int, int); + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_relation_p osl_relation_pread(FILE *, int); +osl_relation_p osl_relation_read(FILE *); +osl_relation_p osl_relation_psread(char **, int); +osl_relation_p osl_relation_psread_polylib(char **, int); +osl_relation_p osl_relation_sread(char **); +osl_relation_p osl_relation_sread_polylib(char **); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_relation_p osl_relation_pmalloc(int, int, int); +osl_relation_p osl_relation_malloc(int, int); +void osl_relation_free_inside(osl_relation_p); +void osl_relation_free(osl_relation_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +int osl_relation_nb_components(osl_relation_p relation); +osl_relation_p osl_relation_nclone(osl_relation_p, int); +osl_relation_p osl_relation_clone_nconstraints(osl_relation_p, int); +osl_relation_p osl_relation_clone(osl_relation_p); +void osl_relation_add(osl_relation_p *, osl_relation_p); +osl_relation_p osl_relation_union(osl_relation_p, osl_relation_p); +void osl_relation_replace_vector(osl_relation_p, osl_vector_p, int); +void osl_relation_insert_vector(osl_relation_p, osl_vector_p, int); +osl_relation_p osl_relation_concat_vector(osl_relation_p, osl_vector_p); +void osl_relation_insert_blank_row(osl_relation_p, int); +void osl_relation_insert_blank_column(osl_relation_p, int); +void osl_relation_add_vector(osl_relation_p, osl_vector_p, int); +void osl_relation_sub_vector(osl_relation_p, osl_vector_p, int); +osl_relation_p osl_relation_from_vector(osl_vector_p); +void osl_relation_replace_constraints(osl_relation_p, + osl_relation_p, int); +void osl_relation_insert_constraints(osl_relation_p, + osl_relation_p, int); +void osl_relation_swap_constraints(osl_relation_p, int, int); +void osl_relation_remove_row(osl_relation_p, int); +void osl_relation_remove_column(osl_relation_p, int); +void osl_relation_insert_columns(osl_relation_p, osl_relation_p,int); +osl_relation_p osl_relation_concat_constraints(osl_relation_p, osl_relation_p); +int osl_relation_part_equal(osl_relation_p, osl_relation_p); +int osl_relation_equal(osl_relation_p, osl_relation_p); +int osl_relation_integrity_check(osl_relation_p, int, int, int,int); +void osl_relation_set_attributes_one(osl_relation_p, + int, int, int, int); +void osl_relation_set_attributes(osl_relation_p, int, int, int, int); +void osl_relation_set_type(osl_relation_p, int); +int osl_relation_get_array_id(osl_relation_p); +int osl_relation_is_access(osl_relation_p); +void osl_relation_get_attributes(osl_relation_p, + int *, int *, int *, int *, int *); +osl_relation_p osl_relation_extend_output(osl_relation_p, int); +osl_interface_p osl_relation_interface(); +void osl_relation_set_precision(int const, osl_relation_p); +void osl_relation_set_same_precision(osl_relation_p, osl_relation_p); + +# if defined(__cplusplus) + } +# endif +#endif /* define OSL_RELATION_H */ diff -Nru cloog-0.18.2/osl/include/osl/relation_list.h cloog-0.18.4/osl/include/osl/relation_list.h --- cloog-0.18.2/osl/include/osl/relation_list.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/relation_list.h 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,146 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** relation_list.h ** + **-----------------------------------------------------------------** + ** First version: 08/10/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_RELATION_LIST_H +# define OSL_RELATION_LIST_H + +# include +# include + + +# if defined(__cplusplus) +extern "C" + { +# endif + + +/** + * The osl_relation_list_t structure describes a (NULL-terminated + * linked) list of relations. + */ +struct osl_relation_list { + osl_relation_p elt; /**< An element of the list. */ + struct osl_relation_list * next; /**< Pointer to the next element + of the list.*/ +}; +typedef struct osl_relation_list osl_relation_list_t; +typedef struct osl_relation_list * osl_relation_list_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_relation_list_idump(FILE *, osl_relation_list_p, int); +void osl_relation_list_dump(FILE *, osl_relation_list_p); +void osl_relation_list_pprint_elts(FILE *, osl_relation_list_p, osl_names_p); +void osl_relation_list_pprint(FILE *, osl_relation_list_p, osl_names_p); +void osl_relation_list_print(FILE *, osl_relation_list_p); + +// SCoPLib Compatibility +void osl_relation_list_pprint_access_array_scoplib(FILE *, osl_relation_list_p, + osl_names_p, int); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_relation_list_p osl_relation_list_pread(FILE *, int); +osl_relation_list_p osl_relation_list_read(FILE *); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_relation_list_p osl_relation_list_malloc(); +void osl_relation_list_free(osl_relation_list_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +osl_relation_list_p osl_relation_list_node(osl_relation_p); +osl_relation_list_p osl_relation_list_clone(osl_relation_list_p); +osl_relation_list_p osl_relation_list_concat(osl_relation_list_p, + osl_relation_list_p); +void osl_relation_list_add(osl_relation_list_p *, + osl_relation_list_p); +void osl_relation_list_push(osl_relation_list_p *, + osl_relation_list_p); +osl_relation_list_p osl_relation_list_pop(osl_relation_list_p *); +void osl_relation_list_dup(osl_relation_list_p *); +void osl_relation_list_drop(osl_relation_list_p *); +void osl_relation_list_destroy(osl_relation_list_p *); +int osl_relation_list_equal(osl_relation_list_p, + osl_relation_list_p); +int osl_relation_list_integrity_check(osl_relation_list_p, + int, int, int, int); +void osl_relation_list_set_type(osl_relation_list_p, int); +osl_relation_list_p osl_relation_list_filter(osl_relation_list_p, int); +size_t osl_relation_list_count(osl_relation_list_p); +void osl_relation_list_get_attributes(osl_relation_list_p, + int *, int *, int *, + int *, int *); +# if defined(__cplusplus) + } +# endif +#endif /* define OSL_RELATION_LIST_H */ diff -Nru cloog-0.18.2/osl/include/osl/scop.h cloog-0.18.4/osl/include/osl/scop.h --- cloog-0.18.2/osl/include/osl/scop.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/scop.h 2015-07-27 11:42:50.000000000 +0000 @@ -0,0 +1,159 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** scop.h ** + **-----------------------------------------------------------------** + ** First version: 30/04/2008 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +/*+**************************************************************************** + * THIS FILE HAS BEEN AUTOMATICALLY GENERATED FROM scop.h.in BY configure * + ******************************************************************************/ + + +#ifndef OSL_SCOP_H +# define OSL_SCOP_H + +# include + +# define OSL_RELEASE "0.9.0" + +# include +# include +# include +# include + + +# if defined(__cplusplus) +extern "C" + { +# endif + + +/** + * The scop_t structure stores a list of scops. Each node stores the useful + * information of a static control part of a program to process it within a + * polyhedral framework. Parameter information may be strings of characters + * (char *) when the type field is OSL_TYPE_STRING or a generic pointer + * to anything else (void *) when the type field is OSL_TYPE_GENERIC. + * The OpenScop library does not touch AT ALL generic information: printing, + * copy etc. must be done externally. + */ +struct osl_scop { + int version; /**< Version of the data structure */ + char * language; /**< Target language (backend) */ + osl_relation_p context; /**< Constraints on the SCoP parameters */ + osl_generic_p parameters; /**< NULL-terminated array of parameters */ + osl_statement_p statement; /**< Statement list of the SCoP */ + osl_interface_p registry; /**< Registered extensions interfaces */ + osl_generic_p extension; /**< List of extensions */ + void * usr; /**< A user-defined field, not touched + AT ALL by the OpenScop Library */ + struct osl_scop * next; /**< Next statement in the linked list */ +}; +typedef struct osl_scop osl_scop_t; +typedef struct osl_scop * osl_scop_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_scop_idump(FILE *, osl_scop_p, int); +void osl_scop_dump(FILE *, osl_scop_p); +void osl_scop_print(FILE *, osl_scop_p); + +// SCoPLib Compatibility +void osl_scop_print_scoplib(FILE *, osl_scop_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_scop_p osl_scop_pread(FILE *, osl_interface_p, int); +osl_scop_p osl_scop_read(FILE *); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_scop_p osl_scop_malloc(); +void osl_scop_free(osl_scop_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +void osl_scop_add(osl_scop_p *, osl_scop_p); +size_t osl_scop_number(osl_scop_p); +osl_scop_p osl_scop_clone(osl_scop_p); +int osl_scop_equal(osl_scop_p, osl_scop_p); +int osl_scop_integrity_check(osl_scop_p); +int osl_scop_check_compatible_scoplib(osl_scop_p); +int osl_scop_get_nb_parameters(osl_scop_p); +void osl_scop_register_extension(osl_scop_p, osl_interface_p); +void osl_scop_get_attributes(osl_scop_p, + int *, int *, int *, int *, int *); +void osl_scop_normalize_scattering(osl_scop_p); + +osl_names_p osl_scop_names(osl_scop_p scop); + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_SCOP_H */ diff -Nru cloog-0.18.2/osl/include/osl/scop.h.in cloog-0.18.4/osl/include/osl/scop.h.in --- cloog-0.18.2/osl/include/osl/scop.h.in 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/scop.h.in 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,159 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** scop.h ** + **-----------------------------------------------------------------** + ** First version: 30/04/2008 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +/*+**************************************************************************** + * THIS FILE HAS BEEN AUTOMATICALLY GENERATED FROM scop.h.in BY configure * + ******************************************************************************/ + + +#ifndef OSL_SCOP_H +# define OSL_SCOP_H + +# include + +# define OSL_RELEASE "@PACKAGE_VERSION@" + +# include +# include +# include +# include + + +# if defined(__cplusplus) +extern "C" + { +# endif + + +/** + * The scop_t structure stores a list of scops. Each node stores the useful + * information of a static control part of a program to process it within a + * polyhedral framework. Parameter information may be strings of characters + * (char *) when the type field is OSL_TYPE_STRING or a generic pointer + * to anything else (void *) when the type field is OSL_TYPE_GENERIC. + * The OpenScop library does not touch AT ALL generic information: printing, + * copy etc. must be done externally. + */ +struct osl_scop { + int version; /**< Version of the data structure */ + char * language; /**< Target language (backend) */ + osl_relation_p context; /**< Constraints on the SCoP parameters */ + osl_generic_p parameters; /**< NULL-terminated array of parameters */ + osl_statement_p statement; /**< Statement list of the SCoP */ + osl_interface_p registry; /**< Registered extensions interfaces */ + osl_generic_p extension; /**< List of extensions */ + void * usr; /**< A user-defined field, not touched + AT ALL by the OpenScop Library */ + struct osl_scop * next; /**< Next statement in the linked list */ +}; +typedef struct osl_scop osl_scop_t; +typedef struct osl_scop * osl_scop_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_scop_idump(FILE *, osl_scop_p, int); +void osl_scop_dump(FILE *, osl_scop_p); +void osl_scop_print(FILE *, osl_scop_p); + +// SCoPLib Compatibility +void osl_scop_print_scoplib(FILE *, osl_scop_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_scop_p osl_scop_pread(FILE *, osl_interface_p, int); +osl_scop_p osl_scop_read(FILE *); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_scop_p osl_scop_malloc(); +void osl_scop_free(osl_scop_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +void osl_scop_add(osl_scop_p *, osl_scop_p); +size_t osl_scop_number(osl_scop_p); +osl_scop_p osl_scop_clone(osl_scop_p); +int osl_scop_equal(osl_scop_p, osl_scop_p); +int osl_scop_integrity_check(osl_scop_p); +int osl_scop_check_compatible_scoplib(osl_scop_p); +int osl_scop_get_nb_parameters(osl_scop_p); +void osl_scop_register_extension(osl_scop_p, osl_interface_p); +void osl_scop_get_attributes(osl_scop_p, + int *, int *, int *, int *, int *); +void osl_scop_normalize_scattering(osl_scop_p); + +osl_names_p osl_scop_names(osl_scop_p scop); + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_SCOP_H */ diff -Nru cloog-0.18.2/osl/include/osl/statement.h cloog-0.18.4/osl/include/osl/statement.h --- cloog-0.18.2/osl/include/osl/statement.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/statement.h 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,145 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** statement.h ** + **-----------------------------------------------------------------** + ** First version: 30/04/2008 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_STATEMENT_H +# define OSL_STATEMENT_H + +# include +# include +# include +# include +# include +# include +# include "body.h" +# include "extensions/extbody.h" + +# if defined(__cplusplus) +extern "C" + { +# endif + + +/** + * The osl_statement_t structure stores a list of statement. Each node + * contains the useful informations for a given statement to process it + * within a polyhedral framework. The order in the list may matter for naming + * conventions (e.g. "S1" for the first statement in the list). + */ +struct osl_statement { + osl_relation_p domain; /**< Iteration domain of the statement */ + osl_relation_p scattering; /**< Scattering relation of the statement*/ + osl_relation_list_p access; /**< Access information */ + osl_generic_p extension; /**< A list of statement extensions */ + void * usr; /**< A user-defined field, not touched + AT ALL by the OpenScop Library. */ + struct osl_statement * next; /**< Next statement in the linked list */ +}; +typedef struct osl_statement osl_statement_t; +typedef struct osl_statement * osl_statement_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_statement_idump(FILE *, osl_statement_p, int); +void osl_statement_dump(FILE *, osl_statement_p); +void osl_statement_pprint(FILE *, osl_statement_p, osl_names_p); +void osl_statement_print(FILE *, osl_statement_p); + +// SCoPLib Compatibility +void osl_statement_pprint_scoplib(FILE *, osl_statement_p, + osl_names_p); + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_statement_p osl_statement_pread(FILE *, osl_interface_p, int); +osl_statement_p osl_statement_read(FILE *); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_statement_p osl_statement_malloc(); +void osl_statement_free(osl_statement_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +void osl_statement_add(osl_statement_p *, osl_statement_p); +void osl_statement_compact(osl_statement_p, int); +int osl_statement_number(osl_statement_p); +osl_statement_p osl_statement_nclone(osl_statement_p, int); +osl_statement_p osl_statement_clone(osl_statement_p); +int osl_statement_equal(osl_statement_p, osl_statement_p); +int osl_statement_integrity_check(osl_statement_p, int); +int osl_statement_get_nb_iterators(osl_statement_p); +void osl_statement_get_attributes(osl_statement_p, int *, int *, + int *, int *, int *); +osl_body_p osl_statement_get_body(osl_statement_p); + +# if defined(__cplusplus) + } +# endif +#endif /* define OSL_STATEMENT_H */ diff -Nru cloog-0.18.2/osl/include/osl/strings.h cloog-0.18.4/osl/include/osl/strings.h --- cloog-0.18.2/osl/include/osl/strings.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/strings.h 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,152 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** strings.h ** + **-----------------------------------------------------------------** + ** First version: 13/07/2011 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_STRINGS_H +# define OSL_STRINGS_H + +# include +# include + +# if defined(__cplusplus) +extern "C" + { +# endif + +# define OSL_URI_STRINGS "strings" + +/* The "strings" type is simply a NULL-terminated array of C character + * strings, i.e. a char **. It is encapsulated into a structure to allow + * its manipulation through a generic type. + */ +struct osl_strings { + char ** string; /**< NULL-terminated array of character strings */ +}; +typedef struct osl_strings osl_strings_t; +typedef struct osl_strings * osl_strings_p; +typedef struct osl_strings const osl_const_strings_t; +typedef struct osl_strings * const osl_strings_const_p; +typedef struct osl_strings const * osl_const_strings_p; +typedef struct osl_strings const * const osl_const_strings_const_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_strings_idump(FILE *, osl_strings_p, int); +void osl_strings_dump(FILE *, osl_strings_p); +char * osl_strings_sprint(osl_strings_p); +void osl_strings_print(FILE *, osl_strings_p); + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ +osl_strings_p osl_strings_sread(char **); +osl_strings_p osl_strings_read(FILE *); + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_strings_p osl_strings_malloc(); +void osl_strings_free(osl_strings_p); + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +osl_strings_p osl_strings_clone(osl_strings_p); +void osl_strings_add(osl_strings_p, char const * const); +size_t osl_strings_find(osl_strings_p, char const * const); +int osl_strings_equal(osl_strings_p, osl_strings_p); +size_t osl_strings_size(osl_const_strings_const_p); +osl_strings_p osl_strings_encapsulate(char *); +osl_interface_p osl_strings_interface(); +osl_strings_p osl_strings_generate(char *, int); + + +# if defined(__cplusplus) + } +# endif + +# if defined(__cplusplus) +#include +#include + +namespace osl +{ + /** + * @brief Convert osl_strings to std::vector + * @param[in] s An osl_strings + * @return the std::vector + */ + inline + std::vector osl_strings_to_cpp(osl_const_strings_const_p s) { + if (s != nullptr && s->string != nullptr) { + return std::vector(s->string, + s->string + osl_strings_size(s)); + } + else { return std::vector(); } + } +} +# endif + +#endif /* define OSL_STRINGS_H */ diff -Nru cloog-0.18.2/osl/include/osl/util.h cloog-0.18.4/osl/include/osl/util.h --- cloog-0.18.2/osl/include/osl/util.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/util.h 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,101 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** util.h ** + **-----------------------------------------------------------------** + ** First version: 08/10/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_UTIL_H +# define OSL_UTIL_H + +# include + + +# if defined(__cplusplus) +extern "C" + { +# endif + + +/*+*************************************************************************** + * Utility functions * + *****************************************************************************/ +char * osl_util_skip_blank_and_comments(FILE *, char *); +void osl_util_sskip_blank_and_comments(char **); +int osl_util_read_int(FILE *, char **); +char * osl_util_read_string(FILE *, char **); +char * osl_util_read_line(FILE *, char **); +char * osl_util_read_tag(FILE *, char **); +char * osl_util_read_tail(FILE *); +char * osl_util_read_uptoflag(FILE *, char **, char *); +char * osl_util_read_uptotag(FILE *, char **, char *); +char * osl_util_read_uptoendtag(FILE *, char **, char *); +char * osl_util_tag_content(char *, char *); +void osl_util_safe_strcat(char **, char *, int *); +char * osl_util_strdup(char const *); +int osl_util_get_precision(); +void osl_util_print_provided(FILE *, int, char *); +char * osl_util_identifier_substitution(char *, char **); + + +# if defined(__cplusplus) + } +# endif + +#endif /* define OSL_UTIL_H */ diff -Nru cloog-0.18.2/osl/include/osl/vector.h cloog-0.18.4/osl/include/osl/vector.h --- cloog-0.18.2/osl/include/osl/vector.h 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/include/osl/vector.h 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,123 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** vector.h ** + **-----------------------------------------------------------------** + ** First version: 01/05/2008 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#ifndef OSL_VECTOR_H +# define OSL_VECTOR_H + +# include +# include + + +# if defined(__cplusplus) +extern "C" + { +# endif + + +/** + * The osl_vector_t structure stores a vector information in the PolyLib + * format (the first entry has a specific meaning). When a vector + * describes a linear constraint, a 0 means it is an equality == 0, a 1 means + * an inequality >= 0. When the vector describes an array access, a number + * different than 0 is the array identifier. + */ +struct osl_vector { + int precision; /**< Precision of the integer elements. */ + int size; /**< Number of vector entries */ + osl_int_t* v; /**< An array of integer values */ +}; +typedef struct osl_vector osl_vector_t; +typedef struct osl_vector * osl_vector_p; + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ +void osl_vector_idump(FILE *, osl_vector_p, int); +void osl_vector_dump(FILE *, osl_vector_p); + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ +osl_vector_p osl_vector_pmalloc(int, int); +osl_vector_p osl_vector_malloc(int); +void osl_vector_free(osl_vector_p); + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ +osl_vector_p osl_vector_add_scalar(osl_vector_p, int); +osl_vector_p osl_vector_mul_scalar(osl_vector_p, int); +osl_vector_p osl_vector_add(osl_vector_p, osl_vector_p); +osl_vector_p osl_vector_sub(osl_vector_p, osl_vector_p); +void osl_vector_tag_inequality(osl_vector_p); +void osl_vector_tag_equality(osl_vector_p); +int osl_vector_equal(osl_vector_p, osl_vector_p); +int osl_vector_is_scalar(osl_vector_p); + +# if defined(__cplusplus) + } +# endif +#endif /* define OSL_VECTOR_H */ diff -Nru cloog-0.18.2/osl/m4/ax_cc_maxopt.m4 cloog-0.18.4/osl/m4/ax_cc_maxopt.m4 --- cloog-0.18.2/osl/m4/ax_cc_maxopt.m4 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/m4/ax_cc_maxopt.m4 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,178 @@ +# =========================================================================== +# http://www.nongnu.org/autoconf-archive/ax_cc_maxopt.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CC_MAXOPT +# +# DESCRIPTION +# +# Try to turn on "good" C optimization flags for various compilers and +# architectures, for some definition of "good". (In our case, good for +# FFTW and hopefully for other scientific codes. Modify as needed.) +# +# The user can override the flags by setting the CFLAGS environment +# variable. The user can also specify --enable-portable-binary in order to +# disable any optimization flags that might result in a binary that only +# runs on the host architecture. +# +# Note also that the flags assume that ANSI C aliasing rules are followed +# by the code (e.g. for gcc's -fstrict-aliasing), and that floating-point +# computations can be re-ordered as needed. +# +# Requires macros: AX_CHECK_COMPILER_FLAGS, AX_COMPILER_VENDOR, +# AX_GCC_ARCHFLAG, AX_GCC_X86_CPUID. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2008 Matteo Frigo +# +# This program 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 of the License, or (at your +# option) any later version. +# +# This program 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 this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +AC_DEFUN([AX_CC_MAXOPT], +[ +AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AX_COMPILER_VENDOR]) +AC_REQUIRE([AC_CANONICAL_HOST]) + +AC_ARG_ENABLE(portable-binary, [AC_HELP_STRING([--enable-portable-binary], [disable compiler optimizations that would produce unportable binaries])], + acx_maxopt_portable=$withval, acx_maxopt_portable=no) + +# Try to determine "good" native compiler flags if none specified via CFLAGS +if test "$ac_test_CFLAGS" != "set"; then + CFLAGS="" + case $ax_cv_c_compiler_vendor in + dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host" + if test "x$acx_maxopt_portable" = xno; then + CFLAGS="$CFLAGS -arch host" + fi;; + + sun) CFLAGS="-native -fast -xO5 -dalign" + if test "x$acx_maxopt_portable" = xyes; then + CFLAGS="$CFLAGS -xarch=generic" + fi;; + + hp) CFLAGS="+Oall +Optrs_ansi +DSnative" + if test "x$acx_maxopt_portable" = xyes; then + CFLAGS="$CFLAGS +DAportable" + fi;; + + ibm) if test "x$acx_maxopt_portable" = xno; then + xlc_opt="-qarch=auto -qtune=auto" + else + xlc_opt="-qtune=auto" + fi + AX_CHECK_COMPILER_FLAGS($xlc_opt, + CFLAGS="-O3 -qansialias -w $xlc_opt", + [CFLAGS="-O3 -qansialias -w" + echo "******************************************************" + echo "* You seem to have the IBM C compiler. It is *" + echo "* recommended for best performance that you use: *" + echo "* *" + echo "* CFLAGS=-O3 -qarch=xxx -qtune=xxx -qansialias -w *" + echo "* ^^^ ^^^ *" + echo "* where xxx is pwr2, pwr3, 604, or whatever kind of *" + echo "* CPU you have. (Set the CFLAGS environment var. *" + echo "* and re-run configure.) For more info, man cc. *" + echo "******************************************************"]) + ;; + + intel) CFLAGS="-O3 -ansi_alias" + if test "x$acx_maxopt_portable" = xno; then + icc_archflag=unknown + icc_flags="" + case $host_cpu in + i686*|x86_64*) + # icc accepts gcc assembly syntax, so these should work: + AX_GCC_X86_CPUID(0) + AX_GCC_X86_CPUID(1) + case $ax_cv_gcc_x86_cpuid_0 in # see AX_GCC_ARCHFLAG + *:756e6547:*:*) # Intel + case $ax_cv_gcc_x86_cpuid_1 in + *6a?:*[[234]]:*:*|*6[[789b]]?:*:*:*) icc_flags="-xK";; + *f3[[347]]:*:*:*|*f4[1347]:*:*:*) icc_flags="-xP -xN -xW -xK";; + *f??:*:*:*) icc_flags="-xN -xW -xK";; + esac ;; + esac ;; + esac + if test "x$icc_flags" != x; then + for flag in $icc_flags; do + AX_CHECK_COMPILER_FLAGS($flag, [icc_archflag=$flag; break]) + done + fi + AC_MSG_CHECKING([for icc architecture flag]) + AC_MSG_RESULT($icc_archflag) + if test "x$icc_archflag" != xunknown; then + CFLAGS="$CFLAGS $icc_archflag" + fi + fi + ;; + + gnu) + # default optimization flags for gcc on all systems + CFLAGS="-O3 -fomit-frame-pointer" + + # -malign-double for x86 systems + AX_CHECK_COMPILER_FLAGS(-malign-double, CFLAGS="$CFLAGS -malign-double") + + # -fstrict-aliasing for gcc-2.95+ + AX_CHECK_COMPILER_FLAGS(-fstrict-aliasing, + CFLAGS="$CFLAGS -fstrict-aliasing") + + # note that we enable "unsafe" fp optimization with other compilers, too + AX_CHECK_COMPILER_FLAGS(-ffast-math, CFLAGS="$CFLAGS -ffast-math") + + AX_GCC_ARCHFLAG($acx_maxopt_portable) + ;; + esac + + if test -z "$CFLAGS"; then + echo "" + echo "********************************************************" + echo "* WARNING: Don't know the best CFLAGS for this system *" + echo "* Use ./configure CFLAGS=... to specify your own flags *" + echo "* (otherwise, a default of CFLAGS=-O3 will be used) *" + echo "********************************************************" + echo "" + CFLAGS="-O3" + fi + + AX_CHECK_COMPILER_FLAGS($CFLAGS, [], [ + echo "" + echo "********************************************************" + echo "* WARNING: The guessed CFLAGS don't seem to work with *" + echo "* your compiler. *" + echo "* Use ./configure CFLAGS=... to specify your own flags *" + echo "********************************************************" + echo "" + CFLAGS="" + ]) + +fi +]) diff -Nru cloog-0.18.2/osl/m4/ax_cflags_warn_all.m4 cloog-0.18.4/osl/m4/ax_cflags_warn_all.m4 --- cloog-0.18.2/osl/m4/ax_cflags_warn_all.m4 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/m4/ax_cflags_warn_all.m4 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,149 @@ +# =========================================================================== +# http://www.nongnu.org/autoconf-archive/ax_cflags_warn_all.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] +# +# DESCRIPTION +# +# Try to find a compiler option that enables most reasonable warnings. +# +# For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The +# result is added to the shellvar being CFLAGS by default. +# +# Currently this macro knows about GCC, Solaris C compiler, Digital Unix C +# compiler, C for AIX Compiler, HP-UX C compiler, IRIX C compiler, NEC +# SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos 10.0.0.8) C +# compiler. +# +# - $1 shell-variable-to-add-to : CFLAGS +# - $2 add-value-if-not-found : nothing +# - $3 action-if-found : add value to shellvariable +# - $4 action-if-not-found : nothing +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim +# +# This program 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 2 of the License, or (at your +# option) any later version. +# +# This program 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 this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl +AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl +AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_warn_all])dnl +AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings], +VAR,[VAR="no, unknown" + AC_LANG_SAVE + AC_LANG_C + ac_save_[]FLAGS="$[]FLAGS" +for ac_arg dnl +in "-pedantic % -Wall" dnl GCC + "-xstrconst % -v" dnl Solaris C + "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix + "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX + "-ansi -ansiE % -fullwarn" dnl IRIX + "+ESlit % +w1" dnl HP-UX C + "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10) + "-h conform % -h msglevel 2" dnl Cray C (Unicos) + # +do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` + AC_TRY_COMPILE([],[return 0;], + [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) +done + FLAGS="$ac_save_[]FLAGS" + AC_LANG_RESTORE +]) +case ".$VAR" in + .ok|.ok,*) m4_ifvaln($3,$3) ;; + .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[ + AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"]) + m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;; + *) m4_ifvaln($3,$3,[ + if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null + then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR]) + else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"]) + m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR" + fi ]) ;; +esac +AS_VAR_POPDEF([VAR])dnl +AS_VAR_POPDEF([FLAGS])dnl +]) + +dnl the only difference - the LANG selection... and the default FLAGS + +AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl +AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl +AS_VAR_PUSHDEF([VAR],[ax_cv_cxxflags_warn_all])dnl +AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings], +VAR,[VAR="no, unknown" + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_[]FLAGS="$[]FLAGS" +for ac_arg dnl +in "-pedantic % -Wall" dnl GCC + "-xstrconst % -v" dnl Solaris C + "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix + "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX + "-ansi -ansiE % -fullwarn" dnl IRIX + "+ESlit % +w1" dnl HP-UX C + "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10) + "-h conform % -h msglevel 2" dnl Cray C (Unicos) + # +do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` + AC_TRY_COMPILE([],[return 0;], + [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) +done + FLAGS="$ac_save_[]FLAGS" + AC_LANG_RESTORE +]) +case ".$VAR" in + .ok|.ok,*) m4_ifvaln($3,$3) ;; + .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[ + AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"]) + m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;; + *) m4_ifvaln($3,$3,[ + if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null + then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR]) + else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"]) + m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR" + fi ]) ;; +esac +AS_VAR_POPDEF([VAR])dnl +AS_VAR_POPDEF([FLAGS])dnl +]) + +dnl implementation tactics: +dnl the for-argument contains a list of options. The first part of +dnl these does only exist to detect the compiler - usually it is +dnl a global option to enable -ansi or -extrawarnings. All other +dnl compilers will fail about it. That was needed since a lot of +dnl compilers will give false positives for some option-syntax +dnl like -Woption or -Xoption as they think of it is a pass-through +dnl to later compile stages or something. The "%" is used as a +dnl delimimiter. A non-option comment can be given after "%%" marks +dnl which will be shown but not added to the respective C/CXXFLAGS. diff -Nru cloog-0.18.2/osl/m4/ax_check_compiler_flags.m4 cloog-0.18.4/osl/m4/ax_check_compiler_flags.m4 --- cloog-0.18.2/osl/m4/ax_check_compiler_flags.m4 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/m4/ax_check_compiler_flags.m4 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,74 @@ +# =========================================================================== +# http://www.nongnu.org/autoconf-archive/ax_check_compiler_flags.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_COMPILER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE]) +# +# DESCRIPTION +# +# Check whether the given compiler FLAGS work with the current language's +# compiler, or whether they give an error. (Warnings, however, are +# ignored.) +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# LICENSE +# +# Copyright (c) 2009 Steven G. Johnson +# Copyright (c) 2009 Matteo Frigo +# +# This program 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 of the License, or (at your +# option) any later version. +# +# This program 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 this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +AC_DEFUN([AX_CHECK_COMPILER_FLAGS], +[AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX +AC_MSG_CHECKING([whether _AC_LANG compiler accepts $1]) +dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: +AS_LITERAL_IF([$1], + [AC_CACHE_VAL(AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1]), [ + ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$1" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes, + AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no) + _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])], + [ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$1" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes, + eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no) + _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS]) +eval ax_check_compiler_flags=$AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1]) +AC_MSG_RESULT($ax_check_compiler_flags) +if test "x$ax_check_compiler_flags" = xyes; then + m4_default([$2], :) +else + m4_default([$3], :) +fi +])dnl AX_CHECK_COMPILER_FLAGS diff -Nru cloog-0.18.2/osl/m4/ax_compiler_vendor.m4 cloog-0.18.4/osl/m4/ax_compiler_vendor.m4 --- cloog-0.18.2/osl/m4/ax_compiler_vendor.m4 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/m4/ax_compiler_vendor.m4 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,61 @@ +# =========================================================================== +# http://www.nongnu.org/autoconf-archive/ax_compiler_vendor.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_COMPILER_VENDOR +# +# DESCRIPTION +# +# Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun, +# hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft, +# watcom, etc. The vendor is returned in the cache variable +# $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2008 Matteo Frigo +# +# This program 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 of the License, or (at your +# option) any later version. +# +# This program 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 this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +AC_DEFUN([AX_COMPILER_VENDOR], +[ +AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, + [ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown + # note: don't check for gcc first since some other compilers define __GNUC__ + for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do + vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ +#if !($vencpp) + thisisanerror; +#endif +])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break]) + done + ]) +]) diff -Nru cloog-0.18.2/osl/m4/ax_gcc_archflag.m4 cloog-0.18.4/osl/m4/ax_gcc_archflag.m4 --- cloog-0.18.2/osl/m4/ax_gcc_archflag.m4 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/m4/ax_gcc_archflag.m4 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,213 @@ +# =========================================================================== +# http://www.nongnu.org/autoconf-archive/ax_gcc_archflag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_GCC_ARCHFLAG([PORTABLE?], [ACTION-SUCCESS], [ACTION-FAILURE]) +# +# DESCRIPTION +# +# This macro tries to guess the "native" arch corresponding to the target +# architecture for use with gcc's -march=arch or -mtune=arch flags. If +# found, the cache variable $ax_cv_gcc_archflag is set to this flag and +# ACTION-SUCCESS is executed; otherwise $ax_cv_gcc_archflag is is set to +# "unknown" and ACTION-FAILURE is executed. The default ACTION-SUCCESS is +# to add $ax_cv_gcc_archflag to the end of $CFLAGS. +# +# PORTABLE? should be either [yes] (default) or [no]. In the former case, +# the flag is set to -mtune (or equivalent) so that the architecture is +# only used for tuning, but the instruction set used is still portable. In +# the latter case, the flag is set to -march (or equivalent) so that +# architecture-specific instructions are enabled. +# +# The user can specify --with-gcc-arch= in order to override the +# macro's choice of architecture, or --without-gcc-arch to disable this. +# +# When cross-compiling, or if $CC is not gcc, then ACTION-FAILURE is +# called unless the user specified --with-gcc-arch manually. +# +# Requires macros: AX_CHECK_COMPILER_FLAGS, AX_GCC_X86_CPUID +# +# (The main emphasis here is on recent CPUs, on the principle that doing +# high-performance computing on old hardware is uncommon.) +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2008 Matteo Frigo +# +# This program 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 of the License, or (at your +# option) any later version. +# +# This program 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 this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +AC_DEFUN([AX_GCC_ARCHFLAG], +[AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AC_CANONICAL_HOST]) + +AC_ARG_WITH(gcc-arch, [AC_HELP_STRING([--with-gcc-arch=], [use architecture for gcc -march/-mtune, instead of guessing])], + ax_gcc_arch=$withval, ax_gcc_arch=yes) + +AC_MSG_CHECKING([for gcc architecture flag]) +AC_MSG_RESULT([]) +AC_CACHE_VAL(ax_cv_gcc_archflag, +[ +ax_cv_gcc_archflag="unknown" + +if test "$GCC" = yes; then + +if test "x$ax_gcc_arch" = xyes; then +ax_gcc_arch="" +if test "$cross_compiling" = no; then +case $host_cpu in + i[[3456]]86*|x86_64*) # use cpuid codes, in part from x86info-1.7 by D. Jones + AX_GCC_X86_CPUID(0) + AX_GCC_X86_CPUID(1) + case $ax_cv_gcc_x86_cpuid_0 in + *:756e6547:*:*) # Intel + case $ax_cv_gcc_x86_cpuid_1 in + *5[[48]]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;; + *5??:*:*:*) ax_gcc_arch=pentium ;; + *6[[3456]]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; + *6a?:*[[01]]:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; + *6a?:*[[234]]:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; + *6[[9d]]?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;; + *6[[78b]]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; + *6??:*:*:*) ax_gcc_arch=pentiumpro ;; + *f3[[347]]:*:*:*|*f4[1347]:*:*:*) + case $host_cpu in + x86_64*) ax_gcc_arch="nocona pentium4 pentiumpro" ;; + *) ax_gcc_arch="prescott pentium4 pentiumpro" ;; + esac ;; + *f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro";; + esac ;; + *:68747541:*:*) # AMD + case $ax_cv_gcc_x86_cpuid_1 in + *5[[67]]?:*:*:*) ax_gcc_arch=k6 ;; + *5[[8d]]?:*:*:*) ax_gcc_arch="k6-2 k6" ;; + *5[[9]]?:*:*:*) ax_gcc_arch="k6-3 k6" ;; + *60?:*:*:*) ax_gcc_arch=k7 ;; + *6[[12]]?:*:*:*) ax_gcc_arch="athlon k7" ;; + *6[[34]]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;; + *67?:*:*:*) ax_gcc_arch="athlon-4 athlon k7" ;; + *6[[68a]]?:*:*:*) + AX_GCC_X86_CPUID(0x80000006) # L2 cache size + case $ax_cv_gcc_x86_cpuid_0x80000006 in + *:*:*[[1-9a-f]]??????:*) # (L2 = ecx >> 16) >= 256 + ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;; + *) ax_gcc_arch="athlon-4 athlon k7" ;; + esac ;; + *f[[4cef8b]]?:*:*:*) ax_gcc_arch="athlon64 k8" ;; + *f5?:*:*:*) ax_gcc_arch="opteron k8" ;; + *f7?:*:*:*) ax_gcc_arch="athlon-fx opteron k8" ;; + *f??:*:*:*) ax_gcc_arch="k8" ;; + esac ;; + *:746e6543:*:*) # IDT + case $ax_cv_gcc_x86_cpuid_1 in + *54?:*:*:*) ax_gcc_arch=winchip-c6 ;; + *58?:*:*:*) ax_gcc_arch=winchip2 ;; + *6[[78]]?:*:*:*) ax_gcc_arch=c3 ;; + *69?:*:*:*) ax_gcc_arch="c3-2 c3" ;; + esac ;; + esac + if test x"$ax_gcc_arch" = x; then # fallback + case $host_cpu in + i586*) ax_gcc_arch=pentium ;; + i686*) ax_gcc_arch=pentiumpro ;; + esac + fi + ;; + + sparc*) + AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/]) + cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null` + cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters` + case $cputype in + *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;; + *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;; + *ultrasparc*) ax_gcc_arch="ultrasparc v9" ;; + *supersparc*|*tms390z5[[05]]*) ax_gcc_arch="supersparc v8" ;; + *hypersparc*|*rt62[[056]]*) ax_gcc_arch="hypersparc v8" ;; + *cypress*) ax_gcc_arch=cypress ;; + esac ;; + + alphaev5) ax_gcc_arch=ev5 ;; + alphaev56) ax_gcc_arch=ev56 ;; + alphapca56) ax_gcc_arch="pca56 ev56" ;; + alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;; + alphaev6) ax_gcc_arch=ev6 ;; + alphaev67) ax_gcc_arch=ev67 ;; + alphaev68) ax_gcc_arch="ev68 ev67" ;; + alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;; + alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;; + alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;; + + powerpc*) + cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | sed 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null` + cputype=`echo $cputype | sed -e 's/ppc//g;s/ *//g'` + case $cputype in + *750*) ax_gcc_arch="750 G3" ;; + *740[[0-9]]*) ax_gcc_arch="$cputype 7400 G4" ;; + *74[[4-5]][[0-9]]*) ax_gcc_arch="$cputype 7450 G4" ;; + *74[[0-9]][[0-9]]*) ax_gcc_arch="$cputype G4" ;; + *970*) ax_gcc_arch="970 G5 power4";; + *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";; + *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";; + 603ev|8240) ax_gcc_arch="$cputype 603e 603";; + *) ax_gcc_arch=$cputype ;; + esac + ax_gcc_arch="$ax_gcc_arch powerpc" + ;; +esac +fi # not cross-compiling +fi # guess arch + +if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then +for arch in $ax_gcc_arch; do + if test "x[]m4_default([$1],yes)" = xyes; then # if we require portable code + flags="-mtune=$arch" + # -mcpu=$arch and m$arch generate nonportable code on every arch except + # x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr. + case $host_cpu in i*86|x86_64*) flags="$flags -mcpu=$arch -m$arch";; esac + else + flags="-march=$arch -mcpu=$arch -m$arch" + fi + for flag in $flags; do + AX_CHECK_COMPILER_FLAGS($flag, [ax_cv_gcc_archflag=$flag; break]) + done + test "x$ax_cv_gcc_archflag" = xunknown || break +done +fi + +fi # $GCC=yes +]) +AC_MSG_CHECKING([for gcc architecture flag]) +AC_MSG_RESULT($ax_cv_gcc_archflag) +if test "x$ax_cv_gcc_archflag" = xunknown; then + m4_default([$3],:) +else + m4_default([$2], [CFLAGS="$CFLAGS $ax_cv_gcc_archflag"]) +fi +]) diff -Nru cloog-0.18.2/osl/m4/ax_gcc_x86_cpuid.m4 cloog-0.18.4/osl/m4/ax_gcc_x86_cpuid.m4 --- cloog-0.18.2/osl/m4/ax_gcc_x86_cpuid.m4 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/m4/ax_gcc_x86_cpuid.m4 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,77 @@ +# =========================================================================== +# http://www.nongnu.org/autoconf-archive/ax_gcc_x86_cpuid.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_GCC_X86_CPUID(OP) +# +# DESCRIPTION +# +# On Pentium and later x86 processors, with gcc or a compiler that has a +# compatible syntax for inline assembly instructions, run a small program +# that executes the cpuid instruction with input OP. This can be used to +# detect the CPU type. +# +# On output, the values of the eax, ebx, ecx, and edx registers are stored +# as hexadecimal strings as "eax:ebx:ecx:edx" in the cache variable +# ax_cv_gcc_x86_cpuid_OP. +# +# If the cpuid instruction fails (because you are running a +# cross-compiler, or because you are not using gcc, or because you are on +# a processor that doesn't have this instruction), ax_cv_gcc_x86_cpuid_OP +# is set to the string "unknown". +# +# This macro mainly exists to be used in AX_GCC_ARCHFLAG. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2008 Matteo Frigo +# +# This program 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 of the License, or (at your +# option) any later version. +# +# This program 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 this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +AC_DEFUN([AX_GCC_X86_CPUID], +[AC_REQUIRE([AC_PROG_CC]) +AC_LANG_PUSH([C]) +AC_CACHE_CHECK(for x86 cpuid $1 output, ax_cv_gcc_x86_cpuid_$1, + [AC_RUN_IFELSE([AC_LANG_PROGRAM([#include ], [ + int op = $1, eax, ebx, ecx, edx; + FILE *f; + __asm__("cpuid" + : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) + : "a" (op)); + f = fopen("conftest_cpuid", "w"); if (!f) return 1; + fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); + fclose(f); + return 0; +])], + [ax_cv_gcc_x86_cpuid_$1=`cat conftest_cpuid`; rm -f conftest_cpuid], + [ax_cv_gcc_x86_cpuid_$1=unknown; rm -f conftest_cpuid], + [ax_cv_gcc_x86_cpuid_$1=unknown])]) +AC_LANG_POP([C]) +]) diff -Nru cloog-0.18.2/osl/m4/ax_submodule.m4 cloog-0.18.4/osl/m4/ax_submodule.m4 --- cloog-0.18.2/osl/m4/ax_submodule.m4 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/m4/ax_submodule.m4 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,71 @@ +AC_DEFUN([AX_SUBMODULE], +[ + +m4_if(m4_bregexp($2,|,choice),choice, + [AC_ARG_WITH($1, + [AS_HELP_STRING([--with-$1=$2], + [Which $1 to use [default=$3]])])]) +case "system" in +$2) + AC_ARG_WITH($1_prefix, + [AS_HELP_STRING([--with-$1-prefix=DIR], + [Prefix of $1 installation])]) + AC_ARG_WITH($1_exec_prefix, + [AS_HELP_STRING([--with-$1-exec-prefix=DIR], + [Exec prefix of $1 installation])]) +esac +m4_if(m4_bregexp($2,build,build),build, + [AC_ARG_WITH($1_builddir, + [AS_HELP_STRING([--with-$1-builddir=DIR], + [Location of $1 builddir])])]) +if test "x$with_$1_prefix" != "x" -a "x$with_$1_exec_prefix" = "x"; then + with_$1_exec_prefix=$with_$1_prefix +fi +if test "x$with_$1_prefix" != "x" -o "x$with_$1_exec_prefix" != "x"; then + if test "x$with_$1" != "x" -a "x$with_$1" != "xyes" -a "x$with_$1" != "xsystem"; then + AC_MSG_ERROR([Setting $with_$1_prefix implies use of system $1]) + fi + with_$1="system" +fi +if test "x$with_$1_builddir" != "x"; then + if test "x$with_$1" != "x" -a "x$with_$1" != "xyes" -a "x$with_$1" != "xbuild"; then + AC_MSG_ERROR([Setting $with_$1_builddir implies use of build $1]) + fi + with_$1="build" + $1_srcdir=`echo @abs_srcdir@ | $with_$1_builddir/config.status --file=-` + AC_MSG_NOTICE($1 sources in $$1_srcdir) +fi +if test "x$with_$1_exec_prefix" != "x"; then + export PKG_CONFIG_PATH="$with_$1_exec_prefix/lib/pkgconfig${PKG_CONFIG_PATH+:$PKG_CONFIG_PATH}" +fi +case "$with_$1" in +$2) + ;; +*) + case "$3" in + bundled) + if test -d $srcdir/.git -a \ + -d $srcdir/$1 -a \ + ! -d $srcdir/$1/.git; then + AC_MSG_WARN([git repo detected, but submodule $1 not initialized]) + AC_MSG_WARN([You may want to run]) + AC_MSG_WARN([ git submodule init]) + AC_MSG_WARN([ git submodule update]) + AC_MSG_WARN([ sh autogen.sh]) + fi + if test -f $srcdir/$1/configure; then + with_$1="bundled" + else + with_$1="no" + fi + ;; + *) + with_$1="$3" + ;; + esac + ;; +esac +AC_MSG_CHECKING([which $1 to use]) +AC_MSG_RESULT($with_$1) + +]) diff -Nru cloog-0.18.2/osl/m4/libtool.m4 cloog-0.18.4/osl/m4/libtool.m4 --- cloog-0.18.2/osl/m4/libtool.m4 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/m4/libtool.m4 2014-10-02 14:14:41.000000000 +0000 @@ -0,0 +1,7997 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_REPLACE_SHELLFNS + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + _LT_TAGVAR(link_all_deplibs, $1)=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) + + +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) + + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) + + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) + + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi + +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) + + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS diff -Nru cloog-0.18.2/osl/m4/lt~obsolete.m4 cloog-0.18.4/osl/m4/lt~obsolete.m4 --- cloog-0.18.2/osl/m4/lt~obsolete.m4 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/m4/lt~obsolete.m4 2014-10-02 14:14:42.000000000 +0000 @@ -0,0 +1,98 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff -Nru cloog-0.18.2/osl/m4/ltoptions.m4 cloog-0.18.4/osl/m4/ltoptions.m4 --- cloog-0.18.2/osl/m4/ltoptions.m4 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/m4/ltoptions.m4 2014-10-02 14:14:42.000000000 +0000 @@ -0,0 +1,384 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 7 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff -Nru cloog-0.18.2/osl/m4/ltsugar.m4 cloog-0.18.4/osl/m4/ltsugar.m4 --- cloog-0.18.2/osl/m4/ltsugar.m4 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/m4/ltsugar.m4 2014-10-02 14:14:42.000000000 +0000 @@ -0,0 +1,123 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff -Nru cloog-0.18.2/osl/m4/ltversion.m4 cloog-0.18.4/osl/m4/ltversion.m4 --- cloog-0.18.2/osl/m4/ltversion.m4 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/m4/ltversion.m4 2014-10-02 14:14:42.000000000 +0000 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# @configure_input@ + +# serial 3337 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.2' +macro_revision='1.3337' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff -Nru cloog-0.18.2/osl/Makefile.am cloog-0.18.4/osl/Makefile.am --- cloog-0.18.2/osl/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/Makefile.am 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,159 @@ +# +# /*+------------------------------------------------------------------** +# ** OpenScop Library ** +# **------------------------------------------------------------------** +# ** makefile.am ** +# **------------------------------------------------------------------** +# ** First version: 30/04/2008 ** +# **------------------------------------------------------------------** +# +# +# *************************************************************************** +# * OpenScop: Structures and formats for polyhedral tools to talk together * +# *************************************************************************** +# * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * +# * / / / // // // // / / / // // / / // / /|,_, * +# * / / / // // // // / / / // // / / // / / / /\ * +# * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * +# * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * +# * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * +# * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * +# * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * +# * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * +# * | I | | | | e | | | | | | | | | | | | | \ \ \ * +# * | T | | | | | | | | | | | | | | | | | \ \ \ * +# * | E | | | | | | | | | | | | | | | | | \ \ \ * +# * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * +# * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * +# * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * +# * * +# * Copyright (C) 2008 University Paris-Sud 11 and INRIA * +# * * +# * (3-clause BSD license) * +# * Redistribution and use in source and binary forms, with or without * +# * modification, are permitted provided that the following conditions * +# * are met: * +# * * +# * 1. Redistributions of source code must retain the above copyright * +# * notice, this list of conditions and the following disclaimer. * +# * 2. Redistributions in binary form must reproduce the above copyright * +# * notice, this list of conditions and the following disclaimer in the * +# * documentation and/or other materials provided with the distribution. * +# * 3. The name of the author may not be used to endorse or promote * +# * products derived from this software without specific prior written * +# * permission. * +# * * +# * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * +# * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +# * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +# * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, * +# * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +# * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * +# * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * +# * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * +# * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * +# * POSSIBILITY OF SUCH DAMAGE. * +# * * +# * OpenScop Library, a library to manipulate OpenScop formats and data * +# * structures. Written by: * +# * Cedric Bastoul and * +# * Louis-Noel Pouchet * +# * * +# ***************************************************************************/ +# +# Makefile.am (or makefile if generated) of the OpenScop Library. +# Makefile.am is not a makefile, you must run the 'autogen.sh' THEN the +# configure shellscript to generate the Makefile thanks to this file. + + +############################################################################# + +AUTOMAKE_OPTIONS = subdir-objects +SUBDIRS = . doc tests +ACLOCAL_AMFLAGS = -I m4 + +############################################################################# + +lib_LTLIBRARIES = libosl.la + +############################################################################# + +pkginclude_HEADERS = \ + include/osl/osl.h \ + include/osl/statement.h \ + include/osl/interface.h \ + include/osl/generic.h \ + include/osl/vector.h \ + include/osl/relation.h \ + include/osl/relation_list.h \ + include/osl/macros.h \ + include/osl/int.h \ + include/osl/names.h \ + include/osl/strings.h \ + include/osl/body.h \ + include/osl/util.h \ + include/osl/scop.h + +pkgextensionsincludedir = $(pkgincludedir)/extensions +pkgextensionsinclude_HEADERS = \ + include/osl/extensions/textual.h \ + include/osl/extensions/comment.h \ + include/osl/extensions/null.h \ + include/osl/extensions/clay.h \ + include/osl/extensions/dependence.h \ + include/osl/extensions/scatnames.h \ + include/osl/extensions/arrays.h \ + include/osl/extensions/coordinates.h \ + include/osl/extensions/irregular.h \ + include/osl/extensions/symbols.h \ + include/osl/extensions/loop.h \ + include/osl/extensions/extbody.h \ + include/osl/extensions/pluto_unroll.h + +AM_CPPFLAGS = -I. -I$(top_builddir)/include -I$(top_srcdir)/include +AM_CFLAGS = $(CFLAGS_WARN) + +############################################################################# + +libosl_la_CPPFLAGS = -I. -I$(top_builddir)/include -I$(top_srcdir)/include -g +libosl_la_SOURCES = \ + source/scop.c \ + source/statement.c \ + source/extensions/textual.c \ + source/extensions/comment.c \ + source/extensions/null.c \ + source/extensions/clay.c \ + source/extensions/dependence.c \ + source/extensions/scatnames.c \ + source/extensions/arrays.c \ + source/extensions/coordinates.c \ + source/extensions/irregular.c \ + source/extensions/symbols.c \ + source/extensions/extbody.c \ + source/extensions/loop.c \ + source/extensions/pluto_unroll.c \ + source/interface.c \ + source/generic.c \ + source/relation.c \ + source/relation_list.c \ + source/vector.c \ + source/names.c \ + source/strings.c \ + source/body.c \ + source/int.c \ + source/util.c + +MAINTAINERCLEANFILES = \ + Makefile.in \ + aclocal.m4 \ + configure \ + source/stamp-h.in \ + $(AUX_DIST) + +############################################################################# + +ctags: + ctags -R --c++-kinds=+p --fields=+iaS --extra=+q -f$(HOME)/.ctags . + +############################################################################# diff -Nru cloog-0.18.2/osl/Makefile.in cloog-0.18.4/osl/Makefile.in --- cloog-0.18.2/osl/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/Makefile.in 2015-07-24 11:59:08.000000000 +0000 @@ -0,0 +1,1454 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# /*+------------------------------------------------------------------** +# ** OpenScop Library ** +# **------------------------------------------------------------------** +# ** makefile.am ** +# **------------------------------------------------------------------** +# ** First version: 30/04/2008 ** +# **------------------------------------------------------------------** +# +# +# *************************************************************************** +# * OpenScop: Structures and formats for polyhedral tools to talk together * +# *************************************************************************** +# * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * +# * / / / // // // // / / / // // / / // / /|,_, * +# * / / / // // // // / / / // // / / // / / / /\ * +# * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * +# * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * +# * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * +# * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * +# * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * +# * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * +# * | I | | | | e | | | | | | | | | | | | | \ \ \ * +# * | T | | | | | | | | | | | | | | | | | \ \ \ * +# * | E | | | | | | | | | | | | | | | | | \ \ \ * +# * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * +# * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * +# * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * +# * * +# * Copyright (C) 2008 University Paris-Sud 11 and INRIA * +# * * +# * (3-clause BSD license) * +# * Redistribution and use in source and binary forms, with or without * +# * modification, are permitted provided that the following conditions * +# * are met: * +# * * +# * 1. Redistributions of source code must retain the above copyright * +# * notice, this list of conditions and the following disclaimer. * +# * 2. Redistributions in binary form must reproduce the above copyright * +# * notice, this list of conditions and the following disclaimer in the * +# * documentation and/or other materials provided with the distribution. * +# * 3. The name of the author may not be used to endorse or promote * +# * products derived from this software without specific prior written * +# * permission. * +# * * +# * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * +# * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +# * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +# * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, * +# * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +# * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * +# * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * +# * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * +# * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * +# * POSSIBILITY OF SUCH DAMAGE. * +# * * +# * OpenScop Library, a library to manipulate OpenScop formats and data * +# * structures. Written by: * +# * Cedric Bastoul and * +# * Louis-Noel Pouchet * +# * * +# ***************************************************************************/ +# +# Makefile.am (or makefile if generated) of the OpenScop Library. +# Makefile.am is not a makefile, you must run the 'autogen.sh' THEN the +# configure shellscript to generate the Makefile thanks to this file. + +############################################################################# + + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(top_srcdir)/include/osl/scop.h.in \ + $(top_srcdir)/autoconf/depcomp $(pkgextensionsinclude_HEADERS) \ + $(pkginclude_HEADERS) AUTHORS COPYING ChangeLog NEWS README \ + THANKS autoconf/compile autoconf/config.guess \ + autoconf/config.sub autoconf/depcomp autoconf/install-sh \ + autoconf/missing autoconf/texinfo.tex autoconf/ltmain.sh \ + $(top_srcdir)/autoconf/compile \ + $(top_srcdir)/autoconf/config.guess \ + $(top_srcdir)/autoconf/config.sub \ + $(top_srcdir)/autoconf/install-sh \ + $(top_srcdir)/autoconf/ltmain.sh \ + $(top_srcdir)/autoconf/missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cc_maxopt.m4 \ + $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ + $(top_srcdir)/m4/ax_check_compiler_flags.m4 \ + $(top_srcdir)/m4/ax_compiler_vendor.m4 \ + $(top_srcdir)/m4/ax_gcc_archflag.m4 \ + $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ + $(top_srcdir)/m4/ax_submodule.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = include/osl/scop.h +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" \ + "$(DESTDIR)$(pkgextensionsincludedir)" \ + "$(DESTDIR)$(pkgincludedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libosl_la_LIBADD = +am__dirstamp = $(am__leading_dot)dirstamp +am_libosl_la_OBJECTS = source/libosl_la-scop.lo \ + source/libosl_la-statement.lo \ + source/extensions/libosl_la-textual.lo \ + source/extensions/libosl_la-comment.lo \ + source/extensions/libosl_la-null.lo \ + source/extensions/libosl_la-clay.lo \ + source/extensions/libosl_la-dependence.lo \ + source/extensions/libosl_la-scatnames.lo \ + source/extensions/libosl_la-arrays.lo \ + source/extensions/libosl_la-coordinates.lo \ + source/extensions/libosl_la-irregular.lo \ + source/extensions/libosl_la-symbols.lo \ + source/extensions/libosl_la-extbody.lo \ + source/extensions/libosl_la-loop.lo \ + source/extensions/libosl_la-pluto_unroll.lo \ + source/libosl_la-interface.lo source/libosl_la-generic.lo \ + source/libosl_la-relation.lo source/libosl_la-relation_list.lo \ + source/libosl_la-vector.lo source/libosl_la-names.lo \ + source/libosl_la-strings.lo source/libosl_la-body.lo \ + source/libosl_la-int.lo source/libosl_la-util.lo +libosl_la_OBJECTS = $(am_libosl_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libosl_la_SOURCES) +DIST_SOURCES = $(libosl_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(pkgextensionsinclude_HEADERS) $(pkginclude_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CD = @CD@ +CFLAGS = @CFLAGS@ +CFLAGS_WARN = @CFLAGS_WARN@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOXYGEN = @DOXYGEN@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PRTDIAG = @PRTDIAG@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TEXI2PDF = @TEXI2PDF@ +VERSION = @VERSION@ +VERSION_MAJOR = @VERSION_MAJOR@ +VERSION_MINOR = @VERSION_MINOR@ +VERSION_REVISION = @VERSION_REVISION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = subdir-objects +SUBDIRS = . doc tests +ACLOCAL_AMFLAGS = -I m4 + +############################################################################# +lib_LTLIBRARIES = libosl.la + +############################################################################# +pkginclude_HEADERS = \ + include/osl/osl.h \ + include/osl/statement.h \ + include/osl/interface.h \ + include/osl/generic.h \ + include/osl/vector.h \ + include/osl/relation.h \ + include/osl/relation_list.h \ + include/osl/macros.h \ + include/osl/int.h \ + include/osl/names.h \ + include/osl/strings.h \ + include/osl/body.h \ + include/osl/util.h \ + include/osl/scop.h + +pkgextensionsincludedir = $(pkgincludedir)/extensions +pkgextensionsinclude_HEADERS = \ + include/osl/extensions/textual.h \ + include/osl/extensions/comment.h \ + include/osl/extensions/null.h \ + include/osl/extensions/clay.h \ + include/osl/extensions/dependence.h \ + include/osl/extensions/scatnames.h \ + include/osl/extensions/arrays.h \ + include/osl/extensions/coordinates.h \ + include/osl/extensions/irregular.h \ + include/osl/extensions/symbols.h \ + include/osl/extensions/loop.h \ + include/osl/extensions/extbody.h \ + include/osl/extensions/pluto_unroll.h + +AM_CPPFLAGS = -I. -I$(top_builddir)/include -I$(top_srcdir)/include +AM_CFLAGS = $(CFLAGS_WARN) + +############################################################################# +libosl_la_CPPFLAGS = -I. -I$(top_builddir)/include -I$(top_srcdir)/include -g +libosl_la_SOURCES = \ + source/scop.c \ + source/statement.c \ + source/extensions/textual.c \ + source/extensions/comment.c \ + source/extensions/null.c \ + source/extensions/clay.c \ + source/extensions/dependence.c \ + source/extensions/scatnames.c \ + source/extensions/arrays.c \ + source/extensions/coordinates.c \ + source/extensions/irregular.c \ + source/extensions/symbols.c \ + source/extensions/extbody.c \ + source/extensions/loop.c \ + source/extensions/pluto_unroll.c \ + source/interface.c \ + source/generic.c \ + source/relation.c \ + source/relation_list.c \ + source/vector.c \ + source/names.c \ + source/strings.c \ + source/body.c \ + source/int.c \ + source/util.c + +MAINTAINERCLEANFILES = \ + Makefile.in \ + aclocal.m4 \ + configure \ + source/stamp-h.in \ + $(AUX_DIST) + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): +include/osl/scop.h: $(top_builddir)/config.status $(top_srcdir)/include/osl/scop.h.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +source/$(am__dirstamp): + @$(MKDIR_P) source + @: > source/$(am__dirstamp) +source/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) source/$(DEPDIR) + @: > source/$(DEPDIR)/$(am__dirstamp) +source/libosl_la-scop.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libosl_la-statement.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/extensions/$(am__dirstamp): + @$(MKDIR_P) source/extensions + @: > source/extensions/$(am__dirstamp) +source/extensions/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) source/extensions/$(DEPDIR) + @: > source/extensions/$(DEPDIR)/$(am__dirstamp) +source/extensions/libosl_la-textual.lo: \ + source/extensions/$(am__dirstamp) \ + source/extensions/$(DEPDIR)/$(am__dirstamp) +source/extensions/libosl_la-comment.lo: \ + source/extensions/$(am__dirstamp) \ + source/extensions/$(DEPDIR)/$(am__dirstamp) +source/extensions/libosl_la-null.lo: \ + source/extensions/$(am__dirstamp) \ + source/extensions/$(DEPDIR)/$(am__dirstamp) +source/extensions/libosl_la-clay.lo: \ + source/extensions/$(am__dirstamp) \ + source/extensions/$(DEPDIR)/$(am__dirstamp) +source/extensions/libosl_la-dependence.lo: \ + source/extensions/$(am__dirstamp) \ + source/extensions/$(DEPDIR)/$(am__dirstamp) +source/extensions/libosl_la-scatnames.lo: \ + source/extensions/$(am__dirstamp) \ + source/extensions/$(DEPDIR)/$(am__dirstamp) +source/extensions/libosl_la-arrays.lo: \ + source/extensions/$(am__dirstamp) \ + source/extensions/$(DEPDIR)/$(am__dirstamp) +source/extensions/libosl_la-coordinates.lo: \ + source/extensions/$(am__dirstamp) \ + source/extensions/$(DEPDIR)/$(am__dirstamp) +source/extensions/libosl_la-irregular.lo: \ + source/extensions/$(am__dirstamp) \ + source/extensions/$(DEPDIR)/$(am__dirstamp) +source/extensions/libosl_la-symbols.lo: \ + source/extensions/$(am__dirstamp) \ + source/extensions/$(DEPDIR)/$(am__dirstamp) +source/extensions/libosl_la-extbody.lo: \ + source/extensions/$(am__dirstamp) \ + source/extensions/$(DEPDIR)/$(am__dirstamp) +source/extensions/libosl_la-loop.lo: \ + source/extensions/$(am__dirstamp) \ + source/extensions/$(DEPDIR)/$(am__dirstamp) +source/extensions/libosl_la-pluto_unroll.lo: \ + source/extensions/$(am__dirstamp) \ + source/extensions/$(DEPDIR)/$(am__dirstamp) +source/libosl_la-interface.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libosl_la-generic.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libosl_la-relation.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libosl_la-relation_list.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libosl_la-vector.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libosl_la-names.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libosl_la-strings.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libosl_la-body.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libosl_la-int.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) +source/libosl_la-util.lo: source/$(am__dirstamp) \ + source/$(DEPDIR)/$(am__dirstamp) + +libosl.la: $(libosl_la_OBJECTS) $(libosl_la_DEPENDENCIES) $(EXTRA_libosl_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) -rpath $(libdir) $(libosl_la_OBJECTS) $(libosl_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f source/*.$(OBJEXT) + -rm -f source/*.lo + -rm -f source/extensions/*.$(OBJEXT) + -rm -f source/extensions/*.lo + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libosl_la-body.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libosl_la-generic.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libosl_la-int.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libosl_la-interface.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libosl_la-names.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libosl_la-relation.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libosl_la-relation_list.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libosl_la-scop.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libosl_la-statement.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libosl_la-strings.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libosl_la-util.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/libosl_la-vector.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/extensions/$(DEPDIR)/libosl_la-arrays.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/extensions/$(DEPDIR)/libosl_la-clay.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/extensions/$(DEPDIR)/libosl_la-comment.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/extensions/$(DEPDIR)/libosl_la-coordinates.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/extensions/$(DEPDIR)/libosl_la-dependence.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/extensions/$(DEPDIR)/libosl_la-extbody.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/extensions/$(DEPDIR)/libosl_la-irregular.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/extensions/$(DEPDIR)/libosl_la-loop.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/extensions/$(DEPDIR)/libosl_la-null.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/extensions/$(DEPDIR)/libosl_la-pluto_unroll.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/extensions/$(DEPDIR)/libosl_la-scatnames.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/extensions/$(DEPDIR)/libosl_la-symbols.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@source/extensions/$(DEPDIR)/libosl_la-textual.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +source/libosl_la-scop.lo: source/scop.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libosl_la-scop.lo -MD -MP -MF source/$(DEPDIR)/libosl_la-scop.Tpo -c -o source/libosl_la-scop.lo `test -f 'source/scop.c' || echo '$(srcdir)/'`source/scop.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libosl_la-scop.Tpo source/$(DEPDIR)/libosl_la-scop.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/scop.c' object='source/libosl_la-scop.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libosl_la-scop.lo `test -f 'source/scop.c' || echo '$(srcdir)/'`source/scop.c + +source/libosl_la-statement.lo: source/statement.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libosl_la-statement.lo -MD -MP -MF source/$(DEPDIR)/libosl_la-statement.Tpo -c -o source/libosl_la-statement.lo `test -f 'source/statement.c' || echo '$(srcdir)/'`source/statement.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libosl_la-statement.Tpo source/$(DEPDIR)/libosl_la-statement.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/statement.c' object='source/libosl_la-statement.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libosl_la-statement.lo `test -f 'source/statement.c' || echo '$(srcdir)/'`source/statement.c + +source/extensions/libosl_la-textual.lo: source/extensions/textual.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/extensions/libosl_la-textual.lo -MD -MP -MF source/extensions/$(DEPDIR)/libosl_la-textual.Tpo -c -o source/extensions/libosl_la-textual.lo `test -f 'source/extensions/textual.c' || echo '$(srcdir)/'`source/extensions/textual.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/extensions/$(DEPDIR)/libosl_la-textual.Tpo source/extensions/$(DEPDIR)/libosl_la-textual.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/extensions/textual.c' object='source/extensions/libosl_la-textual.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/extensions/libosl_la-textual.lo `test -f 'source/extensions/textual.c' || echo '$(srcdir)/'`source/extensions/textual.c + +source/extensions/libosl_la-comment.lo: source/extensions/comment.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/extensions/libosl_la-comment.lo -MD -MP -MF source/extensions/$(DEPDIR)/libosl_la-comment.Tpo -c -o source/extensions/libosl_la-comment.lo `test -f 'source/extensions/comment.c' || echo '$(srcdir)/'`source/extensions/comment.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/extensions/$(DEPDIR)/libosl_la-comment.Tpo source/extensions/$(DEPDIR)/libosl_la-comment.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/extensions/comment.c' object='source/extensions/libosl_la-comment.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/extensions/libosl_la-comment.lo `test -f 'source/extensions/comment.c' || echo '$(srcdir)/'`source/extensions/comment.c + +source/extensions/libosl_la-null.lo: source/extensions/null.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/extensions/libosl_la-null.lo -MD -MP -MF source/extensions/$(DEPDIR)/libosl_la-null.Tpo -c -o source/extensions/libosl_la-null.lo `test -f 'source/extensions/null.c' || echo '$(srcdir)/'`source/extensions/null.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/extensions/$(DEPDIR)/libosl_la-null.Tpo source/extensions/$(DEPDIR)/libosl_la-null.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/extensions/null.c' object='source/extensions/libosl_la-null.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/extensions/libosl_la-null.lo `test -f 'source/extensions/null.c' || echo '$(srcdir)/'`source/extensions/null.c + +source/extensions/libosl_la-clay.lo: source/extensions/clay.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/extensions/libosl_la-clay.lo -MD -MP -MF source/extensions/$(DEPDIR)/libosl_la-clay.Tpo -c -o source/extensions/libosl_la-clay.lo `test -f 'source/extensions/clay.c' || echo '$(srcdir)/'`source/extensions/clay.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/extensions/$(DEPDIR)/libosl_la-clay.Tpo source/extensions/$(DEPDIR)/libosl_la-clay.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/extensions/clay.c' object='source/extensions/libosl_la-clay.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/extensions/libosl_la-clay.lo `test -f 'source/extensions/clay.c' || echo '$(srcdir)/'`source/extensions/clay.c + +source/extensions/libosl_la-dependence.lo: source/extensions/dependence.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/extensions/libosl_la-dependence.lo -MD -MP -MF source/extensions/$(DEPDIR)/libosl_la-dependence.Tpo -c -o source/extensions/libosl_la-dependence.lo `test -f 'source/extensions/dependence.c' || echo '$(srcdir)/'`source/extensions/dependence.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/extensions/$(DEPDIR)/libosl_la-dependence.Tpo source/extensions/$(DEPDIR)/libosl_la-dependence.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/extensions/dependence.c' object='source/extensions/libosl_la-dependence.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/extensions/libosl_la-dependence.lo `test -f 'source/extensions/dependence.c' || echo '$(srcdir)/'`source/extensions/dependence.c + +source/extensions/libosl_la-scatnames.lo: source/extensions/scatnames.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/extensions/libosl_la-scatnames.lo -MD -MP -MF source/extensions/$(DEPDIR)/libosl_la-scatnames.Tpo -c -o source/extensions/libosl_la-scatnames.lo `test -f 'source/extensions/scatnames.c' || echo '$(srcdir)/'`source/extensions/scatnames.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/extensions/$(DEPDIR)/libosl_la-scatnames.Tpo source/extensions/$(DEPDIR)/libosl_la-scatnames.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/extensions/scatnames.c' object='source/extensions/libosl_la-scatnames.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/extensions/libosl_la-scatnames.lo `test -f 'source/extensions/scatnames.c' || echo '$(srcdir)/'`source/extensions/scatnames.c + +source/extensions/libosl_la-arrays.lo: source/extensions/arrays.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/extensions/libosl_la-arrays.lo -MD -MP -MF source/extensions/$(DEPDIR)/libosl_la-arrays.Tpo -c -o source/extensions/libosl_la-arrays.lo `test -f 'source/extensions/arrays.c' || echo '$(srcdir)/'`source/extensions/arrays.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/extensions/$(DEPDIR)/libosl_la-arrays.Tpo source/extensions/$(DEPDIR)/libosl_la-arrays.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/extensions/arrays.c' object='source/extensions/libosl_la-arrays.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/extensions/libosl_la-arrays.lo `test -f 'source/extensions/arrays.c' || echo '$(srcdir)/'`source/extensions/arrays.c + +source/extensions/libosl_la-coordinates.lo: source/extensions/coordinates.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/extensions/libosl_la-coordinates.lo -MD -MP -MF source/extensions/$(DEPDIR)/libosl_la-coordinates.Tpo -c -o source/extensions/libosl_la-coordinates.lo `test -f 'source/extensions/coordinates.c' || echo '$(srcdir)/'`source/extensions/coordinates.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/extensions/$(DEPDIR)/libosl_la-coordinates.Tpo source/extensions/$(DEPDIR)/libosl_la-coordinates.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/extensions/coordinates.c' object='source/extensions/libosl_la-coordinates.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/extensions/libosl_la-coordinates.lo `test -f 'source/extensions/coordinates.c' || echo '$(srcdir)/'`source/extensions/coordinates.c + +source/extensions/libosl_la-irregular.lo: source/extensions/irregular.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/extensions/libosl_la-irregular.lo -MD -MP -MF source/extensions/$(DEPDIR)/libosl_la-irregular.Tpo -c -o source/extensions/libosl_la-irregular.lo `test -f 'source/extensions/irregular.c' || echo '$(srcdir)/'`source/extensions/irregular.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/extensions/$(DEPDIR)/libosl_la-irregular.Tpo source/extensions/$(DEPDIR)/libosl_la-irregular.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/extensions/irregular.c' object='source/extensions/libosl_la-irregular.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/extensions/libosl_la-irregular.lo `test -f 'source/extensions/irregular.c' || echo '$(srcdir)/'`source/extensions/irregular.c + +source/extensions/libosl_la-symbols.lo: source/extensions/symbols.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/extensions/libosl_la-symbols.lo -MD -MP -MF source/extensions/$(DEPDIR)/libosl_la-symbols.Tpo -c -o source/extensions/libosl_la-symbols.lo `test -f 'source/extensions/symbols.c' || echo '$(srcdir)/'`source/extensions/symbols.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/extensions/$(DEPDIR)/libosl_la-symbols.Tpo source/extensions/$(DEPDIR)/libosl_la-symbols.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/extensions/symbols.c' object='source/extensions/libosl_la-symbols.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/extensions/libosl_la-symbols.lo `test -f 'source/extensions/symbols.c' || echo '$(srcdir)/'`source/extensions/symbols.c + +source/extensions/libosl_la-extbody.lo: source/extensions/extbody.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/extensions/libosl_la-extbody.lo -MD -MP -MF source/extensions/$(DEPDIR)/libosl_la-extbody.Tpo -c -o source/extensions/libosl_la-extbody.lo `test -f 'source/extensions/extbody.c' || echo '$(srcdir)/'`source/extensions/extbody.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/extensions/$(DEPDIR)/libosl_la-extbody.Tpo source/extensions/$(DEPDIR)/libosl_la-extbody.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/extensions/extbody.c' object='source/extensions/libosl_la-extbody.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/extensions/libosl_la-extbody.lo `test -f 'source/extensions/extbody.c' || echo '$(srcdir)/'`source/extensions/extbody.c + +source/extensions/libosl_la-loop.lo: source/extensions/loop.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/extensions/libosl_la-loop.lo -MD -MP -MF source/extensions/$(DEPDIR)/libosl_la-loop.Tpo -c -o source/extensions/libosl_la-loop.lo `test -f 'source/extensions/loop.c' || echo '$(srcdir)/'`source/extensions/loop.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/extensions/$(DEPDIR)/libosl_la-loop.Tpo source/extensions/$(DEPDIR)/libosl_la-loop.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/extensions/loop.c' object='source/extensions/libosl_la-loop.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/extensions/libosl_la-loop.lo `test -f 'source/extensions/loop.c' || echo '$(srcdir)/'`source/extensions/loop.c + +source/extensions/libosl_la-pluto_unroll.lo: source/extensions/pluto_unroll.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/extensions/libosl_la-pluto_unroll.lo -MD -MP -MF source/extensions/$(DEPDIR)/libosl_la-pluto_unroll.Tpo -c -o source/extensions/libosl_la-pluto_unroll.lo `test -f 'source/extensions/pluto_unroll.c' || echo '$(srcdir)/'`source/extensions/pluto_unroll.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/extensions/$(DEPDIR)/libosl_la-pluto_unroll.Tpo source/extensions/$(DEPDIR)/libosl_la-pluto_unroll.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/extensions/pluto_unroll.c' object='source/extensions/libosl_la-pluto_unroll.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/extensions/libosl_la-pluto_unroll.lo `test -f 'source/extensions/pluto_unroll.c' || echo '$(srcdir)/'`source/extensions/pluto_unroll.c + +source/libosl_la-interface.lo: source/interface.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libosl_la-interface.lo -MD -MP -MF source/$(DEPDIR)/libosl_la-interface.Tpo -c -o source/libosl_la-interface.lo `test -f 'source/interface.c' || echo '$(srcdir)/'`source/interface.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libosl_la-interface.Tpo source/$(DEPDIR)/libosl_la-interface.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/interface.c' object='source/libosl_la-interface.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libosl_la-interface.lo `test -f 'source/interface.c' || echo '$(srcdir)/'`source/interface.c + +source/libosl_la-generic.lo: source/generic.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libosl_la-generic.lo -MD -MP -MF source/$(DEPDIR)/libosl_la-generic.Tpo -c -o source/libosl_la-generic.lo `test -f 'source/generic.c' || echo '$(srcdir)/'`source/generic.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libosl_la-generic.Tpo source/$(DEPDIR)/libosl_la-generic.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/generic.c' object='source/libosl_la-generic.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libosl_la-generic.lo `test -f 'source/generic.c' || echo '$(srcdir)/'`source/generic.c + +source/libosl_la-relation.lo: source/relation.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libosl_la-relation.lo -MD -MP -MF source/$(DEPDIR)/libosl_la-relation.Tpo -c -o source/libosl_la-relation.lo `test -f 'source/relation.c' || echo '$(srcdir)/'`source/relation.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libosl_la-relation.Tpo source/$(DEPDIR)/libosl_la-relation.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/relation.c' object='source/libosl_la-relation.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libosl_la-relation.lo `test -f 'source/relation.c' || echo '$(srcdir)/'`source/relation.c + +source/libosl_la-relation_list.lo: source/relation_list.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libosl_la-relation_list.lo -MD -MP -MF source/$(DEPDIR)/libosl_la-relation_list.Tpo -c -o source/libosl_la-relation_list.lo `test -f 'source/relation_list.c' || echo '$(srcdir)/'`source/relation_list.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libosl_la-relation_list.Tpo source/$(DEPDIR)/libosl_la-relation_list.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/relation_list.c' object='source/libosl_la-relation_list.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libosl_la-relation_list.lo `test -f 'source/relation_list.c' || echo '$(srcdir)/'`source/relation_list.c + +source/libosl_la-vector.lo: source/vector.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libosl_la-vector.lo -MD -MP -MF source/$(DEPDIR)/libosl_la-vector.Tpo -c -o source/libosl_la-vector.lo `test -f 'source/vector.c' || echo '$(srcdir)/'`source/vector.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libosl_la-vector.Tpo source/$(DEPDIR)/libosl_la-vector.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/vector.c' object='source/libosl_la-vector.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libosl_la-vector.lo `test -f 'source/vector.c' || echo '$(srcdir)/'`source/vector.c + +source/libosl_la-names.lo: source/names.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libosl_la-names.lo -MD -MP -MF source/$(DEPDIR)/libosl_la-names.Tpo -c -o source/libosl_la-names.lo `test -f 'source/names.c' || echo '$(srcdir)/'`source/names.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libosl_la-names.Tpo source/$(DEPDIR)/libosl_la-names.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/names.c' object='source/libosl_la-names.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libosl_la-names.lo `test -f 'source/names.c' || echo '$(srcdir)/'`source/names.c + +source/libosl_la-strings.lo: source/strings.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libosl_la-strings.lo -MD -MP -MF source/$(DEPDIR)/libosl_la-strings.Tpo -c -o source/libosl_la-strings.lo `test -f 'source/strings.c' || echo '$(srcdir)/'`source/strings.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libosl_la-strings.Tpo source/$(DEPDIR)/libosl_la-strings.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/strings.c' object='source/libosl_la-strings.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libosl_la-strings.lo `test -f 'source/strings.c' || echo '$(srcdir)/'`source/strings.c + +source/libosl_la-body.lo: source/body.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libosl_la-body.lo -MD -MP -MF source/$(DEPDIR)/libosl_la-body.Tpo -c -o source/libosl_la-body.lo `test -f 'source/body.c' || echo '$(srcdir)/'`source/body.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libosl_la-body.Tpo source/$(DEPDIR)/libosl_la-body.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/body.c' object='source/libosl_la-body.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libosl_la-body.lo `test -f 'source/body.c' || echo '$(srcdir)/'`source/body.c + +source/libosl_la-int.lo: source/int.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libosl_la-int.lo -MD -MP -MF source/$(DEPDIR)/libosl_la-int.Tpo -c -o source/libosl_la-int.lo `test -f 'source/int.c' || echo '$(srcdir)/'`source/int.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libosl_la-int.Tpo source/$(DEPDIR)/libosl_la-int.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/int.c' object='source/libosl_la-int.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libosl_la-int.lo `test -f 'source/int.c' || echo '$(srcdir)/'`source/int.c + +source/libosl_la-util.lo: source/util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source/libosl_la-util.lo -MD -MP -MF source/$(DEPDIR)/libosl_la-util.Tpo -c -o source/libosl_la-util.lo `test -f 'source/util.c' || echo '$(srcdir)/'`source/util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) source/$(DEPDIR)/libosl_la-util.Tpo source/$(DEPDIR)/libosl_la-util.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='source/util.c' object='source/libosl_la-util.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libosl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source/libosl_la-util.lo `test -f 'source/util.c' || echo '$(srcdir)/'`source/util.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf source/.libs source/_libs + -rm -rf source/extensions/.libs source/extensions/_libs + +distclean-libtool: + -rm -f libtool config.lt +install-pkgextensionsincludeHEADERS: $(pkgextensionsinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(pkgextensionsinclude_HEADERS)'; test -n "$(pkgextensionsincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgextensionsincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgextensionsincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgextensionsincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgextensionsincludedir)" || exit $$?; \ + done + +uninstall-pkgextensionsincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkgextensionsinclude_HEADERS)'; test -n "$(pkgextensionsincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgextensionsincludedir)'; $(am__uninstall_files_from_dir) +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgextensionsincludedir)" "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f source/$(DEPDIR)/$(am__dirstamp) + -rm -f source/$(am__dirstamp) + -rm -f source/extensions/$(DEPDIR)/$(am__dirstamp) + -rm -f source/extensions/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-recursive + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf source/$(DEPDIR) source/extensions/$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-pkgextensionsincludeHEADERS \ + install-pkgincludeHEADERS + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf source/$(DEPDIR) source/extensions/$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES \ + uninstall-pkgextensionsincludeHEADERS \ + uninstall-pkgincludeHEADERS + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + clean-libLTLIBRARIES clean-libtool cscope cscopelist-am ctags \ + ctags-am dist dist-all dist-bzip2 dist-gzip dist-lzip \ + dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-pdf install-pdf-am \ + install-pkgextensionsincludeHEADERS install-pkgincludeHEADERS \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \ + uninstall-pkgextensionsincludeHEADERS \ + uninstall-pkgincludeHEADERS + + +############################################################################# + +ctags: + ctags -R --c++-kinds=+p --fields=+iaS --extra=+q -f$(HOME)/.ctags . + +############################################################################# + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru cloog-0.18.2/osl/NEWS cloog-0.18.4/osl/NEWS --- cloog-0.18.2/osl/NEWS 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/NEWS 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,2 @@ +Some news... + diff -Nru cloog-0.18.2/osl/README cloog-0.18.4/osl/README --- cloog-0.18.2/osl/README 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/README 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,30 @@ +* * * * * * * * * * * * * * +* OpenScop Library 0.9.0 * +* * * * * * * * * * * * * * + +Install with Makefile +--------------------- + +$> ./autogen.sh +$> ./configure +$> make +$> make install + + +Alternative: Install with CMake +------------------------------- + +$> mkdir build +$> cd build +$> cmake .. # -DCMAKE_INSTALL_PREFIX="/your/install/directory" +$> make +$> make test +$> # make install # sudo make install # su -c "make install" +$> make doc + + +Support +------- + +Please contact: +openscop-development@googlegroups.com diff -Nru cloog-0.18.2/osl/source/body.c cloog-0.18.4/osl/source/body.c --- cloog-0.18.2/osl/source/body.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/body.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,404 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** body.c ** + **-----------------------------------------------------------------** + ** First version: 25/06/2011 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +# include +# include +# include +# include +# include +# include +# include +# include +# include + + +/*+*************************************************************************** + * Structure display functions * + *****************************************************************************/ + + +/** + * osl_body_idump function: + * this function displays an osl_body_t structure (*body) into a + * file (file, possibly stdout) in a way that trends to be understandable. + * It includes an indentation level (level) in order to work with others + * dumping functions. + * \param[in] file File where informations are printed. + * \param[in] body The body whose information has to be printed. + * \param[in] level Number of spaces before printing, for each line. + */ +void osl_body_idump(FILE * file, osl_body_p body, int level) { + int j; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (body != NULL) { + fprintf(file, "+-- osl_body_t\n"); + + // A blank line. + for (j = 0; j <= level+1; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); + + // Print the iterators + osl_strings_idump(file, body->iterators, level + 1); + + // Print the original body expression. + osl_strings_idump(file, body->expression, level + 1); + } + else { + fprintf(file, "+-- NULL body\n"); + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_body_dump function: + * this function prints the content of an osl_body_t structure + * (*body) into a file (file, possibly stdout). + * \param[in] file File where informations are printed. + * \param[in] body The body whose information has to be printed. + */ +void osl_body_dump(FILE * file, osl_body_p body) { + osl_body_idump(file, body, 0); +} + + +/** + * osl_body_print function: + * this function prints the content of an osl_body_t structure + * (*body) into a file (file, possibly stdout) in the OpenScop format. + * \param[in] file File where informations are printed. + * \param[in] body The body whose information has to be printed. + */ +void osl_body_print(FILE * file, osl_body_p body) { + int nb_iterators; + + if (body != NULL) { + nb_iterators = osl_strings_size(body->iterators); + fprintf(file, "# Number of original iterators\n"); + fprintf(file, "%d\n", nb_iterators); + + if (nb_iterators > 0) { + fprintf(file, "\n# List of original iterators\n"); + osl_strings_print(file, body->iterators); + } + + fprintf(file, "\n# Statement body expression\n"); + osl_strings_print(file, body->expression); + } + else { + fprintf(file, "# NULL statement body\n"); + } +} + + +/** + * osl_body_print_scoplib function: + * this function prints the content of an osl_body_t structure + * (*body) into a file (file, possibly stdout) in the SCoPLib format. + * \param[in] file File where informations are printed. + * \param[in] body The body whose information has to be printed. + */ +void osl_body_print_scoplib(FILE * file, osl_body_p body) { + int nb_iterators; + + if (body != NULL) { + nb_iterators = osl_strings_size(body->iterators); + + if (nb_iterators > 0) { + fprintf(file, "# List of original iterators\n"); + osl_strings_print(file, body->iterators); + } else { + fprintf(file, "fakeiter\n"); + } + + fprintf(file, "# Statement body expression\n"); + osl_strings_print(file, body->expression); + } + else { + fprintf(file, "# NULL statement body\n"); + } +} + + +/** + * osl_body_sprint function: + * this function prints the content of an osl_body_t structure + * (*body) into a string (returned) in the OpenScop textual format. + * \param[in] body The body structure which has to be printed. + * \return A string containing the OpenScop dump of the body structure. + */ +char * osl_body_sprint(osl_body_p body) { + int nb_iterators; + int high_water_mark = OSL_MAX_STRING; + char * string = NULL; + char buffer[OSL_MAX_STRING]; + char * iterators, * expression; + + OSL_malloc(string, char *, high_water_mark * sizeof(char)); + string[0] = '\0'; + + if (body != NULL) { + nb_iterators = osl_strings_size(body->iterators); + sprintf(buffer, "# Number of original iterators\n%d\n", nb_iterators); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + if (nb_iterators > 0) { + sprintf(buffer, "# List of original iterators\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + iterators = osl_strings_sprint(body->iterators); + osl_util_safe_strcat(&string, iterators, &high_water_mark); + free(iterators); + } + + sprintf(buffer, "# Statement body expression\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + expression = osl_strings_sprint(body->expression); + osl_util_safe_strcat(&string, expression, &high_water_mark); + free(expression); + } + else { + sprintf(buffer, "# NULL body\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + return string; +} + + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/** + * osl_body_read function: + * this function reads a body structure from a string complying to the + * OpenScop textual format and returns a pointer to this body structure. + * The input string should only contain the body this function + * has to read (comments at the end of the line are accepted). The input + * parameter is updated to the position in the input string this function + * reach right after reading the strings structure. + * \param[in,out] input The input string where to find a body structure. + * Updated to the position after what has been read. + * \return A pointer to the body structure that has been read. + */ +osl_body_p osl_body_sread(char ** input) { + osl_body_p body = NULL; + char * expression; + int nb_iterators; + + if (input) { + body = osl_body_malloc(); + + // Read the number of iterators. + nb_iterators = osl_util_read_int(NULL, input); + + // Read the iterator strings if any. + if (nb_iterators > 0) { + body->iterators = osl_strings_sread(input); + } + else { + body->iterators = osl_strings_malloc(); + } + + // Read the body: + expression = osl_util_read_line(NULL, input); + + // Insert the body. + body->expression = osl_strings_encapsulate(expression); + } + + return body; +} + + +/*+*************************************************************************** + * Memory allocation/deallocation functions * + *****************************************************************************/ + + +/** + * osl_body_malloc function: + * this function allocates the memory space for an osl_body_t + * structure and sets its fields with default values. Then it returns a pointer + * to the allocated space. + * \return A pointer to an empty body with fields set to default values. + */ +osl_body_p osl_body_malloc() { + osl_body_p body; + + OSL_malloc(body, osl_body_p, sizeof(osl_body_t)); + body->iterators = NULL; + body->expression = NULL; + + return body; +} + + +/** + * osl_body_free function: + * this function frees the allocated memory for an osl_body_t + * structure. + * \param[in,out] body The pointer to the body we want to free. + */ +void osl_body_free(osl_body_p body) { + + if (body != NULL) { + osl_strings_free(body->iterators); + osl_strings_free(body->expression); + free(body); + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_body_clone function: + * this functions builds and returns a "hard copy" (not a pointer copy) of an + * osl_body_t data structure provided as parameter. However, let us + * recall here that non-string elements are untouched by the OpenScop Library. + * \param[in] body The pointer to the body we want to copy. + * \return A pointer to the full copy of the body provided as parameter. + */ +osl_body_p osl_body_clone(osl_body_p body) { + osl_body_p copy = NULL; + + if (body != NULL) { + copy = osl_body_malloc(); + copy->iterators = osl_strings_clone(body->iterators); + copy->expression = osl_strings_clone(body->expression); + } + + return copy; +} + + +/** + * osl_body_equal function: + * this function returns true if the two bodies are the same, false + * otherwise (the usr field is not tested). However, let us + * recall here that non-string elements are untouched by the OpenScop Library. + * \param[in] b1 The first body. + * \param[in] b2 The second body. + * \return 1 if b1 and b2 are the same (content-wise), 0 otherwise. + */ +int osl_body_equal(osl_body_p b1, osl_body_p b2) { + + if (b1 == b2) + return 1; + + if (((b1 != NULL) && (b2 == NULL)) || + ((b1 == NULL) && (b2 != NULL))) { + OSL_info("bodies are not the same"); + return 0; + } + + if (!osl_strings_equal(b1->iterators, b2->iterators)) { + OSL_info("body iterators are not the same"); + return 0; + } + + if (!osl_strings_equal(b1->expression, b2->expression)) { + OSL_info("body expressions are not the same"); + return 0; + } + + return 1; +} + + +/** + * osl_body_interface function: + * this function creates an interface structure corresponding to the body + * structure and returns it). + * \return An interface structure for the body structure. + */ +osl_interface_p osl_body_interface() { + osl_interface_p interface = osl_interface_malloc(); + + OSL_strdup(interface->URI, OSL_URI_BODY); + interface->idump = (osl_idump_f)osl_body_idump; + interface->sprint = (osl_sprint_f)osl_body_sprint; + interface->sread = (osl_sread_f)osl_body_sread; + interface->malloc = (osl_malloc_f)osl_body_malloc; + interface->free = (osl_free_f)osl_body_free; + interface->clone = (osl_clone_f)osl_body_clone; + interface->equal = (osl_equal_f)osl_body_equal; + + return interface; +} + diff -Nru cloog-0.18.2/osl/source/extensions/arrays.c cloog-0.18.4/osl/source/extensions/arrays.c --- cloog-0.18.2/osl/source/extensions/arrays.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/extensions/arrays.c 2014-10-02 15:41:04.000000000 +0000 @@ -0,0 +1,474 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/arrays.c ** + **-----------------------------------------------------------------** + ** First version: 07/12/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_arrays_idump function: + * this function displays an osl_arrays_t structure (*arrays) into a file + * (file, possibly stdout) in a way that trends to be understandable. It + * includes an indentation level (level) in order to work with others + * idump functions. + * \param[in] file The file where the information has to be printed. + * \param[in] arrays The arrays structure to print. + * \param[in] level Number of spaces before printing, for each line. + */ +void osl_arrays_idump(FILE * file, osl_arrays_p arrays, int level) { + int i, j; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (arrays != NULL) + fprintf(file, "+-- osl_arrays_t\n"); + else + fprintf(file, "+-- NULL arrays\n"); + + if (arrays != NULL) { + // Go to the right level. + for(j = 0; j <= level; j++) + fprintf(file, "|\t"); + + // Display the number of names. + fprintf(file, "nb_names: %d\n", arrays->nb_names); + + // Display the id/name. + for(i = 0; i < arrays->nb_names; i++) { + // Go to the right level. + for(j = 0; j <= level; j++) + fprintf(file, "|\t"); + + fprintf(file, "id: %2d, name: %s\n", arrays->id[i], arrays->names[i]); + } + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_arrays_dump function: + * this function prints the content of an osl_arrays_t structure + * (*arrays) into a file (file, possibly stdout). + * \param[in] file The file where the information has to be printed. + * \param[in] arrays The arrays structure to print. + */ +void osl_arrays_dump(FILE * file, osl_arrays_p arrays) { + osl_arrays_idump(file, arrays, 0); +} + + +/** + * osl_arrays_sprint function: + * this function prints the content of an osl_arrays_t structure + * (*arrays) into a string (returned) in the OpenScop textual format. + * \param[in] arrays The arrays structure to print. + * \return A string containing the OpenScop dump of the arrays structure. + */ +char * osl_arrays_sprint(osl_arrays_p arrays) { + int i; + int high_water_mark = OSL_MAX_STRING; + char * string = NULL; + char buffer[OSL_MAX_STRING]; + + if (arrays != NULL) { + OSL_malloc(string, char *, high_water_mark * sizeof(char)); + string[0] = '\0'; + + sprintf(buffer, "# Number of arrays\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + sprintf(buffer, "%d\n", arrays->nb_names); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + if (arrays->nb_names) { + sprintf(buffer, "# Mapping array-identifiers/array-names\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + for (i = 0; i < arrays->nb_names; i++) { + sprintf(buffer, "%d %s\n", arrays->id[i], arrays->names[i]); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + OSL_realloc(string, char *, (strlen(string) + 1) * sizeof(char)); + } + + return string; +} + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/** + * osl_arrays_sread function: + * this function reads an arrays structure from a string complying to the + * OpenScop textual format and returns a pointer to this arrays structure. + * The string should contain only one textual format of an arrays structure. + * The input parameter is updated to the position in the input string this + * function reach right after reading the comment structure. + * \param[in,out] input The input string where to find an arrays structure. + * Updated to the position after what has been read. + * \return A pointer to the arrays structure that has been read. + */ +osl_arrays_p osl_arrays_sread(char ** input) { + int i, k; + int nb_names; + osl_arrays_p arrays; + + if (input == NULL) { + OSL_debug("no arrays optional tag"); + return NULL; + } + + // Find the number of names provided. + nb_names = osl_util_read_int(NULL, input); + + // Allocate the array of id and names. + arrays = osl_arrays_malloc(); + OSL_malloc(arrays->id, int *, nb_names * sizeof(int)); + OSL_malloc(arrays->names, char **, nb_names * sizeof(char *)); + arrays->nb_names = nb_names; + for (i = 0; i < nb_names; i++) + arrays->names[i] = NULL; + + // Get each array id/name. + for (k = 0; k < nb_names; k++) { + // Get the array name id. + arrays->id[k] = osl_util_read_int(NULL, input); + + // Get the array name string. + arrays->names[k] = osl_util_read_string(NULL, input); + } + + return arrays; +} + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_arrays_malloc function: + * this function allocates the memory space for an osl_arrays_t + * structure and sets its fields with default values. Then it returns a + * pointer to the allocated space. + * \return A pointer to an empty arrays structure with fields set to + * default values. + */ +osl_arrays_p osl_arrays_malloc() { + osl_arrays_p arrays; + + OSL_malloc(arrays, osl_arrays_p, sizeof(osl_arrays_t)); + arrays->nb_names = 0; + arrays->id = NULL; + arrays->names = NULL; + + return arrays; +} + + +/** + * osl_arrays_free function: + * this function frees the allocated memory for an arrays structure. + * \param[in,out] arrays The pointer to the arrays structure we want to free. + */ +void osl_arrays_free(osl_arrays_p arrays) { + int i; + + if (arrays != NULL) { + free(arrays->id); + for (i = 0; i < arrays->nb_names; i++) + free(arrays->names[i]); + free(arrays->names); + free(arrays); + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_arrays_clone function: + * this function builds and returns a "hard copy" (not a pointer copy) of an + * osl_arrays_t data structure. + * \param[in] arrays The pointer to the arrays structure to clone. + * \return A pointer to the clone of the arrays structure. + */ +osl_arrays_p osl_arrays_clone(osl_arrays_p arrays) { + int i; + osl_arrays_p clone; + + if (arrays == NULL) + return NULL; + + clone = osl_arrays_malloc(); + clone->nb_names = arrays->nb_names; + OSL_malloc(clone->id, int *, arrays->nb_names * sizeof(int)); + OSL_malloc(clone->names, char **, arrays->nb_names * sizeof(char*)); + + for (i = 0; i < arrays->nb_names; i++) { + clone->id[i] = arrays->id[i]; + OSL_strdup(clone->names[i], arrays->names[i]); + } + + return clone; +} + + +/** + * osl_arrays_equal function: + * this function returns true if the two arrays structures are the same + * (content-wise), false otherwise. This functions considers two arrays + * structures as equal if the order of the array names differ, however the + * identifiers and names must be the same. + * \param[in] a1 The first arrays structure. + * \param[in] a2 The second arrays structure. + * \return 1 if a1 and a2 are the same (content-wise), 0 otherwise. + */ +int osl_arrays_equal(osl_arrays_p a1, osl_arrays_p a2) { + int i, j, found; + + if (a1 == a2) + return 1; + + if (((a1 == NULL) && (a2 != NULL)) || ((a1 != NULL) && (a2 == NULL))) { + OSL_info("arrays are not the same"); + return 0; + } + + // Check whether the number of names is the same. + if (a1->nb_names != a2->nb_names) { + OSL_info("arrays are not the same"); + return 0; + } + + // We accept a different order of the names, as long as the identifiers + // are the same. + for (i = 0; i < a1->nb_names; i++) { + found = 0; + for (j = 0; j < a2->nb_names; j++) { + if ((a1->id[i] == a2->id[j]) && (!strcmp(a1->names[i], a2->names[j]))) { + found = 1; + break; + } + } + if (found != 1) { + OSL_info("arrays are not the same"); + return 0; + } + } + + return 1; +} + + +/** + * osl_arrays_to_strings function: + * this function creates a strings structure containing the textual names + * contained in a names structure. Each name is placed according to its + * id in the strings array. The "empty" strings cells are filled with + * dummy names. + * \param[in] arrays The arrays structure to convert to a strings. + * \return A strings structure containing all the array names. + */ +osl_strings_p osl_arrays_to_strings(osl_arrays_p arrays) { + int i, max_id = 0; + osl_strings_p strings = NULL; + + if (arrays == NULL) + return NULL; + + // Find the maximum array id. + if (arrays->nb_names >= 1) { + max_id = arrays->id[0]; + for (i = 1; i < arrays->nb_names; i++) + if (arrays->id[i] > max_id) + max_id = arrays->id[i]; + } + + // Build a strings structure for this number of ids. + strings = osl_strings_generate("Dummy", max_id); + for (i = 0; i < arrays->nb_names; i++) { + free(strings->string[arrays->id[i] - 1]); + OSL_strdup(strings->string[arrays->id[i] - 1], arrays->names[i]); + } + + return strings; +} + +/** + * osl_arrays_add function: + * this function adds a new variable at the end of osl_array + * + * \param[in] arrays The arrays structure to modify. + * \param[in] id The new variable's id. + * \param[in] name The new variable's name. + * \return Updated number of elements, -1 means error + */ +int osl_arrays_add(osl_arrays_p arrays, int id, char* name) { + + if (arrays == NULL || name == NULL) + return -1; + + OSL_realloc(arrays->id, int *, (arrays->nb_names+1) * sizeof(int)); + OSL_realloc(arrays->names, char **, (arrays->nb_names+1) * sizeof(char *)); + arrays->id[arrays->nb_names] = id; + OSL_strdup(arrays->names[arrays->nb_names], name); + arrays->nb_names++; + + return arrays->nb_names; +} + + +/** + * osl_arrays_get_index_from_id function: + * this function the index of a variable given its identifier + * + * \param[in] arrays The arrays structure to modify. + * \param[in] id The variable's id. + * \return index of the variable, array->nb_names means error + */ +size_t osl_arrays_get_index_from_id(osl_arrays_p arrays, int id) { + size_t i = 0; + + if (arrays == NULL) + return 0; + + for (i=0; inb_names; i++) { + if(arrays->id[i]==id) + break; + } + + return inb_names? i: arrays->nb_names; +} + +/** + * osl_arrays_get_index_from_name function: + * this function the index of a variable given its name + * + * \param[in] arrays The arrays structure to modify. + * \param[in] name The variable's name. + * \return index of the variable, array->nb_names means error + */ +size_t osl_arrays_get_index_from_name(osl_arrays_p arrays, char* name) { + size_t i = 0; + + if (arrays == NULL || name == NULL) + return 0; + + for (i=0; inb_names; i++) { + if(!strcmp(arrays->names[i], name)) + break; + } + + return inb_names? i: arrays->nb_names;; +} + +/** + * osl_arrays_interface function: + * this function creates an interface structure corresponding to the arrays + * extension and returns it). + * \return An interface structure for the arrays extension. + */ +osl_interface_p osl_arrays_interface() { + osl_interface_p interface = osl_interface_malloc(); + + OSL_strdup(interface->URI, OSL_URI_ARRAYS); + interface->idump = (osl_idump_f)osl_arrays_idump; + interface->sprint = (osl_sprint_f)osl_arrays_sprint; + interface->sread = (osl_sread_f)osl_arrays_sread; + interface->malloc = (osl_malloc_f)osl_arrays_malloc; + interface->free = (osl_free_f)osl_arrays_free; + interface->clone = (osl_clone_f)osl_arrays_clone; + interface->equal = (osl_equal_f)osl_arrays_equal; + + return interface; +} + + diff -Nru cloog-0.18.2/osl/source/extensions/clay.c cloog-0.18.4/osl/source/extensions/clay.c --- cloog-0.18.2/osl/source/extensions/clay.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/extensions/clay.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,315 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/clay.c ** + **-----------------------------------------------------------------** + ** First version: 09/05/2012 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#include +#include +#include + +#include +#include +#include +#include + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_clay_idump function: + * this function displays an osl_clay_t structure (*clay) into a + * file (file, possibly stdout) in a way that trends to be understandable. It + * includes an indentation level (level) in order to work with others + * idump functions. + * \param[in] file The file where the information has to be printed. + * \param[in] clay The clay structure to print. + * \param[in] level Number of spaces before printing, for each line. + */ +void osl_clay_idump(FILE * file, osl_clay_p clay, int level) { + int j; + size_t l; + char * tmp; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (clay != NULL) + fprintf(file, "+-- osl_clay_t\n"); + else + fprintf(file, "+-- NULL clay\n"); + + if (clay != NULL) { + // Go to the right level. + for(j = 0; j <= level; j++) + fprintf(file, "|\t"); + + // Display the clay script (without any carriage return). + OSL_strdup(tmp, clay->script); + for (l = 0; l < strlen(tmp); l++) + if (tmp[l] == '\n') + tmp[l] = ' '; + fprintf(file, "script: %s\n", tmp); + free(tmp); + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_clay_dump function: + * this function prints the content of an osl_clay_t structure + * (*clay) into a file (file, possibly stdout). + * \param[in] file The file where the information has to be printed. + * \param[in] clay The clay structure to print. + */ +void osl_clay_dump(FILE * file, osl_clay_p clay) { + osl_clay_idump(file, clay, 0); +} + + +/** + * osl_clay_sprint function: + * this function prints the content of an osl_clay_t structure + * (*clay) into a string (returned) in the OpenScop textual format. + * \param[in] clay The clay structure to print. + * \return A string containing the OpenScop dump of the clay structure. + */ +char * osl_clay_sprint(osl_clay_p clay) { + int high_water_mark = OSL_MAX_STRING; + char * string = NULL; + char buffer[OSL_MAX_STRING]; + + if (clay != NULL) { + OSL_malloc(string, char *, high_water_mark * sizeof(char)); + string[0] = '\0'; + + // Print the clay. + sprintf(buffer, "%s", clay->script); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + // Keep only the memory space we need. + OSL_realloc(string, char *, (strlen(string) + 1) * sizeof(char)); + } + + return string; +} + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/** + * osl_clay_sread function: + * this function reads a clay structure from a string complying to the + * OpenScop textual format and returns a pointer to this clay structure. + * The input parameter is updated to the position in the input string this + * function reach right after reading the clay structure. + * \param[in,out] input The input string where to find a clay. + * Updated to the position after what has been read. + * \return A pointer to the clay structure that has been read. + */ +osl_clay_p osl_clay_sread(char ** input) { + osl_clay_p clay; + char * script; + + if (*input == NULL) { + OSL_debug("no clay optional tag"); + return NULL; + } + + if (strlen(*input) > OSL_MAX_STRING) + OSL_error("clay script too long"); + + // Build the clay structure + clay = osl_clay_malloc(); + script = *input; + + // Pass the carriage returns (this allows to remove those inserted by + // osl_generic_print), and copy the textual script. + while (*script && (*script == '\n')) + script++; + OSL_strdup(clay->script, script); + + // Update the input pointer (everything has been read). + input += strlen(*input); + + return clay; +} + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_clay_malloc function: + * this function allocates the memory space for an osl_clay_t + * structure and sets its fields with default values. Then it returns a + * pointer to the allocated space. + * \return A pointer to an empty clay structure with fields set to + * default values. + */ +osl_clay_p osl_clay_malloc() { + osl_clay_p clay; + + OSL_malloc(clay, osl_clay_p, sizeof(osl_clay_t)); + clay->script = NULL; + + return clay; +} + + +/** + * osl_clay_free function: + * this function frees the allocated memory for an osl_clay_t + * structure. + * \param[in,out] clay The pointer to the clay structure to free. + */ +void osl_clay_free(osl_clay_p clay) { + if (clay != NULL) { + if(clay->script != NULL) + free(clay->script); + free(clay); + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_clay_clone function: + * this function builds and returns a "hard copy" (not a pointer copy) of an + * osl_clay_t data structure. + * \param[in] clay The pointer to the clay structure to clone. + * \return A pointer to the clone of the clay structure. + */ +osl_clay_p osl_clay_clone(osl_clay_p clay) { + osl_clay_p clone; + + if (clay == NULL) + return NULL; + + clone = osl_clay_malloc(); + OSL_strdup(clone->script, clay->script); + + return clone; +} + + +/** + * osl_clay_equal function: + * this function returns true if the two clay structures are the same + * (content-wise), false otherwise. + * \param[in] c1 The first clay structure. + * \param[in] c2 The second clay structure. + * \return 1 if c1 and c2 are the same (content-wise), 0 otherwise. + */ +int osl_clay_equal(osl_clay_p c1, osl_clay_p c2) { + if (c1 == c2) + return 1; + + if (((c1 == NULL) && (c2 != NULL)) || ((c1 != NULL) && (c2 == NULL))) { + OSL_info("clay extensions are not the same"); + return 0; + } + + if (strcmp(c1->script, c2->script)) { + OSL_info("clay scripts are not the same"); + return 0; + } + + return 1; +} + + +/** + * osl_clay_interface function: + * this function creates an interface structure corresponding to the clay + * extension and returns it). + * \return An interface structure for the clay extension. + */ +osl_interface_p osl_clay_interface() { + osl_interface_p interface = osl_interface_malloc(); + + OSL_strdup(interface->URI, OSL_URI_CLAY); + interface->idump = (osl_idump_f)osl_clay_idump; + interface->sprint = (osl_sprint_f)osl_clay_sprint; + interface->sread = (osl_sread_f)osl_clay_sread; + interface->malloc = (osl_malloc_f)osl_clay_malloc; + interface->free = (osl_free_f)osl_clay_free; + interface->clone = (osl_clone_f)osl_clay_clone; + interface->equal = (osl_equal_f)osl_clay_equal; + + return interface; +} diff -Nru cloog-0.18.2/osl/source/extensions/comment.c cloog-0.18.4/osl/source/extensions/comment.c --- cloog-0.18.2/osl/source/extensions/comment.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/extensions/comment.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,311 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/comment.c ** + **-----------------------------------------------------------------** + ** First version: 07/12/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#include +#include +#include + +#include +#include +#include +#include + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_comment_idump function: + * this function displays an osl_comment_t structure (*comment) into a + * file (file, possibly stdout) in a way that trends to be understandable. It + * includes an indentation level (level) in order to work with others + * idump functions. + * \param[in] file The file where the information has to be printed. + * \param[in] comment The comment structure to print. + * \param[in] level Number of spaces before printing, for each line. + */ +void osl_comment_idump(FILE * file, osl_comment_p comment, int level) { + int j; + size_t l; + char * tmp; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (comment != NULL) + fprintf(file, "+-- osl_comment_t\n"); + else + fprintf(file, "+-- NULL comment\n"); + + if (comment != NULL) { + // Go to the right level. + for(j = 0; j <= level; j++) + fprintf(file, "|\t"); + + // Display the comment message (without any carriage return). + OSL_strdup(tmp, comment->comment); + for (l = 0; l < strlen(tmp); l++) + if (tmp[l] == '\n') + tmp[l] = ' '; + fprintf(file, "comment: %s\n", tmp); + free(tmp); + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_comment_dump function: + * this function prints the content of an osl_comment_t structure + * (*comment) into a file (file, possibly stdout). + * \param[in] file The file where the information has to be printed. + * \param[in] comment The comment structure to print. + */ +void osl_comment_dump(FILE * file, osl_comment_p comment) { + osl_comment_idump(file, comment, 0); +} + + +/** + * osl_comment_sprint function: + * this function prints the content of an osl_comment_t structure + * (*comment) into a string (returned) in the OpenScop textual format. + * \param[in] comment The comment structure to print. + * \return A string containing the OpenScop dump of the comment structure. + */ +char * osl_comment_sprint(osl_comment_p comment) { + int high_water_mark = OSL_MAX_STRING; + char * string = NULL; + char buffer[OSL_MAX_STRING]; + + if (comment != NULL) { + OSL_malloc(string, char *, high_water_mark * sizeof(char)); + string[0] = '\0'; + + // Print the comment. + sprintf(buffer, "%s", comment->comment); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + // Keep only the memory space we need. + OSL_realloc(string, char *, (strlen(string) + 1) * sizeof(char)); + } + + return string; +} + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/** + * osl_comment_sread function: + * this function reads a comment structure from a string complying to the + * OpenScop textual format and returns a pointer to this comment structure. + * The input parameter is updated to the position in the input string this + * function reach right after reading the comment structure. + * \param[in,out] input The input string where to find a comment. + * Updated to the position after what has been read. + * \return A pointer to the comment structure that has been read. + */ +osl_comment_p osl_comment_sread(char ** input) { + osl_comment_p comment; + + if (*input == NULL) { + OSL_debug("no comment optional tag"); + return NULL; + } + + if (strlen(*input) > OSL_MAX_STRING) + OSL_error("comment too long"); + + // Build the comment structure + comment = osl_comment_malloc(); + OSL_strdup(comment->comment, *input); + + // Update the input pointer (everything has been read). + input += strlen(*input); + + return comment; +} + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_comment_malloc function: + * this function allocates the memory space for an osl_comment_t + * structure and sets its fields with default values. Then it returns a + * pointer to the allocated space. + * \return A pointer to an empty comment structure with fields set to + * default values. + */ +osl_comment_p osl_comment_malloc() { + osl_comment_p comment; + + OSL_malloc(comment, osl_comment_p, sizeof(osl_comment_t)); + comment->comment = NULL; + + return comment; +} + + +/** + * osl_comment_free function: + * this function frees the allocated memory for an osl_comment_t + * structure. + * \param[in,out] comment The pointer to the comment structure to free. + */ +void osl_comment_free(osl_comment_p comment) { + if (comment != NULL) { + if(comment->comment != NULL) + free(comment->comment); + free(comment); + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_comment_clone function: + * this function builds and returns a "hard copy" (not a pointer copy) of an + * osl_comment_t data structure. + * \param[in] comment The pointer to the comment structure to clone. + * \return A pointer to the clone of the comment structure. + */ +osl_comment_p osl_comment_clone(osl_comment_p comment) { + osl_comment_p clone; + + if (comment == NULL) + return NULL; + + clone = osl_comment_malloc(); + OSL_strdup(clone->comment, comment->comment); + + return clone; +} + + +/** + * osl_comment_equal function: + * this function returns true if the two comment structures are the same + * (content-wise), false otherwise. + * \param[in] c1 The first comment structure. + * \param[in] c2 The second comment structure. + * \return 1 if c1 and c2 are the same (content-wise), 0 otherwise. + */ +int osl_comment_equal(osl_comment_p c1, osl_comment_p c2) { + if (c1 == c2) + return 1; + + if (((c1 == NULL) && (c2 != NULL)) || ((c1 != NULL) && (c2 == NULL))) { + OSL_info("comments are not the same"); + return 0; + } + + if (strcmp(c1->comment, c2->comment)) { + // Well, the test does not apply well on textual content but the idea + // is here (see osl_generic_sprint if you want to understand the problem). + //OSL_info("comments are not the same"); + //return 0; + } + + return 1; +} + + +/** + * osl_comment_interface function: + * this function creates an interface structure corresponding to the comment + * extension and returns it). + * \return An interface structure for the comment extension. + */ +osl_interface_p osl_comment_interface() { + osl_interface_p interface = osl_interface_malloc(); + + OSL_strdup(interface->URI, OSL_URI_COMMENT); + interface->idump = (osl_idump_f)osl_comment_idump; + interface->sprint = (osl_sprint_f)osl_comment_sprint; + interface->sread = (osl_sread_f)osl_comment_sread; + interface->malloc = (osl_malloc_f)osl_comment_malloc; + interface->free = (osl_free_f)osl_comment_free; + interface->clone = (osl_clone_f)osl_comment_clone; + interface->equal = (osl_equal_f)osl_comment_equal; + + return interface; +} + diff -Nru cloog-0.18.2/osl/source/extensions/coordinates.c cloog-0.18.4/osl/source/extensions/coordinates.c --- cloog-0.18.2/osl/source/extensions/coordinates.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/extensions/coordinates.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,369 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/coordinates.c ** + **-----------------------------------------------------------------** + ** First version: 07/12/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#include +#include +#include + +#include +#include +#include +#include + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_coordinates_idump function: + * this function displays an osl_coordinates_t structure (*coordinates) into a + * file (file, possibly stdout) in a way that trends to be understandable. It + * includes an indentation level (level) in order to work with others + * idump functions. + * \param file The file where the information has to be printed. + * \param coordinates The coordinates structure to print. + * \param level Number of spaces before printing, for each line. + */ +void osl_coordinates_idump(FILE* file, osl_coordinates_p coordinates, + int level) { + int j; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (coordinates != NULL) + fprintf(file, "+-- osl_coordinates_t\n"); + else + fprintf(file, "+-- NULL coordinates\n"); + + if (coordinates != NULL) { + // Go to the right level. + for(j = 0; j <= level; j++) + fprintf(file, "|\t"); + + // Display the file name. + if (coordinates->name != NULL) + fprintf(file, "File name__: %s\n", coordinates->name); + else + fprintf(file, "NULL file name\n"); + + // Go to the right level. + for(j = 0; j <= level; j++) + fprintf(file, "|\t"); + + // Display the lines. + fprintf(file, "Coordinates: [%d,%d -> %d,%d]\n", + coordinates->line_start, coordinates->column_start, + coordinates->line_end, coordinates->column_end); + + // Go to the right level. + for(j = 0; j <= level; j++) + fprintf(file, "|\t"); + + // Display the indentation. + fprintf(file, "Indentation: %d\n", coordinates->indent); + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_coordinates_dump function: + * this function prints the content of an osl_coordinates_t structure + * (*coordinates) into a file (file, possibly stdout). + * \param file The file where the information has to be printed. + * \param coordinates The coordinates structure to print. + */ +void osl_coordinates_dump(FILE* file, osl_coordinates_p coordinates) { + osl_coordinates_idump(file, coordinates, 0); +} + + +/** + * osl_coordinates_sprint function: + * this function prints the content of an osl_coordinates_t structure + * (*coordinates) into a string (returned) in the OpenScop textual format. + * \param coordinates The coordinates structure to be print. + * \return A string containing the OpenScop dump of the coordinates structure. + */ +char* osl_coordinates_sprint(osl_coordinates_p coordinates) { + int high_water_mark = OSL_MAX_STRING; + char* string = NULL; + char buffer[OSL_MAX_STRING]; + + if (coordinates != NULL) { + OSL_malloc(string, char*, high_water_mark * sizeof(char)); + string[0] = '\0'; + + // Print the coordinates content. + sprintf(buffer, "# File name\n%s\n", coordinates->name); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + sprintf(buffer, "# Starting line and column\n%d %d\n", + coordinates->line_start, coordinates->column_start); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + sprintf(buffer, "# Ending line and column\n%d %d\n", + coordinates->line_end, coordinates->column_end); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + sprintf(buffer, "# Indentation\n%d\n", coordinates->indent); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + // Keep only the memory space we need. + OSL_realloc(string, char*, (strlen(string) + 1) * sizeof(char)); + } + + return string; +} + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/** + * osl_coordinates_sread function: + * this function reads a coordinates structure from a string complying to the + * OpenScop textual format and returns a pointer to this structure. + * The input parameter is updated to the position in the input string this + * function reach right after reading the coordinates structure. + * \param[in,out] input The input string where to find coordinates. + * Updated to the position after what has been read. + * \return A pointer to the coordinates structure that has been read. + */ +osl_coordinates_p osl_coordinates_sread(char** input) { + osl_coordinates_p coordinates; + + if (*input == NULL) { + OSL_debug("no coordinates optional tag"); + return NULL; + } + + // Build the coordinates structure. + coordinates = osl_coordinates_malloc(); + + // Read the file name (and path). + coordinates->name = osl_util_read_line(NULL, input); + + // Read the coordinates. + coordinates->line_start = osl_util_read_int(NULL, input); + coordinates->column_start = osl_util_read_int(NULL, input); + coordinates->line_end = osl_util_read_int(NULL, input); + coordinates->column_end = osl_util_read_int(NULL, input); + + // Read the indentation level. + coordinates->indent = osl_util_read_int(NULL, input); + + return coordinates; +} + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_coordinates_malloc function: + * this function allocates the memory space for an osl_coordinates_t + * structure and sets its fields with default values. Then it returns a + * pointer to the allocated space. + * \return A pointer to an empty coordinates structure with fields set to + * default values. + */ +osl_coordinates_p osl_coordinates_malloc() { + osl_coordinates_p coordinates; + + OSL_malloc(coordinates, osl_coordinates_p, sizeof(osl_coordinates_t)); + coordinates->name = NULL; + coordinates->line_start = OSL_UNDEFINED; + coordinates->column_start = OSL_UNDEFINED; + coordinates->line_end = OSL_UNDEFINED; + coordinates->column_end = OSL_UNDEFINED; + coordinates->indent = OSL_UNDEFINED; + + return coordinates; +} + + +/** + * osl_coordinates_free function: + * this function frees the allocated memory for an osl_coordinates_t + * structure. + * \param coordinates The pointer to the coordinates structure to free. + */ +void osl_coordinates_free(osl_coordinates_p coordinates) { + if (coordinates != NULL) { + free(coordinates->name); + free(coordinates); + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_coordinates_clone function: + * this function builds and returns a "hard copy" (not a pointer copy) of an + * osl_coordinates_t data structure. + * \param coordinates The pointer to the coordinates structure to clone. + * \return A pointer to the clone of the coordinates structure. + */ +osl_coordinates_p osl_coordinates_clone(osl_coordinates_p coordinates) { + osl_coordinates_p clone; + + if (coordinates == NULL) + return NULL; + + clone = osl_coordinates_malloc(); + OSL_strdup(clone->name, coordinates->name); + clone->line_start = coordinates->line_start; + clone->column_start = coordinates->column_start; + clone->line_end = coordinates->line_end; + clone->column_end = coordinates->column_end; + clone->indent = coordinates->indent; + + return clone; +} + + +/** + * osl_coordinates_equal function: + * this function returns true if the two coordinates structures are the same + * (content-wise), false otherwise. This functions considers two coordinates + * \param c1 The first coordinates structure. + * \param c2 The second coordinates structure. + * \return 1 if c1 and c2 are the same (content-wise), 0 otherwise. + */ +int osl_coordinates_equal(osl_coordinates_p c1, osl_coordinates_p c2) { + if (c1 == c2) + return 1; + + if (((c1 == NULL) && (c2 != NULL)) || ((c1 != NULL) && (c2 == NULL))) + return 0; + + if (strcmp(c1->name, c2->name)) { + OSL_info("file names are not the same"); + return 0; + } + + if (c1->line_start != c2->line_start) { + OSL_info("starting lines are not the same"); + return 0; + } + + if (c1->column_start != c2->column_start) { + OSL_info("starting columns are not the same"); + return 0; + } + + if (c1->line_end != c2->line_end) { + OSL_info("Ending lines are not the same"); + return 0; + } + + if (c1->column_end != c2->column_end) { + OSL_info("Ending columns are not the same"); + return 0; + } + + if (c1->indent != c2->indent) { + OSL_info("indentations are not the same"); + return 0; + } + + return 1; +} + + +/** + * osl_coordinates_interface function: + * this function creates an interface structure corresponding to the coordinates + * extension and returns it). + * \return An interface structure for the coordinates extension. + */ +osl_interface_p osl_coordinates_interface() { + osl_interface_p interface = osl_interface_malloc(); + + OSL_strdup(interface->URI, OSL_URI_COORDINATES); + interface->idump = (osl_idump_f)osl_coordinates_idump; + interface->sprint = (osl_sprint_f)osl_coordinates_sprint; + interface->sread = (osl_sread_f)osl_coordinates_sread; + interface->malloc = (osl_malloc_f)osl_coordinates_malloc; + interface->free = (osl_free_f)osl_coordinates_free; + interface->clone = (osl_clone_f)osl_coordinates_clone; + interface->equal = (osl_equal_f)osl_coordinates_equal; + + return interface; +} diff -Nru cloog-0.18.2/osl/source/extensions/dependence.c cloog-0.18.4/osl/source/extensions/dependence.c --- cloog-0.18.2/osl/source/extensions/dependence.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/extensions/dependence.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,654 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/dependence.h ** + **-----------------------------------------------------------------** + ** First version: 02/07/2012 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * Most of these functions where extracted from candl and ported to osl + */ + +/****************************************************************************** + * Structure display function * + ******************************************************************************/ + + +/** + * osl_dependence_idump function: + * Displays a osl_dependence_p structure (dependence) into a file (file, + * possibly stdout) in a way that trends to be understandable without falling + * in a deep depression or, for the lucky ones, getting a headache... It + * includes an indentation level (level) in order to work with others + * idump functions. + * - 18/09/2003: first version. + */ +void osl_dependence_idump(FILE* file, + osl_dependence_p dependence, + int level) { + int j, first = 1; + osl_statement_p tmp; + + if (dependence != NULL) { /* Go to the right level. */ + for (j=0; jtype) { + case OSL_UNDEFINED : fprintf(file, "UNSET\n"); break; + case OSL_DEPENDENCE_RAW : fprintf(file, "RAW (flow)\n"); break; + case OSL_DEPENDENCE_WAR : fprintf(file, "WAR (anti)\n"); break; + case OSL_DEPENDENCE_WAW : fprintf(file, "WAW (output)\n"); break; + case OSL_DEPENDENCE_RAR : fprintf(file, "RAR (input)\n"); break; + case OSL_DEPENDENCE_RAW_SCALPRIV : + fprintf(file, "RAW_SCALPRIV (scalar priv)\n"); break; + default : fprintf(file, "unknown\n"); break; + } + + /* A blank line. */ + for (j=0; j<=level+1; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); + + /* Go to the right level and print the depth. */ + for (j=0; j<=level; j++) + fprintf(file, "|\t"); + fprintf(file, "Depth: %d\n", dependence->depth); + + /* A blank line. */ + for (j=0; j<=level+1; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); + + /* Ref source and target */ + for (j=0; j<=level; j++) + fprintf(file, "|\t"); + fprintf(file, "Ref source: %d, Ref target: %d\n", + dependence->ref_source, dependence->ref_target); + + /* A blank line. */ + for (j=0; j<=level+1; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); + + /* Print the source statement. */ + for (j=0; j<=level; j++) + fprintf(file, "|\t"); + fprintf(file, "Statement label: %d\n", dependence->label_source); + tmp = dependence->stmt_source_ptr->next; + dependence->stmt_source_ptr->next = NULL; + osl_statement_idump(file, dependence->stmt_source_ptr, level+1); + dependence->stmt_source_ptr->next = tmp; + + /* Print the target statement. */ + for (j=0; j<=level; j++) + fprintf(file, "|\t"); + fprintf(file, "Target label: %d\n", dependence->label_target); + tmp = dependence->stmt_target_ptr->next; + dependence->stmt_target_ptr->next = NULL; + osl_statement_idump(file, dependence->stmt_target_ptr, level+1); + dependence->stmt_target_ptr->next = tmp; + + /* Print the dependence polyhedron. */ + for (j=0; j<=level; j++) + fprintf(file, "|\t"); + fprintf(file, "%d %d %d %d %d %d %d %d\n", + dependence->source_nb_output_dims_domain, + dependence->source_nb_output_dims_access, + dependence->target_nb_output_dims_domain, + dependence->target_nb_output_dims_access, + dependence->source_nb_local_dims_domain, + dependence->source_nb_local_dims_access, + dependence->target_nb_local_dims_domain, + dependence->target_nb_local_dims_access); + osl_relation_idump(file, dependence->domain, level+1); + + dependence = dependence->next; + + /* Next line. */ + if (dependence != NULL) { + for (j=0; j<=level; j++) + fprintf(file, "|\t"); + fprintf(file, "V\n"); + } + } + + /* The last line. */ + for (j=0; j<=level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_dependence_dump function: + * This function prints the content of a osl_dependence_p structure (dependence) + * into a file (file, possibly stdout). + */ +void osl_dependence_dump(FILE * file, osl_dependence_p dependence) { + osl_dependence_idump(file, dependence, 0); +} + + +/** + * osl_dependence_print function: + * Print the dependence, formatted to fit the .scop representation. + */ +void osl_dependence_print(FILE *file, osl_dependence_p dependence) { + char *string = osl_dependence_sprint(dependence); + fprintf(file, "%s\n", string); + free(string); +} + + +/** + * osl_dependence_sprint function: + * Returns a string containing the dependence, formatted to fit the + * .scop representation. + */ +char* osl_dependence_sprint(osl_dependence_p dependence) { + + osl_dependence_p tmp = dependence; + int nb_deps; + int buffer_size = 2048; + char* buffer; + char buff[2048]; + char* type; + char* pbuffer; + + OSL_malloc(buffer, char*, buffer_size); + buffer[0] = '\0'; + + for (tmp = dependence, nb_deps = 0; tmp; tmp = tmp->next, ++nb_deps) + ; + snprintf(buff, OSL_MAX_STRING, "# Number of dependences\n%d\n", nb_deps); + strcat(buffer, buff); + + if (nb_deps) { + for (tmp = dependence, nb_deps = 1; tmp; tmp = tmp->next, ++nb_deps) { + + switch (tmp->type) { + case OSL_UNDEFINED: + type = "UNSET"; + break; + case OSL_DEPENDENCE_RAW: + type = "RAW #(flow)"; + break; + case OSL_DEPENDENCE_WAR: + type = "WAR #(anti)"; + break; + case OSL_DEPENDENCE_WAW: + type = "WAW #(output)"; + break; + case OSL_DEPENDENCE_RAR: + type = "RAR #(input)"; + break; + case OSL_DEPENDENCE_RAW_SCALPRIV: + type = "RAW_SCALPRIV #(scalar priv)"; + break; + default: + exit(1); + break; + } + + /* Output dependence information. */ + snprintf(buff, OSL_MAX_STRING, "# Description of dependence %d\n" + "# type\n%s\n" + "# From source statement id\n%d\n" + "# To target statement id\n%d\n" + "# Depth \n%d\n" + "# From source access ref\n%d\n" + "# To target access ref\n%d\n" + "# Dependence domain\n", + nb_deps, type, + tmp->label_source, + tmp->label_target, + tmp->depth, + tmp->ref_source, + tmp->ref_target); + + osl_util_safe_strcat(&buffer, buff, &buffer_size); + + /* Output dependence domain. */ + pbuffer = osl_relation_sprint(tmp->domain); + osl_util_safe_strcat(&buffer, pbuffer, &buffer_size); + free(pbuffer); + } + } + + return buffer; +} + + +/** + * osl_dependence_read_one_dep function: + * Read one dependence from a string. + */ +static +osl_dependence_p osl_dependence_read_one_dep(char **input, int precision) { + osl_dependence_p dep = osl_dependence_malloc(); + char *buffer; + + /* Dependence type */ + buffer = osl_util_read_string(NULL, input); + if (! strcmp(buffer, "RAW")) + dep->type = OSL_DEPENDENCE_RAW; + else if (! strcmp(buffer, "RAR")) + dep->type = OSL_DEPENDENCE_RAR; + else if (! strcmp(buffer, "WAR")) + dep->type = OSL_DEPENDENCE_WAR; + else if (! strcmp(buffer, "WAW")) + dep->type = OSL_DEPENDENCE_WAW; + else if (! strcmp(buffer, "RAW_SCALPRIV")) + dep->type = OSL_DEPENDENCE_RAW_SCALPRIV; + free(buffer); + + /* # From source statement xxx */ + dep->label_source = osl_util_read_int(NULL, input); + + /* # To target statement xxx */ + dep->label_target = osl_util_read_int(NULL, input); + + /* # Depth */ + dep->depth = osl_util_read_int(NULL, input); + + /* # From source access ref */ + dep->ref_source = osl_util_read_int(NULL, input); + + /* # To target access ref */ + dep->ref_target = osl_util_read_int(NULL, input); + + /* Read the osl_relation */ + dep->domain = osl_relation_psread(input, precision); + + return dep; +} + + +/** + * osl_dependence_sread function: + * Retrieve a osl_dependence_p list from the option tag in the scop. + */ +osl_dependence_p osl_dependence_sread(char **input) { + int precision = osl_util_get_precision(); + return osl_dependence_psread(input, precision); +} + + +/** + * osl_dependence_psread function + * Retrieve a osl_dependence_p list from the option tag in the scop. + */ +osl_dependence_p osl_dependence_psread(char **input, int precision) { + osl_dependence_p first = NULL; + osl_dependence_p currdep = NULL; + + if (*input == NULL) { + OSL_debug("no dependence optional tag"); + return NULL; + } + + int i; + /* Get the number of dependences. */ + int nbdeps = osl_util_read_int(NULL, input); + + /* For each of them, read 1 and shift of the read size. */ + for (i = 0; i < nbdeps; i++) { + osl_dependence_p adep = osl_dependence_read_one_dep(input, precision); + if (first == NULL) { + currdep = first = adep; + } else { + currdep->next = adep; + currdep = currdep->next; + } + } + + return first; +} + + +/****************************************************************************** + * Memory deallocation function * + ******************************************************************************/ + + +/** + * osl_dependence_malloc function: + * This function allocates the memory space for a osl_dependence_p structure and + * sets its fields with default values. Then it returns a pointer to the + * allocated space. + * - 07/12/2005: first version. + */ +osl_dependence_p osl_dependence_malloc() { + osl_dependence_p dependence; + + /* Memory allocation for the osl_dependence_p structure. */ + OSL_malloc(dependence, osl_dependence_p, sizeof(osl_dependence_t)); + + /* We set the various fields with default values. */ + dependence->depth = OSL_UNDEFINED; + dependence->type = OSL_UNDEFINED; + dependence->label_source = OSL_UNDEFINED; + dependence->label_target = OSL_UNDEFINED; + dependence->ref_source = OSL_UNDEFINED; + dependence->ref_target = OSL_UNDEFINED; + dependence->domain = NULL; + dependence->next = NULL; + dependence->usr = NULL; + dependence->source_nb_output_dims_domain = OSL_UNDEFINED; + dependence->source_nb_output_dims_access = OSL_UNDEFINED; + dependence->target_nb_output_dims_domain = OSL_UNDEFINED; + dependence->target_nb_output_dims_access = OSL_UNDEFINED; + dependence->source_nb_local_dims_domain = OSL_UNDEFINED; + dependence->source_nb_local_dims_access = OSL_UNDEFINED; + dependence->target_nb_local_dims_domain = OSL_UNDEFINED; + dependence->target_nb_local_dims_access = OSL_UNDEFINED; + dependence->ref_source_access_ptr = NULL; + dependence->ref_target_access_ptr = NULL; + dependence->stmt_source_ptr = NULL; + dependence->stmt_target_ptr = NULL; + + return dependence; +} + + +/** + * osl_dependence_free function: + * This function frees the allocated memory for a osl_dependence_p structure. + * - 18/09/2003: first version. + */ +void osl_dependence_free(osl_dependence_p dependence) { + osl_dependence_p next; + while (dependence != NULL) { + next = dependence->next; + osl_relation_free(dependence->domain); + free(dependence); + dependence = next; + } +} + + +/****************************************************************************** + * Processing functions * + ******************************************************************************/ + + +/** + * osl_dependence_nclone function: + * This function builds and returns a "hard copy" (not a pointer copy) of the + * n first elements of an osl_dependence_t list. + * \param statement The pointer to the dependence structure we want to clone. + * \param n The number of nodes we want to copy (-1 for infinity). + * \return The clone of the n first nodes of the dependence list. + */ +osl_dependence_p osl_dependence_nclone(osl_dependence_p dep, int n) { + int first = 1, i = 0; + osl_dependence_p clone = NULL, node, previous = NULL; + + while ((dep != NULL) && ((n == -1) || (i < n))) { + node = osl_dependence_malloc(); + node->stmt_source_ptr = dep->stmt_source_ptr; + node->stmt_target_ptr = dep->stmt_target_ptr; + node->depth = dep->depth; + node->type = dep->type; + node->label_source = dep->label_source; + node->label_target = dep->label_target; + node->ref_source = dep->ref_source; + node->ref_target = dep->ref_target; + node->domain = osl_relation_clone(dep->domain); + node->source_nb_output_dims_domain = dep->source_nb_output_dims_domain; + node->source_nb_output_dims_access = dep->source_nb_output_dims_access; + node->target_nb_output_dims_domain = dep->target_nb_output_dims_domain; + node->target_nb_output_dims_access = dep->target_nb_output_dims_access; + node->source_nb_local_dims_domain = dep->source_nb_local_dims_domain; + node->source_nb_local_dims_access = dep->source_nb_local_dims_access; + node->target_nb_local_dims_domain = dep->target_nb_local_dims_domain; + node->target_nb_local_dims_access = dep->target_nb_local_dims_access; + node->next = NULL; + node->usr = NULL; + + if (first) { + first = 0; + clone = node; + previous = node; + } + else { + previous->next = node; + previous = previous->next; + } + + i++; + dep = dep->next; + } + + return clone; +} + + +/** + * osl_dependence_clone function: + * This functions builds and returns a "hard copy" (not a pointer copy) of an + * osl_dependence_t data structure provided as parameter. + * \param[in] statement The pointer to the dependence we want to clone. + * \return A pointer to the clone of the dependence provided as parameter. + */ +osl_dependence_p osl_dependence_clone(osl_dependence_p dep) { + return osl_dependence_nclone(dep, -1); +} + + +/** + * osl_dependence_equal function: + * this function returns true if the two dependences provided as parameters + * are the same, false otherwise (the usr field is not tested). + * NOTE: the different pointer to statements or relations are nto compared + * \param[in] d1 The first dependence. + * \param[in] d2 The second dependence. + * \return 1 if d1 and d2 are the same (content-wise), 0 otherwise. + */ +int osl_dependence_equal(osl_dependence_p d1, osl_dependence_p d2) { + + if (d1 == d2) + return 1; + + if ((d1->next != NULL && d2->next == NULL) || + (d1->next == NULL && d2->next != NULL)) + return 0; + + if (d1->next != NULL && d2->next != NULL) + if (!osl_dependence_equal(d1->next, d2->next)) + return 0; + + if (!osl_relation_equal(d1->domain, d2->domain)) + return 0; + + if (d1->label_source != d2->label_source || + d1->label_target != d2->label_target || + d1->ref_source != d2->ref_source || + d1->ref_target != d2->ref_target || + d1->depth != d2->depth || + d1->type != d2->type || + + d1->source_nb_output_dims_domain != + d2->source_nb_output_dims_domain || + + d1->source_nb_output_dims_access != + d2->source_nb_output_dims_access || + + d1->target_nb_output_dims_domain != + d2->target_nb_output_dims_domain || + + d1->target_nb_output_dims_access != + d2->target_nb_output_dims_access || + + d1->source_nb_local_dims_domain != + d2->source_nb_local_dims_domain || + + d1->source_nb_local_dims_access != + d2->source_nb_local_dims_access || + + d1->target_nb_local_dims_domain != + d2->target_nb_local_dims_domain || + + d1->target_nb_local_dims_access != + d2->target_nb_local_dims_access) + return 0; + + return 1; +} + + +/** + * osl_dependence_add function: + * This function adds a osl_dependence_p structure (dependence) at a given place + * (now) of a NULL terminated list of osl_dependence_p structures. The beginning + * of this list is (start). This function updates (now) to the end of the loop + * list (loop), and updates (start) if the added element is the first one -that + * is when (start) is NULL-. + * - 18/09/2003: first version. + */ +void osl_dependence_add(osl_dependence_p* start, + osl_dependence_p* now, + osl_dependence_p dependence) { + if (dependence != NULL) { + if (*start == NULL) { + *start = dependence; + *now = *start; + } else { + (*now)->next = dependence; + *now = (*now)->next; + } + + while ((*now)->next != NULL) + *now = (*now)->next; + } +} + + +/** + * osl_nb_dependences function: + * This function returns the number of dependences in the dependence + * list + * \param dependence The first dependence of the dependence list. + ** + */ +int osl_nb_dependences(osl_dependence_p deps) { + osl_dependence_p dep = deps; + int num = 0; + while (dep != NULL) { + num++; + dep = dep->next; + } + return num; +} + + +/** + * osl_dependence_interface function: + * this function creates an interface structure corresponding to the dependence + * extension and returns it). + * \return An interface structure for the dependence extension. + */ +osl_interface_p osl_dependence_interface() { + osl_interface_p interface = osl_interface_malloc(); + + OSL_strdup(interface->URI, OSL_URI_DEPENDENCE); + interface->idump = (osl_idump_f)osl_dependence_idump; + interface->sprint = (osl_sprint_f)osl_dependence_sprint; + interface->sread = (osl_sread_f)osl_dependence_sread; + interface->malloc = (osl_malloc_f)osl_dependence_malloc; + interface->free = (osl_free_f)osl_dependence_free; + interface->clone = (osl_clone_f)osl_dependence_clone; + interface->equal = (osl_equal_f)osl_dependence_equal; + + return interface; +} diff -Nru cloog-0.18.2/osl/source/extensions/extbody.c cloog-0.18.4/osl/source/extensions/extbody.c --- cloog-0.18.2/osl/source/extensions/extbody.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/extensions/extbody.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,391 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/extbody.c ** + **-----------------------------------------------------------------** + ** First version: 07/12/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#include +#include +#include +#include + +#include +#include +#include +#include + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_extbody_idump function: + * this function displays an osl_extbody_t structure (*extbody) into a + * file (file, possibly stdout) in a way that trends to be understandable. It + * includes an indentation level (level) in order to work with others idump + * functions. + * \param[in] file The file where the information has to be printed. + * \param[in] ebody The ebody structure to print. + * \param[in] level Number of spaces before printing, for each line. + */ +void osl_extbody_idump(FILE * file, osl_extbody_p ebody, int level) { + int i, j; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (ebody != NULL) + fprintf(file, "+-- osl_extbody_t\n"); + else + fprintf(file, "+-- NULL extbody\n"); + + if (ebody != NULL) { + // Go to the right level. + for(j = 0; j <= level; j++) + fprintf(file, "|\t"); + + // Display the number of ebody. + fprintf(file, "nb_access: %d\n", ebody->nb_access); + + // Display the coordinates. + for(i = 0; i < ebody->nb_access; i++) { + // Go to the right level. + for(j = 0; j <= level; j++) + fprintf(file, "|\t"); + + fprintf(file, "start: %d, length: %d\n", + ebody->start[i], ebody->length[i]); + } + + // Display the body + osl_body_idump(file, ebody->body, level); + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_extbody_dump function: + * this function prints the content of an osl_extbody_t structure + * (*ebody) into a file (file, possibly stdout). + * \param[in] file The file where the information has to be printed. + * \param[in] ebody The ebody structure to print. + */ +void osl_extbody_dump(FILE * file, osl_extbody_p ebody) { + osl_extbody_idump(file, ebody, 0); +} + + +/** + * osl_extbody_sprint function: + * this function prints the content of an osl_extbody_t structure + * (*ebody) into a string (returned) in the OpenScop textual format. + * \param[in] ebody The ebody structure to print. + * \return A string containing the OpenScop dump of the ebodystructure. + */ +char * osl_extbody_sprint(osl_extbody_p ebody) { + int i; + int high_water_mark = OSL_MAX_STRING; + char * string = NULL, * body_string = NULL; + char buffer[OSL_MAX_STRING]; + + if (ebody != NULL) { + OSL_malloc(string, char *, high_water_mark * sizeof(char)); + string[0] = '\0'; + + sprintf(buffer, "# Number of accesses\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + sprintf(buffer, "%d\n", ebody->nb_access); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + if (ebody->nb_access) { + sprintf(buffer, "# Access coordinates (start/length)\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + for (i = 0; i < ebody->nb_access; i++) { + sprintf(buffer, "%d %d\n", ebody->start[i], ebody->length[i]); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + body_string = osl_body_sprint(ebody->body); + osl_util_safe_strcat(&string, body_string, &high_water_mark); + free(body_string); + } + + return string; +} + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/** + * osl_extbody_sread function: + * this function reads an extbody structure from a string complying + * to the OpenScop textual format and returns a pointer to this + * extbody structure. The string should contain only one textual + * format of an extbody structure. The input parameter is updated to + * the position in the input string this function reach right after reading the + * comment structure. + * \param[in,out] input The input string where to find an extbody + * structure. + * Updated to the position after what has been read. + * \return A pointer to the extbody structure that has been read. + */ +osl_extbody_p osl_extbody_sread(char ** input) { + int k; + int nb_access; + osl_extbody_p ebody; + + if (input == NULL) { + OSL_debug("no extbody optional tag"); + return NULL; + } + + // Find the number of ebody provided. + nb_access = osl_util_read_int(NULL, input); + + // Allocate the array of start and length. + ebody = osl_extbody_malloc(); + OSL_malloc(ebody->start, int *, nb_access * sizeof(int)); + OSL_malloc(ebody->length, int *, nb_access * sizeof(int)); + ebody->nb_access = nb_access; + + // Get each array start/length. + for (k = 0; k < nb_access; k++) { + ebody->start[k] = osl_util_read_int(NULL, input); + ebody->length[k] = osl_util_read_int(NULL, input); + } + + // Read simple body. + ebody->body = osl_body_sread(input); + + return ebody; +} + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_extbody_malloc function: + * this function allocates the memory space for an osl_extbody_t + * structure and sets its fields with default values. Then it returns a + * pointer to the allocated space. + * \return A pointer to an empty extbody structure with fields set to + * default values. + */ +osl_extbody_p osl_extbody_malloc() { + osl_extbody_p ebody; + OSL_malloc(ebody, osl_extbody_p, sizeof(osl_extbody_t)); + + ebody->nb_access = 0; + ebody->start = NULL; + ebody->length = NULL; + ebody->body = NULL; + + return ebody; +} + + +/** + * osl_extbody_free function: + * this function frees the allocated memory for an ebody structure. + * \param[in,out] ebody The pointer to the extbody structure we want to free. + */ +void osl_extbody_free(osl_extbody_p ebody) { + if (ebody != NULL) { + free(ebody->start); + free(ebody->length); + osl_body_free(ebody->body); + free(ebody); + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_extbody_clone function: + * this function builds and returns a "hard copy" (not a pointer copy) of an + * osl_extbody_t data structure. + * \param[in] ebody The pointer to the extbody structure to clone. + * \return A pointer to the clone of the extbody structure. + */ +osl_extbody_p osl_extbody_clone(osl_extbody_p ebody) { + int i; + osl_extbody_p clone; + + if (ebody == NULL) + return NULL; + + clone = osl_extbody_malloc(); + clone->nb_access = ebody->nb_access; + OSL_malloc(clone->start, int *, ebody->nb_access * sizeof(int)); + OSL_malloc(clone->length, int *, ebody->nb_access * sizeof(int)); + + for (i = 0; i < ebody->nb_access; i++) { + clone->start[i] = ebody->start[i]; + clone->length[i] = ebody->length[i]; + } + + clone->body = osl_body_clone(ebody->body); + + return clone; +} + + +/** + * osl_extbody_equal function: + * this function returns true if the two extbody structures are the + * same (content-wise), false otherwise. This functions considers two + * extbody structures as equal if the order of the array start/length + * differ, however the identifiers, start and length must be the same. + * \param[in] e1 The first extbody structure. + * \param[in] e2 The second extbody structure. + * \return 1 if e1 and e2 are the same (content-wise), 0 otherwise. + */ +int osl_extbody_equal(osl_extbody_p e1, osl_extbody_p e2) { + int i, j, found; + + if (e1 == e2) + return 1; + + if (((e1 == NULL) && (e2 != NULL)) || ((e1 != NULL) && (e2 == NULL))) { + OSL_info("extbody are not the same"); + return 0; + } + + // Check whether the number of ebody is the same. + if (e1->nb_access != e2->nb_access) { + OSL_info("extbody are not the same"); + return 0; + } + + // We accept a different order of the start/length, as long as the + // identifiers are the same. + for (i = 0; i < e1->nb_access; i++) { + found = 0; + for (j = 0; j < e2->nb_access; j++) { + if ((e1->start[i] == e2->start[j]) && + (e1->length[i] == e2->length[j])) { + found = 1; + break; + } + } + if (found != 1) { + OSL_info("extbody are not the same"); + return 0; + } + } + + return osl_body_equal(e1->body, e2->body); +} + + +/** + * osl_extbody_interface function: + * this function creates an interface structure corresponding to the + * extbody extension and returns it. + * \return An interface structure for the extbody extension. + */ +osl_interface_p osl_extbody_interface() { + osl_interface_p interface = osl_interface_malloc(); + + OSL_strdup(interface->URI, OSL_URI_EXTBODY); + interface->idump = (osl_idump_f)osl_extbody_idump; + interface->sprint = (osl_sprint_f)osl_extbody_sprint; + interface->sread = (osl_sread_f)osl_extbody_sread; + interface->malloc = (osl_malloc_f)osl_extbody_malloc; + interface->free = (osl_free_f)osl_extbody_free; + interface->clone = (osl_clone_f)osl_extbody_clone; + interface->equal = (osl_equal_f)osl_extbody_equal; + + return interface; +} + + +/** + * osl_extbody_add function: + * This function add an entry in the list of coordinates + */ +void osl_extbody_add(osl_extbody_p ebody, int start, int length) { + ebody->nb_access++; + + OSL_realloc(ebody->start, int*, sizeof(int) * ebody->nb_access); + OSL_realloc(ebody->length, int*, sizeof(int) * ebody->nb_access); + + ebody->start[ebody->nb_access-1] = start; + ebody->length[ebody->nb_access-1] = length; +} diff -Nru cloog-0.18.2/osl/source/extensions/irregular.c cloog-0.18.4/osl/source/extensions/irregular.c --- cloog-0.18.2/osl/source/extensions/irregular.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/extensions/irregular.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,764 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/irregular.c ** + **-----------------------------------------------------------------** + ** First version: 07/12/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#include +#include +#include + +#include +#include +#include +#include +#include + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_irregular_idump function: + * this function displays an osl_irregular_t structure (*irregular) into a + * file (file, possibly stdout) in a way that trends to be understandable. It + * includes an indentation level (level) in order to work with others + * idump functions. + * \param file The file where the information has to be printed. + * \param irregular The irregular structure whose information has to be printed. + * \param level Number of spaces before printing, for each line. + */ +void osl_irregular_idump(FILE * file, osl_irregular_p irregular, int level) { + int i,j; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (irregular != NULL) + fprintf(file, "+-- osl_irregular_t\n"); + else + fprintf(file, "+-- NULL irregular\n"); + + if (irregular != NULL) { + // Go to the right level. + for(j = 0; j <= level; j++) + fprintf(file, "|\t"); + + // Display the irregular contents. + + // Print statements + for (i = 0; i < irregular->nb_statements; i++) { + fprintf(file, "statement%d's predicats : ", i); + for(j = 0; j < irregular->nb_predicates[i]; j++) + fprintf(file, "%d ", irregular->predicates[i][j]); + fprintf(file, "\n"); + } + // Print predicats + // controls : + for (i = 0; i < irregular->nb_control; i++) { + fprintf(file, "predicat%d's\niterators : ", i); + for(j = 0; j < irregular->nb_iterators[i]; j++) + fprintf(file, "%s ", irregular->iterators[i][j]); + fprintf(file, "\ncontrol body: %s\n", irregular->body[i]); + } + // exits : + for(i = irregular->nb_control; + i < irregular->nb_control + irregular->nb_exit; i++) { + fprintf(file, "predicat%d's\niterators : ", i); + for(j = 0; j < irregular->nb_iterators[i]; j++) + fprintf(file, "%s ", irregular->iterators[i][j]); + fprintf(file, "\nexit body: %s\n", irregular->body[i]); + } + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_irregular_dump function: + * this function prints the content of an osl_irregular_t structure + * (*irregular) into a file (file, possibly stdout). + * \param file The file where the information has to be printed. + * \param irregular The irregular structure whose information has to be printed. + */ +void osl_irregular_dump(FILE * file, osl_irregular_p irregular) { + osl_irregular_idump(file, irregular, 0); +} + + +/** + * osl_irregular_sprint function: + * this function prints the content of an osl_irregular_t structure + * (*irregular) into a string (returned) in the OpenScop textual format. + * \param irregular The irregular structure whose information has to be printed. + * \return A string containing the OpenScop dump of the irregular structure. + */ +char * osl_irregular_sprint(osl_irregular_p irregular) { + int high_water_mark = OSL_MAX_STRING,i,j; + char * string = NULL; + char * buffer; + + if (irregular != NULL) { + OSL_malloc(string, char *, high_water_mark * sizeof(char)); + OSL_malloc(buffer, char *, OSL_MAX_STRING * sizeof(char)); + string[0] = '\0'; + + // Print the begin tag. + sprintf(buffer, OSL_TAG_IRREGULAR_START); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + // Print the content. + sprintf(buffer, "\n%d\n", irregular->nb_statements); + for(i=0; inb_statements; i++) { + sprintf(buffer, "%s%d ", buffer, irregular->nb_predicates[i]); + for(j=0; jnb_predicates[i]; j++) { + sprintf(buffer, "%s%d ", buffer, irregular->predicates[i][j]); + } + sprintf(buffer, "%s\n", buffer); + } + // Print the predicates. + // controls: + sprintf(buffer, "%s%d\n", buffer, irregular->nb_control); + sprintf(buffer, "%s%d\n", buffer, irregular->nb_exit); + for(i=0; inb_control; i++) { + sprintf(buffer, "%s%d ", buffer, irregular->nb_iterators[i]); + for(j=0; jnb_iterators[i];j++) + sprintf(buffer, "%s%s ", buffer, irregular->iterators[i][j]); + sprintf(buffer, "%s\n%s\n", buffer, irregular->body[i]); + } + // exits: + for(i=0; inb_exit; i++) { + sprintf(buffer, "%s%d ", buffer, irregular->nb_iterators[ + irregular->nb_control + i]); + for(j=0; jnb_iterators[irregular->nb_control + i];j++) + sprintf(buffer, "%s%s ", buffer, irregular->iterators[ + irregular->nb_control+i][j]); + sprintf(buffer, "%s\n%s\n", buffer, irregular->body[ + irregular->nb_control + i]); + } + + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + // Print the end tag. + sprintf(buffer, OSL_TAG_IRREGULAR_STOP"\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + // Keep only the memory space we need. + OSL_realloc(string, char *, (strlen(string) + 1) * sizeof(char)); + free(buffer); + } + + return string; +} + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + +/** + * osl_irregular_sread function: + * this function reads a irregular structure from a string complying to the + * OpenScop textual format and returns a pointer to this irregular structure. + * The string should contain only one textual format of a irregular structure. + * \param extensions The input string where to find a irregular structure. + * \return A pointer to the irregular structure that has been read. + */ +osl_irregular_p osl_irregular_sread(char ** extensions_fixme) { + char * content,*tok; + int i,j; + osl_irregular_p irregular; + + // FIXME: this is a quick and dirty thing to accept char ** instead + // of char * in the parameter: really do it and update the + // pointer to after what has been read. + content = *extensions_fixme; + + if (content == NULL) { + OSL_debug("no irregular optional tag"); + return NULL; + } + + if (strlen(content) > OSL_MAX_STRING) + OSL_error("irregular too long"); + + irregular = osl_irregular_malloc(); + + // nb statements + tok = strtok(content," \n"); + irregular->nb_statements = atoi(tok); + OSL_malloc(irregular->predicates, int **, + sizeof(int*) * irregular->nb_statements); + OSL_malloc(irregular->nb_predicates, int *, + sizeof(int) * irregular->nb_statements); + + // get predicats + for(i = 0; i < irregular->nb_statements; i++) { + // nb conditions + tok = strtok(NULL," \n"); + irregular->nb_predicates[i] = atoi(tok); + OSL_malloc(irregular->predicates[i], int *, + sizeof(int) * irregular->nb_predicates[i]); + for(j = 0; j < irregular->nb_predicates[i]; j++){ + tok = strtok(NULL, " \n"); + irregular->predicates[i][j] = atoi(tok); + } + } + // Get nb predicat + // control and exits : + tok = strtok(NULL, " \n"); + irregular->nb_control=atoi(tok); + tok = strtok(NULL, " \n"); + irregular->nb_exit = atoi(tok); + + int nb_predicates = irregular->nb_control + irregular->nb_exit; + + OSL_malloc(irregular->iterators, char ***, + sizeof(char **) * nb_predicates); + OSL_malloc(irregular->nb_iterators, int *, sizeof(int) * nb_predicates); + OSL_malloc(irregular->body, char **, sizeof(char *) * nb_predicates); + + for(i = 0; i < nb_predicates; i++) { + // Get number of iterators + tok = strtok(NULL, " \n"); + irregular->nb_iterators[i] = atoi(tok); + OSL_malloc(irregular->iterators[i], char **, + sizeof(char *) * irregular->nb_iterators[i]); + + // Get iterators + for(j = 0; j < irregular->nb_iterators[i]; j++) + OSL_strdup(irregular->iterators[i][j], strtok(NULL, " \n")); + // Get predicat string + OSL_strdup(irregular->body[i], strtok(NULL, "\n")); + } + + return irregular; +} + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_irregular_malloc function: + * This function allocates the memory space for an osl_irregular_t + * structure and sets its fields with default values. Then it returns a + * pointer to the allocated space. + * \return A pointer to an empty irregular structure with fields set to + * default values. + */ +osl_irregular_p osl_irregular_malloc() { + osl_irregular_p irregular; + + OSL_malloc(irregular, osl_irregular_p, + sizeof(osl_irregular_t)); + irregular->nb_statements = 0; + irregular->predicates = NULL; + irregular->nb_predicates = NULL; + irregular->nb_control = 0; + irregular->nb_exit = 0; + irregular->nb_iterators = NULL; + irregular->iterators = NULL; + irregular->body = NULL; + + return irregular; +} + + +/** + * osl_irregular_free function: + * This function frees the allocated memory for an osl_irregular_t + * structure. + * \param irregular The pointer to the irregular structure we want to free. + */ +void osl_irregular_free(osl_irregular_p irregular) { + int i, j, nb_predicates; + + if (irregular != NULL) { + for(i = 0; i < irregular->nb_statements; i++) + free(irregular->predicates[i]); + + if(irregular->predicates != NULL) + free(irregular->predicates); + + nb_predicates = irregular->nb_control + irregular->nb_exit; + for(i = 0; i < nb_predicates; i++) { + for(j = 0; j < irregular->nb_iterators[i]; j++) + free(irregular->iterators[i][j]); + free(irregular->iterators[i]); + free(irregular->body[i]); + } + if(irregular->iterators != NULL) + free(irregular->iterators); + if(irregular->nb_iterators != NULL) + free(irregular->nb_iterators); + if(irregular->body != NULL) + free(irregular->body); + if(irregular->nb_predicates != NULL) + free(irregular->nb_predicates); + free(irregular); + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_irregular_clone function: + * This function builds and returns a "hard copy" (not a pointer copy) of an + * osl_irregular_t data structure. + * \param irregular The pointer to the irregular structure we want to copy. + * \return A pointer to the copy of the irregular structure. + */ +osl_irregular_p osl_irregular_clone(osl_irregular_p irregular) { + int i,j; + osl_irregular_p copy; + + if (irregular == NULL) + return NULL; + + copy = osl_irregular_malloc(); + copy->nb_statements = irregular->nb_statements; + copy->nb_predicates = (int *)malloc(sizeof(int)*copy->nb_statements); + if (copy->nb_predicates == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + copy->predicates = (int **)malloc(sizeof(int*)*copy->nb_statements); + if (copy->predicates == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + for(i=0; inb_statements; i++) + { + copy->nb_predicates[i]=irregular->nb_predicates[i]; + copy->predicates[i] = (int *)malloc(sizeof(int)*copy->nb_predicates[i]); + if (copy->predicates[i] == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + for(j=0; jnb_predicates[i]; j++) + copy->predicates[i][j] = irregular->predicates[i][j]; + } + + copy->nb_control = irregular->nb_control; + copy->nb_exit = irregular->nb_exit; + int nb_predicates = irregular->nb_control + irregular->nb_exit; + copy->nb_iterators = (int *)malloc(sizeof(int)*nb_predicates); + if (copy->nb_iterators == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + copy->iterators = (char ***)malloc(sizeof(char**)*nb_predicates); + if (copy->iterators == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + copy->body = (char **)malloc(sizeof(char*)*nb_predicates); + if (copy->body == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + for(i=0; inb_iterators[i] = irregular->nb_iterators[i]; + copy->iterators[i] = (char**)malloc(sizeof(char*)*copy->nb_iterators[i]); + if (copy->iterators[i] == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + for(j=0;jnb_iterators[i];j++) + OSL_strdup(copy->iterators[i][j], irregular->iterators[i][j]); + OSL_strdup(copy->iterators[i][j], irregular->body[i]); + } + + return copy; +} + + +/** + * osl_irregular_equal function: + * this function returns true if the two irregular structures are the same + * (content-wise), false otherwise. This functions considers two irregular + * \param c1 The first irregular structure. + * \param c2 The second irregular structure. + * \return 1 if c1 and c2 are the same (content-wise), 0 otherwise. + */ +int +osl_irregular_equal(osl_irregular_p c1, osl_irregular_p c2) +{ + int i,j,bool = 0; + if (c1 == c2) + return 1; + + if (((c1 == NULL) && (c2 != NULL)) || ((c1 != NULL) && (c2 == NULL))) + return 0; + + if(c1->nb_statements != c2->nb_statements || + c1->nb_control != c2->nb_control || + c1->nb_exit != c2->nb_exit) + return 0; + i=0; + while(bool == 0 && i < c1->nb_statements) + { + bool = c1->nb_predicates[i] != c2->nb_predicates[i] ? 1 : 0; + i++; + } + if(bool != 0) + return 0; + + i = 0; + while(bool == 0 && i < c1->nb_control + c1->nb_exit) + { + bool += c1->nb_iterators[i] != c2->nb_iterators[i] ? 1 : 0; + bool += strcmp(c1->body[i],c2->body[i]); + j = 0; + while(bool == 0 && j < c1->nb_iterators[i]) + { + bool += strcmp(c1->iterators[i][j],c2->iterators[i][j]); + j++; + } + i++; + } + if(bool != 0) + return 0; + return 1; +} + +osl_irregular_p osl_irregular_add_control( + osl_irregular_p irregular, + char** iterators, + int nb_iterators, + char* body) +{ + int i,j; + osl_irregular_p result=osl_irregular_malloc(); + + result->nb_control = irregular->nb_control + 1; + result->nb_exit = irregular->nb_exit; + result->nb_statements = irregular->nb_statements; + int nb_predicates = result->nb_control + result->nb_exit; + + result->iterators = (char***)malloc(sizeof(char**)*nb_predicates); + result->nb_iterators = (int*)malloc(sizeof(int)*nb_predicates); + result->body = (char**)malloc(sizeof(char*)*nb_predicates); + if (result->iterators == NULL || + result->nb_iterators == NULL || + result->body == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + //copy controls + for(i=0; inb_control; i++) + { + result->nb_iterators[i] = irregular->nb_iterators[i]; + OSL_strdup(result->body[i], irregular->body[i]); + result->iterators[i] = (char**)malloc(sizeof(char*) * + irregular->nb_iterators[i]); + if (result->iterators[i] == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + for(j=0; jnb_iterators[i];j++) + OSL_strdup(result->iterators[i][j], irregular->iterators[i][j]); + } + //add controls + result->iterators[irregular->nb_control] = (char**)malloc(sizeof(char*)*nb_iterators); + if (result->iterators[irregular->nb_control] == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + for(i=0; iiterators[irregular->nb_control][i], iterators[i]); + result->nb_iterators[irregular->nb_control] = nb_iterators; + OSL_strdup(result->body[irregular->nb_control], body); + //copy exits + for(i=result->nb_control; inb_iterators[i] = irregular->nb_iterators[i-1]; + OSL_strdup(result->body[i], irregular->body[i-1]); + result->iterators[i] = (char**)malloc(sizeof(char*) * + irregular->nb_iterators[i-1]); + if (result->iterators[i] == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + for(j=0; jnb_iterators[i-1];j++) + OSL_strdup(result->iterators[i][j], irregular->iterators[i-1][j]); + } + // copy statements + result->nb_predicates = (int*)malloc(sizeof(int)*irregular->nb_statements); + result->predicates = (int**)malloc(sizeof(int*)*irregular->nb_statements); + if (result->nb_predicates == NULL || result->predicates == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + for(i=0; inb_statements; i++) + { + result->predicates[i] = (int*)malloc(sizeof(int)*irregular->nb_predicates[i]); + if (result->predicates[i] == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + result->nb_predicates[i] = irregular->nb_predicates[i]; + for(j=0; jnb_predicates[i]; j++) + result->predicates[i][j]=irregular->predicates[i][j]; + } + return result; +} + + +osl_irregular_p osl_irregular_add_exit( + osl_irregular_p irregular, + char** iterators, + int nb_iterators, + char* body) +{ + int i,j; + osl_irregular_p result=osl_irregular_malloc(); + + result->nb_control = irregular->nb_control; + result->nb_exit = irregular->nb_exit + 1; + result->nb_statements = irregular->nb_statements; + int nb_predicates = result->nb_control + result->nb_exit; + + result->iterators = (char***)malloc(sizeof(char**)*nb_predicates); + result->nb_iterators = (int*)malloc(sizeof(int)*nb_predicates); + result->body = (char**)malloc(sizeof(char*)*nb_predicates); + if (result->iterators == NULL || + result->nb_iterators == NULL || + result->body == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + //copy controls and exits + for(i=0; inb_iterators[i] = irregular->nb_iterators[i]; + OSL_strdup(result->body[i], irregular->body[i]); + result->iterators[i] = (char**)malloc(sizeof(char*) * + irregular->nb_iterators[i]); + if (result->iterators[i] == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + for(j=0; jnb_iterators[i];j++) + OSL_strdup(result->iterators[i][j], irregular->iterators[i][j]); + } + //add exit + result->iterators[nb_predicates-1] = (char**)malloc(sizeof(char*)*nb_iterators); + if (result->iterators[nb_predicates-1] == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + + for(i=0; iiterators[nb_predicates-1][i], iterators[i]); + result->nb_iterators[nb_predicates-1] = nb_iterators; + OSL_strdup(result->body[nb_predicates-1], body); + // copy statements + result->nb_predicates = (int*)malloc(sizeof(int)*irregular->nb_statements); + result->predicates = (int**)malloc(sizeof(int*)*irregular->nb_statements); + if (result->nb_predicates == NULL || result->predicates == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + for(i=0; inb_statements; i++) + { + result->predicates[i] = (int*)malloc(sizeof(int)*irregular->nb_predicates[i]); + if (result->predicates[i] == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + result->nb_predicates[i] = irregular->nb_predicates[i]; + for(j=0; jnb_predicates[i]; j++) + result->predicates[i][j]=irregular->predicates[i][j]; + } + return result; +} + + +osl_irregular_p osl_irregular_add_predicates( + osl_irregular_p irregular, + int* predicates, + int nb_add_predicates) +{ + int i,j; + osl_irregular_p result=osl_irregular_malloc(); + + result->nb_control = irregular->nb_control; + result->nb_exit = irregular->nb_exit; + result->nb_statements = irregular->nb_statements+1; + int nb_predicates = result->nb_control + result->nb_exit; + + result->iterators = (char***)malloc(sizeof(char**)*nb_predicates); + result->nb_iterators = (int*)malloc(sizeof(int)*nb_predicates); + result->body = (char**)malloc(sizeof(char*)*nb_predicates); + if (result->iterators == NULL || + result->nb_iterators == NULL || + result->body == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + //copy controls and exits + for(i=0; inb_iterators[i] = irregular->nb_iterators[i]; + OSL_strdup(result->body[i], irregular->body[i]); + result->iterators[i] = (char**)malloc(sizeof(char*) * + irregular->nb_iterators[i]); + if (result->iterators[i] == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + for(j=0; jnb_iterators[i];j++) + OSL_strdup(result->iterators[i][j], irregular->iterators[i][j]); + } + //copy statements + result->nb_predicates = (int*)malloc(sizeof(int)*result->nb_statements); + result->predicates = (int**)malloc(sizeof(int*)*result->nb_statements); + if (result->nb_predicates == NULL || + result->predicates == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + for(i=0; inb_statements; i++) + { + result->predicates[i] = (int*)malloc(sizeof(int)*irregular->nb_predicates[i]); + if (result->predicates[i] == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + result->nb_predicates[i] = irregular->nb_predicates[i]; + for(j=0; jnb_predicates[i]; j++) + result->predicates[i][j]=irregular->predicates[i][j]; + } + //add statement + result->predicates[irregular->nb_statements] = (int*)malloc(sizeof(int)*nb_add_predicates); + if (result->predicates[irregular->nb_statements] == NULL) + { + fprintf(stderr, "[OpenScop] Error: memory overflow.\n"); + exit(1); + } + for(i=0; ipredicates[irregular->nb_statements][i] = predicates[i]; + result->nb_predicates[irregular->nb_statements] = nb_add_predicates; + + return result; + + +} + + +/** + * osl_irregular_interface function: + * this function creates an interface structure corresponding to the irregular + * extension and returns it). + * \return An interface structure for the irregular extension. + */ +osl_interface_p osl_irregular_interface() { + osl_interface_p interface = osl_interface_malloc(); + + OSL_strdup(interface->URI, OSL_URI_IRREGULAR); + interface->idump = (osl_idump_f)osl_irregular_idump; + interface->sprint = (osl_sprint_f)osl_irregular_sprint; + interface->sread = (osl_sread_f)osl_irregular_sread; + interface->malloc = (osl_malloc_f)osl_irregular_malloc; + interface->free = (osl_free_f)osl_irregular_free; + interface->clone = (osl_clone_f)osl_irregular_clone; + interface->equal = (osl_equal_f)osl_irregular_equal; + + return interface; +} + + diff -Nru cloog-0.18.2/osl/source/extensions/loop.c cloog-0.18.4/osl/source/extensions/loop.c --- cloog-0.18.2/osl/source/extensions/loop.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/extensions/loop.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,594 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/loop.c ** + **-----------------------------------------------------------------** + ** First version: 03/06/2013 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_loop_idump function: + * this function displays an osl_loop_t structure (loop) into a file + * (file, possibly stdout) in a way that trends to be understandable. It + * includes an indentation level (level) in order to work with others + * idump functions. + * + * \param[in] file The file where the information has to be printed. + * \param[in] loop The loop structure to print. + * \param[in] level Number of spaces before printing, for each line. + */ +void osl_loop_idump(FILE * file, osl_loop_p loop, int level) { + int i, j, first = 1, number=1; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (loop != NULL) + fprintf(file, "+-- osl_loop_t\n"); + else + fprintf(file, "+-- NULL loop\n"); + + while (loop != NULL) { + // Go to the right level. + if (!first) { + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + fprintf(file, "| osl_loop_t (node %d)\n", number); + } else { + first = 0; + } + + // A blank line. + for (j = 0; j <= level+1; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); + + // Display the number of names. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "+--iterator: %s\n", loop->iter); + + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "+--nb_stmts: %d\n", loop->nb_stmts); + + // Display the id/name. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "+--stmt_ids:"); + for(i = 0; i < loop->nb_stmts; i++) { + // Go to the right level. + fprintf(file, "%2d, ", loop->stmt_ids[i]); + } + fprintf(file, "\n"); + + + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "+--private_vars: %s\n", loop->private_vars); + + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "+--directive: %d\n", loop->directive); + + loop = loop->next; + number++; + + // Next line. + if (loop != NULL) { + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "V\n"); + } + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_loop_dump function: + * this function prints the content of an osl_loop_t structure + * (*loop) into a file (file, possibly stdout). + * + * \param[in] file The file where the information has to be printed. + * \param[in] loop The loop structure to print. + */ +void osl_loop_dump(FILE * file, osl_loop_p loop) { + osl_loop_idump(file, loop, 0); +} + + +/** + * osl_loop_sprint function: + * this function prints the content of an osl_loop_t structure + * (*loop) into a string (returned) in the OpenScop textual format. + * \param[in] loop The loop structure to print. + * \return A string containing the OpenScop dump of the loop structure. + */ +char * osl_loop_sprint(osl_loop_p loop) { + int i; + int nloop = 0; + int high_water_mark = OSL_MAX_STRING; + char *string = NULL; + char buffer[OSL_MAX_STRING]; + + OSL_malloc(string, char *, high_water_mark * sizeof(char)); + string[0] = '\0'; + + sprintf(buffer, "# Number of loops\n%d\n",osl_loop_count(loop)); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + while (loop != NULL) { + sprintf(buffer, "# ===========================================\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + sprintf(buffer, "# Loop number %d \n", ++nloop); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + sprintf(buffer, "# Iterator name\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + sprintf(buffer, "%s\n", loop->iter); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + sprintf(buffer, "# Number of stmts\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + sprintf(buffer, "%d\n", loop->nb_stmts); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + if (loop->nb_stmts) { + sprintf(buffer, "# Statement identifiers\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + for (i = 0; i < loop->nb_stmts; i++) { + sprintf(buffer, "%d\n", loop->stmt_ids[i]); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + sprintf(buffer, "# Private variables\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + sprintf(buffer, "%s\n", loop->private_vars); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + sprintf(buffer, "# Directive\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + sprintf(buffer, "%d\n", loop->directive); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + loop = loop->next; + } + + OSL_realloc(string, char *, (strlen(string) + 1) * sizeof(char)); + return string; +} + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/** + * osl_loop_sread function: + * this function reads a loop structure from a string complying to the + * OpenScop textual format and returns a pointer to this loop structure. + * The input parameter is updated to the position in the input string this + * function reaches right after reading the comment structure. + * + * \param[in,out] input The input string where to find an loop structure. + * Updated to the position after what has been read. + * \return A pointer to the loop structure that has been read. + */ +osl_loop_p osl_loop_sread(char **input) { + int i; + int nb_loops; + osl_loop_p head; + osl_loop_p loop; + + if (input == NULL) { + OSL_debug("no loop optional tag"); + return NULL; + } + + // Find the number of names provided. + nb_loops = osl_util_read_int(NULL, input); + if(nb_loops == 0) + return NULL; + + // Allocate the array of id and names. + head = loop = osl_loop_malloc(); + + while (nb_loops != 0) { + + loop->iter = osl_util_read_string(NULL, input); + loop->nb_stmts = osl_util_read_int(NULL, input); + + OSL_malloc(loop->stmt_ids, int *, loop->nb_stmts * sizeof(int)); + for (i = 0; i < loop->nb_stmts; i++) + loop->stmt_ids[i] = osl_util_read_int(NULL, input); + + loop->private_vars = osl_util_read_line(NULL, input); + if (!strcmp(loop->private_vars, "(null)")) { + free(loop->private_vars); + loop->private_vars=NULL; + } + + loop->directive = osl_util_read_int(NULL, input); + + nb_loops--; + if (nb_loops != 0) { + loop->next = osl_loop_malloc (); + loop = loop->next; + } + } + + return head; +} + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_loop_malloc function: + * this function allocates the memory space for an osl_loop_t + * structure and sets its fields with default values. Then it returns a + * pointer to the allocated space. + * + * \return A pointer to an empty loop structure with fields set to + * default values. + */ +osl_loop_p osl_loop_malloc() { + osl_loop_p loop; + + OSL_malloc(loop, osl_loop_p, sizeof(osl_loop_t)); + loop->iter = NULL; + loop->nb_stmts = 0; + loop->stmt_ids = NULL; + loop->private_vars = NULL; + loop->directive = 0; + loop->next = NULL; + + return loop; +} + + +/** + * osl_loop_free function: + * this function frees the allocated memory for an loop structure. + * + * \param[in,out] loop The pointer to the loop structure we want to free. + */ +void osl_loop_free(osl_loop_p loop) { + + while (loop != NULL) { + osl_loop_p tmp = loop; + + if (loop->iter) free(loop->iter); + if (loop->stmt_ids) free(loop->stmt_ids); + if (loop->private_vars) free(loop->private_vars); + + loop = loop->next; + + free(tmp); + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_loop_clone_one function: + * this function builds and returns a "hard copy" (not a pointer copy) of + * "one" (and not the whole list) osl_loop_t data structure. + * + * \param[in] loop The pointer to the loop structure to clone. + * \return A pointer to the clone of the loop structure. + */ +osl_loop_p osl_loop_clone_one(osl_loop_p loop) { + int i; + osl_loop_p clone; + + if (loop == NULL) + return NULL; + + clone = osl_loop_malloc(); + OSL_strdup(clone->iter, loop->iter); + clone->nb_stmts = loop->nb_stmts; + OSL_malloc(clone->stmt_ids, int *, loop->nb_stmts * sizeof(int)); + + for (i = 0; i < loop->nb_stmts; i++) { + clone->stmt_ids[i] = loop->stmt_ids[i]; + } + + clone->directive = loop->directive; + + if(loop->private_vars != NULL) + OSL_strdup(clone->private_vars, loop->private_vars); + + return clone; +} + +/** + * osl_loop_clone function: + * this function builds and returns a "hard copy" (not a pointer copy) of a + * list of osl_loop_t data structures. + * + * \param[in] loop The pointer to the list of loop structure to clone. + * \return A pointer to the clone of list of the loop structure. + */ +osl_loop_p osl_loop_clone(osl_loop_p loop) { + osl_loop_p clone = NULL; + osl_loop_p head = NULL; + + if (loop == NULL) + return NULL; + + while (loop) { + + if (clone==NULL) { + head = clone = osl_loop_clone_one(loop); + } + else { + clone->next = osl_loop_clone_one(loop); + clone = clone->next; + } + + loop = loop->next; + } + + return head; +} + +/** + * osl_loop_equal_one function: + * this function returns true if the two loop structures are the same + * (content-wise), false otherwise. This functions considers two loop + * structures as equal if the order of the array names differ, however + * the identifiers and names must be the same. + * + * \param[in] a1 The first loop structure. + * \param[in] a2 The second loop structure. + * \return 1 if a1 and a2 are the same (content-wise), 0 otherwise. + */ +int osl_loop_equal_one(osl_loop_p a1, osl_loop_p a2) { + int i, j, found; + + if (a1 == a2) + return 1; + + if (((a1 == NULL) && (a2 != NULL)) || ((a1 != NULL) && (a2 == NULL))) { + //OSL_info("loops are not the same (compare with NULL)"); + return 0; + } + + // Check whether the number of names is the same. + if (a1->nb_stmts != a2->nb_stmts) { + //OSL_info("loops are not the same (nb_stmts)"); + return 0; + } + + if (strcmp(a1->iter, a2->iter)) { + //OSL_info("loops are not the same (iter name)"); + return 0; + } + // We accept a different order of the names, as long as the identifiers + // are the same. + for (i = 0; i < a1->nb_stmts; i++) { + found = 0; + for (j = 0; j < a2->nb_stmts; j++) { + if (a1->stmt_ids[i] == a2->stmt_ids[j]) { + found = 1; + break; + } + } + if (found != 1) { + //OSL_info("loop are not the same (stmt ids)"); + return 0; + } + } + + //TODO: necessarily same ??? + if (a1->private_vars != a2->private_vars) { // NULL check + if (strcmp(a1->private_vars, a2->private_vars)) { + //OSL_info("loops are not the same (private vars)"); + return 0; + } + } + + //TODO: necessarily same ??? + if (a1->directive != a2->directive) { + //OSL_info("loops are not the same (directive)"); + return 0; + } + + return 1; +} + +/** + * osl_loop_equal function: + * this function returns true if the two loop lists are the same + * (content-wise), false otherwise. Two lists are equal if one contains + * all the elements of the other and vice versa. The exact order of the + * nodes is not taken into account by this function. + * + * \param[in] a1 The first loop list. + * \param[in] a2 The second loop list. + * \return 1 if a1 and a2 are the same (content-wise), 0 otherwise. + */ +int osl_loop_equal(osl_loop_p a1, osl_loop_p a2) { + int found = 0; + + if (a1 == a2) + return 1; + + if (((a1 == NULL) && (a2 != NULL)) || ((a1 != NULL) && (a2 == NULL))) { + OSL_info("lists of loops are not the same (compare with NULL)"); + return 0; + } + + if (osl_loop_count(a1) != osl_loop_count(a2)) { + OSL_info("list of loops are not the same"); + return 0; + } + + while (a1) { + found = 0; + osl_loop_p temp = a2; + + while (temp) { + if(osl_loop_equal_one(a1, temp)==1){ + found= 1; + break; + } + temp = temp->next; + } + + if(found!=1){ + OSL_info("list of loops are not the same"); + return 0; + } + a1 = a1->next; + } + + return 1; +} + + +/** + * osl_loop_interface function: + * this function creates an interface structure corresponding to the loop + * extension and returns it. + * + * \return An interface structure for the loop extension. + */ +osl_interface_p osl_loop_interface() { + osl_interface_p interface = osl_interface_malloc(); + + OSL_strdup(interface->URI, OSL_URI_LOOP); + interface->idump = (osl_idump_f)osl_loop_idump; + interface->sprint = (osl_sprint_f)osl_loop_sprint; + interface->sread = (osl_sread_f)osl_loop_sread; + interface->malloc = (osl_malloc_f)osl_loop_malloc; + interface->free = (osl_free_f)osl_loop_free; + interface->clone = (osl_clone_f)osl_loop_clone; + interface->equal = (osl_equal_f)osl_loop_equal; + + return interface; +} + + +/** + * osl_loop_add function: + * this function adds a loop structure at the end of the list + * + * \param[in,out] ll Pointer to a list of loops. + * \param[in] loop Pointer to the loop structure to be added. + */ +void osl_loop_add(osl_loop_p loop, osl_loop_p *ll) { + + while (*ll != NULL) + ll = &(*ll)->next; + + *ll = loop; +} + + +/** + * osl_loop_count: + * this function returns the number of elements in the list + * + * \param[in] ll Pointer to a list of loops. + * \return Number of elements in the list + */ +int osl_loop_count(osl_loop_p ll) { + int count = 0; + while (ll) { + count++; + ll = ll->next; + } + + return count; +} diff -Nru cloog-0.18.2/osl/source/extensions/null.c cloog-0.18.4/osl/source/extensions/null.c --- cloog-0.18.2/osl/source/extensions/null.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/extensions/null.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,269 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/null.c ** + **-----------------------------------------------------------------** + ** First version: 28/06/2012 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#include +#include +#include + +#include +#include +#include +#include + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_null_idump function: + * this function displays an osl_null_t structure (*null) into a + * file (file, possibly stdout) in a way that trends to be understandable. It + * includes an indentation level (level) in order to work with others + * idump functions. + * \param[in] file The file where the information has to be printed. + * \param[in] null The null structure to print. + * \param[in] level Number of spaces before printing, for each line. + */ +void osl_null_idump(FILE * file, osl_null_p null, int level) { + int j; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (null != NULL) + fprintf(file, "+-- osl_null_t\n"); + else + fprintf(file, "+-- NULL null\n"); + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_null_dump function: + * this function prints the content of an osl_null_t structure + * (*null) into a file (file, possibly stdout). + * \param[in] file The file where the information has to be printed. + * \param[in] null The null structure to print. + */ +void osl_null_dump(FILE * file, osl_null_p null) { + osl_null_idump(file, null, 0); +} + + +/** + * osl_null_sprint function: + * this function prints the content of an osl_null_t structure + * (*null) into a string (returned) in the OpenScop textual format. + * \param[in] null The null structure to print. + * \return A string containing the OpenScop dump of the null structure. + */ +char * osl_null_sprint(osl_null_p null) { + char * string = NULL; + + if (null != NULL) { + // Print nothing. + OSL_malloc(string, char *, sizeof(char)); + string[0] = '\0'; + } + + return string; +} + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/** + * osl_null_sread function: + * this function reads a null structure from a string complying to the + * OpenScop textual format and returns a pointer to this null structure. + * The input parameter is updated to the position in the input string this + * function reach right after reading the null structure. + * \param[in,out] input The input string where to find a null. + * Updated to the position after what has been read. + * \return A pointer to the null structure that has been read. + */ +osl_null_p osl_null_sread(char ** input) { + osl_null_p null; + + if (*input == NULL) { + OSL_debug("no null optional tag"); + return NULL; + } + + // Build the null structure + null = osl_null_malloc(); + + // Update the input pointer (everything has been read and ignored). + input += strlen(*input); + + return null; +} + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_null_malloc function: + * this function allocates the memory space for an osl_null_t + * structure and sets its fields with default values. Then it returns a + * pointer to the allocated space. + * \return A pointer to an empty null structure with fields set to + * default values. + */ +osl_null_p osl_null_malloc() { + osl_null_p null; + + OSL_malloc(null, osl_null_p, sizeof(osl_null_t)); + return null; +} + + +/** + * osl_null_free function: + * this function frees the allocated memory for an osl_null_t + * structure. + * \param[in,out] null The pointer to the null structure to free. + */ +void osl_null_free(osl_null_p null) { + if (null != NULL) { + free(null); + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_null_clone function: + * this function builds and returns a "hard copy" (not a pointer copy) of an + * osl_null_t data structure. + * \param[in] null The pointer to the null structure to clone. + * \return A pointer to the clone of the null structure. + */ +osl_null_p osl_null_clone(osl_null_p null) { + osl_null_p clone; + + if (null == NULL) + return NULL; + + clone = osl_null_malloc(); + return clone; +} + + +/** + * osl_null_equal function: + * this function returns true if the two null structures are the same + * (content-wise), false otherwise. + * \param[in] c1 The first null structure. + * \param[in] c2 The second null structure. + * \return 1 if c1 and c2 are the same (content-wise), 0 otherwise. + */ +int osl_null_equal(osl_null_p c1, osl_null_p c2) { + if (c1 == c2) + return 1; + + if (((c1 == NULL) && (c2 != NULL)) || ((c1 != NULL) && (c2 == NULL))) { + OSL_info("nulls are not the same"); + return 0; + } + + return 1; +} + + +/** + * osl_null_interface function: + * this function creates an interface structure corresponding to the null + * extension and returns it). + * \return An interface structure for the null extension. + */ +osl_interface_p osl_null_interface() { + osl_interface_p interface = osl_interface_malloc(); + + OSL_strdup(interface->URI, OSL_URI_NULL); + interface->idump = (osl_idump_f)osl_null_idump; + interface->sprint = (osl_sprint_f)osl_null_sprint; + interface->sread = (osl_sread_f)osl_null_sread; + interface->malloc = (osl_malloc_f)osl_null_malloc; + interface->free = (osl_free_f)osl_null_free; + interface->clone = (osl_clone_f)osl_null_clone; + interface->equal = (osl_equal_f)osl_null_equal; + + return interface; +} diff -Nru cloog-0.18.2/osl/source/extensions/pluto_unroll.c cloog-0.18.4/osl/source/extensions/pluto_unroll.c --- cloog-0.18.2/osl/source/extensions/pluto_unroll.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/extensions/pluto_unroll.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,422 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/pluto_unroll.c ** + **-----------------------------------------------------------------** + ** First version: 26/06/2014 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2014 Inria * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#include +#include + +#include "../include/osl/extensions/pluto_unroll.h" +#include "../include/osl/macros.h" + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_loop_idump function: + * this function displays an osl_pluto_unroll_t structure (pluto_unroll) into a + * file (file, possibly stdout) in a way that trends to be understandable. It + * includes an indentation level (level) in order to work with others + * idump functions. + * + * \param[in] file The file where the information has to be printed. + * \param[in] pluto_unroll The pluto_unroll structure to print. + * \param[in] level Number of spaces before printing, for each line. + */ +void osl_pluto_unroll_idump(FILE * file, + osl_pluto_unroll_p pluto_unroll, int level) { + int j, first = 1, number=1; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (pluto_unroll != NULL) + fprintf(file, "+-- osl_pluto_unroll_t\n"); + else + fprintf(file, "+-- NULL pluto_unroll\n"); + + while (pluto_unroll != NULL) { + // Go to the right level. + if (!first) { + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + fprintf(file, "| osl_pluto_unroll_t (node %d)\n", number); + } else { + first = 0; + } + + // A blank line. + for (j = 0; j <= level+1; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); + + // Display the names of iterators. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "+--iterator: %s\n", pluto_unroll->iter); + + // Display the names of iterators. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "+--jam: %i\n", pluto_unroll->jam); + + // Display the names of iterators. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "+--factor: %i\n", pluto_unroll->factor); + + pluto_unroll = pluto_unroll->next; + + // Next line. + if (pluto_unroll != NULL) { + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "V\n"); + } + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_pluto_unroll_dump function: + * this function prints the content of an osl_pluto_unroll_t structure + * (*pluto_unroll) into a file (file, possibly stdout). + * + * \param[in] file The file where the information has to be printed. + * \param[in] pluto_unroll The pluto_unroll structure to print. + */ +void osl_pluto_unroll_dump(FILE * file, osl_pluto_unroll_p pluto_unroll) { + osl_pluto_unroll_idump(file, pluto_unroll, 0); +} + + +/** + * osl_pluto_unroll_sprint function: + * this function prints the content of an osl_pluto_unroll_t structure + * (*pluto_unroll) into a string (returned) in the OpenScop textual format. + * + * \param[in] pluto_unroll The loop structure to print. + * + * \return a string containing the OpenScop dump of the loop structure. + */ +char * osl_pluto_unroll_sprint(osl_pluto_unroll_p pluto_unroll) { + + char* string = NULL; + char buffer[OSL_MAX_STRING] = { 0 }; + + strcat(buffer, "# Pluto unroll\n"); + if (pluto_unroll != NULL) { + strcat(buffer, "1\n"); + } else { + strcat(buffer, "0\n"); + } + + while (pluto_unroll != NULL) + { + strcat(buffer, "# Iterator name\n"); + sprintf(buffer + strlen(buffer), "%s\n", pluto_unroll->iter); + + strcat(buffer, "# Jam\n"); + sprintf(buffer + strlen(buffer), "%i\n", pluto_unroll->jam); + + strcat(buffer, "# Factor\n"); + sprintf(buffer + strlen(buffer), "%i\n", pluto_unroll->factor); + + pluto_unroll = pluto_unroll->next; + + strcat(buffer, "# Next\n"); + if (pluto_unroll != NULL) { + strcat(buffer, "1\n"); + } else { + strcat(buffer, "0\n"); + } + } + + OSL_realloc(string, char*, (strlen(buffer) + 1) * sizeof(char)); + strcpy(string, buffer); + + return string; +} + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/** + * osl_pluto_unroll_sread function: + * this function reads a pluto_unroll structure from a string complying to the + * OpenScop textual format and returns a pointer to this pluto_unroll structure. + * The input parameter is updated to the position in the input string this + * function reaches right after reading the comment structure. + * + * \param[in,out] input The input string where to find an pluto_unroll + * structure. + * Updated to the position after what has been read. + * + * \return a pointer to the pluto_unroll structure that has been read. + */ +osl_pluto_unroll_p osl_pluto_unroll_sread(char** input) { + osl_pluto_unroll_p p = NULL; + if (osl_util_read_int(NULL, input) == 1) { p = osl_pluto_unroll_malloc(); } + osl_pluto_unroll_p r = p; + + while (p != NULL) + { + // iter + p->iter = osl_util_read_line(NULL, input); + // jam + p->jam = osl_util_read_int(NULL, input); + // factor + p->factor = osl_util_read_int(NULL, input); + // Next + if (osl_util_read_int(NULL, input) == 1) { + p->next = osl_pluto_unroll_malloc(); + } + p = p->next; + } + + return r; +} + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_pluto_unroll_malloc function: + * this function allocates the memory space for an osl_pluto_unroll_t + * structure and sets its fields with default values. Then it returns a + * pointer to the allocated space. + * + * \return a pointer to an empty pluto_unroll structure with fields set to + * default values. + */ +osl_pluto_unroll_p osl_pluto_unroll_malloc() { + osl_pluto_unroll_p pluto_unroll = NULL; + + OSL_malloc(pluto_unroll, osl_pluto_unroll_p, sizeof(osl_pluto_unroll_t)); + pluto_unroll->iter = NULL; + pluto_unroll->jam = false; + pluto_unroll->factor = 0; + pluto_unroll->next = NULL; + + return pluto_unroll; +} + + +/** + * osl_pluto_unroll_free function: + * this function frees the allocated memory for an pluto_unroll structure. + * + * \param[in,out] pluto_unroll The pointer to the pluto_unroll structure + * we want to free. + */ +void osl_pluto_unroll_free(osl_pluto_unroll_p pluto_unroll) { + if (pluto_unroll != NULL) { + osl_pluto_unroll_free(pluto_unroll->next); + + free(pluto_unroll->iter); + free(pluto_unroll); pluto_unroll = NULL; + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + +/** + * osl_pluto_unroll_fill function: + * this function fill the osl_pluto_unroll_t with the iterator name, + * if jam or not and the unroll factor + * + * \param[in] pluto_unroll The pointer to the osl_pluto_unroll_t + * \param[in] jam true if jam, falsee otherwise + * \param[in] factor Unroll factor + */ +void osl_pluto_unroll_fill(osl_pluto_unroll_p pluto_unroll, + char const * const iterator_name, + bool const jam, int const factor) { + if (pluto_unroll != NULL) { + // iter + if (iterator_name != NULL) { + OSL_realloc(pluto_unroll->iter, + char*, (strlen(iterator_name) + 1) * sizeof(char)); + strcpy(pluto_unroll->iter, iterator_name); + } + // jam + pluto_unroll->jam = jam; + // factor + pluto_unroll->factor = factor; + } else { + OSL_warning("osl_pluto_unroll_fill can not fill NULL osl_pluto_unroll_p"); + } +} + +/** + * osl_pluto_unroll_clone function: + * this function builds and returns a "hard copy" (not a pointer copy) of a + * list of osl_pluto_unroll_t data structures. + * + * \param[in] pluto_unroll The pointer to the list of pluto_unroll structure to + * clone. + * + * \return a pointer to the clone of list of the pluto_unroll structure. + */ +osl_pluto_unroll_p osl_pluto_unroll_clone(osl_pluto_unroll_p pluto_unroll) { + osl_pluto_unroll_p p = NULL; + if (pluto_unroll != NULL) { p = osl_pluto_unroll_malloc(); } + osl_pluto_unroll_p r = p; + + while (pluto_unroll != NULL) + { + osl_pluto_unroll_fill(p, pluto_unroll->iter, + pluto_unroll->jam, + pluto_unroll->factor); + + pluto_unroll = pluto_unroll->next; + + if (pluto_unroll != NULL) { p->next = osl_pluto_unroll_malloc(); } + p = p->next; + } + + return r; +} + +/** + * osl_pluto_unroll_equal function: + * this function returns true if the two pluto_unroll lists are the same + * (content-wise), false otherwise. Two lists are equal if one contains + * all the elements of the other and vice versa. The exact order of the + * nodes is not taken into account by this function. + * + * \param[in] a The first pluto_unroll list. + * \param[in] b The second pluto_unroll list. + * + * \return 1 if a and b are the same (content-wise), 0 otherwise. + */ +int osl_pluto_unroll_equal(osl_pluto_unroll_p a, osl_pluto_unroll_p b) { + + if (a == b) { return 1; } + + if (a == NULL && b != NULL) { return 0; } + if (a != NULL && b == NULL) { return 0; } + + while (a != NULL) { + // Iter + if (a->iter == NULL && b->iter != NULL) { return 0; } + if (a->iter != NULL && b->iter == NULL) { return 0; } + if (a->iter != NULL) { + if (strcmp(a->iter, b->iter) != 0) { return 0; } + + } + // Jam + if (a->jam != b->jam) { return 0; } + // Factor + if (a->factor != b->factor) { return 0; } + // Next + if (a->next == b->next) { return 1; } + if (a->next == NULL && b->next != NULL) { return 0; } + if (a->next != NULL && b->next == NULL) { return 0; } + a = a->next; + b = b->next; + } + + return 1; +} + + +/** + * osl_pluto_unroll_interface function: + * this function creates an interface structure corresponding to the + * pluto_unroll extension and returns it. + * + * \return an interface structure for the pluto_unroll extension. + */ +osl_interface_p osl_pluto_unroll_interface() { + osl_interface_p interface = osl_interface_malloc(); + + OSL_strdup(interface->URI, OSL_URI_PLUTO_UNROLL); + interface->idump = (osl_idump_f)osl_pluto_unroll_idump; + interface->sprint = (osl_sprint_f)osl_pluto_unroll_sprint; + interface->sread = (osl_sread_f)osl_pluto_unroll_sread; + interface->malloc = (osl_malloc_f)osl_pluto_unroll_malloc; + interface->free = (osl_free_f)osl_pluto_unroll_free; + interface->clone = (osl_clone_f)osl_pluto_unroll_clone; + interface->equal = (osl_equal_f)osl_pluto_unroll_equal; + + return interface; +} diff -Nru cloog-0.18.2/osl/source/extensions/scatnames.c cloog-0.18.4/osl/source/extensions/scatnames.c --- cloog-0.18.2/osl/source/extensions/scatnames.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/extensions/scatnames.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,282 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/scatnames.c ** + **-----------------------------------------------------------------** + ** First version: 03/12/2011 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#include +#include +#include + +#include +#include +#include +#include +#include + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_scatnames_idump function: + * this function displays an osl_scatnames_t structure (*scatnames) into a + * file (file, possibly stdout) in a way that trends to be understandable. It + * includes an indentation level (level) in order to work with others + * idump functions. + * \param[in] file The file where the information has to be printed. + * \param[in] scatnames Scatnames structure to print. + * \param[in] level Number of spaces before printing, for each line. + */ +void osl_scatnames_idump(FILE * file, osl_scatnames_p scatnames, int level) { + int j; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (scatnames != NULL) + fprintf(file, "+-- osl_scatnames_t\n"); + else + fprintf(file, "+-- NULL scatnames\n"); + + if (scatnames != NULL) { + // Go to the right level. + for(j = 0; j <= level + 1; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); + + // Display the list of scattering names. + osl_strings_idump(file, scatnames->names, level + 1); + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_scatnames_dump function: + * this function prints the content of an osl_scatnames_t structure + * (*scatnames) into a file (file, possibly stdout). + * \param[in] file The file where the information has to be printed. + * \param[in] scatnames The scatnames structure to print. + */ +void osl_scatnames_dump(FILE * file, osl_scatnames_p scatnames) { + osl_scatnames_idump(file, scatnames, 0); +} + + +/** + * osl_scatnames_sprint function: + * this function prints the content of an osl_scatnames_t structure + * (*scatnames) into a string (returned) in the OpenScop textual format. + * \param[in] scatnames The scatnames structure to print. + * \return A string containing the OpenScop dump of the scatnames structure. + */ +char * osl_scatnames_sprint(osl_scatnames_p scatnames) { + return osl_strings_sprint(scatnames->names); +} + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/** + * osl_scatnames_sread function: + * this function reads a scatnames structure from a string complying to the + * OpenScop textual format and returns a pointer to this scatnames structure. + * The input parameter is updated to the position in the input string this + * function reach right after reading the scatnames structure. If there + * is nothing to read, the function returns NULL. + * \param[in,out] input The input string where to find a scatnames. + * Updated to the position after what has been read. + * \return A pointer to the scatnames structure that has been read. + */ +osl_scatnames_p osl_scatnames_sread(char ** input) { + osl_scatnames_p scatnames = NULL; + osl_strings_p names = NULL; + + if (*input == NULL) { + OSL_debug("no scatnames optional tag"); + return NULL; + } + + // Build the scatnames structure + names = osl_strings_sread(input); + if (names != NULL) { + scatnames = osl_scatnames_malloc(); + scatnames->names = names; + } + + return scatnames; +} + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_scatnames_malloc function: + * this function allocates the memory space for an osl_scatnames_t + * structure and sets its fields with default values. Then it returns a + * pointer to the allocated space. + * \return A pointer to an empty scatnames structure with fields set to + * default values. + */ +osl_scatnames_p osl_scatnames_malloc() { + osl_scatnames_p scatnames; + + OSL_malloc(scatnames, osl_scatnames_p, sizeof(osl_scatnames_t)); + scatnames->names = NULL; + + return scatnames; +} + + +/** + * osl_scatnames_free function: + * this function frees the allocated memory for an osl_scatnames_t + * structure. + * \param[in,out] scatnames The pointer to the scatnames structure to free. + */ +void osl_scatnames_free(osl_scatnames_p scatnames) { + if (scatnames != NULL) { + osl_strings_free(scatnames->names); + free(scatnames); + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_scatnames_clone function: + * This function builds and returns a "hard copy" (not a pointer copy) of an + * osl_scatnames_t data structure. + * \param[in] scatnames The pointer to the scatnames structure to clone. + * \return A pointer to the clone of the scatnames structure. + */ +osl_scatnames_p osl_scatnames_clone(osl_scatnames_p scatnames) { + osl_scatnames_p clone; + + if (scatnames == NULL) + return NULL; + + clone = osl_scatnames_malloc(); + clone->names = osl_strings_clone(scatnames->names); + + return clone; +} + + +/** + * osl_scatnames_equal function: + * this function returns true if the two scatnames structures are the same + * (content-wise), false otherwise. + * \param[in] s1 The first scatnames structure. + * \param[in] s2 The second scatnames structure. + * \return 1 if s1 and s2 are the same (content-wise), 0 otherwise. + */ +int osl_scatnames_equal(osl_scatnames_p s1, osl_scatnames_p s2) { + + if (s1 == s2) + return 1; + + if (((s1 == NULL) && (s2 != NULL)) || ((s1 != NULL) && (s2 == NULL))) + return 0; + + if (!osl_strings_equal(s1->names, s2->names)) + return 0; + + return 1; +} + + +/** + * osl_scatnames_interface function: + * this function creates an interface structure corresponding to the scatnames + * extension and returns it). + * \return An interface structure for the scatnames extension. + */ +osl_interface_p osl_scatnames_interface() { + osl_interface_p interface = osl_interface_malloc(); + + OSL_strdup(interface->URI, OSL_URI_SCATNAMES); + interface->idump = (osl_idump_f)osl_scatnames_idump; + interface->sprint = (osl_sprint_f)osl_scatnames_sprint; + interface->sread = (osl_sread_f)osl_scatnames_sread; + interface->malloc = (osl_malloc_f)osl_scatnames_malloc; + interface->free = (osl_free_f)osl_scatnames_free; + interface->clone = (osl_clone_f)osl_scatnames_clone; + interface->equal = (osl_equal_f)osl_scatnames_equal; + + return interface; +} diff -Nru cloog-0.18.2/osl/source/extensions/symbols.c cloog-0.18.4/osl/source/extensions/symbols.c --- cloog-0.18.2/osl/source/extensions/symbols.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/extensions/symbols.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,563 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/symbols.c ** + **-----------------------------------------------------------------** + ** First version: 07/03/2012 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul * + * Louis-Noel Pouchet * + * Prasanth Chatharasi * + * * + *****************************************************************************/ + +#include +#include +#include + +#include +#include +#include +#include +#include + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_symbols_idump function: + * this function displays an osl_symbols_t structure (*symbols) into a + * file (file, possibly stdout) in a way that trends to be understandable. It + * includes an indentation level (level) in order to work with others + * idump functions. + * \param[in] file The file where the information has to be printed. + * \param[in] symbols The symbols structure to print. + * \param[in] level Number of spaces before printing, for each line. + */ +void osl_symbols_idump(FILE * file, osl_symbols_p symbols, int level) { + + int i, j, first = 1, number = 1; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (symbols != NULL) + fprintf(file, "+-- osl_symbols_t\n"); + else + fprintf(file, "+-- NULL symbols\n"); + + while (symbols != NULL) { + if (!first) { + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + fprintf(file, "| osl_symbol_t (node %d)\n", number); + } else { + first = 0; + } + + // A blank line. + for (j = 0; j <= level+1; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); + + // 1. Print the symbol kind. + for (i = 0; i <= level; i++) + fprintf(file, "|\t"); + if (symbols->type != OSL_UNDEFINED) { + fprintf(file, "+-- Type: "); + switch (symbols->type) { + case OSL_SYMBOL_TYPE_ITERATOR : fprintf(file, "Iterator\n"); break; + case OSL_SYMBOL_TYPE_PARAMETER: fprintf(file, "Parameter\n"); break; + case OSL_SYMBOL_TYPE_ARRAY : fprintf(file, "Array\n"); break; + case OSL_SYMBOL_TYPE_FUNCTION : fprintf(file, "Function\n"); break; + default : fprintf(file, "Unknown\n") ; + } + } else { + fprintf(file, "+-- NULL type\n"); + } + + // A blank line. + for(j = 0; j <= level + 1; j++) + fprintf(file, "|\t") ; + fprintf(file, "\n") ; + + // 2. Print the origin of the symbol. + for (i = 0; i <= level; i++) + fprintf(file, "|\t"); + if (symbols->generated != OSL_UNDEFINED) + fprintf(file, "+-- Origin: %d\n", symbols->generated); + else + fprintf(file, "+-- Undefined origin\n"); + + // A blank line. + for(j = 0; j <= level + 1; j++) + fprintf(file, "|\t") ; + fprintf(file, "\n") ; + + // 3. Print the number of array dimensions for the symbol. + for (i = 0; i <= level; i++) + fprintf(file, "|\t"); + if (symbols->nb_dims != OSL_UNDEFINED) + fprintf(file, "+-- Number of Dimensions: %d\n", symbols->nb_dims); + else + fprintf(file, "+-- Undefined number of dimensions\n"); + + // A blank line. + for(j = 0; j <= level + 1; j++) + fprintf(file, "|\t") ; + fprintf(file, "\n") ; + + // 4. Print the symbol identifier. + osl_generic_idump(file, symbols->identifier, level + 1); + + // 5. Print the data type of the symbol. + osl_generic_idump(file, symbols->datatype, level + 1); + + // 6. Print the scope of the symbol. + osl_generic_idump(file, symbols->scope, level + 1); + + // 7. Print the extent of the symbol. + osl_generic_idump(file, symbols->extent, level + 1); + + symbols = symbols->next; + number++; + // Next line. + if (symbols != NULL) { + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "V\n"); + } + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_symbols_dump function: + * this function prints the content of an osl_symbols_t structure + * (*symbols) into a file (file, possibly stdout). + * \param[in] file The file where the information has to be printed. + * \param[in] symbols The symbols structure to print. + */ +void osl_symbols_dump(FILE * file, osl_symbols_p symbols) { + osl_symbols_idump(file, symbols, 0); +} + + +/** + * osl_symbols_sprint function: + * this function prints the content of an osl_symbols_t structure + * (*symbols) into a string (returned) in the OpenScop textual format. + * \param[in] symbols The symbols structure to print. + * \return A string containing the OpenScop dump of the symbols structure. + */ +char * osl_symbols_sprint(osl_symbols_p symbols) { + int i = 1; + int high_water_mark = OSL_MAX_STRING; + char* string = NULL, *temp; + char buffer[OSL_MAX_STRING]; + + OSL_malloc(string, char *, high_water_mark * sizeof(char)); + string[0] = '\0'; + + sprintf(buffer, "# Number of symbols\n%d\n", + osl_symbols_get_nb_symbols(symbols)); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + while (symbols != NULL) { + sprintf(buffer, "# ===========================================\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + sprintf(buffer, "# %d Data for symbol number %d \n", i, i); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + if (symbols->type == OSL_UNDEFINED) { + sprintf(buffer, "# %d.1 Symbol type\nUndefined\n", i); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + else { + sprintf(buffer, "# %d.1 Symbol type\n", i); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + switch (symbols->type) { + case OSL_SYMBOL_TYPE_ITERATOR : sprintf(buffer, "Iterator\n"); break; + case OSL_SYMBOL_TYPE_PARAMETER: sprintf(buffer, "Parameter\n"); break; + case OSL_SYMBOL_TYPE_ARRAY : sprintf(buffer, "Array\n"); break; + case OSL_SYMBOL_TYPE_FUNCTION : sprintf(buffer, "Function\n"); break; + default : sprintf(buffer, "Undefined\n") ; + } + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + // Printing Generated Boolean flag + sprintf(buffer, "\n# %d.2 Generated Boolean\n%d\n", i, symbols->generated); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + // Printing Number of dimensions + sprintf(buffer,"\n# %d.3 Number of dimensions\n%d\n", i, symbols->nb_dims); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + // Printing Identifier + sprintf(buffer, "\n# %d.4 Identifier\n", i); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + temp = osl_generic_sprint(symbols->identifier); + osl_util_safe_strcat(&string, temp, &high_water_mark); + free(temp); + + // Printing Datatype + sprintf(buffer, "\n# %d.5 Datatype\n", i); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + temp = osl_generic_sprint(symbols->datatype); + osl_util_safe_strcat(&string, temp, &high_water_mark); + free(temp); + + // Printing Scope + sprintf(buffer, "\n# %d.6 Scope\n", i); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + temp = osl_generic_sprint(symbols->scope); + osl_util_safe_strcat(&string, temp, &high_water_mark); + free(temp); + + // Printing Extent + sprintf(buffer, "\n# %d.7 Extent\n", i); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + temp = osl_generic_sprint(symbols->extent); + osl_util_safe_strcat(&string, temp, &high_water_mark); + free(temp); + + symbols = symbols->next; + } + + OSL_realloc(string, char *, (strlen(string) + 1) * sizeof(char)); + return string; +} + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/** + * osl_symbols_sread function: + * this function reads a symbols structure from a string complying to the + * OpenScop textual format and returns a pointer to this symbols structure. + * The input parameter is updated to the position in the input string this + * function reach right after reading the symbols structure. + * \param[in,out] input The input string where to find a symbols. + * Updated to the position after what has been read. + * \return A pointer to the symbols structure that has been read. + */ +osl_symbols_p osl_symbols_sread(char ** input) { + int nb_symbols; + char* type; + osl_symbols_p symbols; + osl_symbols_p head; + osl_interface_p registry; + + if (*input == NULL) { + OSL_debug("no symbols optional tag"); + return NULL; + } + + if (strlen(*input) > OSL_MAX_STRING) + OSL_error("symbols too long"); + + // Find the number of names provided. + nb_symbols = osl_util_read_int(NULL, input); + + if (nb_symbols == 0) + return NULL; + + head = symbols = osl_symbols_malloc(); + registry = osl_interface_get_default_registry(); + + while (nb_symbols != 0) { + // Reading the type of symbol + type = osl_util_read_string(NULL, input); + if (type != NULL) { + if (strcmp(type, "Iterator") == 0) + symbols->type = OSL_SYMBOL_TYPE_ITERATOR; + else if (strcmp(type, "Parameter") == 0) + symbols->type = OSL_SYMBOL_TYPE_PARAMETER; + else if (strcmp(type, "Array") == 0) + symbols->type = OSL_SYMBOL_TYPE_ARRAY; + else if (strcmp(type, "Function") == 0) + symbols->type = OSL_SYMBOL_TYPE_FUNCTION; + else + symbols->type = OSL_UNDEFINED; + free(type); + } + + // Reading origin of symbol + symbols->generated = osl_util_read_int(NULL, input); + + // Reading the number of dimensions of a symbol + symbols->nb_dims = osl_util_read_int(NULL, input); + + // Reading identifier + symbols->identifier = osl_generic_sread_one(input, registry); + + // Reading data type + symbols->datatype = osl_generic_sread_one(input, registry); + + // Reading scope + symbols->scope = osl_generic_sread_one(input, registry); + + // Reading extent + symbols->extent = osl_generic_sread_one(input, registry); + + nb_symbols --; + if (nb_symbols != 0) { + symbols->next = osl_symbols_malloc (); + symbols = symbols->next; + } + } + + osl_interface_free(registry); + return head; +} + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_symbols_malloc function: + * this function allocates the memory space for an osl_symbols_t + * structure and sets its fields with default values. Then it returns a + * pointer to the allocated space. + * \return A pointer to an empty symbols structure with fields set to + * default values. + */ +osl_symbols_p osl_symbols_malloc() { + osl_symbols_p symbols; + + OSL_malloc(symbols, osl_symbols_p, sizeof(osl_symbols_t)); + symbols->type = OSL_UNDEFINED; + symbols->generated = OSL_UNDEFINED; + symbols->nb_dims = OSL_UNDEFINED; + symbols->identifier = NULL; + symbols->datatype = NULL; + symbols->scope = NULL; + symbols->extent = NULL; + symbols->next = NULL; + + return symbols; +} + + +/** + * osl_symbols_free function: + * this function frees the allocated memory for an osl_symbols_t + * structure. + * \param[in,out] symbols The pointer to the symbols structure to free. + */ +void osl_symbols_free(osl_symbols_p symbols) { + osl_symbols_p tmp; + + while (symbols != NULL) { + tmp = symbols->next; + osl_generic_free(symbols->identifier); + osl_generic_free(symbols->datatype); + osl_generic_free(symbols->scope); + osl_generic_free(symbols->extent); + free(symbols); + symbols = tmp; + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_symbols_add function: + * this function adds a scop "scop" at the end of the symbols list pointed + * by "location". + * \param[in,out] location Address of the first element of the symbols list. + * \param[in] symbols The symbols to add to the list. + */ +void osl_symbols_add(osl_symbols_p* location, osl_symbols_p symbols) { + while (*location != NULL) + location = &((*location)->next); + + *location = symbols; +} + + +/** + * osl_symbols_nclone function: + * This function builds and returns a "hard copy" (not a pointer copy) of the + * n first elements of an osl_symbols_t list. + * \param symbols The pointer to the symbols structure we want to clone. + * \param n The number of nodes we want to copy (-1 for infinity). + * \return The clone of the n first nodes of the symbols list. + */ +osl_symbols_p osl_symbols_nclone(osl_symbols_p symbols, int n) { + osl_symbols_p clone = NULL, new; + int i = 0; + + while ((symbols != NULL) && ((n == -1) || (i < n))) { + new = osl_symbols_malloc(); + new->type = symbols->type; + new->generated = symbols->generated; + new->nb_dims = symbols->nb_dims; + new->identifier = osl_generic_clone(symbols->identifier); + new->datatype = osl_generic_clone(symbols->datatype); + new->scope = osl_generic_clone(symbols->scope); + new->extent = osl_generic_clone(symbols->extent); + + osl_symbols_add(&clone, new); + symbols = symbols->next; + i++; + } + + return clone; +} + + +/** + * osl_symbols_clone function: + * this function builds and returns a "hard copy" (not a pointer copy) of an + * osl_symbols_t data structure. + * \param[in] symbols The pointer to the symbols structure to clone. + * \return A pointer to the clone of the symbols structure. + */ +osl_symbols_p osl_symbols_clone(osl_symbols_p symbols) { + + return osl_symbols_nclone(symbols, -1); +} + + +/** + * osl_symbols_equal function: + * this function returns true if the two symbols structures are the same + * (content-wise), false otherwise. + * \param[in] c1 The first symbols structure. + * \param[in] c2 The second symbols structure. + * \return 1 if c1 and c2 are the same (content-wise), 0 otherwise. + */ +int osl_symbols_equal(osl_symbols_p c1, osl_symbols_p c2) { + + if (c1 == c2) + return 1; + + if (((c1 == NULL) && (c2 != NULL)) || ((c1 != NULL) && (c2 == NULL))) + return 0; + + if (c1->type == c2->type && c1->generated == c2->generated && + c1->nb_dims == c2->nb_dims) { + if (osl_generic_equal(c1->identifier, c2->identifier)) { + if (osl_generic_equal(c1->datatype, c2->datatype)) { + if (osl_generic_equal(c1->scope, c2->scope)) { + if (osl_generic_equal(c1->extent, c2->extent)) { + return 1; + } + } + } + } + } + + return 0; +} + + +/** + * osl_symbols_get_nb_symbols function: + * this function returns the number of symbols in the symbol list provided + * as input. + * \param symbols The head of the symbol list. + * \return The number of symbols in the symbol list. + */ +int osl_symbols_get_nb_symbols(osl_symbols_p symbols) { + int nb_symbols = 0; + + while (symbols != NULL) { + nb_symbols++; + symbols = symbols->next; + } + return nb_symbols; +} + + +/** + * osl_symbols_interface function: + * this function creates an interface structure corresponding to the symbols + * extension and returns it). + * \return An interface structure for the symbols extension. + */ +osl_interface_p osl_symbols_interface() { + osl_interface_p interface = osl_interface_malloc(); + + OSL_strdup(interface->URI, OSL_URI_SYMBOLS); + interface->idump = (osl_idump_f)osl_symbols_idump; + interface->sprint = (osl_sprint_f)osl_symbols_sprint; + interface->sread = (osl_sread_f)osl_symbols_sread; + interface->malloc = (osl_malloc_f)osl_symbols_malloc; + interface->free = (osl_free_f)osl_symbols_free; + interface->clone = (osl_clone_f)osl_symbols_clone; + interface->equal = (osl_equal_f)osl_symbols_equal; + return interface; +} diff -Nru cloog-0.18.2/osl/source/extensions/textual.c cloog-0.18.4/osl/source/extensions/textual.c --- cloog-0.18.2/osl/source/extensions/textual.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/extensions/textual.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,335 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/textual.c ** + **-----------------------------------------------------------------** + ** First version: 15/17/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#include +#include +#include + +#include +#include +#include +#include + + +/* CAUTION : TEXTUAL IS A VERY SPECIAL CASE: DO NOT USE IT AS AN EXAMPLE !!! */ + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_textual_idump function: + * this function displays an osl_textual_t structure (*textual) into a + * file (file, possibly stdout) in a way that trends to be understandable. It + * includes an indentation level (level) in order to work with others + * idump functions. + * \param[in] file The file where the information has to be printed. + * \param[in] textual The textual structure to be printed. + * \param[in] level Number of spaces before printing, for each line. + */ +void osl_textual_idump(FILE * file, osl_textual_p textual, int level) { + int j; + char * tmp; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (textual != NULL) { + fprintf(file, "+-- osl_textual_t: "); + + // Display the textual message (without any carriage return). + OSL_strdup(tmp, textual->textual); + for (j = 0; j < (int)strlen(tmp); j++) + if (tmp[j] == '\n') + tmp[j] = ' '; + + if (strlen(tmp) > 40) { + for (j = 0; j < 20; j++) + fprintf(file, "%c", tmp[j]); + fprintf(file, " ... "); + for (j = (int)strlen(tmp) - 20; j < (int)strlen(tmp); j++) + fprintf(file, "%c", tmp[j]); + fprintf(file, "\n"); + } + else { + fprintf(file,"%s\n", tmp); + } + free(tmp); + } + else { + fprintf(file, "+-- NULL textual\n"); + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_textual_dump function: + * this function prints the content of an osl_textual_t structure + * (*textual) into a file (file, possibly stdout). + * \param[in] file The file where the information has to be printed. + * \param[in] textual The textual structure to be printed. + */ +void osl_textual_dump(FILE * file, osl_textual_p textual) { + osl_textual_idump(file, textual, 0); +} + + + +#if 0 +/** + * osl_textual_sprint function: + * this function prints the content of an osl_textual_t structure + * (*textual) into a string (returned) in the OpenScop textual format. + * \param[in] textual The textual structure to be printed. + * \return A string containing the OpenScop dump of the textual structure. + */ +char * osl_textual_sprint(osl_textual_p textual) { + char * string = NULL; + + if ((textual != NULL) && (textual->textual != NULL)) { + if (strlen(textual->textual) > OSL_MAX_STRING) + OSL_error("textual too long"); + + string = strdup(textual->textual); + if (string == NULL) + OSL_error("memory overflow"); + } + + return string; +} +#else +/** + * osl_textual_sprint function: + * this function returns NULL. This is part of the special behavior of + * the textual option (printing it along with other options would double + * the options...). + * \param[in] textual The textual structure to be printed. + * \return NULL. + */ +char * osl_textual_sprint(osl_textual_p textual) { + + return NULL; +} +#endif + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/** + * osl_textual_sread function: + * this function reads a textual structure from a string complying to the + * OpenScop textual format and returns a pointer to this textual structure. + * The string should contain only one textual format of a textual structure. + * \param[in,out] extensions The input string where to find a textual struct. + * Updated to the position after what has been read. + * \return A pointer to the textual structure that has been read. + */ +osl_textual_p osl_textual_sread(char ** extensions) { + osl_textual_p textual = NULL; + + if (*extensions != NULL) { + textual = osl_textual_malloc(); + OSL_strdup(textual->textual, *extensions); + + // Update the input string pointer to the end of the string (since + // everything has been read). + *extensions = *extensions + strlen(*extensions); + } + + return textual; +} + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_textual_malloc function: + * this function allocates the memory space for an osl_textual_t + * structure and sets its fields with default values. Then it returns a + * pointer to the allocated space. + * \return A pointer to an empty textual structure with fields set to + * default values. + */ +osl_textual_p osl_textual_malloc() { + osl_textual_p textual; + + OSL_malloc(textual, osl_textual_p, sizeof(osl_textual_t)); + textual->textual = NULL; + + return textual; +} + + +/** + * osl_textual_free function: + * this function frees the allocated memory for an osl_textual_t + * structure. + * \param[in,out] textual The pointer to the textual structure to be freed. + */ +void osl_textual_free(osl_textual_p textual) { + if (textual != NULL) { + if(textual->textual != NULL) + free(textual->textual); + free(textual); + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_textual_clone function: + * this function builds and returns a "hard copy" (not a pointer copy) of an + * osl_textual_t data structure. + * \param[in] textual The pointer to the textual structure we want to clone. + * \return A pointer to the clone of the textual structure. + */ +osl_textual_p osl_textual_clone(osl_textual_p textual) { + osl_textual_p clone; + + if (textual == NULL) + return NULL; + + clone = osl_textual_malloc(); + OSL_strdup(clone->textual, textual->textual); + + return clone; +} + + +#if 0 +/** + * osl_textual_equal function: + * this function returns true if the two textual structures are the same + * (content-wise), false otherwise. + * \param f1 The first textual structure. + * \param ff The second textual structure. + * \return 1 if f1 and f2 are the same (content-wise), 0 otherwise. + */ +int osl_textual_equal(osl_textual_p f1, osl_textual_p f2) { + + if (f1 == f2) + return 1; + + if (((f1 == NULL) && (f2 != NULL)) || ((f1 != NULL) && (f2 == NULL))) + return 0; + + if (strcmp(f1->textual, f2->textual)) + return 0; + + return 1; +} +#else +/** + * osl_textual_equal function: + * this function returns 1. This is part of the special behavior of + * the textual option (the text string can be easily different while the + * options are actually identical. + * \param[in] f1 The first textual structure. + * \param[in] f2 The second textual structure. + * \return 1. + */ +int osl_textual_equal(osl_textual_p f1, osl_textual_p f2) { + + return 1; +} +#endif + + +/** + * osl_textual_interface function: + * this function creates an interface structure corresponding to the textual + * extension and returns it). + * \return An interface structure for the textual extension. + */ +osl_interface_p osl_textual_interface() { + osl_interface_p interface = osl_interface_malloc(); + + OSL_strdup(interface->URI, OSL_URI_TEXTUAL); + interface->idump = (osl_idump_f)osl_textual_idump; + interface->sprint = (osl_sprint_f)osl_textual_sprint; + interface->sread = (osl_sread_f)osl_textual_sread; + interface->malloc = (osl_malloc_f)osl_textual_malloc; + interface->free = (osl_free_f)osl_textual_free; + interface->clone = (osl_clone_f)osl_textual_clone; + interface->equal = (osl_equal_f)osl_textual_equal; + + return interface; +} + diff -Nru cloog-0.18.2/osl/source/generic.c cloog-0.18.4/osl/source/generic.c --- cloog-0.18.2/osl/source/generic.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/generic.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,699 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** generic.c ** + **-----------------------------------------------------------------** + ** First version: 26/11/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#include +#include +#include + +#include +#include +#include +#include +#include + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_generic_idump function: + * this function displays an osl_generic_t structure (*generic) into + * a file (file, possibly stdout) in a way that trends to be understandable. + * It includes an indentation level (level) in order to work with others + * idump functions. + * \param[in] file File where informations are printed. + * \param[in] generic The generic whose information has to be printed. + * \param[in] level Number of spaces before printing, for each line. + */ +void osl_generic_idump(FILE * file, osl_generic_p generic, int level) { + int j, first = 1; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file,"|\t"); + + if (generic != NULL) + fprintf(file, "+-- osl_generic_t\n"); + else + fprintf(file, "+-- NULL generic\n"); + + while (generic != NULL) { + if (!first) { + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + fprintf(file, "| osl_generic_t\n"); + } + else { + first = 0; + } + + // A blank line + for(j = 0; j <= level + 1; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); + + osl_interface_idump(file, generic->interface, level + 1); + + if (generic->interface != NULL) + generic->interface->idump(file, generic->data, level + 1); + + generic = generic->next; + + // Next line. + if (generic != NULL) { + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "V\n"); + } + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_generic_dump function: + * this function prints the content of an osl_generic_t structure + * (*generic) into a file (file, possibly stdout). + * \param[in] file File where the information has to be printed. + * \param[in] generic The generic structure to print. + */ +void osl_generic_dump(FILE * file, osl_generic_p generic) { + osl_generic_idump(file, generic, 0); +} + + +/** + * osl_generic_sprint function: + * this function prints the content of an osl_generic_t structure + * (*strings) into a string (returned) in the OpenScop textual format. + * \param[in] generic The generic structure which has to be printed. + * \return A string containing the OpenScop dump of the generic structure. + */ +char * osl_generic_sprint(osl_generic_p generic) { + int high_water_mark = OSL_MAX_STRING; + char * string = NULL, * content; + char buffer[OSL_MAX_STRING]; + + OSL_malloc(string, char *, high_water_mark * sizeof(char)); + string[0] = '\0'; + + while (generic != NULL) { + if (generic->interface != NULL) { + content = generic->interface->sprint(generic->data); + if (content != NULL) { + sprintf(buffer, "<%s>\n", generic->interface->URI); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + osl_util_safe_strcat(&string, content, &high_water_mark); + free(content); + sprintf(buffer, "\n", generic->interface->URI); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + } + generic = generic->next; + if (generic != NULL) { + sprintf(buffer, "\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + } + + return string; +} + + +/** + * osl_generic_print function: + * this function prints the content of an osl_generic_t structure + * (*generic) into a string (returned) in the OpenScop format. + * \param[in] file File where the information has to be printed. + * \param[in] generic The generic structure to print. + */ +void osl_generic_print(FILE * file, osl_generic_p generic) { + char * string; + + string = osl_generic_sprint(generic); + if (string != NULL) { + fprintf(file, "%s", string); + free(string); + } +} + + +/** + * osl_generic_print_options_scoplib function: + * this function prints the options sections (only arrays in the + * SCoPLib format) + * \param[in] file File where the information has to be printed. + * \param[in] generic The generic structure to print. + */ +void osl_generic_print_options_scoplib(FILE * file, osl_generic_p generic) { + char * string; + + osl_generic_p arrays = osl_generic_lookup(generic, OSL_URI_ARRAYS); + + string = osl_arrays_sprint((osl_arrays_p) arrays); + if (string != NULL) { + fprintf(file, "\n%s\n", string); + free(string); + } +} + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/** + * osl_generic_sread function: + * this function reads a list of generic structure from a string complying to + * the OpenScop textual format and returns a pointer to this generic structure. + * The input parameter is updated to the position in the input string this + * function reach right after reading the generic structure. + * \param[in,out] input The input string where to find a list of generic. + * Updated to the position after what has been read. + * \param[in] registry The list of known interfaces (others are ignored). + * \return A pointer to the generic information list that has been read. + */ +osl_generic_p osl_generic_sread(char ** input, osl_interface_p registry) { + osl_generic_p generic = NULL, new; + + while (**input != '\0') { + new = osl_generic_sread_one(input, registry); + osl_generic_add(&generic, new); + } + + return generic; +} + + +/** + * osl_generic_sread_one function: + * this function reads one generic structure from a string complying to the + * OpenScop textual format and returns a pointer to this generic structure. + * The input parameter is updated to the position in the input string this + * function reach right after reading the generic structure. + * \param[in,out] input The input string where to find a generic. + * Updated to the position after what has been read. + * \param[in] registry The list of known interfaces (others are ignored). + * \return A pointer to the generic structure that has been read. + */ +osl_generic_p osl_generic_sread_one(char ** input, osl_interface_p registry) { + char * tag; + char * content, * temp; + osl_generic_p generic = NULL; + osl_interface_p interface; + + tag = osl_util_read_tag(NULL, input); + if ((tag == NULL) || (strlen(tag) < 1) || (tag[0] == '/')) { + OSL_debug("empty tag name or closing tag instead of an opening one"); + return NULL; + } + + content = osl_util_read_uptoendtag(NULL, input, tag); + interface = osl_interface_lookup(registry, tag); + + temp = content; + if (interface == NULL) { + OSL_warning("unsupported generic"); + fprintf(stderr, "[osl] Warning: unknown URI \"%s\".\n", tag); + } + else { + generic = osl_generic_malloc(); + generic->interface = osl_interface_nclone(interface, 1); + generic->data = interface->sread(&temp); + } + + free(content); + free(tag); + return generic; +} + + +/** + * osl_generic_read_one function: + * this function reads one generic from a file (possibly stdin) + * complying to the OpenScop textual format and a list of known interfaces. + * It returns a pointer to the corresponding generic structure. If no + * tag is found, an error is reported, in the case of an empty or closing tag + * name the function returns the NULL pointer. + * \param[in] file The input file where to read a list of data. + * \param[in] registry The list of known interfaces (others are ignored). + * \return A pointer to the generic that has been read. + */ +osl_generic_p osl_generic_read_one(FILE * file, osl_interface_p registry) { + char * tag; + char * content, * temp; + osl_generic_p generic = NULL; + osl_interface_p interface; + + tag = osl_util_read_tag(file, NULL); + if ((tag == NULL) || (strlen(tag) < 1) || (tag[0] == '/')) { + OSL_debug("empty tag name or closing tag instead of an opening one"); + return NULL; + } + + content = osl_util_read_uptoendtag(file, NULL, tag); + interface = osl_interface_lookup(registry, tag); + + temp = content; + if (interface == NULL) { + OSL_warning("unsupported generic"); + fprintf(stderr, "[osl] Warning: unknown URI \"%s\".\n", tag); + } + else { + generic = osl_generic_malloc(); + generic->interface = osl_interface_nclone(interface, 1); + generic->data = interface->sread(&temp); + } + + free(content); + free(tag); + return generic; +} + + +/** + * osl_generic_read function: + * this function reads a list of generics from a file (possibly stdin) + * complying to the OpenScop textual format and a list of known interfaces. + * It returns a pointer to the list of corresponding generic structures. + * \param[in] file The input file where to read a list of data. + * \param[in] registry The list of known interfaces (others are ignored). + * \return A pointer to the generic information list that has been read. + */ +osl_generic_p osl_generic_read(FILE * file, osl_interface_p registry) { + char * generic_string, * temp; + osl_generic_p generic_list; + + generic_string = osl_util_read_uptoendtag(file, NULL, OSL_URI_SCOP); + temp = generic_string; + generic_list = osl_generic_sread(&temp, registry); + free(generic_string); + return generic_list; +} + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_generic_add function: + * this function adds a generic node (it may be a list as well) to a list + * of generics provided as parameter (list). The new node is inserted at + * the end of the list. + * \param[in] list The list of generics to add a node (NULL if empty). + * \param[in] generic The generic list to add to the initial list. + */ +void osl_generic_add(osl_generic_p * list, osl_generic_p generic) { + osl_generic_p tmp = *list, check; + + if (generic != NULL) { + // First, check that the generic list is OK. + check = generic; + while (check != NULL) { + if ((check->interface == NULL) || (check->interface->URI == NULL)) + OSL_error("no interface or URI in a generic to add to a list"); + + // TODO: move this to the integrity check. + if (osl_generic_lookup(*list, check->interface->URI) != NULL) + OSL_error("only one generic with a given URI is allowed"); + check = check->next; + } + + if (*list != NULL) { + while (tmp->next != NULL) + tmp = tmp->next; + tmp->next = generic; + } + else { + *list = generic; + } + } +} + +/** + * osl_generic_remove_node function: + * this functions removes a given generic from a generic list + * \param[in] list Address of a generic list + * \param[in] generic Pointer to the generic to be removed + * Assumes a single node is to be removed. + */ +void osl_generic_remove_node(osl_generic_p * list, osl_generic_p generic) { + + osl_generic_p tmp = NULL; + + if (generic != NULL) { + + if (*list != NULL) { + //target is the first element of list + if(*list==generic){ + *list = generic->next; + generic->next=NULL; //free below removes the whole list! + osl_generic_free(generic); + return; + } + + //find target + tmp = *list; + while (tmp->next!=generic && tmp->next != NULL) + tmp = tmp->next; + + if(tmp->next==generic){ + tmp->next = generic->next; + generic->next=NULL; //free below removes the whole list! + osl_generic_free(generic); + } + else //target not found + OSL_warning("generic not found in the list\n"); + } + + } +} + +/** + * osl_generic_remove function: + * given a URI, this function removes that generic from the list + * \param[in] list Address of a generic list + * \param[in] URI Pointer to the URI string + */ +void osl_generic_remove(osl_generic_p *list, char * URI){ + + osl_generic_p tmp = *list; + + while(tmp != NULL){ + if(osl_generic_has_URI(tmp, URI)) + break; + tmp = tmp->next; + } + + if(tmp!=NULL){ + osl_generic_remove_node(list, tmp); + } + +} + + +/** + * osl_generic_malloc function: + * This function allocates the memory space for an osl_generic_t + * structure and sets its fields with default values. Then it returns a + * pointer to the allocated space. + * \return A pointer to an empty generic structure with fields set to + * default values. + */ +osl_generic_p osl_generic_malloc() { + osl_generic_p generic; + + OSL_malloc(generic, osl_generic_p, sizeof(osl_generic_t)); + generic->interface = NULL; + generic->data = NULL; + generic->next = NULL; + + return generic; +} + + +/** + * osl_generic_free function: + * This function frees the allocated memory for a generic structure. + * \param[in] generic The pointer to the generic structure we want to free. + */ +void osl_generic_free(osl_generic_p generic) { + osl_generic_p next; + + while (generic != NULL) { + next = generic->next; + if (generic->interface != NULL) { + generic->interface->free(generic->data); + osl_interface_free(generic->interface); + } + else { + if (generic->data != NULL) { + OSL_warning("unregistered interface, memory leaks are possible"); + free(generic->data); + } + } + free(generic); + generic = next; + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_generic_number function: + * this function returns the number of statements in the generic list + * provided as parameter. + * \param[in] generic The first element of the generic list. + * \return The number of statements in the generic list. + */ +int osl_generic_number(osl_generic_p generic) { + int number = 0; + + while (generic != NULL) { + number++; + generic = generic->next; + } + return number; +} + + +/** + * osl_generic_clone function: + * This function builds and returns a "hard copy" (not a pointer copy) of an + * osl_generic_t data structure. + * \param[in] generic The pointer to the generic structure we want to clone. + * \return A pointer to the clone of the input generic structure. + */ +osl_generic_p osl_generic_clone(osl_generic_p generic) { + osl_generic_p clone = NULL, new; + osl_interface_p interface; + void * x; + + while (generic != NULL) { + if (generic->interface != NULL) { + x = generic->interface->clone(generic->data); + interface = osl_interface_clone(generic->interface); + new = osl_generic_malloc(); + new->interface = interface; + new->data = x; + osl_generic_add(&clone, new); + } + else { + OSL_warning("unregistered interface, cloning ignored"); + } + generic = generic->next; + } + + return clone; +} + + +/** + * osl_generic_count function: + * this function counts the number of elements in the generic list provided + * as parameter (x) and returns this number. + * \param[in] x The list of generics. + * \return The number of elements in the list. + */ +int osl_generic_count(osl_generic_p x) { + int generic_number = 0; + + while (x != NULL) { + generic_number++; + x = x->next; + } + + return generic_number; +} + + +/** + * osl_generic_equal function: + * this function returns true if the two generic structures are the same, + * false otherwise. This functions considers two generic structures as equal + * independently of the order of the nodes. + * \param[in] x1 The first generic structure. + * \param[in] x2 The second generic structure. + * \return 1 if x1 and x2 are the same (content-wise), 0 otherwise. + */ +int osl_generic_equal(osl_generic_p x1, osl_generic_p x2) { + int x1_generic_number, x2_generic_number; + int found, equal; + osl_generic_p backup_x2 = x2; + + if (x1 == x2) + return 1; + + // Check whether the number of generics is the same or not. + x1_generic_number = osl_generic_count(x1); + x2_generic_number = osl_generic_count(x2); + if (x1_generic_number != x2_generic_number) + return 0; + + // Check that for each generic in x1 a similar generic is in x2. + while (x1 != NULL) { + x2 = backup_x2; + found = 0; + while ((x2 != NULL) && (found != 1)) { + if (osl_interface_equal(x1->interface, x2->interface)) { + if (x1->interface != NULL) { + equal = x1->interface->equal(x1->data, x2->data); + } + else { + OSL_warning("unregistered generic, " + "cannot state generic equality"); + equal = 0; + } + + if (equal == 0) + return 0; + else + found = 1; + } + + x2 = x2->next; + } + + if (found != 1) + return 0; + + x1 = x1->next; + } + + return 1; +} + + +/** + * osl_generic_has_URI function: + * this function returns 1 if the generic provided as parameter has + * a given URI, 0 other wise. + * \param[in] x The generic structure to test. + * \param[in] URI The URI value to test. + * \return 1 if x has the provided URI, 0 otherwise. + */ +int osl_generic_has_URI(osl_const_generic_const_p x, char const * const URI) { + + if ((x == NULL) || + (x->interface == NULL) || + (x->interface->URI == NULL) || + (strcmp(x->interface->URI, URI))) + return 0; + + return 1; +} + + +/** + * osl_generic_lookup function: + * this function returns the first generic with a given URI in the + * generic list provided as parameter and NULL if it doesn't find such + * a generic. + * \param[in] x The generic list where to search a given generic URI. + * \param[in] URI The URI of the generic we are looking for. + * \return The first generic of the requested URI in the list. + */ +void * osl_generic_lookup(osl_generic_p x, char const * const URI) { + while (x != NULL) { + if (osl_generic_has_URI(x, URI)) + return x->data; + + x = x->next; + } + + return NULL; +} + + +/** + * osl_generic_shell function: + * this function creates and returns a generic structure "shell" which + * embed the data and interface provided as parameters. + * \param[in] data Data to put in the generic shell. + * \param[in] interface Interface to put in the generic shell. + * \return A new generic structure containing the data and interface. + */ +osl_generic_p osl_generic_shell(void * data, osl_interface_p interface) { + osl_generic_p generic = NULL; + + if ((data == NULL) || (interface == NULL)) + OSL_warning("shell created with some empty elements inside"); + + generic = osl_generic_malloc(); + generic->data = data; + generic->interface = interface; + return generic; +} diff -Nru cloog-0.18.2/osl/source/int.c cloog-0.18.4/osl/source/int.c --- cloog-0.18.2/osl/source/int.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/int.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,1313 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** int.c ** + **-----------------------------------------------------------------** + ** First version: 18/07/2011 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#include +#include +#include + +#ifdef OSL_GMP_IS_HERE +# include +#endif + +#include +#include + + +/*+*************************************************************************** + * Basic Functions * + *****************************************************************************/ + + +/** + * osl_int_is_precision_supported function: + * this function returns 1 if the precision provided as parameter is supported + * by the library and 0 otherwise. Possible values for the precision + * parameter are OSL_PRECISION_SP for 32 bits (single) precision, + * OSL_PRECISION_DP for 64 bits (double) precision and OSL_PRECISION_MP for + * multiple precision. + * \param[in] precision The precision to check for. + * \return 1 if the precision is supported, 0 otherwise. + */ +int osl_int_is_precision_supported(int precision) { + switch (precision) { + case OSL_PRECISION_SP: + return 1; + case OSL_PRECISION_DP: + return 1; +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + return 1; +#endif + } + + return 0; +} + + +/** + * osl_int_dump_precision function: + * this function prints in a human readable fashion the precision + * corresponding to the "precision" parameter. + * \param[in] file The file where to print the precision. + * \param[in] precision The precision to print. + */ +void osl_int_dump_precision(FILE * file, int precision) { + switch (precision) { + case OSL_PRECISION_SP: + fprintf(file, "32 bits"); + break; + case OSL_PRECISION_DP: + fprintf(file, "64 bits"); + break; +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + fprintf(file, "GMP"); + break; +#endif + default: + fprintf(file, "unknown precision %d", precision); + } +} + + +/** + * \brief Initialize the osl int + * \param[in] precision Precision of the osl int + * \param[in] variable A osl int to initialize + */ +void osl_int_init(int precision, osl_int_const_p variable) { + switch (precision) { + case OSL_PRECISION_SP: + variable->sp = 0; + break; + + case OSL_PRECISION_DP: + variable->dp = 0; + break; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + OSL_malloc(variable->mp, void*, sizeof(mpz_t)); + mpz_init(*variable->mp); + break; +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief Initialize the osl int + * \param[in] precision Precision of the osl int + */ +osl_int_p osl_int_malloc(int precision) { + osl_int_p variable; + + OSL_malloc(variable, osl_int_p, sizeof(osl_int_t)); + osl_int_init(precision, variable); + return variable; +} + + +/** + * \brief variable = value + * \param[in] precision Precision of the osl int + * \param[in] variable A osl int to assign + * \param[in] value Value in a osl int + */ +void osl_int_assign(int precision, + osl_int_const_p variable, osl_const_int_t value) { + switch (precision) { + case OSL_PRECISION_SP: + variable->sp = value.sp; + break; + + case OSL_PRECISION_DP: + variable->dp = value.dp; + break; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + mpz_set(*variable->mp, *value.mp); + break; +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief variable = i + * \param[in] precision Precision of the osl int + * \param[in] variable A osl int to assign + * \param[in] i Value in a int + */ +void osl_int_set_si(int precision, osl_int_const_p variable, int i) { + switch (precision) { + case OSL_PRECISION_SP: + variable->sp = (long int)i; + break; + + case OSL_PRECISION_DP: + variable->dp = (long long int)i; + break; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + mpz_set_si(*variable->mp, i); + break; +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief Get the value in a int + * \param[in] precision Precision of the osl int + * \param[in] value Value in a osl int + * \return the value in a int + */ +int osl_int_get_si(int precision, osl_const_int_t value) { + switch (precision) { + case OSL_PRECISION_SP: + #ifndef NDEBUG + if (value.sp > (long int)(INT_MAX)) + OSL_overflow("osl_int_get_si overflow"); + if (value.sp < (long int)(INT_MIN)) + OSL_overflow("osl_int_get_si overflow"); + #endif + return (int)value.sp; + + case OSL_PRECISION_DP: + #ifndef NDEBUG + if (value.dp > (long long int)(INT_MAX)) + OSL_overflow("osl_int_get_si overflow"); + if (value.dp < (long long int)(INT_MIN)) + OSL_overflow("osl_int_get_si overflow"); + #endif + return (int)value.dp; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + #ifndef NDEBUG + if (mpz_fits_sint_p(*value.mp) == 0) + OSL_overflow("osl_int_get_si overflow"); + #endif + return mpz_get_si(*value.mp); +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief Get the value in a double + * \param[in] precision Precision of the osl int + * \param[in] i Value in a osl int + * \return the value in a double + */ +double osl_int_get_d(int precision, osl_const_int_t i) { + switch (precision) { + case OSL_PRECISION_SP: + return (double)i.sp; + + case OSL_PRECISION_DP: + return (double)i.dp; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + return mpz_get_d(*i.mp); +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief variable = i // including initialization for GMP + * \param[in] precision Precision of the osl int + * \param[in] variable A osl int to initialize + * \param[in] i Value in a osl int + */ +void osl_int_init_set(int precision, osl_int_const_p variable, osl_const_int_t i) { + osl_int_init(precision, variable); + osl_int_assign(precision, variable, i); +} + + +/** + * \brief variable = i // including initialization for GMP + * \param[in] precision Precision of the osl int + * \param[in] variable A osl int to initialize + * \param[in] i Value in a osl int + */ +void osl_int_init_set_si(int precision, osl_int_const_p variable, int i) { + switch (precision) { + case OSL_PRECISION_SP: + variable->sp = (long int)i; + break; + + case OSL_PRECISION_DP: + variable->dp = (long long int)i; + break; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + OSL_malloc(variable->mp, void*, sizeof(mpz_t)); + mpz_init_set_si(*variable->mp, i); + break; +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief Swap the osl ints + * \param[in] precision Precision of the osl ints + * \param[in] var1 First osl int to swap + * \param[in] var2 Second osl int to swap + */ +void osl_int_swap(int precision, osl_int_const_p var1, osl_int_const_p var2) { + switch (precision) { + case OSL_PRECISION_SP: { + long int temp = var1->sp; + var1->sp = var2->sp; + var2->sp = temp; + break; + } + + case OSL_PRECISION_DP: { + long long int temp = var1->dp; + var1->dp = var2->dp; + var2->dp = temp; + break; + } + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: { + mpz_t temp; + mpz_init(temp); + mpz_set(temp, *var1->mp); + mpz_set(*var1->mp, *var2->mp); + mpz_set(*var2->mp, temp); + mpz_clear(temp); + break; + } +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief variable = 0 // including cleaning for GMP + * \param[in] precision Precision of the osl int + * \param[in] variable A osl int to clear + */ +void osl_int_clear(int precision, osl_int_const_p variable) { + switch (precision) { + case OSL_PRECISION_SP: + variable->sp = 0; + break; + + case OSL_PRECISION_DP: + variable->dp = 0; + break; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + mpz_clear(*variable->mp); + free(variable->mp); + break; +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief Free thr osl int + * \param[in] precision Precision of the osl int + * \param[in] variable A osl int to free + */ +void osl_int_free(int precision, osl_int_const_p variable) { + osl_int_clear(precision, variable); + free(variable); +} + + +/** + * osl_int_print function: + * this function displays an integer value into a file (file, possibly stdout). + * \param file The file where the integer has to be printed. + * \param precision The precision of the integer. + * \param value The integer element to print. + */ +void osl_int_print(FILE * file, int precision, osl_const_int_t value) { + char string[OSL_MAX_STRING]; + + osl_int_sprint(string, precision, value); + fprintf(file, "%s", string); +} + + +/** + * osl_int_sprint function: + * this function prints an integer value into a string, it uses the + * OpenScop Library formats OSL_FMT_* to format the printing. + * \param string The string where the integer has to be printed. + * \param precision The precision of the integer. + * \param value The integer element to print. + */ +void osl_int_sprint(char * string, int precision, osl_const_int_t value) { + switch (precision) { + case OSL_PRECISION_SP: + sprintf(string, OSL_FMT_SP, value.sp); + break; + + case OSL_PRECISION_DP: + sprintf(string, OSL_FMT_DP, value.dp); + break; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: { + char * str; + str = mpz_get_str(0, 10, *value.mp); //TODO: 10 -> #define + sprintf(string, OSL_FMT_MP, str); + free(str); + break; + } +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * osl_int_sprint_txt function: + * this function is similar to osl_int_sprintf but it prints the value + * using OSL_TMT_TXT_* formats. + * \see osl_int_sprintf + */ +void osl_int_sprint_txt(char * string, int precision, osl_const_int_t value) { + switch (precision) { + case OSL_PRECISION_SP: + sprintf(string, OSL_FMT_TXT_SP, value.sp); + break; + + case OSL_PRECISION_DP: + sprintf(string, OSL_FMT_TXT_DP, value.dp); + break; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: { + char * str; + str = mpz_get_str(0, 10, *value.mp); //TODO: 10 -> #define + sprintf(string, OSL_FMT_TXT_MP, str); + free(str); + break; + } +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief sscanf for osl int + * \param[in] string Integer in a char* + * \param[in] precision Precision of the osl int + * \param[in] i A osl int to save integer + * \return the number of char readed + */ +int osl_int_sscanf(char* string, int precision, osl_int_const_p i) { + int nb_read = 0; + + switch (precision) { + case OSL_PRECISION_SP: + nb_read = sscanf(string, OSL_FMT_TXT_SP, &(i->sp)); + break; + + case OSL_PRECISION_DP: + nb_read = sscanf(string, OSL_FMT_TXT_DP, &(i->dp)); + break; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: { + nb_read = gmp_sscanf(string, "%lZd", i->mp); + break; + } +#endif + + default: + OSL_error("unknown precision"); + } + + if (nb_read == 0) { OSL_error("failed to read an integer"); } + + return nb_read; +} + + +/** + * \brief sread for osl int + * \param[in] string Integer in a char** + * \param[in] precision Precision of the osl int + * \param[in] i A osl int to save integer + */ +void osl_int_sread(char ** string, int precision, osl_int_const_p i) { + // Update the position in the input string. + *string += osl_int_sscanf(*string, precision, i); +} + + +/*+*************************************************************************** + * Arithmetic Operations * + *****************************************************************************/ + + +/** + * \brief variable = value + 1 + * \param[in] precision Precision of the osl int + * \param[in] variable A osl int to save the result + * \param[in] value Value in a osl int + */ +void osl_int_increment(int precision, + osl_int_const_p variable, osl_const_int_t value) { + osl_int_add_si(precision, variable, value, 1); +} + + +/** + * \brief variable = value - 1 + * \param[in] precision Precision of the osl int + * \param[in] variable A osl int to save the result + * \param[in] value Value in a osl int + */ +void osl_int_decrement(int precision, + osl_int_const_p variable, osl_const_int_t value) { + osl_int_add_si(precision, variable, value, -1); +} + + +/** + * \brief variable = val1 + val2 + * \param[in] precision Precision of the osl int + * \param[in] variable A osl int to save the result + * \param[in] val1 Value of first osl int + * \param[in] val2 Value of second osl int + */ +void osl_int_add(int precision, osl_int_const_p variable, + osl_const_int_t val1, osl_const_int_t val2) { + switch (precision) { + case OSL_PRECISION_SP: + #ifndef NDEBUG + if (osl_int_pos(precision, val1) && osl_int_pos(precision, val2)) { + if (LONG_MAX - val1.sp < val2.sp) + OSL_overflow("osl_int_add overflow"); + } + else if (osl_int_neg(precision, val1) && osl_int_neg(precision, val2)) { + if (val1.sp - LONG_MIN < -val2.sp) + OSL_overflow("osl_int_add overflow"); + } + #endif + variable->sp = val1.sp + val2.sp; + break; + + case OSL_PRECISION_DP: + #ifndef NDEBUG + if (osl_int_pos(precision, val1) && osl_int_pos(precision, val2)) { + if (LLONG_MAX - val1.dp < val2.dp) + OSL_overflow("osl_int_add overflow"); + } + else if (osl_int_neg(precision, val1) && osl_int_neg(precision, val2)) { + if (val1.dp - LLONG_MIN < -val2.dp) + OSL_overflow("osl_int_add overflow"); + } + #endif + variable->dp = val1.dp + val2.dp; + break; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + mpz_add(*variable->mp, *val1.mp, *val2.mp); + break; +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief variable = val1 + i + * \param[in] precision Precision of the osl int + * \param[in] variable A osl int to save the result + * \param[in] value Value of first int in a osl int + * \param[in] i Value of second int in a int + */ +void osl_int_add_si(int precision, + osl_int_const_p variable, osl_const_int_t value, int i) { + switch (precision) { + case OSL_PRECISION_SP: + #ifndef NDEBUG + if (osl_int_pos(precision, value) && i > 0) { + if (LONG_MAX - value.sp < i) + OSL_overflow("osl_int_add_si overflow"); + } + else if (osl_int_neg(precision, value) && i < 0) { + if (value.sp - LONG_MIN < -i) + OSL_overflow("osl_int_add_si overflow"); + } + #endif + variable->sp = value.sp + (long int)i; + break; + + case OSL_PRECISION_DP: + #ifndef NDEBUG + if (osl_int_pos(precision, value) && i > 0) { + if (LLONG_MAX - value.dp < i) + OSL_overflow("osl_int_add_si overflow"); + } + else if (osl_int_neg(precision, value) && i < 0) { + if (value.dp - LLONG_MIN < -i) + OSL_overflow("osl_int_add_si overflow"); + } + #endif + variable->dp = value.dp + (long long int)i; + break; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: { + mpz_t si; + mpz_init_set_si(si, i); + mpz_add(*variable->mp, *value.mp, si); + mpz_clear(si); + break; + } +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief variable = val1 - val2 + * \param[in] precision Precision of the osl int + * \param[in] variable A osl int to save the result + * \param[in] val1 Value of first osl int + * \param[in] val2 Value of second osl int + */ +void osl_int_sub(int precision, osl_int_const_p variable, + osl_const_int_t val1, osl_const_int_t val2) { +#ifdef OSL_GMP_IS_HERE + if (precision == OSL_PRECISION_MP) { + mpz_sub(*variable->mp, *val1.mp, *val2.mp); + } + else +#endif + { + osl_int_t mval2; osl_int_init(precision, &mval2); + osl_int_oppose(precision, &mval2, val2); + osl_int_add(precision, variable, val1, mval2); + } +} + + +/** + * \brief variable = val1 * val2 + * \param[in] precision Precision of the osl int + * \param[in] variable A osl int to save the result + * \param[in] val1 Value of first osl int + * \param[in] val2 Value of second osl int + */ +void osl_int_mul(int precision, osl_int_const_p variable, + osl_const_int_t val1, osl_const_int_t val2) { + switch (precision) { + case OSL_PRECISION_SP: + variable->sp = val1.sp * val2.sp; + #ifndef NDEBUG + if (!osl_int_zero(precision, val1) && !osl_int_zero(precision, val2)) { + if (variable->sp / val2.sp != val1.sp) { + OSL_overflow("osl_int_mul overflow"); + } + } + #endif + break; + + case OSL_PRECISION_DP: + variable->dp = val1.dp * val2.dp; + #ifndef NDEBUG + if (!osl_int_zero(precision, val1) && !osl_int_zero(precision, val2)) { + if (variable->dp / val2.dp != val1.dp) { + OSL_overflow("osl_int_mul overflow"); + } + } + #endif + break; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + mpz_mul(*variable->mp, *val1.mp, *val2.mp); + break; +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief variable = val1 * i + * \param[in] precision Precision of the osl int + * \param[in] variable A osl int to save the result + * \param[in] value Value of first int in a osl int + * \param[in] i Value of second int in a int + */ +void osl_int_mul_si(int precision, + osl_int_const_p variable, osl_const_int_t value, int i) { + switch (precision) { + case OSL_PRECISION_SP: + variable->sp = value.sp * (long int)i; + #ifndef NDEBUG + if (!osl_int_zero(precision, value) && i != 0) { + if (variable->sp / (long int)i != value.sp) { + OSL_overflow("osl_int_mul_si overflow"); + } + } + #endif + break; + + case OSL_PRECISION_DP: + variable->dp = value.dp * (long long int)i; + #ifndef NDEBUG + if (!osl_int_zero(precision, value) && i != 0) { + if (variable->dp / (long long int)i != value.dp) { + OSL_overflow("osl_int_mul_si overflow"); + } + } + #endif + break; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + mpz_mul_si(*variable->mp, *value.mp, i); + break; +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief q = a / b + * \pre b divides a (without remainder) + * \param[in] precision Precision of the osl int + * \param[in] q Quotient in a osl int + * \param[in] a Value of first osl int + * \param[in] b Value of second osl int + */ +void osl_int_div_exact(int const precision, + osl_int_const_p q, + osl_const_int_t a, osl_const_int_t b) { + switch (precision) { + case OSL_PRECISION_SP: q->sp = a.sp / b.sp; return; + + case OSL_PRECISION_DP: q->dp = a.dp / b.dp; return; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: mpz_divexact(*q->mp, *a.mp, *b.mp); return; +#endif + + default: OSL_error("unknown precision"); + } +} + + +/** + * \brief q = floor(a / b) + * \param[in] precision Precision of the osl int + * \param[in] q Quotient in a osl int + * \param[in] a Value of first osl int + * \param[in] b Value of second osl int + */ +void osl_int_floor_div_q(int const precision, + osl_int_const_p q, + osl_const_int_t a, osl_const_int_t b) { + switch (precision) { + case OSL_PRECISION_SP: + q->sp = a.sp / b.sp; + if (q->sp < 0) { if (a.sp % b.sp != 0) --q->sp; } + else if (q->sp == 0) { + if ((osl_int_pos(precision, a) && osl_int_neg(precision, b)) || + (osl_int_neg(precision, a) && osl_int_pos(precision, b))) { + --q->sp; + } + } + return; + + case OSL_PRECISION_DP: + q->dp = a.dp / b.dp; + if (q->dp < 0) { if (a.dp % b.dp != 0) --q->dp; } + else if (q->dp == 0) { + if ((osl_int_pos(precision, a) && osl_int_neg(precision, b)) || + (osl_int_neg(precision, a) && osl_int_pos(precision, b))) { + --q->dp; + } + } + return; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: mpz_fdiv_q(*q->mp, *a.mp, *b.mp); return; +#endif + + default: OSL_error("unknown precision"); + } +} + + +/** + * \brief r = a - b * (a / b) + * \param[in] precision Precision of the osl int + * \param[in] r Remainder in a osl int + * \param[in] a Value of first osl int + * \param[in] b Value of second osl int + */ +void osl_int_floor_div_r(int const precision, + osl_int_const_p r, + osl_const_int_t a, osl_const_int_t b) { + switch (precision) { + case OSL_PRECISION_SP: + osl_int_floor_div_q(precision, r, a, b); + r->sp = a.sp - r->sp * b.sp; + return; + + case OSL_PRECISION_DP: + osl_int_floor_div_q(precision, r, a, b); + r->dp = a.dp - r->dp * b.dp; + return; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: mpz_fdiv_r(*r->mp, *a.mp, *b.mp); return; +#endif + + default: OSL_error("unknown precision"); + } +} + + +/** + * \brief Compute (q, r) such that a = b * q + r + * \param[in] precision Precision of the osl int + * \param[in] q Quotient in a osl int + * \param[in] r Remainder in a osl int + * \param[in] a Value of first osl int + * \param[in] b Value of second osl int + */ +void osl_int_floor_div_q_r(int const precision, + osl_int_const_p q, osl_int_const_p r, + osl_const_int_t a, osl_const_int_t b) { + switch (precision) { + case OSL_PRECISION_SP: + osl_int_floor_div_q(precision, q, a, b); + r->sp = a.sp - q->sp * b.sp; + return; + + case OSL_PRECISION_DP: + osl_int_floor_div_q(precision, q, a, b); + r->dp = a.dp - q->dp * b.dp; + return; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: mpz_fdiv_qr(*q->mp, *r->mp, *a.mp, *b.mp); return; +#endif + + default: OSL_error("unknown precision"); + } +} + + +/** + * \brief mod = a % b + * \pre mod is always positive + * \param[in] precision Precision of the osl int + * \param[in] mod Modulo in a osl int + * \param[in] a Value of first osl int + * \param[in] b Value of second osl int + */ +void osl_int_mod(int const precision, osl_int_const_p mod, + osl_const_int_t a, osl_const_int_t b) { + switch (precision) { + case OSL_PRECISION_SP: + mod->sp = a.sp % b.sp; + if (mod->sp < 0) mod->sp += labs(b.sp); + return; + + case OSL_PRECISION_DP: + mod->dp = a.dp % b.dp; + if (mod->dp < 0) mod->dp += llabs(b.dp); + return; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: mpz_mod(*mod->mp, *a.mp, *b.mp); return; +#endif + + default: OSL_error("unknown precision"); + } +} + + +// gcd (greatest common divisor) for long long int +static long long int llgcd(long long int const a, long long int const b) { + return (b ? llgcd(b, a % b) : a); +} + +/** + * \brief Compute the gcd (greatest common divisor) of a and b + * \param[in] precision Precision of the osl int + * \param[in] gcd Greatest common divisor in a osl int + * \param[in] a Value of first osl int + * \param[in] b Value of second osl int + */ +void osl_int_gcd(int const precision, osl_int_const_p gcd, + osl_const_int_t a, osl_const_int_t b) { + switch (precision) { + case OSL_PRECISION_SP: gcd->sp = labs(llgcd(a.sp, b.sp)); return; + + case OSL_PRECISION_DP: gcd->dp = llabs(llgcd(a.dp, b.dp)); return; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: mpz_gcd(*gcd->mp, *a.mp, *b.mp); return; +#endif + + default: OSL_error("unknown precision"); + } +} + + +/** + * \brief variable = - value + * \param[in] precision Precision of the osl int + * \param[in] variable A osl int to get the oppose + * \param[in] value Value in a osl int + */ +void osl_int_oppose(int precision, + osl_int_const_p variable, osl_const_int_t value) { + switch (precision) { + case OSL_PRECISION_SP: + variable->sp = -value.sp; + break; + + case OSL_PRECISION_DP: + variable->dp = -value.dp; + break; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + mpz_neg(*variable->mp, *value.mp); + break; +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief variable = | value | + * \param[in] precision Precision of the osl int + * \param[in] variable A osl int to get the absolute value + * \param[in] value Value in a osl int + */ +void osl_int_abs(int precision, + osl_int_const_p variable, osl_const_int_t value) { + switch (precision) { + case OSL_PRECISION_SP: + variable->sp = (value.sp > 0) ? value.sp : -value.sp; + break; + + case OSL_PRECISION_DP: + variable->dp = (value.dp > 0) ? value.dp : -value.dp; + break; + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + mpz_abs(*variable->mp, *value.mp); + break; +#endif + + default: + OSL_error("unknown precision"); + } +} + + +// log2 function for long long int +static size_t lllog2(long long int x) { + size_t n = 0; + + x = llabs(x); + + while (x) { x >>= 1; ++n; } + + return ((n == 0) ? 1 : n); +} + +/** + * \brief Get the size in base 2 + * \param[in] precision Precision of the osl int + * \param[in] value Value in a osl int + * \return the size in base 2 + */ +size_t osl_int_size_in_base_2(int const precision, + osl_const_int_t const value) { + switch (precision) { + case OSL_PRECISION_SP: return lllog2(value.sp); + + case OSL_PRECISION_DP: return lllog2(value.dp); + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: return mpz_sizeinbase(*value.mp, 2); +#endif + + default: OSL_error("unknown precision"); + } +} + + +// log10 function for long long int +static size_t lllog10(long long int x) { + size_t n = 0; + + x = llabs(x); + + while (x) { x /= 10; ++n; } + + return n; +} + +/** + * \brief Get the size in base 10 + * \warning warning mpz_sizeinbase may not return the same result with same integer in different precisions + * \param[in] precision Precision of the osl int + * \param[in] value Value in a osl int + * \return the size in base 10 + */ +size_t osl_int_size_in_base_10(int const precision, + osl_const_int_t const value) { + switch (precision) { + case OSL_PRECISION_SP: return lllog10(value.sp); + + case OSL_PRECISION_DP: return lllog10(value.dp); + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: return mpz_sizeinbase(*value.mp, 10); +#endif + + default: OSL_error("unknown precision"); + } +} + + +/*+*************************************************************************** + * Conditional Operations * + *****************************************************************************/ + + +/** + * \brief val1 == val2 + * \param[in] precision Precision of the osl int + * \param[in] val1 Value of first osl int + * \param[in] val2 Value of second osl int + * \return 1 if values are equal, false otherwise + */ +int osl_int_eq(int precision, osl_const_int_t val1, osl_const_int_t val2) { + switch (precision) { + case OSL_PRECISION_SP: + return (val1.sp == val2.sp); + + case OSL_PRECISION_DP: + return (val1.dp == val2.dp); + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + return (mpz_cmp(*val1.mp, *val2.mp) == 0); +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief val1 != val2 + * \param[in] precision Precision of the osl int + * \param[in] val1 Value of first osl int + * \param[in] val2 Value of second osl int + * \return 1 if values are not equal, false otherwise + */ +int osl_int_ne(int precision, osl_const_int_t val1, osl_const_int_t val2) { + return !osl_int_eq(precision, val1, val2); +} + + +/** + * \brief value > 0 + * \param[in] precision Precision of the osl int + * \param[in] value Value in a osl int + * \return 1 if value is > 0, false otherwise + */ +int osl_int_pos(int precision, osl_const_int_t value) { + switch (precision) { + case OSL_PRECISION_SP: + return (value.sp > 0); + + case OSL_PRECISION_DP: + return (value.dp > 0); + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + return (mpz_sgn(*value.mp) > 0); +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief value < 0 + * \param[in] precision Precision of the osl int + * \param[in] value Value in a osl int + * \return 1 if value < 0, false otherwise + */ +int osl_int_neg(int precision, osl_const_int_t value) { + switch (precision) { + case OSL_PRECISION_SP: + return (value.sp < 0); + + case OSL_PRECISION_DP: + return (value.dp < 0); + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + return (mpz_sgn(*value.mp) < 0); +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief value == 0 + * \param[in] precision Precision of the osl int + * \param[in] value Value in a osl int + * \return 1 if value equal to 0, false otherwise + */ +int osl_int_zero(int precision, osl_const_int_t value) { + switch (precision) { + case OSL_PRECISION_SP: + return (value.sp == 0); + + case OSL_PRECISION_DP: + return (value.dp == 0); + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + return (mpz_sgn(*value.mp) == 0); +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief value == 1 + * \param[in] precision Precision of the osl int + * \param[in] value Value in a osl int + * \return 1 if value equal to 1, false otherwise + */ +int osl_int_one(int precision, osl_const_int_t value) { + switch (precision) { + case OSL_PRECISION_SP: + return (value.sp == (long int)1); + + case OSL_PRECISION_DP: + return (value.dp == (long long int)1); + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + return (mpz_cmp_si(*value.mp, 1) == 0); +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief value == -1 + * \param[in] precision Precision of the osl int + * \param[in] value Value in a osl int + * \return 1 if value equal to -1, false otherwise + */ +int osl_int_mone(int precision, osl_const_int_t value) { + switch (precision) { + case OSL_PRECISION_SP: + return (value.sp == (long int)-1); + + case OSL_PRECISION_DP: + return (value.dp == (long long int)-1); + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + return (mpz_cmp_si(*value.mp, -1) == 0); +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/** + * \brief (val1 % val2) == 0 + * \param[in] precision Precision of the osl int + * \param[in] val1 Value of first osl int + * \param[in] val2 Value of second osl int + * \return 1 if val2 divises val1 without remainder, false otherwise + */ +int osl_int_divisible(int precision, + osl_const_int_t val1, osl_const_int_t val2) { + switch (precision) { + case OSL_PRECISION_SP: + return ((val1.sp % val2.sp) == 0); + + case OSL_PRECISION_DP: + return ((val1.dp % val2.dp) == 0); + +#ifdef OSL_GMP_IS_HERE + case OSL_PRECISION_MP: + return mpz_divisible_p(*val1.mp, *val2.mp); +#endif + + default: + OSL_error("unknown precision"); + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * \brief Change the precision of the osl_int + * \param[in] precision Precision of the osl int + * \param[in] new_precision Precision wanted for the osl int + * \param[in,out] i A osl int to change the precision + */ +void osl_int_set_precision(int const precision, int const new_precision, + osl_int_p i) { + if (i != NULL && precision != new_precision) { + int v = osl_int_get_si(precision, *i); // TODO Fix to avoid overflow + osl_int_clear(precision, i); + osl_int_init_set_si(new_precision, i, v); + } +} diff -Nru cloog-0.18.2/osl/source/interface.c cloog-0.18.4/osl/source/interface.c --- cloog-0.18.2/osl/source/interface.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/interface.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,413 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** interface.c ** + **-----------------------------------------------------------------** + ** First version: 15/07/2011 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_interface_idump function: + * this function displays an osl_interface_t structure (*interface) into + * a file (file, possibly stdout) in a way that trends to be understandable. + * It includes an indentation level (level) in order to work with others + * idump functions. + * \param file The file where the information has to be printed. + * \param interface The interface structure which has to be printed. + * \param level Number of spaces before printing, for each line. + */ +void osl_interface_idump(FILE * file, osl_interface_p interface, int level) { + int j, first = 1; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (interface != NULL) + fprintf(file, "+-- osl_interface_t: URI = %s\n", interface->URI); + else + fprintf(file, "+-- NULL interface\n"); + + + while (interface != NULL) { + if (!first) { + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (interface->URI != NULL) + fprintf(file, "| osl_interface_t: URI = %s\n", interface->URI); + else + fprintf(file, "| osl_interface_t: URI = (NULL)\n"); + } + else + first = 0; + + interface = interface->next; + + // Next line. + if (interface != NULL) { + for (j = 0; j <= level + 1; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "V\n"); + } + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_interface_dump function: + * this function prints the content of a osl_interface_t structure + * (*interface) into a file (file, possibly stdout). + * \param file File where informations are printed. + * \param interface The interface structure to print. + */ +void osl_interface_dump(FILE * file, osl_interface_p interface) { + osl_interface_idump(file, interface, 0); +} + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_interface_add function: + * this function adds an interface node (it may be a list as well) to a + * list of interfaces provided as parameter (list). The new node + * is inserted at the end of the list. + * \param list The list of interfaces to add a node (NULL if empty). + * \param interface The interface to add to the list. + */ +void osl_interface_add(osl_interface_p * list, osl_interface_p interface) { + osl_interface_p tmp = *list, check_interface; + + if (interface != NULL) { + // First, check that the interface list is OK. + check_interface = interface; + while (check_interface != NULL) { + if (check_interface->URI == NULL) + OSL_error("no URI in an interface to add to a list"); + + if (osl_interface_lookup(*list, check_interface->URI) != NULL) + OSL_error("only one interface with a given URI is allowed"); + check_interface = check_interface->next; + } + + if (*list != NULL) { + while (tmp->next != NULL) + tmp = tmp->next; + tmp->next = interface; + } + else { + *list = interface; + } + } +} + + +/** + * osl_interface_malloc function: + * This function allocates the memory space for a osl_interface_t + * structure and sets its fields with default values. Then it returns a + * pointer to the allocated space. + * \return A pointer to an empty interface structure with fields set to + * default values. + */ +osl_interface_p osl_interface_malloc() { + osl_interface_p interface; + + OSL_malloc(interface, osl_interface_p, + sizeof(osl_interface_t)); + interface->URI = NULL; + interface->idump = NULL; + interface->sprint = NULL; + interface->sread = NULL; + interface->malloc = NULL; + interface->free = NULL; + interface->clone = NULL; + interface->equal = NULL; + interface->next = NULL; + + return interface; +} + + +/** + * osl_interface_free function: + * this function frees the allocated memory for an osl_interface_t + * structure, and all the interfaces stored in the list. + * \param[in] interface The pointer to the interface we want to free. + */ +void osl_interface_free(osl_interface_p interface) { + osl_interface_p tmp; + int i = 0; + + while (interface != NULL) { + tmp = interface->next; + if (interface->URI != NULL) + free(interface->URI); + free(interface); + interface = tmp; + i++; + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_interface_number function: + * this function returns the number of statements in the interface list + * provided as parameter. + * \param[in] interface The first element of the interface list. + * \return The number of statements in the interface list. + */ +int osl_interface_number(osl_interface_p interface) { + int number = 0; + + while (interface != NULL) { + number++; + interface = interface->next; + } + return number; +} + + +/** + * osl_interface_nclone function: + * This function builds and returns a "hard copy" (not a pointer copy) of the + * n first elements of an osl_interface_t list. + * \param interface The pointer to the interface structure we want to clone. + * \param n The number of nodes we want to copy (-1 for infinity). + * \return The clone of the n first nodes of the interface list. + */ +osl_interface_p osl_interface_nclone(osl_interface_p interface, int n) { + osl_interface_p clone = NULL, new; + int i = 0; + + while ((interface != NULL) && ((n == -1) || (i < n))) { + new = osl_interface_malloc(); + OSL_strdup(new->URI, interface->URI); + new->idump = interface->idump; + new->sprint = interface->sprint; + new->sread = interface->sread; + new->malloc = interface->malloc; + new->free = interface->free; + new->clone = interface->clone; + new->equal = interface->equal; + + osl_interface_add(&clone, new); + interface = interface->next; + i++; + } + + return clone; +} + + +/** + * osl_interface_clone function: + * This function builds and returns a "hard copy" (not a pointer copy) of an + * osl_interface_t data structure. + * \param interface The pointer to the interface structure we want to copy. + * \return A pointer to the copy of the interface structure. + */ +osl_interface_p osl_interface_clone(osl_interface_p interface) { + + return osl_interface_nclone(interface, -1); +} + + +/** + * osl_interface_equal function: + * this function returns true if the two interface structures are the same, + * (content-wise) false otherwise. + * \param interface1 The first interface structure. + * \param interface2 The second interface structure. + * \return 1 if interface1 and interface2 are the same, 0 otherwise. + */ +int osl_interface_equal(osl_interface_p interface1, + osl_interface_p interface2) { + + if (interface1 == interface2) + return 1; + + if (((interface1 == NULL) && (interface2 != NULL)) || + ((interface1 != NULL) && (interface2 == NULL))) + return 0; + + if (strcmp(interface1->URI, interface2->URI) || + (interface1->idump != interface2->idump) || + (interface1->sprint != interface2->sprint) || + (interface1->sread != interface2->sread) || + (interface1->malloc != interface2->malloc) || + (interface1->free != interface2->free) || + (interface1->clone != interface2->clone) || + (interface1->equal != interface2->equal)) + return 0; + + return 1; +} + + +/** + * osl_interface_lookup function: + * this function returns the first interface with a given URI in the + * interface list provided as parameter and NULL if it doesn't find such + * an interface. + * \param list The interface list where to search a given interface URI. + * \param URI The URI of the interface we are looking for. + * \return The first interface of the requested URI in the list. + */ +osl_interface_p +osl_interface_lookup(osl_interface_p list, char * URI) { + + if (URI == NULL) { + OSL_warning("lookup for a NULL URI"); + } + else { + while (list != NULL) { + if ((list->URI != NULL) && (!strcmp(list->URI, URI))) + return list; + + list = list->next; + } + } + + return NULL; +} + + +/** + * osl_interface_get_default_registry function: + * this function creates the list of known interfaces (of all generic types, + * including extensions) and returns it. + * \return The list of known interfaces. + */ +osl_interface_p osl_interface_get_default_registry() { + osl_interface_p registry = NULL; + + // Internal generics + osl_interface_add(®istry, osl_strings_interface()); + osl_interface_add(®istry, osl_body_interface()); + osl_interface_add(®istry, osl_relation_interface()); + + // Extensions + osl_interface_add(®istry, osl_textual_interface()); + osl_interface_add(®istry, osl_comment_interface()); + osl_interface_add(®istry, osl_null_interface()); + osl_interface_add(®istry, osl_scatnames_interface()); + osl_interface_add(®istry, osl_arrays_interface()); + osl_interface_add(®istry, osl_coordinates_interface()); + osl_interface_add(®istry, osl_clay_interface()); + osl_interface_add(®istry, osl_dependence_interface()); + osl_interface_add(®istry, osl_symbols_interface()); + osl_interface_add(®istry, osl_extbody_interface()); + osl_interface_add(®istry, osl_loop_interface()); + osl_interface_add(®istry, osl_pluto_unroll_interface()); + //osl_interface_add(®istry, osl_irregular_interface()); + + return registry; +} + + + diff -Nru cloog-0.18.2/osl/source/names.c cloog-0.18.4/osl/source/names.c --- cloog-0.18.2/osl/source/names.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/names.c 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,242 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** extensions/names.c ** + **-----------------------------------------------------------------** + ** First version: 18/04/2011 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#include +#include +#include + +#include +#include +#include + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_names_idump function: + * this function displays an osl_names_t structure (*names) into a + * file (file, possibly stdout) in a way that trends to be understandable. It + * includes an indentation level (level) in order to work with others + * idump functions. + * \param[in] file The file where the information has to be printed. + * \param[in] names The names structure whose information has to be printed. + * \param[in] level Number of spaces before printing, for each line. + */ +void osl_names_idump(FILE * file, osl_names_p names, int level) { + int j; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (names != NULL) + fprintf(file, "+-- osl_names_t\n"); + else + fprintf(file, "+-- NULL names\n"); + + if (names != NULL) { + // A blank line. + for (j = 0; j <= level+1; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); + + // Print the various names. + osl_strings_idump(file, names->parameters, level + 1); + osl_strings_idump(file, names->iterators, level + 1); + osl_strings_idump(file, names->scatt_dims, level + 1); + osl_strings_idump(file, names->local_dims, level + 1); + osl_strings_idump(file, names->arrays, level + 1); + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_names_dump function: + * this function prints the content of an osl_names_t structure + * (*names) into a file (file, possibly stdout). + * \param[in] file The file where the information has to be printed. + * \param[in] names The names structure whose information has to be printed. + */ +void osl_names_dump(FILE * file, osl_names_p names) { + osl_names_idump(file, names, 0); +} + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_names_malloc function: + * this function allocates the memory space for an osl_names_t + * structure and sets its fields with default values. Then it returns a + * pointer to the allocated space. + * \return A pointer to an empty names structure with fields set to + * default values. + */ +osl_names_p osl_names_malloc() { + osl_names_p names; + + OSL_malloc(names, osl_names_p, sizeof(osl_names_t)); + names->parameters = NULL; + names->iterators = NULL; + names->scatt_dims = NULL; + names->local_dims = NULL; + names->arrays = NULL; + + return names; +} + + +/** + * osl_names_free function: + * This function frees the allocated memory for an osl_names_t + * structure. If the names are not character strings, it is the + * responsibility of the user to free each array of elements (including + * the array itself), this function will only free the osl_names_t shell. + * \param[in,out] names The pointer to the names structure we want to free. + */ +void osl_names_free(osl_names_p names) { + if (names != NULL) { + osl_strings_free(names->parameters); + osl_strings_free(names->iterators); + osl_strings_free(names->scatt_dims); + osl_strings_free(names->local_dims); + osl_strings_free(names->arrays); + + free(names); + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_names_generate function: + * this function generates some names. For each kind of name it will generate + * a given number of names with a given prefix followed by a number. + * \param[in] parameter_prefix Prefix for parameter names. + * \param[in] nb_parameters Number of parameters names to generate. + * \param[in] iterator_prefix Prefix for iterator names. + * \param[in] nb_iterators Number of iterators names to generate. + * \param[in] scatt_dim_prefix Prefix for scattering dimension names. + * \param[in] nb_scatt_dims Number of scattering dim names to generate. + * \param[in] local_dim_prefix Prefix for local dimension names. + * \param[in] nb_local_dims Number of local dimension names to generate. + * \param[in] array_prefix Prefix for array names. + * \param[in] nb_arrays Number of array names to generate. + * \return A new names structure containing generated names. + */ +osl_names_p osl_names_generate( + char * parameter_prefix, int nb_parameters, + char * iterator_prefix, int nb_iterators, + char * scatt_dim_prefix, int nb_scatt_dims, + char * local_dim_prefix, int nb_local_dims, + char * array_prefix, int nb_arrays) { + osl_names_p names = osl_names_malloc(); + + names->parameters= osl_strings_generate(parameter_prefix,nb_parameters); + names->iterators = osl_strings_generate(iterator_prefix, nb_iterators); + names->scatt_dims= osl_strings_generate(scatt_dim_prefix,nb_scatt_dims); + names->local_dims= osl_strings_generate(local_dim_prefix,nb_local_dims); + names->arrays = osl_strings_generate(array_prefix, nb_arrays); + + return names; +} + +/** + * osl_names_clone function: + * this function builds and returns a "hard copy" (not a pointer copy) of an + * osl_names_t data structure provided as parameter. + * \param[in] names The pointer to the names structure we want to clone. + * \return A pointer to the clone of the names structure provided as parameter. + */ +osl_names_p osl_names_clone(osl_names_p names) { + osl_names_p clone = NULL; + + if (names != NULL) { + clone = osl_names_malloc(); + clone->parameters = osl_strings_clone(names->parameters); + clone->iterators = osl_strings_clone(names->iterators); + clone->scatt_dims = osl_strings_clone(names->scatt_dims); + clone->local_dims = osl_strings_clone(names->local_dims); + clone->arrays = osl_strings_clone(names->arrays); + } + return clone; +} diff -Nru cloog-0.18.2/osl/source/relation.c cloog-0.18.4/osl/source/relation.c --- cloog-0.18.2/osl/source/relation.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/relation.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,3057 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** relation.c ** + **-----------------------------------------------------------------** + ** First version: 30/04/2008 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_relation_sprint_type function: + * this function prints the textual type of an osl_relation_t structure into + * a string, according to the OpenScop specification, and returns that string. + * \param[in] relation The relation whose type has to be printed. + * \return A string containing the relation type. + */ +static +char * osl_relation_sprint_type(osl_relation_p relation) { + char * string = NULL; + + OSL_malloc(string, char *, OSL_MAX_STRING * sizeof(char)); + string[0] = '\0'; + + if (relation != NULL) { + switch (relation->type) { + case OSL_UNDEFINED: { + snprintf(string, OSL_MAX_STRING, OSL_STRING_UNDEFINED); + break; + } + case OSL_TYPE_CONTEXT: { + snprintf(string, OSL_MAX_STRING, OSL_STRING_CONTEXT); + break; + } + case OSL_TYPE_DOMAIN: { + snprintf(string, OSL_MAX_STRING, OSL_STRING_DOMAIN); + break; + } + case OSL_TYPE_SCATTERING: { + snprintf(string, OSL_MAX_STRING, OSL_STRING_SCATTERING); + break; + } + case OSL_TYPE_READ: { + snprintf(string, OSL_MAX_STRING, OSL_STRING_READ); + break; + } + case OSL_TYPE_WRITE: { + snprintf(string, OSL_MAX_STRING, OSL_STRING_WRITE); + break; + } + case OSL_TYPE_MAY_WRITE: { + snprintf(string, OSL_MAX_STRING, OSL_STRING_MAY_WRITE); + break; + } + default: { + OSL_warning("unknown relation type, " + "replaced with "OSL_STRING_UNDEFINED); + snprintf(string, OSL_MAX_STRING, OSL_STRING_UNDEFINED); + } + } + } + + return string; +} + + +/** + * osl_relation_print_type function: + * this function displays the textual type of an osl_relation_t structure into + * a file (file, possibly stdout), according to the OpenScop specification. + * \param[in] file File where informations are printed. + * \param[in] relation The relation whose type has to be printed. + */ +static +void osl_relation_print_type(FILE * file, osl_relation_p relation) { + char * string = osl_relation_sprint_type(relation); + fprintf(file, "%s", string); + free(string); +} + + +/** + * osl_relation_idump function: + * this function displays a osl_relation_t structure (*relation) into a + * file (file, possibly stdout) in a way that trends to be understandable. + * It includes an indentation level (level) in order to work with others + * idump functions. + * \param[in] file File where informations are printed. + * \param[in] relation The relation whose information has to be printed. + * \param[in] level Number of spaces before printing, for each line. + */ +void osl_relation_idump(FILE * file, osl_relation_p relation, int level) { + int i, j, first = 1; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (relation != NULL) { + fprintf(file, "+-- osl_relation_t ("); + osl_relation_print_type(file, relation); + fprintf(file, ", "); + osl_int_dump_precision(file, relation->precision); + fprintf(file, ")\n"); + } + else { + fprintf(file, "+-- NULL relation\n"); + } + + while (relation != NULL) { + if (! first) { + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + fprintf(file, "| osl_relation_t ("); + osl_relation_print_type(file, relation); + fprintf(file, ", "); + osl_int_dump_precision(file, relation->precision); + fprintf(file, ")\n"); + } + else + first = 0; + + // A blank line + for(j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "%d %d %d %d %d %d\n", + relation->nb_rows, relation->nb_columns, + relation->nb_output_dims, relation->nb_input_dims, + relation->nb_local_dims, relation->nb_parameters); + + // Display the relation. + for (i = 0; i < relation->nb_rows; i++) { + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + + fprintf(file, "[ "); + + for (j = 0; j < relation->nb_columns; j++) { + osl_int_print(file, relation->precision, relation->m[i][j]); + fprintf(file, " "); + } + + fprintf(file, "]\n"); + } + + relation = relation->next; + + // Next line. + if (relation != NULL) { + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "|\n"); + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "V\n"); + } + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_relation_dump function: + * this function prints the content of a osl_relation_t structure + * (*relation) into a file (file, possibly stdout). + * \param[in] file File where informations are printed. + * \param[in] relation The relation whose information have to be printed. + */ +void osl_relation_dump(FILE * file, osl_relation_p relation) { + osl_relation_idump(file, relation, 0); +} + + +/** + * osl_relation_expression_element function: + * this function returns a string containing the printing of a value (e.g., + * an iterator with its coefficient or a constant). + * \param[in] val Coefficient or constant value. + * \param[in] precision The precision of the value. + * \param[in,out] first Pointer to a boolean set to 1 if the current value + * is the first of an expresion, 0 otherwise (maybe + * updated). + * \param[in] cst A boolean set to 1 if the value is a constant, + * 0 otherwise. + * \param[in] name String containing the name of the element. + * \return A string that contains the printing of a value. + */ +static +char * osl_relation_expression_element(osl_int_t val, + int precision, int * first, + int cst, char * name) { + char * temp, * body, * sval; + + OSL_malloc(temp, char *, OSL_MAX_STRING * sizeof(char)); + OSL_malloc(body, char *, OSL_MAX_STRING * sizeof(char)); + OSL_malloc(sval, char *, OSL_MAX_STRING * sizeof(char)); + + body[0] = '\0'; + sval[0] = '\0'; + + // statements for the 'normal' processing. + if (!osl_int_zero(precision, val) && (!cst)) { + if ((*first) || osl_int_neg(precision, val)) { + if (osl_int_one(precision, val)) { // case 1 + sprintf(sval, "%s", name); + } + else { + if (osl_int_mone(precision, val)) { // case -1 + sprintf(sval, "-%s", name); + } + else { // default case + osl_int_sprint_txt(sval, precision, val); + sprintf(temp, "*%s", name); + strcat(sval, temp); + } + } + *first = 0; + } + else { + if (osl_int_one(precision, val)) { + sprintf(sval, "+%s", name); + } + else { + sprintf(sval, "+"); + osl_int_sprint_txt(temp, precision, val); + strcat(sval, temp); + sprintf(temp, "*%s", name); + strcat(sval, temp); + } + } + } + else { + if (cst) { + if ((osl_int_zero(precision, val) && (*first)) || + (osl_int_neg(precision, val))) + osl_int_sprint_txt(sval, precision, val); + if (osl_int_pos(precision, val)) { + if (!(*first)) { + sprintf(sval, "+"); + osl_int_sprint_txt(temp, precision, val); + strcat(sval, temp); + } + else { + osl_int_sprint_txt(sval, precision, val); + } + } + } + } + free(temp); + free(body); + + return(sval); +} + + +/** + * osl_relation_strings function: + * this function creates a NULL-terminated array of strings from an + * osl_names_t structure in such a way that the ith string is the "name" + * corresponding to the ith column of the constraint matrix. + * \param[in] relation The relation for which we need an array of names. + * \param[in] names The set of names for each element. + * \return An array of strings with one string per constraint matrix column. + */ +static +char ** osl_relation_strings(osl_relation_p relation, osl_names_p names) { + char ** strings; + char temp[OSL_MAX_STRING]; + int i, offset; + + if ((relation == NULL) || (names == NULL)) { + OSL_debug("no names or relation to build the name array"); + return NULL; + } + + OSL_malloc(strings, char **, (relation->nb_columns + 1)*sizeof(char *)); + strings[relation->nb_columns] = NULL; + + // 1. Equality/inequality marker. + OSL_strdup(strings[0], "e/i"); + offset = 1; + + // 2. Output dimensions. + if (osl_relation_is_access(relation)) { + // The first output dimension is the array name. + OSL_strdup(strings[offset], "Arr"); + // The other ones are the array dimensions [1]...[n] + for (i = offset + 1; i < relation->nb_output_dims + offset; i++) { + sprintf(temp, "[%d]", i - 1); + OSL_strdup(strings[i], temp); + } + } + else + if ((relation->type == OSL_TYPE_DOMAIN) || + (relation->type == OSL_TYPE_CONTEXT)) { + for (i = offset; i < relation->nb_output_dims + offset; i++) { + OSL_strdup(strings[i], names->iterators->string[i - offset]); + } + } + else { + for (i = offset; i < relation->nb_output_dims + offset; i++) { + OSL_strdup(strings[i], names->scatt_dims->string[i - offset]); + } + } + offset += relation->nb_output_dims; + + // 3. Input dimensions. + for (i = offset; i < relation->nb_input_dims + offset; i++) + OSL_strdup(strings[i], names->iterators->string[i - offset]); + offset += relation->nb_input_dims; + + // 4. Local dimensions. + for (i = offset; i < relation->nb_local_dims + offset; i++) + OSL_strdup(strings[i], names->local_dims->string[i - offset]); + offset += relation->nb_local_dims; + + // 5. Parameters. + for (i = offset; i < relation->nb_parameters + offset; i++) + OSL_strdup(strings[i], names->parameters->string[i - offset]); + offset += relation->nb_parameters; + + // 6. Scalar. + OSL_strdup(strings[offset], "1"); + + return strings; +} + + +/** + * osl_relation_subexpression function: + * this function returns a string corresponding to an affine (sub-)expression + * stored at the "row"^th row of the relation pointed by "relation" between + * the start and stop columns. Optionally it may oppose the whole expression. + * \param[in] relation A set of linear expressions. + * \param[in] row The row corresponding to the expression. + * \param[in] start The first column for the expression (inclusive). + * \param[in] stop The last column for the expression (inclusive). + * \param[in] oppose Boolean set to 1 to negate the expression, 0 otherwise. + * \param[in] strings Array of textual names of the various elements. + * \return A string that contains the printing of an affine (sub-)expression. + */ +static +char * osl_relation_subexpression(osl_relation_p relation, + int row, int start, int stop, int oppose, + char ** strings) { + int i, first = 1, constant; + char * sval; + char * sline; + + OSL_malloc(sline, char *, OSL_MAX_STRING * sizeof(char)); + sline[0] = '\0'; + + // Create the expression. The constant is a special case. + for (i = start; i <= stop; i++) { + if (oppose) { + osl_int_oppose(relation->precision, + &relation->m[row][i], relation->m[row][i]); + } + + if (i == relation->nb_columns - 1) + constant = 1; + else + constant = 0; + + sval = osl_relation_expression_element(relation->m[row][i], + relation->precision, &first, constant, strings[i]); + + if (oppose) { + osl_int_oppose(relation->precision, + &relation->m[row][i], relation->m[row][i]); + } + strcat(sline, sval); + free(sval); + } + + return sline; +} + + +/** + * osl_relation_expression function: + * this function returns a string corresponding to an affine expression + * stored at the "row"^th row of the relation pointed by "relation". + * \param[in] relation A set of linear expressions. + * \param[in] row The row corresponding to the expression. + * \param[in] strings Array of textual names of the various elements. + * \return A string that contains the printing of an affine expression. + */ +char * osl_relation_expression(osl_relation_p relation, + int row, char ** strings) { + + return osl_relation_subexpression(relation, row, + 1, relation->nb_columns - 1, 0, + strings); +} + + +/** + * osl_relation_is_simple_output function: + * this function returns 1 or -1 if a given constraint row of a relation + * corresponds to an output, 0 otherwise. We call a simple output an equality + * constraint where exactly one output coefficient is not 0 and is either + * 1 (in this case the function returns 1) or -1 (in this case the function + * returns -1). + * \param[in] relation The relation to test for simple output. + * \param[in] row The row corresponding to the constraint to test. + * \return 1 or -1 if the row is a simple output, 0 otherwise. + */ +static +int osl_relation_is_simple_output(osl_relation_p relation, int row) { + int i; + int first = 1; + int sign = 0; + + if ((relation == NULL) || + (relation->m == NULL) || + (relation->nb_output_dims == 0)) + return 0; + + if ((row < 0) || (row > relation->nb_rows)) + OSL_error("the specified row does not exist in the relation"); + + // The constraint must be an equality. + if (!osl_int_zero(relation->precision, relation->m[row][0])) + return 0; + + // Check the output part has one and only one non-zero +1 or -1 coefficient. + first = 1; + for (i = 1; i <= relation->nb_output_dims; i++) { + if (!osl_int_zero(relation->precision, relation->m[row][i])) { + if (first) + first = 0; + else + return 0; + + if (osl_int_one(relation->precision, relation->m[row][i])) + sign = 1; + else if (osl_int_mone(relation->precision, relation->m[row][i])) + sign = -1; + else + return 0; + } + } + + return sign; +} + + +/** + * osl_relation_sprint_comment function: + * this function prints into a string a comment corresponding to a constraint + * of a relation, according to its type, then it returns this string. This + * function does not check that printing the comment is possible (i.e., are + * there enough names ?), hence it is the responsibility of the user to ensure + * he/she can call this function safely. + * \param[in] relation The relation for which a comment has to be printed. + * \param[in] row The constrain row for which a comment has to be printed. + * \param[in] strings Array of textual names of the various elements. + * \param[in] arrays Array of textual identifiers of the arrays. + * \return A string which contains the comment for the row. + */ +static +char * osl_relation_sprint_comment(osl_relation_p relation, int row, + char ** strings, char ** arrays) { + int sign; + int high_water_mark = OSL_MAX_STRING; + char * string = NULL; + char * expression; + char buffer[OSL_MAX_STRING]; + + OSL_malloc(string, char *, high_water_mark * sizeof(char)); + string[0] = '\0'; + + if ((relation == NULL) || (strings == NULL)) { + OSL_debug("no relation or names while asked to print a comment"); + return string; + } + + if ((sign = osl_relation_is_simple_output(relation, row))) { + // First case : output == expression. + + expression = osl_relation_subexpression(relation, row, + 1, relation->nb_output_dims, + sign < 0, + strings); + snprintf(buffer, OSL_MAX_STRING, " ## %s", expression); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + free(expression); + + // We don't print the right hand side if it's an array identifier. + if (!osl_relation_is_access(relation) || + osl_int_zero(relation->precision, relation->m[row][1])) { + expression = osl_relation_subexpression(relation, row, + relation->nb_output_dims + 1, + relation->nb_columns - 1, + sign > 0, + strings); + snprintf(buffer, OSL_MAX_STRING, " == %s", expression); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + free(expression); + } + else { + snprintf(buffer, OSL_MAX_STRING, " == %s", + arrays[osl_relation_get_array_id(relation) - 1]); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + } + else { + // Second case : general case. + + expression = osl_relation_expression(relation, row, strings); + snprintf(buffer, OSL_MAX_STRING, " ## %s", expression); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + free(expression); + + if (osl_int_zero(relation->precision, relation->m[row][0])) + snprintf(buffer, OSL_MAX_STRING, " == 0"); + else + snprintf(buffer, OSL_MAX_STRING, " >= 0"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + return string; +} + + +/** + * osl_relation_column_string function: + * this function returns an OpenScop comment string showing all column + * names. It is designed to nicely fit a constraint matrix that would be + * printed just below this line. + * \param[in] relation The relation related to the comment line to build. + * \param[in] strings Array of textual names of the various elements. + * \return A fancy comment string with all the dimension names. + */ +static +char * osl_relation_column_string(osl_relation_p relation, char ** strings) { + int i, j; + int index_output_dims; + int index_input_dims; + int index_local_dims; + int index_parameters; + int index_scalar; + int space, length, left, right; + char * scolumn; + char temp[OSL_MAX_STRING]; + + OSL_malloc(scolumn, char *, OSL_MAX_STRING); + + index_output_dims = 1; + index_input_dims = index_output_dims + relation->nb_output_dims; + index_local_dims = index_input_dims + relation->nb_input_dims; + index_parameters = index_local_dims + relation->nb_local_dims; + index_scalar = index_parameters + relation->nb_parameters; + + // 1. The comment part. + sprintf(scolumn, "#"); + for (j = 0; j < (OSL_FMT_LENGTH - 1)/2 - 1; j++) + strcat(scolumn, " "); + + i = 0; + while (strings[i] != NULL) { + space = OSL_FMT_LENGTH; + length = (space > (int)strlen(strings[i])) ? (int)strlen(strings[i]) : space; + right = (space - length + (OSL_FMT_LENGTH % 2)) / 2; + left = space - length - right; + + // 2. Spaces before the name + for (j = 0; j < left; j++) + strcat(scolumn, " "); + + // 3. The (abbreviated) name + for (j = 0; j < length - 1; j++) { + sprintf(temp, "%c", strings[i][j]); + strcat(scolumn, temp); + } + if (length >= (int)strlen(strings[i])) + sprintf(temp, "%c", strings[i][j]); + else + sprintf(temp, "."); + strcat(scolumn, temp); + + // 4. Spaces after the name + for (j = 0; j < right; j++) + strcat(scolumn, " "); + + i++; + if ((i == index_output_dims) || + (i == index_input_dims) || + (i == index_local_dims) || + (i == index_parameters) || + (i == index_scalar)) + strcat(scolumn, "|"); + else + strcat(scolumn, " "); + } + strcat(scolumn, "\n"); + + return scolumn; +} + + +/** + * osl_relation_column_string_scoplib function: + * this function returns an OpenScop comment string showing all column + * names. It is designed to nicely fit a constraint matrix that would be + * printed just below this line. + * \param[in] relation The relation related to the comment line to build. + * \param[in] strings Array of textual names of the various elements. + * \return A fancy comment string with all the dimension names. + */ +static +char * osl_relation_column_string_scoplib(osl_relation_p relation, + char ** strings) { + int i, j; + int index_output_dims; + int index_input_dims; + int index_local_dims; + int index_parameters; + int index_scalar; + int space, length, left, right; + char * scolumn; + char temp[OSL_MAX_STRING]; + + OSL_malloc(scolumn, char *, OSL_MAX_STRING); + + index_output_dims = 1; + index_input_dims = index_output_dims + relation->nb_output_dims; + index_local_dims = index_input_dims + relation->nb_input_dims; + index_parameters = index_local_dims + relation->nb_local_dims; + index_scalar = index_parameters + relation->nb_parameters; + + // 1. The comment part. + sprintf(scolumn, "#"); + for (j = 0; j < (OSL_FMT_LENGTH - 1)/2 - 1; j++) + strcat(scolumn, " "); + + i = 0; + while (strings[i] != NULL) { + + if (i == 0 || + (relation->type != OSL_TYPE_DOMAIN && i >= index_input_dims) || + (relation->type == OSL_TYPE_DOMAIN && i <= index_output_dims) || + i >= index_parameters) { + space = OSL_FMT_LENGTH; + length = (space > (int)strlen(strings[i])) ? (int)strlen(strings[i]) : space; + right = (space - length + (OSL_FMT_LENGTH % 2)) / 2; + left = space - length - right; + + // 2. Spaces before the name + for (j = 0; j < left; j++) + strcat(scolumn, " "); + + // 3. The (abbreviated) name + for (j = 0; j < length - 1; j++) { + sprintf(temp, "%c", strings[i][j]); + strcat(scolumn, temp); + } + if (length >= (int)strlen(strings[i])) + sprintf(temp, "%c", strings[i][j]); + else + sprintf(temp, "."); + strcat(scolumn, temp); + + // 4. Spaces after the name + for (j = 0; j < right; j++) + strcat(scolumn, " "); + + if ((i == index_output_dims-1) || + (i == index_input_dims-1) || + (i == index_local_dims-1) || + (i == index_parameters-1) || + (i == index_scalar-1)) + strcat(scolumn, "|"); + else + strcat(scolumn, " "); + } + + i++; + } + strcat(scolumn, "\n"); + + return scolumn; +} + + +/** + * osl_relation_names function: + * this function generates as set of names for all the dimensions + * involved in a given relation. + * \param[in] relation The relation we have to generate names for. + * \return A set of generated names for the input relation dimensions. + */ +static +osl_names_p osl_relation_names(osl_relation_p relation) { + int nb_parameters = OSL_UNDEFINED; + int nb_iterators = OSL_UNDEFINED; + int nb_scattdims = OSL_UNDEFINED; + int nb_localdims = OSL_UNDEFINED; + int array_id = OSL_UNDEFINED; + + osl_relation_get_attributes(relation, &nb_parameters, &nb_iterators, + &nb_scattdims, &nb_localdims, &array_id); + + return osl_names_generate("P", nb_parameters, + "i", nb_iterators, + "c", nb_scattdims, + "l", nb_localdims, + "A", array_id); +} + + +/** + * osl_relation_nb_components function: + * this function returns the number of component in the union of relations + * provided as parameter. + * \param[in] relation The input union of relations. + * \return The number of components in the input union of relations. + */ +int osl_relation_nb_components(osl_relation_p relation) { + int nb_components = 0; + + while (relation != NULL) { + nb_components++; + relation = relation->next; + } + + return nb_components; +} + + +/** + * osl_relation_spprint_polylib function: + * this function pretty-prints the content of an osl_relation_t structure + * (*relation) into a string in the extended polylib format, and returns this + * string. This format is the same as OpenScop's, minus the type. + * \param[in] relation The relation whose information has to be printed. + * \param[in] names The names of the constraint columns for comments. + * \return A string containing the relation pretty-printing. + */ +char * osl_relation_spprint_polylib(osl_relation_p relation, + osl_names_p names) { + int i, j; + int part, nb_parts; + int generated_names = 0; + int high_water_mark = OSL_MAX_STRING; + char * string = NULL; + char buffer[OSL_MAX_STRING]; + char ** name_array = NULL; + char * scolumn; + char * comment; + + if (relation == NULL) + return osl_util_strdup("# NULL relation\n"); + + OSL_malloc(string, char *, high_water_mark * sizeof(char)); + string[0] = '\0'; + + // Generates the names for the comments if necessary. + if (names == NULL) { + generated_names = 1; + names = osl_relation_names(relation); + } + + nb_parts = osl_relation_nb_components(relation); + + if (nb_parts > 1) { + snprintf(buffer, OSL_MAX_STRING, "# Union with %d parts\n%d\n", + nb_parts, nb_parts); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + // Print each part of the union. + for (part = 1; part <= nb_parts; part++) { + // Prepare the array of strings for comments. + name_array = osl_relation_strings(relation, names); + + if (nb_parts > 1) { + snprintf(buffer, OSL_MAX_STRING, "# Union part No.%d\n", part); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + snprintf(buffer, OSL_MAX_STRING, "%d %d %d %d %d %d\n", + relation->nb_rows, relation->nb_columns, + relation->nb_output_dims, relation->nb_input_dims, + relation->nb_local_dims, relation->nb_parameters); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + if (relation->nb_rows > 0) { + scolumn = osl_relation_column_string(relation, name_array); + snprintf(buffer, OSL_MAX_STRING, "%s", scolumn); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + free(scolumn); + } + + for (i = 0; i < relation->nb_rows; i++) { + for (j = 0; j < relation->nb_columns; j++) { + osl_int_sprint(buffer, relation->precision, relation->m[i][j]); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + snprintf(buffer, OSL_MAX_STRING, " "); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + if (name_array != NULL) { + comment = osl_relation_sprint_comment(relation, i, name_array, + names->arrays->string); + osl_util_safe_strcat(&string, comment, &high_water_mark); + free(comment); + } + snprintf(buffer, OSL_MAX_STRING, "\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + // Free the array of strings. + if (name_array != NULL) { + for (i = 0; i < relation->nb_columns; i++) + free(name_array[i]); + free(name_array); + } + + relation = relation->next; + } + + if (generated_names) + osl_names_free(names); + + return string; +} + + +/** + * osl_relation_spprint_polylib_scoplib function: + * this function pretty-prints the content of an osl_relation_t structure + * (*relation) into a string in the extended polylib format, and returns this + * string. + * \param[in] relation The relation whose information has to be printed. + * \param[in] names The names of the constraint columns for comments. + * \param[in] print_nth_part Print the value of `n' (used for domain union) + * \param[in] add_fakeiter + * \return A string containing the relation pretty-printing. + */ +char * osl_relation_spprint_polylib_scoplib(osl_relation_p relation, + osl_names_p names, + int print_nth_part, + int add_fakeiter) { + int i, j; + int part, nb_parts; + int generated_names = 0; + int is_access_array; + int high_water_mark = OSL_MAX_STRING; + int start_row; // for removing the first line in the access matrix + int index_output_dims; + int index_input_dims; + int index_params; + char * string = NULL; + char buffer[OSL_MAX_STRING]; + char ** name_array = NULL; + char * scolumn; + char * comment; + + if (relation == NULL) + return osl_util_strdup("# NULL relation\n"); + + OSL_malloc(string, char *, high_water_mark * sizeof(char)); + string[0] = '\0'; + + // Generates the names for the comments if necessary. + if (names == NULL) { + generated_names = 1; + names = osl_relation_names(relation); + } + + nb_parts = osl_relation_nb_components(relation); + if (nb_parts > 1) { + snprintf(buffer, OSL_MAX_STRING, "# Union with %d parts\n%d\n", + nb_parts, nb_parts); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + is_access_array = (relation->type == OSL_TYPE_READ || + relation->type == OSL_TYPE_WRITE ? 1 : 0); + + // Print each part of the union. + + for (part = 1; part <= nb_parts; part++) { + + index_output_dims = 1; + index_input_dims = index_output_dims + relation->nb_output_dims; + index_params = index_input_dims + relation->nb_input_dims; + + // Prepare the array of strings for comments. + name_array = osl_relation_strings(relation, names); + + if (nb_parts > 1) { + snprintf(buffer, OSL_MAX_STRING, "# Union part No.%d\n", part); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + if (print_nth_part) { + snprintf(buffer, OSL_MAX_STRING, "%d\n", part); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + // Don't print the array size for access array + // (the total size is printed in osl_relation_list_pprint_access_array_scoplib) + if (!is_access_array) { + + // Print array size + if (relation->type == OSL_TYPE_DOMAIN) { + + if (add_fakeiter) { + + snprintf(buffer, OSL_MAX_STRING, "%d %d\n", + relation->nb_rows+1, relation->nb_columns - + relation->nb_input_dims + 1); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + // add the fakeiter line + snprintf(buffer, OSL_MAX_STRING, " 0 "); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + snprintf(buffer, OSL_MAX_STRING, " 1 "); // fakeiter + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + for (i = 0 ; i < relation->nb_parameters ; i++) { + snprintf(buffer, OSL_MAX_STRING, " 0 "); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + snprintf(buffer, OSL_MAX_STRING, " 0 ## fakeiter == 0\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + } else { + snprintf(buffer, OSL_MAX_STRING, "%d %d\n", + relation->nb_rows, relation->nb_columns - + relation->nb_input_dims); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + } else { // SCATTERING + + if (add_fakeiter) { + snprintf(buffer, OSL_MAX_STRING, "%d %d\n", + relation->nb_rows+2, relation->nb_columns - + relation->nb_output_dims + 1); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } else { + snprintf(buffer, OSL_MAX_STRING, "%d %d\n", + relation->nb_rows, relation->nb_columns - + relation->nb_output_dims); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + } + + // Print column names in comment + if (relation->nb_rows > 0) { + scolumn = osl_relation_column_string_scoplib(relation, name_array); + snprintf(buffer, OSL_MAX_STRING, "%s", scolumn); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + free(scolumn); + } + + start_row = 0; + + } else { + + if (relation->nb_rows == 1) // for non array variables + start_row = 0; + else // Remove the 'Arr' line + start_row = 1; + } + + // Print the array + for (i = start_row; i < relation->nb_rows; i++) { + + // First column + if (!is_access_array) { + // array index name for scoplib + osl_int_sprint(buffer, relation->precision, relation->m[i][0]); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + snprintf(buffer, OSL_MAX_STRING, " "); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + } else { + // The first column represents the array index name in openscop + if (i == start_row) + osl_int_sprint(buffer, relation->precision, + relation->m[0][relation->nb_columns-1]); + else + snprintf(buffer, OSL_MAX_STRING, " 0 "); + + osl_util_safe_strcat(&string, buffer, &high_water_mark); + snprintf(buffer, OSL_MAX_STRING, " "); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + // Rest of the array + if (relation->type == OSL_TYPE_DOMAIN) { + + for (j = 1; j < index_input_dims; j++) { + osl_int_sprint(buffer, relation->precision, relation->m[i][j]); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + snprintf(buffer, OSL_MAX_STRING, " "); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + // Jmp input_dims + for (j = index_params; j < relation->nb_columns; j++) { + osl_int_sprint(buffer, relation->precision, relation->m[i][j]); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + snprintf(buffer, OSL_MAX_STRING, " "); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + } else { + + // Jmp output_dims + for (j = index_input_dims; j < index_params; j++) { + if (is_access_array && relation->nb_rows == 1 && + j == relation->nb_columns-1) { + snprintf(buffer, OSL_MAX_STRING, " 0 "); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } else { + osl_int_sprint(buffer, relation->precision, relation->m[i][j]); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + snprintf(buffer, OSL_MAX_STRING, " "); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + } + + if (add_fakeiter) { + snprintf(buffer, OSL_MAX_STRING, " 0 "); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + for (; j < relation->nb_columns; j++) { + if (is_access_array && relation->nb_rows == 1 && + j == relation->nb_columns-1) { + snprintf(buffer, OSL_MAX_STRING, " 0 "); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } else { + osl_int_sprint(buffer, relation->precision, relation->m[i][j]); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + snprintf(buffer, OSL_MAX_STRING, " "); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + } + } + + // equation in comment + if (name_array != NULL) { + comment = osl_relation_sprint_comment(relation, i, name_array, + names->arrays->string); + osl_util_safe_strcat(&string, comment, &high_water_mark); + free(comment); + snprintf(buffer, OSL_MAX_STRING, "\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + // add the lines in the scattering if we need the fakeiter + if (relation->nb_rows > 0 && add_fakeiter && + relation->type == OSL_TYPE_SCATTERING) { + + for (i = 0 ; i < 2 ; i++) { + for (j = 0; j < relation->nb_columns; j++) { + if (j == index_output_dims && i == 0) + snprintf(buffer, OSL_MAX_STRING, " 1 "); // fakeiter + else + snprintf(buffer, OSL_MAX_STRING, " 0 "); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + snprintf(buffer, OSL_MAX_STRING, "\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + } + + } + + // Free the array of strings. + if (name_array != NULL) { + for (i = 0; i < relation->nb_columns; i++) + free(name_array[i]); + free(name_array); + } + + relation = relation->next; + } + + if (generated_names) + osl_names_free(names); + + return string; +} + + +/** + * osl_relation_spprint function: + * this function pretty-prints the content of an osl_relation_t structure + * (*relation) into a string in the OpenScop format, and returns this string. + * \param[in] relation The relation whose information has to be printed. + * \param[in] names The names of the constraint columns for comments. + * \return A string + */ +char * osl_relation_spprint(osl_relation_p relation, osl_names_p names) { + int high_water_mark = OSL_MAX_STRING; + char * string = NULL; + char * temp; + char buffer[OSL_MAX_STRING]; + OSL_malloc(string, char *, high_water_mark * sizeof(char)); + string[0] = '\0'; + + if (osl_relation_nb_components(relation) > 0) { + temp = osl_relation_sprint_type(relation); + osl_util_safe_strcat(&string, temp, &high_water_mark); + free(temp); + + snprintf(buffer, OSL_MAX_STRING, "\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + + temp = osl_relation_spprint_polylib(relation, names); + osl_util_safe_strcat(&string, temp, &high_water_mark); + free(temp); + } + + return string; +} + + +/** + * osl_relation_spprint_scoplib function: + * this function pretty-prints the content of an osl_relation_t structure + * (*relation) into a string in the SCoPLib format, and returns this string. + * \param[in] relation The relation whose information has to be printed. + * \param[in] names The names of the constraint columns for comments. + * \param[in] print_nth_part Print the value of `n' (used for domain union) + * \param[in] add_fakeiter + * \return A string + */ +char * osl_relation_spprint_scoplib(osl_relation_p relation, osl_names_p names, + int print_nth_part, int add_fakeiter) { + int high_water_mark = OSL_MAX_STRING; + char * string = NULL; + char * temp; + OSL_malloc(string, char *, high_water_mark * sizeof(char)); + string[0] = '\0'; + + if (relation) { + temp = osl_relation_spprint_polylib_scoplib(relation, names, + print_nth_part, add_fakeiter); + osl_util_safe_strcat(&string, temp, &high_water_mark); + free(temp); + } + + return string; +} + + +/** + * osl_relation_pprint function: + * this function pretty-prints the content of an osl_relation_t structure + * (*relation) into a file (file, possibly stdout) in the OpenScop format. + * \param[in] file File where informations are printed. + * \param[in] relation The relation whose information has to be printed. + * \param[in] names The names of the constraint columns for comments. + */ +void osl_relation_pprint(FILE * file, osl_relation_p relation, + osl_names_p names) { + char * string = osl_relation_spprint(relation, names); + fprintf(file, "%s", string); + free(string); +} + + +/** + * osl_relation_pprint_scoplib function: + * this function pretty-prints the content of an osl_relation_t structure + * (*relation) into a file (file, possibly stdout) in the SCoPLibformat. + * \param[in] file File where informations are printed. + * \param[in] relation The relation whose information has to be printed. + * \param[in] names The names of the constraint columns for comments. + * \param[in] print_nth_part + * \param[in] add_fakeiter + */ +void osl_relation_pprint_scoplib(FILE * file, osl_relation_p relation, + osl_names_p names, int print_nth_part, + int add_fakeiter) { + char * string = osl_relation_spprint_scoplib(relation, names, + print_nth_part, add_fakeiter); + fprintf(file, "%s", string); + free(string); +} + + +/** + * osl_relation_sprint function: + * this function prints the content of an osl_relation_t structure + * (*relation) into a string (returned) in the OpenScop textual format. + * \param[in] relation The relation structure to print. + * \return A string containing the OpenScop dump of the relation structure. + */ +char * osl_relation_sprint(osl_relation_p relation) { + + return osl_relation_spprint(relation, NULL); +} + + +/** + * osl_relation_print function: + * this function prints the content of an osl_relation_t structure + * (*relation) into a file (file, possibly stdout) in the OpenScop format. + * \param[in] file File where informations are printed. + * \param[in] relation The relation whose information has to be printed. + */ +void osl_relation_print(FILE * file, osl_relation_p relation) { + + osl_relation_pprint(file, relation, NULL); +} + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/** + * osl_relation_read_type function: + * this function reads a textual relation type on the input 'file' or the + * input string 'str' depending on which one is not NULL (exactly + * one of them must not be NULL). It returns its integer counterpart. + * \param[in] file The file where to read a relation type (if not NULL). + * \param[in,out] str The string where to read a relation type (if not NULL). + * This pointer is updated to reflect the read and points + * after the tag in the input string. + * \return The relation type. + */ +static +int osl_relation_read_type(FILE * file, char ** str) { + int type; + osl_strings_p strings; + + if ((file != NULL && str != NULL) || (file == NULL && str == NULL)) + OSL_error("one and only one of the two parameters can be non-NULL"); + + if (file != NULL) + strings = osl_strings_read(file); + else + strings = osl_strings_sread(str); + + if (osl_strings_size(strings) > 1) { + OSL_warning("uninterpreted information (after the relation type)"); + } + if (osl_strings_size(strings) == 0) + OSL_error("no relation type"); + + if (!strcmp(strings->string[0], OSL_STRING_UNDEFINED)) { + type = OSL_UNDEFINED; + goto return_type; + } + + if (!strcmp(strings->string[0], OSL_STRING_CONTEXT)) { + type = OSL_TYPE_CONTEXT; + goto return_type; + } + + if (!strcmp(strings->string[0], OSL_STRING_DOMAIN)) { + type = OSL_TYPE_DOMAIN; + goto return_type; + } + + if (!strcmp(strings->string[0], OSL_STRING_SCATTERING)) { + type = OSL_TYPE_SCATTERING; + goto return_type; + } + + if (!strcmp(strings->string[0], OSL_STRING_READ)) { + type = OSL_TYPE_READ; + goto return_type; + } + + if (!strcmp(strings->string[0], OSL_STRING_WRITE)) { + type = OSL_TYPE_WRITE; + goto return_type; + } + + if (!strcmp(strings->string[0], OSL_STRING_MAY_WRITE)) { + type = OSL_TYPE_MAY_WRITE; + goto return_type; + } + + OSL_error("relation type not supported"); + +return_type: + osl_strings_free(strings); + return type; +} + + +/** + * osl_relation_pread function ("precision read"): + * this function reads a relation into a file (foo, posibly stdin) and + * returns a pointer this relation. + * \param[in] foo The input stream. + * \param[in] precision The precision of the relation elements. + * \return A pointer to the relation structure that has been read. + */ +osl_relation_p osl_relation_pread(FILE * foo, int precision) { + int i, j, k, n, read = 0; + int nb_rows, nb_columns; + int nb_output_dims, nb_input_dims, nb_local_dims, nb_parameters; + int nb_union_parts = 1; + int may_read_nb_union_parts = 1; + int read_attributes = 1; + int first = 1; + int type; + char * c, s[OSL_MAX_STRING], str[OSL_MAX_STRING], *tmp; + osl_relation_p relation, relation_union = NULL, previous = NULL; + + type = osl_relation_read_type(foo, NULL); + + // Read each part of the union (the number of parts may be updated inside) + for (k = 0; k < nb_union_parts; k++) { + // Read the number of union parts or the attributes of the union part + while (read_attributes) { + read_attributes = 0; + + // Read relation attributes. + c = osl_util_skip_blank_and_comments(foo, s); + read = sscanf(c, " %d %d %d %d %d %d", &nb_rows, &nb_columns, + &nb_output_dims, &nb_input_dims, + &nb_local_dims, &nb_parameters); + + if (((read != 1) && (read != 6)) || + ((read == 1) && (may_read_nb_union_parts != 1))) + OSL_error("not 1 or 6 integers on the first relation line"); + + if (read == 1) { + // Only one number means a union and is the number of parts. + nb_union_parts = nb_rows; + if (nb_union_parts < 1) + OSL_error("negative nb of union parts"); + + // Allow to read the properties of the first part of the union. + read_attributes = 1; + } + + may_read_nb_union_parts = 0; + } + + // Allocate the union part and fill its properties. + relation = osl_relation_pmalloc(precision, nb_rows, nb_columns); + relation->type = type; + relation->nb_output_dims = nb_output_dims; + relation->nb_input_dims = nb_input_dims; + relation->nb_local_dims = nb_local_dims; + relation->nb_parameters = nb_parameters; + + // Read the matrix of constraints. + for (i = 0; i < relation->nb_rows; i++) { + c = osl_util_skip_blank_and_comments(foo, s); + if (c == NULL) + OSL_error("not enough rows"); + + for (j = 0; j < relation->nb_columns; j++) { + if (c == NULL || *c == '#' || *c == '\n') + OSL_error("not enough columns"); + if (sscanf(c, "%s%n", str, &n) == 0) + OSL_error("not enough rows"); + + // TODO: remove this tmp (sread updates the pointer). + tmp = str; + osl_int_sread(&tmp, precision, &relation->m[i][j]); + c += n; + } + } + + // Build the linked list of union parts. + if (first == 1) { + relation_union = relation; + first = 0; + } + else { + previous->next = relation; + } + + previous = relation; + read_attributes = 1; + } + + return relation_union; +} + +/** + * osl_relation_psread function ("precision read"): + * this function is equivalent to osl_relation_psread_polylib() except that + * it reads an the type of the relation before reading the rest of the + * input. + * \see{osl_relation_psread_polylib} + */ +osl_relation_p osl_relation_psread(char ** input, int precision) { + int type; + osl_relation_p relation; + + type = osl_relation_read_type(NULL, input); + relation = osl_relation_psread_polylib(input, precision); + relation->type = type; + + return relation; +} + +/** + * osl_relation_psread_polylib function ("precision read"): + * this function reads a relation from a string complying to the Extended + * PolyLib textual format and returns a pointer this relation. The input + * parameter is updated to the position in the input string this function + * reach right after reading the generic structure. + * \param[in,out] input The input string where to find a relation. + * Updated to the position after what has been read. + * \param[in] precision The precision of the relation elements. + * \return A pointer to the relation structure that has been read. + */ +osl_relation_p osl_relation_psread_polylib(char ** input, int precision) { + int i, j, k, n, read = 0; + int nb_rows, nb_columns; + int nb_output_dims, nb_input_dims, nb_local_dims, nb_parameters; + int nb_union_parts = 1; + int may_read_nb_union_parts = 1; + int read_attributes = 1; + int first = 1; + char str[OSL_MAX_STRING], *tmp; + osl_relation_p relation, relation_union = NULL, previous = NULL; + + // Read each part of the union (the number of parts may be updated inside) + for (k = 0; k < nb_union_parts; k++) { + // Read the number of union parts or the attributes of the union part + while (read_attributes) { + read_attributes = 0; + // Read relation attributes. + osl_util_sskip_blank_and_comments(input); + // make a copy of the first line + tmp = *input; + while ((*tmp != '\0') && (*tmp != '\n')) + tmp++; + strncpy(str, *input, sizeof(char) * (tmp-*input)); + str[(tmp-*input)] = '\0'; + + read = sscanf(str, " %d %d %d %d %d %d", + &nb_rows, &nb_columns, + &nb_output_dims, &nb_input_dims, + &nb_local_dims, &nb_parameters); + *input = tmp; + + if (((read != 1) && (read != 6)) || + ((read == 1) && (may_read_nb_union_parts != 1))) + OSL_error("not 1 or 6 integers on the first relation line"); + + if (read == 1) { + // Only one number means a union and is the number of parts. + nb_union_parts = nb_rows; + if (nb_union_parts < 1) + OSL_error("negative nb of union parts"); + + // Allow to read the properties of the first part of the union. + read_attributes = 1; + } + + may_read_nb_union_parts = 0; + } + + // Allocate the union part and fill its properties. + relation = osl_relation_pmalloc(precision, nb_rows, nb_columns); + relation->nb_output_dims = nb_output_dims; + relation->nb_input_dims = nb_input_dims; + relation->nb_local_dims = nb_local_dims; + relation->nb_parameters = nb_parameters; + + // Read the matrix of constraints. + for (i = 0; i < relation->nb_rows; i++) { + osl_util_sskip_blank_and_comments(input); + if (!(*input)) + OSL_error("not enough rows"); + + for (j = 0; j < relation->nb_columns; j++) { + if (*input == NULL || **input == '#' || **input == '\n') + OSL_error("not enough columns"); + if (sscanf(*input, "%s%n", str, &n) == 0) + OSL_error("not enough rows"); + + // TODO: remove this tmp (sread updates the pointer). + tmp = str; + osl_int_sread(&tmp, precision, &relation->m[i][j]); + *input += n; + } + } + + // Build the linked list of union parts. + if (first == 1) { + relation_union = relation; + first = 0; + } + else { + previous->next = relation; + } + + previous = relation; + read_attributes = 1; + } + + return relation_union; +} + + +/** + * osl_relation_sread function: + * this function is equivalent to osl_relation_psread() except that + * the precision corresponds to the precision environment variable or + * to the highest available precision if it is not defined. + * \see{osl_relation_psread} + */ +osl_relation_p osl_relation_sread(char ** input) { + int precision = osl_util_get_precision(); + return osl_relation_psread(input, precision); +} + +/** + * osl_relation_sread function: + * this function is equivalent to osl_relation_psread_polylib() except that + * the precision corresponds to the precision environment variable or + * to the highest available precision if it is not defined. + * \see{osl_relation_posread_polylib} + */ +osl_relation_p osl_relation_sread_polylib(char ** input) { + int precision = osl_util_get_precision(); + return osl_relation_psread_polylib(input, precision); +} + + +/** + * osl_relation_read function: + * this function is equivalent to osl_relation_pread() except that + * the precision corresponds to the precision environment variable or + * to the highest available precision if it is not defined. + * \see{osl_relation_pread} + */ +osl_relation_p osl_relation_read(FILE * foo) { + int precision = osl_util_get_precision(); + return osl_relation_pread(foo, precision); +} + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_relation_pmalloc function: + * (precision malloc) this function allocates the memory space for an + * osl_relation_t structure and sets its fields with default values. + * Then it returns a pointer to the allocated space. + * \param[in] precision The precision of the constraint matrix. + * \param[in] nb_rows The number of row of the relation to allocate. + * \param[in] nb_columns The number of columns of the relation to allocate. + * \return A pointer to an empty relation with fields set to default values + * and a ready-to-use constraint matrix. + */ +osl_relation_p osl_relation_pmalloc(int precision, + int nb_rows, int nb_columns) { + osl_relation_p relation; + osl_int_t ** p, * q; + int i, j; + + if ((precision != OSL_PRECISION_SP) && + (precision != OSL_PRECISION_DP) && + (precision != OSL_PRECISION_MP)) + OSL_error("unknown precision"); + + if ((nb_rows < 0) || (nb_columns < 0)) + OSL_error("negative sizes"); + + OSL_malloc(relation, osl_relation_p, sizeof(osl_relation_t)); + relation->type = OSL_UNDEFINED; + relation->nb_rows = nb_rows; + relation->nb_columns = nb_columns; + relation->nb_output_dims = OSL_UNDEFINED; + relation->nb_input_dims = OSL_UNDEFINED; + relation->nb_parameters = OSL_UNDEFINED; + relation->nb_local_dims = OSL_UNDEFINED; + relation->precision = precision; + + if ((nb_rows == 0) || (nb_columns == 0) || + (nb_rows == OSL_UNDEFINED) || (nb_columns == OSL_UNDEFINED)) { + relation->m = NULL; + } + else { + OSL_malloc(p, osl_int_t**, nb_rows * sizeof(osl_int_t*)); + OSL_malloc(q, osl_int_t*, nb_rows * nb_columns * sizeof(osl_int_t)); + relation->m = p; + for (i = 0; i < nb_rows; i++) { + relation->m[i] = q + i * nb_columns ; + for (j = 0; j < nb_columns; j++) + osl_int_init_set_si(precision, &relation->m[i][j], 0); + } + } + + relation->next = NULL; + + return relation; +} + + +/** + * osl_relation_malloc function: + * this function is equivalent to osl_relation_pmalloc() except that + * the precision corresponds to the precision environment variable or + * to the highest available precision if it is not defined. + * \see{osl_relation_pmalloc} + */ +osl_relation_p osl_relation_malloc(int nb_rows, int nb_columns) { + int precision = osl_util_get_precision(); + return osl_relation_pmalloc(precision, nb_rows, nb_columns); +} + + +/** + * osl_relation_free_inside function: + * this function frees the allocated memory for the inside of a + * osl_relation_t structure, i.e. only m. + * \param[in] relation The pointer to the relation we want to free internals. + */ +void osl_relation_free_inside(osl_relation_p relation) { + int i, nb_elements; + + if (relation == NULL) + return; + + nb_elements = relation->nb_rows * relation->nb_columns; + + for (i = 0; i < nb_elements; i++) + osl_int_clear(relation->precision, &relation->m[0][i]); + + if (relation->m != NULL) { + if (nb_elements > 0) + free(relation->m[0]); + free(relation->m); + } +} + + +/** + * osl_relation_free function: + * this function frees the allocated memory for an osl_relation_t + * structure. + * \param[in] relation The pointer to the relation we want to free. + */ +void osl_relation_free(osl_relation_p relation) { + osl_relation_p tmp; + + while (relation != NULL) { + tmp = relation->next; + osl_relation_free_inside(relation); + free(relation); + relation = tmp; + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_relation_nclone function: + * this functions builds and returns a "hard copy" (not a pointer copy) of the + * first n parts of a relation union. + * \param[in] relation The pointer to the relation we want to clone. + * \param[in] n The number of union parts of the relation we want to + * clone (the special value -1 means "all the parts"). + * \return A pointer to the clone of the relation union restricted to the + * first n parts of the relation union. + */ +osl_relation_p osl_relation_nclone(osl_relation_p relation, int n) { + int i, j, k; + int first = 1, nb_components, nb_parts; + osl_relation_p clone = NULL, node, previous = NULL; + + nb_components = osl_relation_nb_components(relation); + nb_parts = (n == -1) ? nb_components : n; + if (nb_components < nb_parts) + OSL_error("not enough union parts to clone"); + + for (k = 0; k < nb_parts; k++) { + node = osl_relation_pmalloc(relation->precision, + relation->nb_rows, relation->nb_columns); + node->type = relation->type; + node->nb_output_dims = relation->nb_output_dims; + node->nb_input_dims = relation->nb_input_dims; + node->nb_local_dims = relation->nb_local_dims; + node->nb_parameters = relation->nb_parameters; + + for (i = 0; i < relation->nb_rows; i++) + for (j = 0; j < relation->nb_columns; j++) + osl_int_assign(relation->precision, + &node->m[i][j], relation->m[i][j]); + + if (first) { + first = 0; + clone = node; + previous = node; + } + else { + previous->next = node; + previous = previous->next; + } + + relation = relation->next; + } + + return clone; +} + + +/** + * osl_relation_clone_nconstraints function: + * this functions builds and returns a "hard copy" (not a pointer copy) of a + * osl_relation_t data structure such that the clone is restricted to the + * "n" first rows of the relation. This applies to all the parts in the case + * of a relation union. + * \param[in] relation The pointer to the relation we want to clone. + * \param[in] n The number of row of the relation we want to clone (the + * special value -1 means "all the rows"). + * \return A pointer to the clone of the relation union restricted to the + * first n rows of constraint matrix for each part of the union. + */ +osl_relation_p osl_relation_clone_nconstraints(osl_relation_p relation, + int n) { + int i, j; + int first = 1, all_rows = 0; + osl_relation_p clone = NULL, node, previous = NULL; + + if (n == -1) + all_rows = 1; + + while (relation != NULL) { + if (all_rows) + n = relation->nb_rows; + + if (n > relation->nb_rows) + OSL_error("not enough rows to clone in the relation"); + + node = osl_relation_pmalloc(relation->precision, n, relation->nb_columns); + node->type = relation->type; + node->nb_output_dims = relation->nb_output_dims; + node->nb_input_dims = relation->nb_input_dims; + node->nb_local_dims = relation->nb_local_dims; + node->nb_parameters = relation->nb_parameters; + + for (i = 0; i < n; i++) + for (j = 0; j < relation->nb_columns; j++) + osl_int_assign(relation->precision, + &node->m[i][j], relation->m[i][j]); + + if (first) { + first = 0; + clone = node; + previous = node; + } + else { + previous->next = node; + previous = previous->next; + } + + relation = relation->next; + } + + return clone; +} + + +/** + * osl_relation_clone function: + * this function builds and returns a "hard copy" (not a pointer copy) of an + * osl_relation_t data structure (the full union of relation). + * \param[in] relation The pointer to the relation we want to clone. + * \return A pointer to the clone of the union of relations. + */ +osl_relation_p osl_relation_clone(osl_relation_p relation) { + if (relation == NULL) + return NULL; + + return osl_relation_nclone(relation, -1); +} + + +/** + * osl_relation_add function: + * this function adds a relation (union) at the end of the relation (union) + * pointed by r1. No new relation is created: this functions links the two + * input unions. If the first relation is NULL, it is set to the + * second relation. + * \param[in,out] r1 Pointer to the first relation (union). + * \param[in] r2 The second relation (union). + */ +void osl_relation_add(osl_relation_p *r1, osl_relation_p r2) { + while (*r1 != NULL) + r1 = &((*r1)->next); + + *r1 = r2; +} + + +/** + * osl_relation_union function: + * this function builds a new relation from two relations provided + * as parameters. The new relation is built as an union of the + * two relations: the list of constraint sets are linked together. + * \param[in] r1 The first relation. + * \param[in] r2 The second relation. + * \return A new relation corresponding to the union of r1 and r2. + */ +osl_relation_p osl_relation_union(osl_relation_p r1, + osl_relation_p r2) { + osl_relation_p copy1, copy2; + + if ((r1 == NULL) && (r2 == NULL)) + return NULL; + + copy1 = osl_relation_clone(r1); + copy2 = osl_relation_clone(r2); + osl_relation_add(©1, copy2); + + return copy1; +} + + +/** + * osl_relation_replace_vector function: + * this function replaces the "row"^th row of a relation "relation" with the + * vector "vector". It directly updates the relation union part pointed + * by "relation" and this part only. + * \param[in,out] relation The relation we want to replace a row. + * \param[in] vector The vector that will replace a row of the relation. + * \param[in] row The row of the relation to be replaced. + */ +void osl_relation_replace_vector(osl_relation_p relation, + osl_vector_p vector, int row) { + int i; + + if ((relation == NULL) || (vector == NULL) || + (relation->precision != vector->precision) || + (relation->nb_columns != vector->size) || + (row >= relation->nb_rows) || (row < 0)) + OSL_error("vector cannot replace relation row"); + + for (i = 0; i < vector->size; i++) + osl_int_assign(relation->precision, &relation->m[row][i], vector->v[i]); +} + + +/** + * osl_relation_add_vector function: + * this function adds (meaning, +) a vector to the "row"^th row of a + * relation "relation". It directly updates the relation union part pointed + * by "relation" and this part only. + * \param[in,out] relation The relation we want to add a vector to a row. + * \param[in] vector The vector that will replace a row of the relation. + * \param[in] row The row of the relation to add the vector. + */ +void osl_relation_add_vector(osl_relation_p relation, + osl_vector_p vector, int row) { + int i; + + if ((relation == NULL) || (vector == NULL) || + (relation->precision != vector->precision) || + (relation->nb_columns != vector->size) || + (row >= relation->nb_rows) || (row < 0)) + OSL_error("vector cannot be added to relation"); + + if (osl_int_get_si(relation->precision, relation->m[row][0]) == 0) + osl_int_assign(relation->precision, &relation->m[row][0], vector->v[0]); + + for (i = 1; i < vector->size; i++) + osl_int_add(relation->precision, + &relation->m[row][i], relation->m[row][i], vector->v[i]); +} + + +/** + * osl_relation_sub_vector function: + * this function subtracts the vector "vector" to the "row"^th row of + * a relation "relation. It directly updates the relation union part pointed + * by "relation" and this part only. + * \param[in,out] relation The relation where to subtract a vector to a row. + * \param[in] vector The vector to subtract to a relation row. + * \param[in] row The row of the relation to subtract the vector. + */ +void osl_relation_sub_vector(osl_relation_p relation, + osl_vector_p vector, int row) { + int i; + + if ((relation == NULL) || (vector == NULL) || + (relation->precision != vector->precision) || + (relation->nb_columns != vector->size) || + (row >= relation->nb_rows) || (row < 0)) + OSL_error("vector cannot be subtracted to row"); + + if (osl_int_get_si(relation->precision, relation->m[row][0]) == 0) + osl_int_assign(relation->precision, &relation->m[row][0], vector->v[0]); + + for (i = 1; i < vector->size; i++) + osl_int_sub(relation->precision, + &relation->m[row][i], relation->m[row][i], vector->v[i]); +} + + +/** + * osl_relation_insert_vector function: + * this function inserts a new row corresponding to the vector "vector" to + * the relation "relation" by inserting it at the "row"^th row of + * "relation" (-1 is a shortcut to insert the vector after the constraints + * of the relation). It directly updates the relation union part pointed + * by "relation" and this part only. If "vector" (or "relation") is NULL, + * the relation is left unmodified. + * \param[in,out] relation The relation we want to extend. + * \param[in] vector The vector that will be added relation. + * \param[in] row The row where to insert the vector (-1 to + * insert it after the relation constraints). + */ +void osl_relation_insert_vector(osl_relation_p relation, + osl_vector_p vector, int row) { + osl_relation_p temp; + + temp = osl_relation_from_vector(vector); + osl_relation_insert_constraints(relation, temp, row); + osl_relation_free(temp); +} + + +/** + * osl_relation_concat_vector function: + * this function builds a new relation from one relation and a vector sent as + * parameters. The new set of constraints is built as the concatenation + * of the rows of the first part of the relation and of the vector + * constraint. This means, there is no next field in the result. + * \param[in] r The input relation. + * \param[in] v The input vector. + * \return A pointer to the relation resulting from the concatenation of + * the constraints of the relation and of the vector. + */ +osl_relation_p osl_relation_concat_vector(osl_relation_p relation, + osl_vector_p vector) { + osl_relation_p new, temp; + + temp = osl_relation_from_vector(vector); + new = osl_relation_concat_constraints(relation, temp); + osl_relation_free(temp); + return new; +} + + +/** + * osl_relation_insert_blank_row function: + * this function inserts a new row filled with zeros o an existing relation + * union part (it only affects the first union part). + * \param[in,out] relation The relation to add a row in. + * \param[in] row The row where to insert the blank row. + */ +void osl_relation_insert_blank_row(osl_relation_p relation, int row) { + osl_vector_p vector; + + if (relation != NULL) { + vector = osl_vector_pmalloc(relation->precision, relation->nb_columns); + osl_relation_insert_vector(relation, vector, row); + osl_vector_free(vector); + } +} + + +/** + * osl_relation_insert_blank_column function: + * this function inserts a new column filled with zeros to an existing + * relation union part (it only affects the first union part). WARNING: + * this function does not update the relation attributes. + * \param[in,out] relation The relation to add a column in. + * \param[in] column The column where to insert the blank column. + */ +void osl_relation_insert_blank_column(osl_relation_p relation, int column) { + + int i, j; + osl_relation_p temp; + + if (relation == NULL) + return; + + if ((column < 0) || (column > relation->nb_columns)) + OSL_error("bad column number"); + + // We use a temporary relation just to reuse existing functions. Cleaner. + temp = osl_relation_pmalloc(relation->precision, + relation->nb_rows, relation->nb_columns + 1); + + for (i = 0; i < relation->nb_rows; i++) { + for (j = 0; j < column; j++) + osl_int_assign(relation->precision, &temp->m[i][j], relation->m[i][j]); + + for (j = column; j < relation->nb_columns; j++) + osl_int_assign(relation->precision, &temp->m[i][j+1], relation->m[i][j]); + } + + osl_relation_free_inside(relation); + + // Replace the inside of relation. + relation->nb_columns = temp->nb_columns; + relation->m = temp->m; + + // Free the temp "shell". + free(temp); +} + + +/** + * osl_relation_from_vector function: + * this function converts a vector "vector" to a relation with a single row + * and returns a pointer to that relation. + * \param[in] vector The vector to convert to a relation. + * \return A pointer to a relation resulting from the vector conversion. + */ +osl_relation_p osl_relation_from_vector(osl_vector_p vector) { + osl_relation_p relation; + + if (vector == NULL) + return NULL; + + relation = osl_relation_pmalloc(vector->precision, 1, vector->size); + osl_relation_replace_vector(relation, vector, 0); + return relation; +} + + +/** + * osl_relation_replace_constraints function: + * this function replaces some rows of a relation "r1" with the rows of + * the relation "r2". It begins at the "row"^th row of "r1". It directly + * updates the relation union part pointed by "r1" and this part only. + * \param[in,out] r1 The relation we want to change some rows. + * \param[in] r2 The relation containing the new rows. + * \param[in] row The first row of the relation r1 to be replaced. + */ +void osl_relation_replace_constraints(osl_relation_p r1, + osl_relation_p r2, int row) { + int i, j; + + if ((r1 == NULL) || (r2 == NULL) || + (r1->precision != r2->precision) || + (r1->nb_columns != r1->nb_columns) || + ((row + r2->nb_rows) > r1->nb_rows) || (row < 0)) + OSL_error("relation rows could not be replaced"); + + for (i = 0; i < r2->nb_rows; i++) + for (j = 0; j < r2->nb_columns; j++) + osl_int_assign(r1->precision, &r1->m[i+row][j], r2->m[i][j]); +} + + +/** + * osl_relation_insert_constraints function: + * this function inserts the rows of the relation "r2" to the relation + * "r1", starting from the "row"^th row of "r1" (-1 is a + * shortcut to insert the "r2" constraints after the constraints of r1). + * It directly updates the relation union part pointed by "r1" and this + * part only. If "r2" (or "r1") is NULL, the relation is left unmodified. + * \param[in,out] r1 The relation we want to extend. + * \param[in] r2 The relation to be inserted. + * \param[in] row The row where to insert the constraints (-1 to + * insert them after those of "r1"). + */ +void osl_relation_insert_constraints(osl_relation_p r1, + osl_relation_p r2, int row) { + int i, j; + osl_relation_p temp; + + if ((r1 == NULL) || (r2 == NULL)) + return; + + if (row == -1) + row = r1->nb_rows; + + if ((r1->nb_columns != r2->nb_columns) || + (r1->precision != r2->precision) || + (row > r1->nb_rows) || (row < 0)) + OSL_error("constraints cannot be inserted"); + + // We use a temporary relation just to reuse existing functions. Cleaner. + temp = osl_relation_pmalloc(r1->precision, + r1->nb_rows + r2->nb_rows, r1->nb_columns); + + for (i = 0; i < row; i++) + for (j = 0; j < r1->nb_columns; j++) + osl_int_assign(r1->precision, &temp->m[i][j], r1->m[i][j]); + + osl_relation_replace_constraints(temp, r2, row); + + for (i = row + r2->nb_rows; i < r2->nb_rows + r1->nb_rows; i++) + for (j = 0; j < r1->nb_columns; j++) + osl_int_assign(r1->precision, &temp->m[i][j], r1->m[i-r2->nb_rows][j]); + + osl_relation_free_inside(r1); + + // Replace the inside of relation. + r1->nb_rows = temp->nb_rows; + r1->m = temp->m; + + // Free the temp "shell". + free(temp); +} + + +/** + * osl_relation_swap_constraints function: + * this function swaps two constraints (i.e., rows) of the relation matrix. + * This function updates the relation directly. + * \param[in,out] relation The relation to swap two rows (modified). + * \param[in] c1 The row corresponding to the first constraint. + * \param[in] c2 The row corresponding to the second constraint. + */ +void osl_relation_swap_constraints(osl_relation_p relation, int c1, int c2) { + int i; + + if ((relation == NULL) || (c1 == c2)) + return; + + if ((c1 >= relation->nb_rows) || (c1 < 0) || + (c2 >= relation->nb_rows) || (c2 < 0)) + OSL_error("bad constraint rows"); + + for (i = 0; i < relation->nb_columns; i++) + osl_int_swap(relation->precision, + &relation->m[c1][i], &relation->m[c2][i]); +} + + +/** + * osl_relation_remove_row function: + * this function removes a given row to the relation "r". It directly + * updates the relation union part pointed by "r" and this part only. + * \param[in,out] r The relation to remove a row. + * \param[in] row The row number to remove. + */ +void osl_relation_remove_row(osl_relation_p r, int row) { + int i, j; + osl_relation_p temp; + + if (r == NULL) + return; + + if ((row < 0) || (row >= r->nb_rows)) + OSL_error("bad row number"); + + // We use a temporary relation just to reuse existing functions. Cleaner. + temp = osl_relation_pmalloc(r->precision, + r->nb_rows - 1, r->nb_columns); + + for (i = 0; i < row; i++) + for (j = 0; j < r->nb_columns; j++) + osl_int_assign(r->precision, &temp->m[i][j], r->m[i][j]); + + for (i = row + 1; i < r->nb_rows; i++) + for (j = 0; j < r->nb_columns; j++) + osl_int_assign(r->precision, &temp->m[i - 1][j], r->m[i][j]); + + osl_relation_free_inside(r); + + // Replace the inside of relation. + r->nb_rows = temp->nb_rows; + r->m = temp->m; + + // Free the temp "shell". + free(temp); +} + + +/** + * osl_relation_remove_column function: + * this function removes a given column to the relation "r". It directly + * updates the relation union part pointed by "r" and this part only. + * \param[in,out] r The relation to remove a column. + * \param[in] column The column number to remove. + */ +void osl_relation_remove_column(osl_relation_p r, int column) { + int i, j; + osl_relation_p temp; + + if (r == NULL) + return; + + if ((column < 0) || (column >= r->nb_columns)) + OSL_error("bad column number"); + + // We use a temporary relation just to reuse existing functions. Cleaner. + temp = osl_relation_pmalloc(r->precision, + r->nb_rows, r->nb_columns - 1); + + for (i = 0; i < r->nb_rows; i++) { + for (j = 0; j < column; j++) + osl_int_assign(r->precision, &temp->m[i][j], r->m[i][j]); + + for (j = column + 1; j < r->nb_columns; j++) + osl_int_assign(r->precision, &temp->m[i][j - 1], r->m[i][j]); + } + + osl_relation_free_inside(r); + + // Replace the inside of relation. + r->nb_columns = temp->nb_columns; + r->m = temp->m; + + // Free the temp "shell". + free(temp); +} + + +/** + * osl_relation_insert_columns function: + * this function inserts new columns to an existing relation union part (it + * only affects the first union part). The columns are copied out from the + * matrix of an input relation which must have the convenient number of rows. + * All columns of the input matrix are copied. WARNING: this function does not + * update the relation attributes of the modified matrix. + * \param[in,out] relation The relation to add columns in. + * \param[in] insert The relation containing the columns to add. + * \param[in] column The column where to insert the new columns. + */ +void osl_relation_insert_columns(osl_relation_p relation, + osl_relation_p insert, int column) { + int i, j; + osl_relation_p temp; + + if ((relation == NULL) || (insert == NULL)) + return; + + if ((relation->precision != insert->precision) || + (relation->nb_rows != insert->nb_rows) || + (column < 0) || (column > relation->nb_columns)) + OSL_error("columns cannot be inserted"); + + // We use a temporary relation just to reuse existing functions. Cleaner. + temp = osl_relation_pmalloc(relation->precision, relation->nb_rows, + relation->nb_columns + insert->nb_columns); + + for (i = 0; i < relation->nb_rows; i++) { + for (j = 0; j < column; j++) + osl_int_assign(relation->precision, &temp->m[i][j], relation->m[i][j]); + + for (j = column; j < column + insert->nb_columns; j++) + osl_int_assign(relation->precision, + &temp->m[i][j], insert->m[i][j - column]); + + for (j = column + insert->nb_columns; + j < insert->nb_columns + relation->nb_columns; j++) + osl_int_assign(relation->precision, + &temp->m[i][j], relation->m[i][j - insert->nb_columns]); + } + + osl_relation_free_inside(relation); + + // Replace the inside of relation. + relation->nb_columns = temp->nb_columns; + relation->m = temp->m; + + // Free the temp "shell". + free(temp); +} + + +/** + * osl_relation_concat_constraints function: + * this function builds a new relation from two relations sent as + * parameters. The new set of constraints is built as the concatenation + * of the rows of the first elements of the two relation unions r1 and r2. + * This means, there is no next field in the result. + * \param[in] r1 The first relation. + * \param[in] r2 The second relation. + * \return A pointer to the relation resulting from the concatenation of + * the first elements of r1 and r2. + */ +osl_relation_p osl_relation_concat_constraints( + osl_relation_p r1, + osl_relation_p r2) { + osl_relation_p new; + + if (r1 == NULL) + return osl_relation_clone(r2); + + if (r2 == NULL) + return osl_relation_clone(r1); + + if (r1->nb_columns != r2->nb_columns) + OSL_error("incompatible sizes for concatenation"); + + if (r1->next || r2->next) + OSL_warning("relation concatenation is done on the first elements " + "of union only"); + + new = osl_relation_pmalloc(r1->precision, + r1->nb_rows + r2->nb_rows, r1->nb_columns); + osl_relation_replace_constraints(new, r1, 0); + osl_relation_replace_constraints(new, r2, r1->nb_rows); + + return new; +} + + +/** + * osl_relation_part_equal function: + * this function returns true if the two relations parts provided as + * parameters are the same, false otherwise. In the case of relation + * unions, only the first part of the two relations are tested. + * \param[in] r1 The first relation. + * \param[in] r2 The second relation. + * \return 1 if r1 and r2 are the same (content-wise), 0 otherwise. + */ +int osl_relation_part_equal(osl_relation_p r1, osl_relation_p r2) { + int i, j; + + if (r1 == r2) + return 1; + + if (((r1 == NULL) && (r2 != NULL)) || + ((r1 != NULL) && (r2 == NULL))) + return 0; + + if ((r1->type != r2->type) || + (r1->precision != r2->precision) || + (r1->nb_rows != r2->nb_rows) || + (r1->nb_columns != r2->nb_columns) || + (r1->nb_output_dims != r2->nb_output_dims) || + (r1->nb_input_dims != r2->nb_input_dims) || + (r1->nb_local_dims != r2->nb_local_dims) || + (r1->nb_parameters != r2->nb_parameters)) + return 0; + + for (i = 0; i < r1->nb_rows; ++i) + for (j = 0; j < r1->nb_columns; ++j) + if (osl_int_ne(r1->precision, r1->m[i][j], r2->m[i][j])) + return 0; + + return 1; +} + + +/** + * osl_relation_equal function: + * this function returns true if the two relations provided as parameters + * are the same, false otherwise. + * \param[in] r1 The first relation. + * \param[in] r2 The second relation. + * \return 1 if r1 and r2 are the same (content-wise), 0 otherwise. + */ +int osl_relation_equal(osl_relation_p r1, osl_relation_p r2) { + while ((r1 != NULL) && (r2 != NULL)) { + if (!osl_relation_part_equal(r1, r2)) + return 0; + + r1 = r1->next; + r2 = r2->next; + } + + if (((r1 == NULL) && (r2 != NULL)) || ((r1 != NULL) && (r2 == NULL))) + return 0; + + return 1; +} + + +/** + * osl_relation_check_attribute internal function: + * This function checks whether an "actual" value is the same as an + * "expected" value or not. If the expected value is set to + * OSL_UNDEFINED, this function sets it to the "actual" value + * and do not report a difference has been detected. + * It returns 0 if a difference has been detected, 1 otherwise. + * \param[in,out] expected Pointer to the expected value (the value is + * modified if it was set to OSL_UNDEFINED). + * \param[in] actual Value we want to check. + * \return 0 if the values are not the same while the expected value was + * not OSL_UNDEFINED, 1 otherwise. + */ +static +int osl_relation_check_attribute(int * expected, int actual) { + if (*expected != OSL_UNDEFINED) { + if ((actual != OSL_UNDEFINED) && + (actual != *expected)) { + OSL_warning("unexpected atribute"); + return 0; + } + } + else { + *expected = actual; + } + + return 1; +} + + +/** + * osl_relation_check_nb_columns internal function: + * This function checks that the number of columns of a relation + * corresponds to some expected properties (setting an expected property to + * OSL_UNDEFINED makes this function unable to detect a problem). + * It returns 0 if the number of columns seems incorrect or 1 if no problem + * has been detected. + * \param[in] relation The relation we want to check the number of columns. + * \param[in] expected_nb_output_dims Expected number of output dimensions. + * \param[in] expected_nb_input_dims Expected number of input dimensions. + * \param[in] expected_nb_parameters Expected number of parameters. + * \return 0 if the number of columns seems incorrect, 1 otherwise. + */ +static +int osl_relation_check_nb_columns(osl_relation_p relation, + int expected_nb_output_dims, + int expected_nb_input_dims, + int expected_nb_parameters) { + int expected_nb_local_dims, expected_nb_columns; + + if ((expected_nb_output_dims != OSL_UNDEFINED) && + (expected_nb_input_dims != OSL_UNDEFINED) && + (expected_nb_parameters != OSL_UNDEFINED)) { + + if (relation->nb_local_dims == OSL_UNDEFINED) + expected_nb_local_dims = 0; + else + expected_nb_local_dims = relation->nb_local_dims; + + expected_nb_columns = expected_nb_output_dims + + expected_nb_input_dims + + expected_nb_local_dims + + expected_nb_parameters + + 2; + + if (expected_nb_columns != relation->nb_columns) { + OSL_warning("unexpected number of columns"); + return 0; + } + } + + return 1; +} + + +/** + * osl_relation_integrity_check function: + * this function checks that a relation is "well formed" according to some + * expected properties (setting an expected value to OSL_UNDEFINED means + * that we do not expect a specific value) and what the relation is supposed + * to represent. It returns 0 if the check failed or 1 if no problem has been + * detected. + * \param[in] relation The relation we want to check. + * \param[in] expected_type Semantics about this relation (domain, access...). + * \param[in] expected_nb_output_dims Expected number of output dimensions. + * \param[in] expected_nb_input_dims Expected number of input dimensions. + * \param[in] expected_nb_parameters Expected number of parameters. + * \return 0 if the integrity check fails, 1 otherwise. + */ +int osl_relation_integrity_check(osl_relation_p relation, + int expected_type, + int expected_nb_output_dims, + int expected_nb_input_dims, + int expected_nb_parameters) { + int i; + + // Check the NULL case. + if (relation == NULL) { + if ((expected_nb_output_dims != OSL_UNDEFINED) || + (expected_nb_input_dims != OSL_UNDEFINED) || + (expected_nb_parameters != OSL_UNDEFINED)) { + OSL_debug("NULL relation with some expected attibutes"); + //return 0; + } + + return 1; + } + + // Check the type. + if (((expected_type != OSL_TYPE_ACCESS) && + (expected_type != relation->type)) || + ((expected_type == OSL_TYPE_ACCESS) && + (!osl_relation_is_access(relation)))) { + OSL_warning("wrong type"); + osl_relation_dump(stderr, relation); + return 0; + } + + // Check that relations have no undefined atributes. + if ((relation->nb_output_dims == OSL_UNDEFINED) || + (relation->nb_input_dims == OSL_UNDEFINED) || + (relation->nb_local_dims == OSL_UNDEFINED) || + (relation->nb_parameters == OSL_UNDEFINED)) { + OSL_warning("all attributes should be defined"); + osl_relation_dump(stderr, relation); + return 0; + } + + // Check that a context has actually 0 output dimensions. + if ((relation->type == OSL_TYPE_CONTEXT) && + (relation->nb_output_dims != 0)) { + OSL_warning("context without 0 as number of output dimensions"); + osl_relation_dump(stderr, relation); + return 0; + } + + // Check that a domain or a context has actually 0 input dimensions. + if (((relation->type == OSL_TYPE_DOMAIN) || + (relation->type == OSL_TYPE_CONTEXT)) && + (relation->nb_input_dims != 0)) { + OSL_warning("domain or context without 0 input dimensions"); + osl_relation_dump(stderr, relation); + return 0; + } + + // Check properties according to expected values (and if expected values + // are undefined, define them with the first relation part properties). + if (!osl_relation_check_attribute(&expected_nb_output_dims, + relation->nb_output_dims) || + !osl_relation_check_attribute(&expected_nb_input_dims, + relation->nb_input_dims) || + !osl_relation_check_attribute(&expected_nb_parameters, + relation->nb_parameters)) { + osl_relation_dump(stderr, relation); + return 0; + } + + while (relation != NULL) { + + // Attributes (except the number of local dimensions) should be the same + // in all parts of the union. + if ((expected_nb_output_dims != relation->nb_output_dims) || + (expected_nb_input_dims != relation->nb_input_dims) || + (expected_nb_parameters != relation->nb_parameters)) { + OSL_warning("inconsistent attributes"); + osl_relation_dump(stderr, relation); + return 0; + } + + // Check whether the number of columns is OK or not. + if (!osl_relation_check_nb_columns(relation, + expected_nb_output_dims, + expected_nb_input_dims, + expected_nb_parameters)) { + osl_relation_dump(stderr, relation); + return 0; + } + + // Check the first column. The first column of a relation part should be + // made of 0 or 1 only. + if ((relation->nb_rows > 0) && (relation->nb_columns > 0)) { + for (i = 0; i < relation->nb_rows; i++) { + if (!osl_int_zero(relation->precision, relation->m[i][0]) && + !osl_int_one(relation->precision, relation->m[i][0])) { + OSL_warning("first column of a relation is not " + "strictly made of 0 or 1"); + osl_relation_dump(stderr, relation); + return 0; + } + } + } + + // Array accesses must provide the array identifier. + if ((osl_relation_is_access(relation)) && + (osl_relation_get_array_id(relation) == OSL_UNDEFINED)) { + osl_relation_dump(stderr, relation); + return 0; + } + + relation = relation->next; + } + + return 1; +} + + +/** + * osl_relation_set_attributes_one function: + * this functions sets the attributes of a relation part provided as a + * parameter. It updates the relation directly. + * \param[in,out] relation The relation (union part) to set the attributes. + * \param[in] nb_output_dims Number of output dimensions. + * \param[in] nb_input_dims Number of input dimensions. + * \param[in] nb_local_dims Number of local dimensions. + * \param[in] nb_parameters Number of parameters. + */ +void osl_relation_set_attributes_one(osl_relation_p relation, + int nb_output_dims, int nb_input_dims, + int nb_local_dims, int nb_parameters) { + if (relation != NULL) { + relation->nb_output_dims = nb_output_dims; + relation->nb_input_dims = nb_input_dims; + relation->nb_local_dims = nb_local_dims; + relation->nb_parameters = nb_parameters; + } +} + + +/** + * osl_relation_set_attributes function: + * this functions sets the attributes of a relation (union) provided + * as a parameter. It updates the relation directly. + * \param[in,out] relation The relation (union) to set the attributes. + * \param[in] nb_output_dims Number of output dimensions. + * \param[in] nb_input_dims Number of input dimensions. + * \param[in] nb_local_dims Number of local dimensions. + * \param[in] nb_parameters Number of parameters. + */ +void osl_relation_set_attributes(osl_relation_p relation, + int nb_output_dims, int nb_input_dims, + int nb_local_dims, int nb_parameters) { + while (relation != NULL) { + osl_relation_set_attributes_one(relation, + nb_output_dims, nb_input_dims, + nb_local_dims, nb_parameters); + relation = relation->next; + } +} + + +/** + * osl_relation_set_type function: + * this function sets the type of each relation union part in the relation + * to the one provided as parameter. + * \param relation The relation to set the type. + * \param type The type. + */ +void osl_relation_set_type(osl_relation_p relation, int type) { + + while (relation != NULL) { + relation->type = type; + relation = relation->next; + } +} + + +/** + * osl_relation_get_array_id function: + * this function returns the array identifier in a relation with access type + * It returns OSL_UNDEFINED if it is not able to find it (in particular + * if there are irregularities in the relation). + * \param[in] relation The relation where to find an array identifier. + * \return The array identifier in the relation or OSL_UNDEFINED. + */ +int osl_relation_get_array_id(osl_relation_p relation) { + int i; + int first = 1; + int array_id = OSL_UNDEFINED; + int reference_array_id = OSL_UNDEFINED; + int nb_array_id; + int row_id = 0; + int precision; + + if (relation == NULL) + return OSL_UNDEFINED; + + if (!osl_relation_is_access(relation)) { + OSL_warning("asked for an array id of non-array relation"); + return OSL_UNDEFINED; + } + + while (relation != NULL) { + precision = relation->precision; + + // There should be room to store the array identifier. + if ((relation->nb_rows < 1) || + (relation->nb_columns < 3)) { + OSL_warning("no array identifier in an access function"); + return OSL_UNDEFINED; + } + + // Array identifiers are m[i][#columns -1] / m[i][1], with i the only row + // where m[i][1] is not 0. + // - check there is exactly one row such that m[i][1] is not 0, + // - check the whole ith row if full of 0 except m[i][1] and the id, + // - check that (m[i][#columns -1] % m[i][1]) == 0, + // - check that (-m[i][#columns -1] / m[i][1]) > 0. + nb_array_id = 0; + for (i = 0; i < relation->nb_rows; i++) { + if (!osl_int_zero(precision, relation->m[i][1])) { + nb_array_id ++; + row_id = i; + } + } + if (nb_array_id == 0) { + OSL_warning("no array identifier in an access function"); + return OSL_UNDEFINED; + } + if (nb_array_id > 1) { + OSL_warning("several array identifiers in one access function"); + return OSL_UNDEFINED; + } + for (i = 0; i < relation->nb_columns - 1; i++) { + if ((i != 1) && !osl_int_zero(precision, relation->m[row_id][i])) { + OSL_warning("non integer array identifier"); + return OSL_UNDEFINED; + } + } + if (!osl_int_divisible(precision, + relation->m[row_id][relation->nb_columns - 1], + relation->m[row_id][1])) { + OSL_warning("rational array identifier"); + return OSL_UNDEFINED; + } + array_id = -osl_int_get_si(precision, + relation->m[row_id][relation->nb_columns - 1]); + array_id /= osl_int_get_si(precision, relation->m[row_id][1]); + if (array_id <= 0) { + OSL_warning("negative or 0 identifier in access function"); + return OSL_UNDEFINED; + } + + // Unions of accesses are allowed, but they should refer at the same array. + if (first) { + reference_array_id = array_id; + first = 0; + } + else { + if (reference_array_id != array_id) { + OSL_warning("inconsistency of array identifiers in an " + "union of access relations"); + return OSL_UNDEFINED; + } + } + + relation = relation->next; + } + + return array_id; +} + + +/** + * osl_relation_is_access function: + * this function returns 1 if the relation corresponds to an access relation, + * whatever its precise type (read, write etc.), 0 otherwise. + * \param relation The relation to check wheter it is an access relation or not. + * \return 1 if the relation is an access relation, 0 otherwise. + */ +int osl_relation_is_access(osl_relation_p relation) { + + if (relation == NULL) + return 0; + + if ((relation->type == OSL_TYPE_ACCESS) || + (relation->type == OSL_TYPE_READ) || + (relation->type == OSL_TYPE_WRITE) || + (relation->type == OSL_TYPE_MAY_WRITE)) + return 1; + + return 0; +} + + +/** + * osl_relation_get_attributes function: + * this function returns, through its parameters, the maximum values of the + * relation attributes (nb_iterators, nb_parameters etc), depending on its + * type. HOWEVER, it updates the parameter value iff the attribute is greater + * than the input parameter value. Hence it may be used to get the + * attributes as well as to find the maximum attributes for several relations. + * The array identifier 0 is used when there is no array identifier (AND this + * is OK), OSL_UNDEFINED is used to report it is impossible to provide the + * property while it should. This function is not intended for checking, the + * input relation should be correct. + * \param[in] relation The relation to extract attribute values. + * \param[in,out] nb_parameters Number of parameter attribute. + * \param[in,out] nb_iterators Number of iterators attribute. + * \param[in,out] nb_scattdims Number of scattering dimensions attribute. + * \param[in,out] nb_localdims Number of local dimensions attribute. + * \param[in,out] array_id Maximum array identifier attribute. + */ +void osl_relation_get_attributes(osl_relation_p relation, + int * nb_parameters, + int * nb_iterators, + int * nb_scattdims, + int * nb_localdims, + int * array_id) { + int type; + int local_nb_parameters = OSL_UNDEFINED; + int local_nb_iterators = OSL_UNDEFINED; + int local_nb_scattdims = OSL_UNDEFINED; + int local_nb_localdims = OSL_UNDEFINED; + int local_array_id = OSL_UNDEFINED; + + while (relation != NULL) { + if (osl_relation_is_access(relation)) + type = OSL_TYPE_ACCESS; + else + type = relation->type; + + // There is some redundancy but I believe the code is cleaner this way. + switch (type) { + case OSL_TYPE_CONTEXT: + local_nb_parameters = relation->nb_parameters; + local_nb_iterators = 0; + local_nb_scattdims = 0; + local_nb_localdims = relation->nb_local_dims; + local_array_id = 0; + break; + + case OSL_TYPE_DOMAIN: + local_nb_parameters = relation->nb_parameters; + local_nb_iterators = relation->nb_output_dims; + local_nb_scattdims = 0; + local_nb_localdims = relation->nb_local_dims; + local_array_id = 0; + break; + + case OSL_TYPE_SCATTERING: + local_nb_parameters = relation->nb_parameters; + local_nb_iterators = relation->nb_input_dims; + local_nb_scattdims = relation->nb_output_dims; + local_nb_localdims = relation->nb_local_dims; + local_array_id = 0; + break; + + case OSL_TYPE_ACCESS: + local_nb_parameters = relation->nb_parameters; + local_nb_iterators = relation->nb_input_dims; + local_nb_scattdims = 0; + local_nb_localdims = relation->nb_local_dims; + local_array_id = osl_relation_get_array_id(relation); + break; + + default: + local_nb_parameters = relation->nb_parameters; + local_nb_iterators = relation->nb_input_dims; + local_nb_scattdims = relation->nb_output_dims; + local_nb_localdims = relation->nb_local_dims; + local_array_id = 0; + } + + // Update. + *nb_parameters = OSL_max(*nb_parameters, local_nb_parameters); + *nb_iterators = OSL_max(*nb_iterators, local_nb_iterators); + *nb_scattdims = OSL_max(*nb_scattdims, local_nb_scattdims); + *nb_localdims = OSL_max(*nb_localdims, local_nb_localdims); + *array_id = OSL_max(*array_id, local_array_id); + relation = relation->next; + } +} + + +/** + * osl_relation_extend_output function: + * this function extends the number of output dimensions of a given relation. It + * returns a copy of the input relation with a number of output dimensions + * extended to "dim" for all its union components. The new output dimensions + * are simply set equal to 0. The extended number of dimensions must be higher + * than or equal to the original one (an error will be raised otherwise). + * \param[in] relation The input relation to extend. + * \param[in] dim The number of output dimension to reach. + * \return A new relation: "relation" extended to "dim" output dims. + */ +osl_relation_p osl_relation_extend_output(osl_relation_p relation, int dim) { + int i, j; + int first = 1; + int offset; + int precision = relation->precision; + osl_relation_p extended = NULL, node, previous = NULL; + + while (relation != NULL) { + if (relation->nb_output_dims > dim) + OSL_error("Number of output dims is greater than required extension"); + offset = dim - relation->nb_output_dims; + + node = osl_relation_pmalloc(precision, + relation->nb_rows + offset, + relation->nb_columns + offset); + + node->type = relation->type; + node->nb_output_dims = OSL_max(relation->nb_output_dims, dim); + node->nb_input_dims = relation->nb_input_dims; + node->nb_local_dims = relation->nb_local_dims; + node->nb_parameters = relation->nb_parameters; + + // Copy of the original relation with some 0 columns for the new dimensions + // Note that we use the fact that the matrix is initialized with zeros. + for (i = 0; i < relation->nb_rows; i++) { + for (j = 0; j <= relation->nb_output_dims; j++) + osl_int_assign(precision, &node->m[i][j], relation->m[i][j]); + + for (j = relation->nb_output_dims + offset + 1; + j < relation->nb_columns + offset; j++) + osl_int_assign(precision, &node->m[i][j], relation->m[i][j - offset]); + } + + // New rows dedicated to the new dimensions + for (i = relation->nb_rows; i < relation->nb_rows + offset; i++) { + for (j = 0; j < relation->nb_columns + offset; j++) { + if ((i - relation->nb_rows) == (j - relation->nb_output_dims - 1)) + osl_int_set_si(precision, &node->m[i][j], -1); + } + } + + if (first) { + first = 0; + extended = node; + previous = node; + } + else { + previous->next = node; + previous = previous->next; + } + + relation = relation->next; + } + + return extended; +} + + +/** + * osl_relation_interface function: + * this function creates an interface structure corresponding to the relation + * and returns it. + * \return An interface structure for the relation structure. + */ +osl_interface_p osl_relation_interface() { + osl_interface_p interface = osl_interface_malloc(); + + OSL_strdup(interface->URI, OSL_URI_RELATION); + interface->idump = (osl_idump_f)osl_relation_idump; + interface->sprint = (osl_sprint_f)osl_relation_sprint; + interface->sread = (osl_sread_f)osl_relation_sread; + interface->malloc = (osl_malloc_f)osl_relation_malloc; + interface->free = (osl_free_f)osl_relation_free; + interface->clone = (osl_clone_f)osl_relation_clone; + interface->equal = (osl_equal_f)osl_relation_equal; + + return interface; +} + + +/** + * osl_relation_set_precision function: + * this function changes the precision of the osl_relation + * \param[in] precision Precision wanted for the relation + * \param[in,out] r A osl relation to change the precision + */ +void osl_relation_set_precision(int const precision, osl_relation_p r) { + while (r != NULL) { + if (precision != r->precision) { + size_t i; + size_t j; + for (i = 0; i < (size_t)r->nb_rows; ++i) { + for (j = 0; j < (size_t)r->nb_columns; ++j) { + osl_int_set_precision(r->precision, precision, &r->m[i][j]); + } + } + r->precision = precision; + } + r = r->next; + } +} + + +/** + * osl_relation_set_same_precision function: + * this function gets the highest precision of the relations + * and set this precision to the other relation if necessary + * \param[in,out] a A osl relation to change the precision if necessary + * \param[in,out] b A osl relation to change the precision if necessary + */ +void osl_relation_set_same_precision(osl_relation_p a, osl_relation_p b) { + if (a != NULL && b != NULL && a->precision != b->precision) { + if (a->precision == OSL_PRECISION_MP || b->precision == OSL_PRECISION_MP) { + osl_relation_set_precision(OSL_PRECISION_MP, a); + osl_relation_set_precision(OSL_PRECISION_MP, b); + } + else if (a->precision == OSL_PRECISION_DP || b->precision == OSL_PRECISION_DP) { + osl_relation_set_precision(OSL_PRECISION_DP, a); + osl_relation_set_precision(OSL_PRECISION_DP, b); + } + } +} diff -Nru cloog-0.18.2/osl/source/relation_list.c cloog-0.18.4/osl/source/relation_list.c --- cloog-0.18.2/osl/source/relation_list.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/relation_list.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,806 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** relation_list.c ** + **-----------------------------------------------------------------** + ** First version: 08/10/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#include +#include +#include +#include + +#include +#include +#include +#include + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_relation_list_idump function: + * Displays a osl_relation_list_t structure (a list of relations) into a + * file (file, possibly stdout). See osl_relation_print_structure for + * more details. + * \param file File where informations are printed. + * \param l The list of relations whose information has to be printed. + * \param level Number of spaces before printing, for each line. + */ +void osl_relation_list_idump(FILE * file, osl_relation_list_p l, int level) { + int j, first = 1; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file,"|\t"); + + if (l != NULL) + fprintf(file, "+-- osl_relation_list_t\n"); + else + fprintf(file, "+-- NULL relation list\n"); + + while (l != NULL) { + if (!first) { + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + fprintf(file, "| osl_relation_list_t\n"); + } + else + first = 0; + + // A blank line. + for (j = 0; j <= level+1; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); + + // Print a relation. + osl_relation_idump(file, l->elt, level+1); + + l = l->next; + + // Next line. + if (l != NULL) { + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "V\n"); + } + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_relation_dump function: + * This function prints the content of a osl_relation_list_t into + * a file (file, possibly stdout). + * \param file File where informations are printed. + * \param list The relation whose information has to be printed. + */ +void osl_relation_list_dump(FILE * file, osl_relation_list_p list) { + osl_relation_list_idump(file, list, 0); +} + + +/** + * osl_relation_list_pprint_elts function: + * This function pretty-prints the elements of a osl_relation_list_t structure + * into a file (file, possibly stdout) in the OpenScop format. I.e., it prints + * only the elements and not the number of elements. It prints an element of the + * list only if it is not NULL. + * \param file File where informations are printed. + * \param list The relation list whose information has to be printed. + * \param[in] names Array of constraint columns names. + */ +void osl_relation_list_pprint_elts(FILE * file, osl_relation_list_p list, + osl_names_p names) { + size_t i; + osl_relation_list_p head = list; + + // Count the number of elements in the list with non-NULL content. + i = osl_relation_list_count(list); + + // Print each element of the relation list. + if (i > 0) { + i = 0; + while (head) { + if (head->elt != NULL) { + osl_relation_pprint(file, head->elt, names); + if (head->next != NULL) + fprintf(file, "\n"); + i++; + } + head = head->next; + } + } + else { + fprintf(file, "# NULL relation list\n"); + } +} + + +/** + * osl_relation_list_pprint_access_array_scoplib function: + * This function pretty-prints the elements of a osl_relation_list_t structure + * into a file (file, possibly stdout) in the SCoPLib format. I.e., it prints + * only the elements and not the number of elements. It prints an element of the + * list only if it is not NULL. + * \param file File where informations are printed. + * \param list The relation list whose information has to be printed. + * \param[in] names Array of constraint columns names. + * \param[in] add_fakeiter True of False + */ +void osl_relation_list_pprint_access_array_scoplib(FILE * file, + osl_relation_list_p list, osl_names_p names, int add_fakeiter) { + size_t i; + int nb_rows_read = 0, nb_columns_read = 0; + int nb_rows_write = 0, nb_columns_write = 0; + int nb_rows_may_write = 0, nb_columns_may_write = 0; + osl_relation_list_p head ; + + // Count the number of elements in the list with non-NULL content. + i = osl_relation_list_count(list); + + // Print each element of the relation list. + if (i > 0) { + + // Read/Write arrays size + head = list; + while (head) { + if (head->elt != NULL) { + if (head->elt->type == OSL_TYPE_READ) { + if (head->elt->nb_rows == 1) + nb_rows_read++; + else + nb_rows_read += head->elt->nb_rows - 1; // remove the 'Arr' + + nb_columns_read = head->elt->nb_columns - head->elt->nb_output_dims; + + } else if (head->elt->type == OSL_TYPE_WRITE) { + if (head->elt->nb_rows == 1) + nb_rows_write++; + else + nb_rows_write += head->elt->nb_rows - 1; // remove the 'Arr' + + nb_columns_write = head->elt->nb_columns - head->elt->nb_output_dims; + + } else if (head->elt->type == OSL_TYPE_MAY_WRITE) { + if (head->elt->nb_rows == 1) + nb_rows_may_write++; + else + nb_rows_may_write += head->elt->nb_rows - 1; // remove the 'Arr' + + nb_columns_may_write = head->elt->nb_columns - + head->elt->nb_output_dims; + } + } + head = head->next; + } + + if (add_fakeiter) { + nb_columns_read++; + nb_columns_write++; + nb_columns_may_write++; + } + + fprintf(file, "# Read access informations\n%d %d\n", + nb_rows_read, nb_columns_read); + head = list; + while (head) { + if (head->elt != NULL && head->elt->type == OSL_TYPE_READ) { + osl_relation_pprint_scoplib(file, head->elt, names, 0, add_fakeiter); + } + head = head->next; + } + + fprintf(file, "# Write access informations\n%d %d\n", + nb_rows_write, nb_columns_write); + head = list; + while (head) { + if (head->elt != NULL && head->elt->type == OSL_TYPE_WRITE) { + osl_relation_pprint_scoplib(file, head->elt, names, 0, add_fakeiter); + } + head = head->next; + } + + if (nb_rows_may_write > 0) { + fprintf(file, "# May Write access informations\n%d %d\n", + nb_rows_may_write, nb_columns_may_write); + head = list; + while (head) { + if (head->elt != NULL && head->elt->type == OSL_TYPE_MAY_WRITE) { + osl_relation_pprint_scoplib(file, head->elt, names, 0, add_fakeiter); + } + head = head->next; + } + } + } + else { + fprintf(file, "# NULL relation list\n"); + } +} + + +/** + * osl_relation_list_pprint function: + * This function pretty-prints the content of a osl_relation_list_t structure + * into a file (file, possibly stdout) in the OpenScop format. It prints + * an element of the list only if it is not NULL. + * \param[in] file File where informations are printed. + * \param[in] list The relation list whose information has to be printed. + * \param[in] names Array of constraint columns names. + */ +void osl_relation_list_pprint(FILE * file, osl_relation_list_p list, + osl_names_p names) { + size_t i; + + // Count the number of elements in the list with non-NULL content. + i = osl_relation_list_count(list); + + // Print it. + if (i > 1) + fprintf(file,"# List of %lu elements\n%lu\n", i, i); + else + fprintf(file,"# List of %lu element \n%lu\n", i, i); + + // Print each element of the relation list. + osl_relation_list_pprint_elts(file, list, names); +} + + +/** + * osl_relation_list_print function: + * This function prints the content of a osl_relation_list_t structure + * into a file (file, possibly stdout) in the OpenScop format. It prints + * an element of the list only if it is not NULL. + * \param file File where informations are printed. + * \param list The relation list whose information has to be printed. + */ +void osl_relation_list_print(FILE * file, osl_relation_list_p list) { + + osl_relation_list_pprint(file, list, NULL); +} + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/** + * osl_relation_list_pread function ("precision read"): + * this function reads a list of relations into a file (foo, + * posibly stdin) and returns a pointer this relation list. + * \param[in] file The input stream. + * \param[in] precision The precision of the relation elements. + * \return A pointer to the relation list structure that has been read. + */ +osl_relation_list_p osl_relation_list_pread(FILE * file, int precision) { + int i; + osl_relation_list_p list; + osl_relation_list_p res; + int nb_mat; + + // Read the number of relations to read. + nb_mat = osl_util_read_int(file, NULL); + + if (nb_mat < 0) + OSL_error("negative number of relations"); + + // Allocate the header of the list and start reading each element. + res = list = osl_relation_list_malloc(); + for (i = 0; i < nb_mat; ++i) { + list->elt = osl_relation_pread(file, precision); + if (i < nb_mat - 1) + list->next = osl_relation_list_malloc(); + list = list->next; + } + + return res; +} + + +/** + * osl_relation_list_read function: + * this function is equivalent to osl_relation_list_pread() except that + * the precision corresponds to the precision environment variable or + * to the highest available precision if it is not defined. + * \see{osl_relation_list_pread} + */ +osl_relation_list_p osl_relation_list_read(FILE * foo) { + int precision = osl_util_get_precision(); + return osl_relation_list_pread(foo, precision); +} + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_relation_list_malloc function: + * This function allocates the memory space for a osl_relation_list_t + * structure and sets its fields with default values. Then it returns + * a pointer to the allocated space. + * \return A pointer to an empty relation list with fields set to default + * values. + */ +osl_relation_list_p osl_relation_list_malloc() { + osl_relation_list_p res; + + OSL_malloc(res, osl_relation_list_p, sizeof(osl_relation_list_t)); + res->elt = NULL; + res->next = NULL; + + return res; +} + + + +/** + * osl_relation_list_free function: + * This function frees the allocated memory for a osl_relation_list_t + * structure, and all the relations stored in the list. + * \param list The pointer to the relation list we want to free. + */ +void osl_relation_list_free(osl_relation_list_p list) { + osl_relation_list_p tmp; + + if (list == NULL) + return; + + while (list != NULL) { + if (list->elt != NULL) + osl_relation_free(list->elt); + tmp = list->next; + free(list); + list = tmp; + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_relation_list_node function: + * This function builds an osl_relation_list_t node and sets its + * relation element as a copy of the one provided as parameter. + * If the relation provided as an argument is NULL, NULL is returned. + * \param r The pointer to the relation to copy/paste in a list node. + * \return A pointer to a relation list node containing a copy of "relation". + */ +osl_relation_list_p osl_relation_list_node(osl_relation_p r) { + osl_relation_list_p new = NULL; + + if (r != NULL) { + new = osl_relation_list_malloc(); + new->elt = osl_relation_clone(r); + } + return new; +} + + +/** + * osl_relation_list_clone function: + * This functions builds and returns a quasi-"hard copy" (not a pointer copy) + * of a osl_relation_list_t data structure provided as parameter. + * \param list The pointer to the relation list we want to copy. + * \return A pointer to the full copy of the relation list in parameter. + */ +osl_relation_list_p osl_relation_list_clone(osl_relation_list_p list) { + + osl_relation_list_p clone = NULL, node, previous = NULL; + int first = 1; + + while (list != NULL) { + node = osl_relation_list_malloc(); + node->elt = osl_relation_clone(list->elt); + + if (first) { + first = 0; + clone = node; + previous = node; + } + else { + previous->next = node; + previous = previous->next; + } + + list = list->next; + } + + return clone; +} + + +/** + * osl_relation_list_concat function: + * this function builds a new relation list as the concatenation of the + * two lists sent as parameters. + * \param l1 The first relation list. + * \param l2 The second relation list. + * \return A pointer to the relation list resulting from the concatenation of + * l1 and l2. + */ +osl_relation_list_p osl_relation_list_concat(osl_relation_list_p l1, + osl_relation_list_p l2) { + osl_relation_list_p new, end; + + if (l1 == NULL) + return osl_relation_list_clone(l2); + + if (l2 == NULL) + return osl_relation_list_clone(l1); + + new = osl_relation_list_clone(l1); + end = new; + while (end->next != NULL) + end = end->next; + end->next = osl_relation_list_clone(l2); + + return new; +} + + +/** + * osl_relation_list_add function: + * this function adds a relation list at the end of the relation list + * pointed by l1. No new list is created: this functions links the two + * input lists. If the first relation list is NULL, it is set to the + * second relation list. + * \param[in,out] l1 Pointer to the first relation list. + * \param[in] l2 The second relation list. + */ +void osl_relation_list_add(osl_relation_list_p *l1, osl_relation_list_p l2) { + while (*l1 != NULL) + l1 = &((*l1)->next); + + *l1 = l2; +} + + +/** + * osl_relation_list_push function: + * this function sees a list of relations as a stack of relations and + * performs the push operation onto this stack. + * \param[in,out] head Pointer to the head of the relation stack. + * \param[in,out] node Relation node to add to the stack. Its next field is + * updated to the previous head of the stack. + */ +void osl_relation_list_push(osl_relation_list_p *head, + osl_relation_list_p node) { + if (node != NULL) { + node->next = *head; + *head = node; + } +} + + +/** + * osl_relation_list_pop function: + * this function sees a list of relations as a stack of relations and + * performs the pop operation onto this stack. + * \param[in,out] head Pointer to the head of the relation stack. It is + * updated to the previous element in the stack (NULL + * if there is none). + * \return The top element of the stack (detached from the list). + */ +osl_relation_list_p osl_relation_list_pop(osl_relation_list_p *head) { + osl_relation_list_p top = NULL; + + if (*head != NULL) { + top = *head; + *head = (*head)->next; + top->next = NULL; + } + + return top; +} + + +/** + * osl_relation_list_dup function: + * this function sees a list of relations as a stack of relations and + * performs the dup operation (duplicate the top element) onto + * this stack. + * \param[in,out] head Pointer to the head of the relation stack. It is + * updated to the new element after duplication. + */ +void osl_relation_list_dup(osl_relation_list_p *head) { + osl_relation_list_p top = osl_relation_list_pop(head); + osl_relation_list_push(head, osl_relation_list_clone(top)); + osl_relation_list_push(head, top); +} + + +/** + * osl_relation_list_drop function: + * this function sees a list of relations as a stack of relations and + * performs the drop operation (pop and destroy popped element) onto + * this stack. + * \param[in,out] head Pointer to the head of the relation stack. It is + * updated to the previous element in the stack (NULL + * if there is none). + */ +void osl_relation_list_drop(osl_relation_list_p *head) { + osl_relation_list_p top = osl_relation_list_pop(head); + osl_relation_list_free(top); +} + + +/** + * osl_relation_list_destroy function: + * this function sees a list of relations as a stack of relations and + * performs the destroy operation onto this stack, i.e., it completely + * free it. + * \param[in,out] head Pointer to the head of the relation stack. + * Updated to NULL. + */ +void osl_relation_list_destroy(osl_relation_list_p *head) { + + while (*head != NULL) + osl_relation_list_drop(head); +} + + +/** + * osl_relation_list_equal function: + * This function returns true if the two relation lists are the same, false + * otherwise.. + * \param l1 The first relation list. + * \param l2 The second relation list. + * \return 1 if l1 and l2 are the same (content-wise), 0 otherwise. + */ +int osl_relation_list_equal(osl_relation_list_p l1, osl_relation_list_p l2) { + while ((l1 != NULL) && (l2 != NULL)) { + if (l1 == l2) + return 1; + + if (!osl_relation_equal(l1->elt, l2->elt)) + return 0; + + l1 = l1->next; + l2 = l2->next; + } + + if (((l1 == NULL) && (l2 != NULL)) || ((l1 != NULL) && (l2 == NULL))) + return 0; + + return 1; +} + + +/** + * osl_relation_integrity_check function: + * This function checks that a list of relation is "well formed" according to + * some expected properties (setting an expected value to OSL_UNDEFINED + * means that we do not expect a specific value) and what the relations are + * supposed to represent (all relations of a list are supposed to have the + * same semantics). It returns 0 if the check failed or 1 if no problem has + * been detected. + * \param list The relation list we want to check. + * \param type Semantics about this relation (domain, access...). + * \param expected_nb_output_dims Expected number of output dimensions. + * \param expected_nb_input_dims Expected number of input dimensions. + * \param expected_nb_parameters Expected number of parameters. + * \return 0 if the integrity check fails, 1 otherwise. + */ +int osl_relation_list_integrity_check(osl_relation_list_p list, + int type, + int expected_nb_output_dims, + int expected_nb_input_dims, + int expected_nb_parameters) { + while (list != NULL) { + // Check the access function. + if (!osl_relation_integrity_check(list->elt, + type, + expected_nb_output_dims, + expected_nb_input_dims, + expected_nb_parameters)) { + return 0; + } + + list = list->next; + } + + return 1; +} + + +/** + * osl_relation_list_set_type function: + * this function sets the type of each relation in the relation list to the + * one provided as parameter. + * \param list The list of relations to set the type. + * \param type The type. + */ +void osl_relation_list_set_type(osl_relation_list_p list, int type) { + + while (list != NULL) { + if (list->elt != NULL) { + list->elt->type = type; + } + list = list->next; + } +} + + +/** + * osl_relation_list_filter function: + * this function returns a copy of the input relation list, restricted to + * the relations of a given type. The special type OSL_TYPE_ACCESS + * filters any kind of access (read, write, rdwr etc.). + * \param list The relation list to copy/filter. + * \param type The filtering type. + * \return A copy of the input list with only relation of the given type. + */ +osl_relation_list_p osl_relation_list_filter(osl_relation_list_p list, + int type) { + + osl_relation_list_p copy = osl_relation_list_clone(list); + osl_relation_list_p filtered = NULL; + osl_relation_list_p previous = NULL; + osl_relation_list_p trash; + int first = 1; + + while (copy != NULL) { + if ((copy->elt != NULL) && + (((type == OSL_TYPE_ACCESS) && + (osl_relation_is_access(copy->elt))) || + ((type != OSL_TYPE_ACCESS) && + (type == copy->elt->type)))) { + if (first) { + filtered = copy; + first = 0; + } + + previous = copy; + copy = copy->next; + } + else { + trash = copy; + if (!first) + previous->next = copy->next; + copy = copy->next; + trash->next = NULL; + osl_relation_list_free(trash); + } + } + + return filtered; +} + + +/** + * osl_relation_list_count function: + * this function returns the number of elements with non-NULL content + * in a relation list. + * \param list The relation list to count the number of elements. + * \return The number of nodes with non-NULL content in the relation list. + */ +size_t osl_relation_list_count(osl_relation_list_p list) { + size_t i = 0; + + while (list != NULL) { + if (list->elt != NULL) + i++; + list = list->next; + } + + return i; +} + + +/** + * osl_relation_list_get_attributes function: + * this function returns, through its parameters, the maximum values of the + * relation attributes (nb_iterators, nb_parameters etc) in the relation list, + * depending on its type. HOWEVER, it updates the parameter value iff the + * attribute is greater than the input parameter value. Hence it may be used + * to get the attributes as well as to find the maximum attributes for several + * relation lists. The array identifier 0 is used when there is no array + * identifier (AND this is OK), OSL_UNDEFINED is used to report it is + * impossible to provide the property while it should. This function is not + * intended for checking, the input relation list should be correct. + * \param[in] list The relation list to extract attribute values. + * \param[in,out] nb_parameters Number of parameter attribute. + * \param[in,out] nb_iterators Number of iterators attribute. + * \param[in,out] nb_scattdims Number of scattering dimensions attribute. + * \param[in,out] nb_localdims Number of local dimensions attribute. + * \param[in,out] array_id Maximum array identifier attribute. + */ +void osl_relation_list_get_attributes(osl_relation_list_p list, + int * nb_parameters, + int * nb_iterators, + int * nb_scattdims, + int * nb_localdims, + int * array_id) { + int local_nb_parameters = OSL_UNDEFINED; + int local_nb_iterators = OSL_UNDEFINED; + int local_nb_scattdims = OSL_UNDEFINED; + int local_nb_localdims = OSL_UNDEFINED; + int local_array_id = OSL_UNDEFINED; + + while (list != NULL) { + osl_relation_get_attributes(list->elt, + &local_nb_parameters, + &local_nb_iterators, + &local_nb_scattdims, + &local_nb_localdims, + &local_array_id); + // Update. + *nb_parameters = OSL_max(*nb_parameters, local_nb_parameters); + *nb_iterators = OSL_max(*nb_iterators, local_nb_iterators); + *nb_scattdims = OSL_max(*nb_scattdims, local_nb_scattdims); + *nb_localdims = OSL_max(*nb_localdims, local_nb_localdims); + *array_id = OSL_max(*array_id, local_array_id); + list = list->next; + } +} + diff -Nru cloog-0.18.2/osl/source/scop.c cloog-0.18.4/osl/source/scop.c --- cloog-0.18.2/osl/source/scop.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/scop.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,972 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** scop.c ** + **-----------------------------------------------------------------** + ** First version: 30/04/2008 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +# include +# include +# include +# include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +/*+*************************************************************************** + * Structure display functions * + *****************************************************************************/ + + +/** + * osl_scop_idump function: + * this function displays an osl_scop_t structure (*scop) into a + * file (file, possibly stdout) in a way that trends to be understandable. It + * includes an indentation level (level) in order to work with others + * idump functions. + * \param file The file where the information has to be printed. + * \param scop The scop structure whose information has to be printed. + * \param level Number of spaces before printing, for each line. + */ +void osl_scop_idump(FILE * file, osl_scop_p scop, int level) { + int j, first = 1; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (scop != NULL) + fprintf(file, "+-- osl_scop_t\n"); + else + fprintf(file, "+-- NULL scop\n"); + + while (scop != NULL) { + if (!first) { + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + fprintf(file, "| osl_scop_t\n"); + } + else + first = 0; + + // A blank line. + for (j = 0; j <= level+1; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); + + // Print the version. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + fprintf(file, "|\tVersion: %d\n", scop->version); + + // A blank line. + for (j = 0; j <= level+1; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); + + // Print the language. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + fprintf(file, "|\tLanguage: %s\n", scop->language); + + // A blank line. + for (j = 0; j <= level+1; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); + + // Print the context of the scop. + osl_relation_idump(file, scop->context, level+1); + + // Print the parameters. + osl_generic_idump(file, scop->parameters, level+1); + + // Print the statements. + osl_statement_idump(file, scop->statement, level+1); + + // Print the registered extension interfaces. + osl_interface_idump(file, scop->registry, level+1); + + // Print the extensions. + osl_generic_idump(file, scop->extension, level+1); + + scop = scop->next; + + // Next line. + if (scop != NULL) { + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "V\n"); + } + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_scop_dump function: + * this function prints the content of an osl_scop_t structure (*scop) + * into a file (file, possibly stdout). + * \param file The file where the information has to be printed. + * \param scop The scop structure whose information has to be printed. + */ +void osl_scop_dump(FILE * file, osl_scop_p scop) { + osl_scop_idump(file, scop, 0); +} + + +/** + * osl_scop_names function: + * this function generates as set of names for all the dimensions + * involved in a given scop. + * \param[in] scop The scop (list) we have to generate names for. + * \return A set of generated names for the input scop dimensions. + */ +osl_names_p osl_scop_names(osl_scop_p scop) { + int nb_parameters = OSL_UNDEFINED; + int nb_iterators = OSL_UNDEFINED; + int nb_scattdims = OSL_UNDEFINED; + int nb_localdims = OSL_UNDEFINED; + int array_id = OSL_UNDEFINED; + + osl_scop_get_attributes(scop, &nb_parameters, &nb_iterators, + &nb_scattdims, &nb_localdims, &array_id); + + return osl_names_generate("P", nb_parameters, + "i", nb_iterators, + "c", nb_scattdims, + "l", nb_localdims, + "A", array_id); +} + + +/** + * osl_scop_print function: + * this function prints the content of an osl_scop_t structure (*scop) + * into a file (file, possibly stdout) in the OpenScop textual format. + * \param file The file where the information has to be printed. + * \param scop The scop structure whose information has to be printed. + */ +void osl_scop_print(FILE * file, osl_scop_p scop) { + int parameters_backedup = 0; + int arrays_backedup = 0; + osl_strings_p parameters_backup = NULL; + osl_strings_p arrays_backup = NULL; + osl_names_p names; + osl_arrays_p arrays; + + if (scop == NULL) { + fprintf(file, "# NULL scop\n"); + return; + } + else { + fprintf(file, "# [File generated by the OpenScop Library %s]\n", + OSL_RELEASE); + } + + if (osl_scop_integrity_check(scop) == 0) + OSL_warning("OpenScop integrity check failed. Something may go wrong."); + + // Generate the names for the various dimensions. + names = osl_scop_names(scop); + + while (scop != NULL) { + // If possible, replace parameter names with scop parameter names. + if (osl_generic_has_URI(scop->parameters, OSL_URI_STRINGS)) { + parameters_backedup = 1; + parameters_backup = names->parameters; + names->parameters = scop->parameters->data; + } + + // If possible, replace array names with arrays extension names. + arrays = osl_generic_lookup(scop->extension, OSL_URI_ARRAYS); + if (arrays != NULL) { + arrays_backedup = 1; + arrays_backup = names->arrays; + names->arrays = osl_arrays_to_strings(arrays); + } + + fprintf(file, "\n<"OSL_URI_SCOP">\n\n"); + fprintf(file, "# =============================================== " + "Global\n"); + fprintf(file, "# Language\n"); + fprintf(file, "%s\n\n", scop->language); + + fprintf(file, "# Context\n"); + osl_relation_pprint(file, scop->context, names); + fprintf(file, "\n"); + + osl_util_print_provided(file, + osl_generic_has_URI(scop->parameters, OSL_URI_STRINGS), + "Parameters are"); + osl_generic_print(file, scop->parameters); + + fprintf(file, "\n# Number of statements\n"); + fprintf(file, "%d\n\n",osl_statement_number(scop->statement)); + + osl_statement_pprint(file, scop->statement, names); + + if (scop->extension) { + fprintf(file, "# =============================================== " + "Extensions\n"); + osl_generic_print(file, scop->extension); + } + fprintf(file, "\n\n\n"); + + // If necessary, switch back parameter names. + if (parameters_backedup) { + parameters_backedup = 0; + names->parameters = parameters_backup; + } + + // If necessary, switch back array names. + if (arrays_backedup) { + arrays_backedup = 0; + osl_strings_free(names->arrays); + names->arrays = arrays_backup; + } + + scop = scop->next; + } + + osl_names_free(names); +} + + +/** + * osl_scop_print_scoplib function: + * this function prints the content of an osl_scop_t structure (*scop) + * into a file (file, possibly stdout) in the ScopLib textual format. + * \param file The file where the information has to be printed. + * \param scop The scop structure whose information has to be printed. + */ +void osl_scop_print_scoplib(FILE * file, osl_scop_p scop) { + int parameters_backedup = 0; + int arrays_backedup = 0; + osl_strings_p parameters_backup = NULL; + osl_strings_p arrays_backup = NULL; + osl_names_p names; + osl_arrays_p arrays; + + if (scop == NULL) { + fprintf(file, "# NULL scop\n"); + return; + } + else { + fprintf(file, "# [File generated by the OpenScop Library %s]\n" + "# [SCoPLib format]\n", + OSL_RELEASE); + } + + if (osl_scop_check_compatible_scoplib(scop) == 0) { + OSL_error("SCoP integrity check failed. Something may go wrong."); + exit(1); + } + + // Generate the names for the various dimensions. + names = osl_scop_names(scop); + + while (scop != NULL) { + // If possible, replace parameter names with scop parameter names. + if (osl_generic_has_URI(scop->parameters, OSL_URI_STRINGS)) { + parameters_backedup = 1; + parameters_backup = names->parameters; + names->parameters = scop->parameters->data; + } + + // If possible, replace array names with arrays extension names. + arrays = osl_generic_lookup(scop->extension, OSL_URI_ARRAYS); + if (arrays != NULL) { + arrays_backedup = 1; + arrays_backup = names->arrays; + names->arrays = osl_arrays_to_strings(arrays); + } + + fprintf(file, "\nSCoP\n\n"); + fprintf(file, "# =============================================== " + "Global\n"); + fprintf(file, "# Language\n"); + fprintf(file, "%s\n\n", scop->language); + + fprintf(file, "# Context\n"); + + osl_relation_pprint_scoplib(file, scop->context, names, 0, 0); + fprintf(file, "\n"); + + osl_util_print_provided(file, + osl_generic_has_URI(scop->parameters, OSL_URI_STRINGS), + "Parameters are"); + + if (scop->parameters) { + fprintf(file, "# Parameter names\n"); + osl_strings_print(file, scop->parameters->data); + } + + fprintf(file, "\n# Number of statements\n"); + fprintf(file, "%d\n\n",osl_statement_number(scop->statement)); + + osl_statement_pprint_scoplib(file, scop->statement, names); + + if (scop->extension) { + fprintf(file, "# =============================================== " + "Options\n"); + osl_generic_print_options_scoplib(file, scop->extension); + } + + // If necessary, switch back parameter names. + if (parameters_backedup) { + parameters_backedup = 0; + names->parameters = parameters_backup; + } + + // If necessary, switch back array names. + if (arrays_backedup) { + arrays_backedup = 0; + osl_strings_free(names->arrays); + names->arrays = arrays_backup; + } + + scop = scop->next; + } + + osl_names_free(names); +} + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/** + * osl_scop_pread function ("precision read"): + * this function reads a list of scop structures from a file (possibly stdin) + * complying to the OpenScop textual format and returns a pointer to this + * scop list. If some relation properties (number of input/output/local + * dimensions and number of parameters) are undefined, it will define them + * according to the available information. + * \param[in] file The file where the scop has to be read. + * \param[in] registry The list of known interfaces (others are ignored). + * \param[in] precision The precision of the relation elements. + * \return A pointer to the scop structure that has been read. + */ +osl_scop_p osl_scop_pread(FILE * file, osl_interface_p registry, + int precision) { + osl_scop_p list = NULL, current = NULL, scop; + osl_statement_p stmt = NULL; + osl_statement_p prev = NULL; + osl_strings_p language; + int nb_statements; + char * tmp; + int first = 1; + int i; + + if (file == NULL) + return NULL; + + while(1) { + // + // I. START TAG + // + tmp = osl_util_read_uptotag(file, NULL, OSL_URI_SCOP); + if (tmp == NULL) { + OSL_debug("no more scop in the file"); + break; + } + else { + free(tmp); + } + + scop = osl_scop_malloc(); + scop->registry = osl_interface_clone(registry); + + // + // II. CONTEXT PART + // + + // Read the language. + language = osl_strings_read(file); + if (osl_strings_size(language) == 0) + OSL_error("no language (backend) specified"); + + if (osl_strings_size(language) > 1) + OSL_warning("uninterpreted information (after language)"); + + if (language != NULL) { + OSL_strdup(scop->language, language->string[0]); + osl_strings_free(language); + } + + // Read the context domain. + scop->context = osl_relation_pread(file, precision); + + // Read the parameters. + if (osl_util_read_int(file, NULL) > 0) + scop->parameters = osl_generic_read_one(file, scop->registry); + + // + // III. STATEMENT PART + // + + // Read the number of statements. + nb_statements = osl_util_read_int(file, NULL); + + for (i = 0; i < nb_statements; i++) { + // Read each statement. + stmt = osl_statement_pread(file, scop->registry, precision); + if (scop->statement == NULL) + scop->statement = stmt; + else + prev->next = stmt; + prev = stmt; + } + + // + // IV. EXTENSION PART (TO THE END TAG) + // + + // Read up the end tag (if any), and store extensions. + scop->extension = osl_generic_read(file, scop->registry); + + // Add the new scop to the list. + if (first) { + list = scop; + first = 0; + } + else { + current->next = scop; + } + current = scop; + } + + if (!osl_scop_integrity_check(list)) + OSL_warning("scop integrity check failed"); + + return list; +} + + +/** + * osl_scop_read function: + * this function is equivalent to osl_scop_pread() except that + * (1) the precision corresponds to the precision environment variable or + * to the highest available precision if it is not defined, and + * (2) the list of known interface is set to the default one. + * \see{osl_scop_pread} + */ +osl_scop_p osl_scop_read(FILE * foo) { + int precision = osl_util_get_precision(); + osl_interface_p registry = osl_interface_get_default_registry(); + osl_scop_p scop = osl_scop_pread(foo, registry, precision); + + osl_interface_free(registry); + return scop; +} + + +/*+*************************************************************************** + * Memory allocation/deallocation functions * + *****************************************************************************/ + + +/** + * osl_scop_malloc function: + * this function allocates the memory space for a osl_scop_t structure and + * sets its fields with default values. Then it returns a pointer to the + * allocated space. + * \return A pointer to an empty scop with fields set to default values. + */ +osl_scop_p osl_scop_malloc() { + osl_scop_p scop; + + OSL_malloc(scop, osl_scop_p, sizeof(osl_scop_t)); + scop->version = 1; + scop->language = NULL; + scop->context = NULL; + scop->parameters = NULL; + scop->statement = NULL; + scop->registry = NULL; + scop->extension = NULL; + scop->usr = NULL; + scop->next = NULL; + + return scop; +} + + +/** + * osl_scop_free function: + * This function frees the allocated memory for a osl_scop_t structure. + * \param scop The pointer to the scop we want to free. + */ +void osl_scop_free(osl_scop_p scop) { + osl_scop_p tmp; + + while (scop != NULL) { + if (scop->language != NULL) + free(scop->language); + osl_generic_free(scop->parameters); + osl_relation_free(scop->context); + osl_statement_free(scop->statement); + osl_interface_free(scop->registry); + osl_generic_free(scop->extension); + + tmp = scop->next; + free(scop); + scop = tmp; + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_scop_add function: + * this function adds a scop "scop" at the end of the scop list pointed + * by "location". + * \param[in,out] location Address of the first element of the scop list. + * \param[in] scop The scop to add to the list. + */ +void osl_scop_add(osl_scop_p * location, osl_scop_p scop) { + while (*location != NULL) + location = &((*location)->next); + + *location = scop; +} + + +/** + * osl_scop_number function: + * this function returns the number of scops in the scop list + * provided as parameter. + * \param[in] scop The first element of the scop list. + * \return The number of scops in the scop list. + */ +size_t osl_scop_number(osl_scop_p scop) { + size_t number = 0; + + while (scop != NULL) { + number++; + scop = scop->next; + } + return number; +} + + +/** + * osl_scop_clone function: + * This functions builds and returns a "hard copy" (not a pointer copy) + * of a osl_statement_t data structure provided as parameter. + * Note that the usr field is not touched by this function. + * \param scop The pointer to the scop we want to clone. + * \return A pointer to the full clone of the scop provided as parameter. + */ +osl_scop_p osl_scop_clone(osl_scop_p scop) { + osl_scop_p clone = NULL, node, previous = NULL; + int first = 1; + + while (scop != NULL) { + node = osl_scop_malloc(); + node->version = scop->version; + if (scop->language != NULL) + OSL_strdup(node->language, scop->language); + node->context = osl_relation_clone(scop->context); + node->parameters = osl_generic_clone(scop->parameters); + node->statement = osl_statement_clone(scop->statement); + node->registry = osl_interface_clone(scop->registry); + node->extension = osl_generic_clone(scop->extension); + + if (first) { + first = 0; + clone = node; + previous = node; + } + else { + previous->next = node; + previous = previous->next; + } + + scop = scop->next; + } + + return clone; +} + + +/** + * osl_scop_equal function: + * this function returns true if the two scops are the same, false + * otherwise (the usr field is not tested). + * \param s1 The first scop. + * \param s2 The second scop. + * \return 1 if s1 and s2 are the same (content-wise), 0 otherwise. + */ +int osl_scop_equal(osl_scop_p s1, osl_scop_p s2) { + + while ((s1 != NULL) && (s2 != NULL)) { + if (s1 == s2) + return 1; + + if (s1->version != s2->version) { + OSL_info("versions are not the same"); + return 0; + } + + if (strcmp(s1->language, s2->language) != 0) { + OSL_info("languages are not the same"); + return 0; + } + + if (!osl_relation_equal(s1->context, s2->context)) { + OSL_info("contexts are not the same"); + return 0; + } + + if (!osl_generic_equal(s1->parameters, s2->parameters)) { + OSL_info("parameters are not the same"); + return 0; + } + + if (!osl_statement_equal(s1->statement, s2->statement)) { + OSL_info("statements are not the same"); + return 0; + } + + if (!osl_interface_equal(s1->registry, s2->registry)) { + OSL_info("registries are not the same"); + return 0; + } + + if (!osl_generic_equal(s1->extension, s2->extension)) { + OSL_info("extensions are not the same"); + return 0; + } + + s1 = s1->next; + s2 = s2->next; + } + + if (((s1 == NULL) && (s2 != NULL)) || ((s1 != NULL) && (s2 == NULL))) + return 0; + + return 1; +} + + +/** + * osl_scop_integrity_check function: + * This function checks that a scop is "well formed". It returns 0 if the + * check failed or 1 if no problem has been detected. + * \param scop The scop we want to check. + * \return 0 if the integrity check fails, 1 otherwise. + */ +int osl_scop_integrity_check(osl_scop_p scop) { + int expected_nb_parameters; + + + while (scop != NULL) { + // Check the language. + if ((scop->language != NULL) && + (!strcmp(scop->language, "caml") || !strcmp(scop->language, "Caml") || + !strcmp(scop->language, "ocaml") || !strcmp(scop->language, "OCaml"))) + fprintf(stderr, "[OpenScop] Alert: What ?! Caml ?! Are you sure ?!?!\n"); + + // Check the context. + if (!osl_relation_integrity_check(scop->context, + OSL_TYPE_CONTEXT, + OSL_UNDEFINED, + OSL_UNDEFINED, + OSL_UNDEFINED)) + return 0; + + // Get the number of parameters. + if (scop->context != NULL) + expected_nb_parameters = scop->context->nb_parameters; + else + expected_nb_parameters = OSL_UNDEFINED; + + // TODO : check the number of parameter strings. + + if (!osl_statement_integrity_check(scop->statement, + expected_nb_parameters)) + return 0; + + scop = scop->next; + } + + return 1; +} + + +/** + * osl_scop_check_compatible_scoplib function: + * This function checks that a scop is "well formed". It returns 0 if the + * check failed or 1 if no problem has been detected. + * \param scop The scop we want to check. + * \return 0 if the integrity check fails, 1 otherwise. + */ +int osl_scop_check_compatible_scoplib(osl_scop_p scop) { + + if (!osl_scop_integrity_check(scop)) + return 0; + if (scop->next != NULL) + return 0; + if (scop == NULL || scop->statement == NULL) + return 1; + + osl_relation_p domain; + osl_statement_p statement; + osl_relation_p scattering; + int precision = scop->statement->scattering->precision; + int i, j; + + statement = scop->statement; + while (statement != NULL) { + scattering = statement->scattering; + + if (scattering->nb_local_dims != 0) { + OSL_error("Local dims in scattering matrix"); + return 0; + } + + domain = statement->domain; + while (domain != NULL) { + if (domain->nb_local_dims != 0) { + OSL_error("Local dims in domain matrix"); + return 0; + } + domain = domain->next; + } + + // Check if there is only the -Identity in the output_dims + // and the lines MUST be in the right order + for (i = 0 ; i < scattering->nb_rows ; i++) { + for (j = 0 ; j < scattering->nb_output_dims ; j++) { + if (i == j) { // -1 + if (!osl_int_mone(precision, scattering->m[i][j+1])) { + OSL_error("Wrong -Identity"); + return 0; + } + } else { // 0 + if (!osl_int_zero(precision, scattering->m[i][j+1])) { + OSL_error("Wrong -Identity"); + return 0; + } + } + } + } + + statement = statement->next; + } + + return 1; +} + + +/** + * osl_scop_get_nb_parameters function: + * this function returns the number of global parameters of a given SCoP. + * \param scop The scop we want to know the number of global parameters. + * \return The number of global parameters in the scop. + */ +int osl_scop_get_nb_parameters(osl_scop_p scop) { + + if (scop->context == NULL) { + OSL_debug("no context domain, assuming 0 parameters"); + return 0; + } + else { + return scop->context->nb_parameters; + } +} + + +/** + * osl_scop_register_extension function: + * this function registers a list of extension interfaces to a scop, i.e., it + * adds them to the scop registry. In addition, it will extract extensions + * corresponding to those interfaces from the textual form of the extensions + * (if any) and add them to the scop extension list. + * \param scop The scop for which an extension has to be registered. + * \param interface The extension interface to register within the scop. + */ +void osl_scop_register_extension(osl_scop_p scop, osl_interface_p interface) { + osl_generic_p textual, new; + char * extension_string; + + if ((interface != NULL) && (scop != NULL)) { + osl_interface_add(&scop->registry, interface); + + textual = osl_generic_lookup(scop->extension, interface->URI); + if (textual != NULL) { + extension_string = ((osl_textual_p)textual->data)->textual; + new = osl_generic_sread(&extension_string, interface); + osl_generic_add(&scop->extension, new); + } + } +} + + +/** + * osl_scop_get_attributes function: + * this function returns, through its parameters, the maximum values of the + * relation attributes (nb_iterators, nb_parameters etc) in the scop. + * HOWEVER, it updates the parameter value iff the attribute is greater than + * the input parameter value. Hence it may be used to get the attributes as + * well as to find the maximum attributes for several scop lists. The array + * identifier 0 is used when there is no array identifier (AND this is OK), + * OSL_UNDEFINED is used to report it is impossible to provide the property + * while it should. This function is not intended for checking, the input + * scop should be correct. + * \param[in] scop The scop to extract attributes values. + * \param[in,out] nb_parameters Number of parameter attribute. + * \param[in,out] nb_iterators Number of iterators attribute. + * \param[in,out] nb_scattdims Number of scattering dimensions attribute. + * \param[in,out] nb_localdims Number of local dimensions attribute. + * \param[in,out] array_id Maximum array identifier attribute. + */ +void osl_scop_get_attributes(osl_scop_p scop, + int * nb_parameters, + int * nb_iterators, + int * nb_scattdims, + int * nb_localdims, + int * array_id) { + int local_nb_parameters = OSL_UNDEFINED; + int local_nb_iterators = OSL_UNDEFINED; + int local_nb_scattdims = OSL_UNDEFINED; + int local_nb_localdims = OSL_UNDEFINED; + int local_array_id = OSL_UNDEFINED; + + while (scop != NULL) { + osl_relation_get_attributes(scop->context, + &local_nb_parameters, + &local_nb_iterators, + &local_nb_scattdims, + &local_nb_localdims, + &local_array_id); + + osl_statement_get_attributes(scop->statement, + &local_nb_parameters, + &local_nb_iterators, + &local_nb_scattdims, + &local_nb_localdims, + &local_array_id); + // Update. + *nb_parameters = OSL_max(*nb_parameters, local_nb_parameters); + *nb_iterators = OSL_max(*nb_iterators, local_nb_iterators); + *nb_scattdims = OSL_max(*nb_scattdims, local_nb_scattdims); + *nb_localdims = OSL_max(*nb_localdims, local_nb_localdims); + *array_id = OSL_max(*array_id, local_array_id); + scop = scop->next; + } +} + + +/** + * osl_scop_normalize_scattering function: + * this function modifies a scop such that all scattering relation have + * the same number of output dimensions (additional output dimensions are + * set as being equal to zero). + * \param[in,out] scop The scop to nomalize the scattering functions. + */ +void osl_scop_normalize_scattering(osl_scop_p scop) { + int max_scattering_dims = 0; + osl_statement_p statement; + osl_relation_p extended; + + if ((scop != NULL) && (scop->statement != NULL)) { + // Get the max number of scattering dimensions. + statement = scop->statement; + while (statement != NULL) { + if (statement->scattering != NULL) { + max_scattering_dims = OSL_max(max_scattering_dims, + statement->scattering->nb_output_dims); + } + statement = statement->next; + } + + // Normalize. + statement = scop->statement; + while (statement != NULL) { + if (statement->scattering != NULL) { + extended = osl_relation_extend_output(statement->scattering, + max_scattering_dims); + osl_relation_free(statement->scattering); + statement->scattering = extended; + } + statement = statement->next; + } + } +} + diff -Nru cloog-0.18.2/osl/source/statement.c cloog-0.18.4/osl/source/statement.c --- cloog-0.18.2/osl/source/statement.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/statement.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,851 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** statement.c ** + **-----------------------------------------------------------------** + ** First version: 30/04/2008 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +/*+*************************************************************************** + * Structure display functions * + *****************************************************************************/ + + +/** + * osl_statement_idump function: + * this function displays an osl_statement_t structure (*statement) into + * a file (file, possibly stdout) in a way that trends to be understandable. + * It includes an indentation level (level) in order to work with others + * dumping functions. + * \param[in] file File where the information has to be printed. + * \param[in] statement The statement whose information has to be printed. + * \param[in] level Number of spaces before printing, for each line. + */ +void osl_statement_idump(FILE * file, osl_statement_p statement, int level) { + int j, first = 1, number = 1; + + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + + if (statement != NULL) + fprintf(file, "+-- osl_statement_t (S%d)\n", number); + else + fprintf(file, "+-- NULL statement\n"); + + while (statement != NULL) { + if (!first) { + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + fprintf(file, "| osl_statement_t (S%d)\n", number); + } + else + first = 0; + + // A blank line. + for (j = 0; j <= level + 1; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); + + // Print the domain of the statement. + osl_relation_idump(file, statement->domain, level + 1); + + // Print the scattering of the statement. + osl_relation_idump(file, statement->scattering, level + 1); + + // Print the array access information of the statement. + osl_relation_list_idump(file, statement->access, level + 1); + + // Print the original body expression. + osl_generic_idump(file, statement->extension, level + 1); + + statement = statement->next; + number++; + + // Next line. + if (statement != NULL) { + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "V\n"); + } + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_statement_dump function: + * this function prints the content of an osl_statement_t structure + * (*statement) into a file (file, possibly stdout). + * \param[in] file The file where the information has to be printed. + * \param[in] statement The statement whose information has to be printed. + */ +void osl_statement_dump(FILE * file, osl_statement_p statement) { + osl_statement_idump(file, statement, 0); +} + + +/** + * osl_statement_names function: + * this function generates as set of names for all the dimensions + * involved in a given statement. + * \param[in] statement The statement (list) we have to generate names for. + * \return A set of generated names for the input statement dimensions. + */ +static +osl_names_p osl_statement_names(osl_statement_p statement) { + int nb_parameters = OSL_UNDEFINED; + int nb_iterators = OSL_UNDEFINED; + int nb_scattdims = OSL_UNDEFINED; + int nb_localdims = OSL_UNDEFINED; + int array_id = OSL_UNDEFINED; + + osl_statement_get_attributes(statement, &nb_parameters, &nb_iterators, + &nb_scattdims, &nb_localdims, &array_id); + + return osl_names_generate("P", nb_parameters, + "i", nb_iterators, + "c", nb_scattdims, + "l", nb_localdims, + "A", array_id); +} + + +/** + * osl_statement_pprint function: + * this function pretty-prints the content of an osl_statement_t structure + * (*statement) into a file (file, possibly stdout) in the OpenScop format. + * \param[in] file The file where the information has to be printed. + * \param[in] statement The statement whose information has to be printed. + * \param[in] names The names of the constraint columns for comments. + */ +void osl_statement_pprint(FILE * file, osl_statement_p statement, + osl_names_p names) { + size_t nb_relations; + int number = 1; + int generated_names = 0; + int iterators_backedup = 0; + int nb_ext = 0; + osl_body_p body = NULL; + osl_strings_p iterators_backup = NULL; + + // Generate the dimension names if necessary and replace iterators with + // statement iterators if possible. + if (names == NULL) { + generated_names = 1; + names = osl_statement_names(statement); + } + + while (statement != NULL) { + // If possible, replace iterator names with statement iterator names. + body = (osl_body_p)osl_generic_lookup(statement->extension, OSL_URI_BODY); + if (body && body->iterators != NULL) { + iterators_backedup = 1; + iterators_backup = names->iterators; + names->iterators = body->iterators; + } + + nb_relations = 0; + + fprintf(file, "# =============================================== "); + fprintf(file, "Statement %d\n", number); + + fprintf(file, "# Number of relations describing the statement:\n"); + + if (statement->domain != NULL) + nb_relations ++; + if (statement->scattering != NULL) + nb_relations ++; + nb_relations += osl_relation_list_count(statement->access); + + fprintf(file, "%lu\n\n", nb_relations); + + fprintf(file, "# ---------------------------------------------- "); + fprintf(file, "%2d.1 Domain\n", number); + osl_relation_pprint(file, statement->domain, names); + fprintf(file, "\n"); + + fprintf(file, "# ---------------------------------------------- "); + fprintf(file, "%2d.2 Scattering\n", number); + osl_relation_pprint(file, statement->scattering, names); + fprintf(file, "\n"); + + fprintf(file, "# ---------------------------------------------- "); + fprintf(file, "%2d.3 Access\n", number); + osl_relation_list_pprint_elts(file, statement->access, names); + fprintf(file, "\n"); + + fprintf(file, "# ---------------------------------------------- "); + fprintf(file, "%2d.4 Statement Extensions\n", number); + fprintf(file, "# Number of Statement Extensions\n"); + nb_ext = osl_generic_number(statement->extension); + fprintf(file, "%d\n", nb_ext); + if(nb_ext>0) + osl_generic_print(file, statement->extension); + + fprintf(file, "\n"); + + // If necessary, switch back iterator names. + if (iterators_backedup) { + iterators_backedup = 0; + names->iterators = iterators_backup; + } + + statement = statement->next; + number++; + } + + if (generated_names) + osl_names_free(names); +} + + +/** + * osl_statement_pprint_scoplib function: + * this function pretty-prints the content of an osl_statement_t structure + * (*statement) into a file (file, possibly stdout) in the SCoPLib format. + * \param[in] file The file where the information has to be printed. + * \param[in] statement The statement whose information has to be printed. + * \param[in] names The names of the constraint columns for comments. + */ +void osl_statement_pprint_scoplib(FILE * file, osl_statement_p statement, + osl_names_p names) { + int number = 1; + int generated_names = 0; + int iterators_backedup = 0; + osl_body_p body = NULL; + osl_strings_p iterators_backup = NULL; + int add_fakeiter; + + // Generate the dimension names if necessary and replace iterators with + // statement iterators if possible. + if (names == NULL) { + generated_names = 1; + names = osl_statement_names(statement); + } + + while (statement != NULL) { + // If possible, replace iterator names with statement iterator names. + body = (osl_body_p)osl_generic_lookup(statement->extension, OSL_URI_BODY); + if (body && body->iterators != NULL) { + iterators_backedup = 1; + iterators_backup = names->iterators; + names->iterators = body->iterators; + } + + add_fakeiter = statement->domain->nb_rows == 0 && + statement->scattering->nb_rows == 1; + + fprintf(file, "# =============================================== "); + fprintf(file, "Statement %d\n", number); + + fprintf(file, "# ---------------------------------------------- "); + fprintf(file, "%2d.1 Domain\n", number); + fprintf(file, "# Iteration domain\n"); + osl_relation_pprint_scoplib(file, statement->domain, names, 1, add_fakeiter); + fprintf(file, "\n"); + + fprintf(file, "# ---------------------------------------------- "); + fprintf(file, "%2d.2 Scattering\n", number); + fprintf(file,"# Scattering function is provided\n1\n"); + osl_relation_pprint_scoplib(file, statement->scattering, names, 0, + add_fakeiter); + fprintf(file, "\n"); + + fprintf(file, "# ---------------------------------------------- "); + fprintf(file, "%2d.3 Access\n", number); + fprintf(file,"# Access informations are provided\n1\n"); + + osl_relation_list_pprint_access_array_scoplib(file, statement->access, + names, add_fakeiter); + fprintf(file, "\n"); + + fprintf(file, "# ---------------------------------------------- "); + fprintf(file, "%2d.4 Body\n", number); + if (body != NULL) { + fprintf(file, "# Statement body is provided\n1\n"); + osl_body_print_scoplib(file, body); + body = NULL; //re-initialize for next statement + } + else { + fprintf(file, "# Statement body is not provided\n0\n"); + } + + fprintf(file, "\n"); + + // If necessary, switch back iterator names. + if (iterators_backedup) { + iterators_backedup = 0; + names->iterators = iterators_backup; + } + + statement = statement->next; + number++; + } + + if (generated_names) + osl_names_free(names); +} + + +/** + * osl_statement_print function: + * this function prints the content of an osl_statement_t structure + * (*statement) into a file (file, possibly stdout) in the OpenScop format. + * \param[in] file The file where the information has to be printed. + * \param[in] statement The statement whose information has to be printed. + */ +void osl_statement_print(FILE * file, osl_statement_p statement) { + + osl_statement_pprint(file, statement, NULL); +} + + +/***************************************************************************** + * Reading function * + *****************************************************************************/ + + +/** + * osl_statement_dispatch function: + * this function dispatches the relations from a relation list to the + * convenient fields of a statement structure: it extracts the domain, + * the scattering and the access list and store them accordingly in the + * statement structure provided as a parameter. + * \param[in,out] stmt The statement where to dispatch the relations. + * \param[in,out] list The "brute" relation list to sort and dispatch (freed). + */ +static +void osl_statement_dispatch(osl_statement_p stmt, osl_relation_list_p list) { + osl_relation_list_p domain_list; + osl_relation_list_p scattering_list; + size_t nb_domains, nb_scattering, nb_accesses; + + // Domain. + domain_list = osl_relation_list_filter(list, OSL_TYPE_DOMAIN); + nb_domains = osl_relation_list_count(domain_list); + if (nb_domains > 1) + OSL_error("more than one domain for a statement"); + + if (domain_list != NULL) { + stmt->domain = domain_list->elt; + domain_list->elt = NULL; + osl_relation_list_free(domain_list); + } + else { + stmt->domain = NULL; + } + + // Scattering. + scattering_list=osl_relation_list_filter(list,OSL_TYPE_SCATTERING); + nb_scattering = osl_relation_list_count(scattering_list); + if (nb_scattering > 1) + OSL_error("more than one scattering relation for a statement"); + + if (scattering_list != NULL) { + stmt->scattering = scattering_list->elt; + scattering_list->elt = NULL; + osl_relation_list_free(scattering_list); + } + else { + stmt->scattering = NULL; + } + + // Access. + stmt->access = osl_relation_list_filter(list, OSL_TYPE_ACCESS); + nb_accesses = osl_relation_list_count(stmt->access); + + if ((nb_domains + nb_scattering + nb_accesses) != + (osl_relation_list_count(list))) + OSL_error("unexpected relation type to define a statement"); + + osl_relation_list_free(list); +} + + +/** + * osl_statement_pread function ("precision read"): + * this function reads an osl_statement_t structure from an input stream + * (possibly stdin). + * \param[in] file The input stream. + * \param[in] registry The list of known interfaces (others are ignored). + * \param[in] precision The precision of the relation elements. + * \return A pointer to the statement structure that has been read. + */ +osl_statement_p osl_statement_pread(FILE * file, osl_interface_p registry, + int precision) { + osl_statement_p stmt = osl_statement_malloc(); + osl_relation_list_p list; + osl_generic_p new = NULL; + int i, nb_ext = 0; + + if (file) { + // Read all statement relations. + list = osl_relation_list_pread(file, precision); + + // Store relations at the right place according to their type. + osl_statement_dispatch(stmt, list); + + // Read the Extensions + nb_ext = osl_util_read_int(file, NULL); + for (i=0; iextension, new); + } + } + + return stmt; +} + + +/** + * osl_statement_read function: + * this function is equivalent to osl_statement_pread() except that + * (1) the precision corresponds to the precision environment variable or + * to the highest available precision if it is not defined, and + * (2) the list of known interface is set to the default one. + * \see{osl_statement_pread} + */ +osl_statement_p osl_statement_read(FILE * foo) { + int precision = osl_util_get_precision(); + osl_interface_p registry = osl_interface_get_default_registry(); + osl_statement_p statement = osl_statement_pread(foo, registry, precision); + + osl_interface_free(registry); + return statement; +} + + +/*+*************************************************************************** + * Memory allocation/deallocation functions * + *****************************************************************************/ + + +/** + * osl_statement_malloc function: + * this function allocates the memory space for an osl_statement_t + * structure and sets its fields with default values. Then it returns a pointer + * to the allocated space. + * \return A pointer to an empty statement with fields set to default values. + */ +osl_statement_p osl_statement_malloc() { + osl_statement_p statement; + + OSL_malloc(statement, osl_statement_p, sizeof(osl_statement_t)); + statement->domain = NULL; + statement->scattering = NULL; + statement->access = NULL; + statement->extension = NULL; + statement->next = NULL; + + return statement; +} + + +/** + * osl_statement_free function: + * this function frees the allocated memory for an osl_statement_t + * structure. + * \param[in,out] statement The pointer to the statement we want to free. + */ +void osl_statement_free(osl_statement_p statement) { + osl_statement_p next; + + while (statement != NULL) { + next = statement->next; + osl_relation_free(statement->domain); + osl_relation_free(statement->scattering); + osl_relation_list_free(statement->access); + osl_generic_free(statement->extension); + + free(statement); + statement = next; + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_statement_add function: + * this function adds a statement "statement" at the end of the statement + * list pointed by "location". + * \param[in,out] location Address of the first element of the statement list. + * \param[in] statement The statement to add to the list. + */ +void osl_statement_add(osl_statement_p * location, + osl_statement_p statement) { + while (*location != NULL) + location = &((*location)->next); + + *location = statement; +} + + +/** + * osl_statement_number function: + * this function returns the number of statements in the statement list + * provided as parameter. + * \param[in] statement The first element of the statement list. + * \return The number of statements in the statement list. + */ +int osl_statement_number(osl_statement_p statement) { + int number = 0; + + while (statement != NULL) { + number++; + statement = statement->next; + } + return number; +} + + +/** + * osl_statement_nclone function: + * This function builds and returns a "hard copy" (not a pointer copy) of the + * n first elements of an osl_statement_t list. + * \param statement The pointer to the statement structure we want to clone. + * \param n The number of nodes we want to copy (-1 for infinity). + * \return The clone of the n first nodes of the statement list. + */ +osl_statement_p osl_statement_nclone(osl_statement_p statement, int n) { + int first = 1, i = 0; + osl_statement_p clone = NULL, node, previous = NULL; + + while ((statement != NULL) && ((n == -1) || (i < n))) { + node = osl_statement_malloc(); + node->domain = osl_relation_clone(statement->domain); + node->scattering = osl_relation_clone(statement->scattering); + node->access = osl_relation_list_clone(statement->access); + node->extension = osl_generic_clone(statement->extension); + node->next = NULL; + + if (first) { + first = 0; + clone = node; + previous = node; + } + else { + previous->next = node; + previous = previous->next; + } + + i++; + statement = statement->next; + } + + return clone; +} + + +/** + * osl_statement_clone function: + * This functions builds and returns a "hard copy" (not a pointer copy) of an + * osl_statement_t data structure provided as parameter. + * \param[in] statement The pointer to the statement we want to clone. + * \return A pointer to the clone of the statement provided as parameter. + */ +osl_statement_p osl_statement_clone(osl_statement_p statement) { + return osl_statement_nclone(statement, -1); +} + + +/** + * osl_statement_equal function: + * this function returns true if the two statements provided as parameters + * are the same, false otherwise (the usr field is not tested). + * \param[in] s1 The first statement. + * \param[in] s2 The second statement. + * \return 1 if s1 and s2 are the same (content-wise), 0 otherwise. + */ +int osl_statement_equal(osl_statement_p s1, osl_statement_p s2) { + + if (s1 == s2) + return 1; + + if (((s1->next != NULL) && (s2->next == NULL)) || + ((s1->next == NULL) && (s2->next != NULL))) { + OSL_info("statements are not the same"); + return 0; + } + + if ((s1->next != NULL) && (s2->next != NULL)) { + if (!osl_statement_equal(s1->next, s2->next)) { + OSL_info("number of statements is not the same"); + return 0; + } + } + + if (!osl_relation_equal(s1->domain, s2->domain)) { + OSL_info("statement domains are not the same"); + return 0; + } + + if (!osl_relation_equal(s1->scattering, s2->scattering)) { + OSL_info("statement scatterings are not the same"); + return 0; + } + + if (!osl_relation_list_equal(s1->access, s2->access)) { + OSL_info("statement accesses are not the same"); + return 0; + } + + if (!osl_generic_equal(s1->extension, s2->extension)) { + OSL_info("statement bodies are not the same"); + return 0; + } + + return 1; +} + + +/** + * osl_statement_integrity_check function: + * this function checks that a statement is "well formed" according to some + * expected properties (setting an expected value to OSL_UNDEFINED means + * that we do not expect a specific value). It returns 0 if the check failed + * or 1 if no problem has been detected. + * \param[in] statement The statement we want to check. + * \param[in] expected_nb_parameters Expected number of parameters. + * \return 0 if the integrity check fails, 1 otherwise. + */ +int osl_statement_integrity_check(osl_statement_p statement, + int expected_nb_parameters) { + int expected_nb_iterators; + osl_body_p body = NULL; + + while (statement != NULL) { + // Check the domain. + if (!osl_relation_integrity_check(statement->domain, + OSL_TYPE_DOMAIN, + OSL_UNDEFINED, + 0, + expected_nb_parameters)) { + return 0; + } + + // Get the number of iterators. + if (statement->domain != NULL) + expected_nb_iterators = statement->domain->nb_output_dims; + else + expected_nb_iterators = OSL_UNDEFINED; + + // Check the scattering relation. + if (!osl_relation_integrity_check(statement->scattering, + OSL_TYPE_SCATTERING, + OSL_UNDEFINED, + expected_nb_iterators, + expected_nb_parameters)) { + return 0; + } + + // Check the access relations. + if (!osl_relation_list_integrity_check(statement->access, + OSL_TYPE_ACCESS, + OSL_UNDEFINED, + expected_nb_iterators, + expected_nb_parameters)) { + return 0; + } + + // Check the statement body. + body = (osl_body_p)osl_generic_lookup(statement->extension, OSL_URI_BODY); + if ((expected_nb_iterators != OSL_UNDEFINED) && + body && body->iterators != NULL && + ((size_t)expected_nb_iterators != osl_strings_size(body->iterators))) { + OSL_warning("unexpected number of original iterators"); + return 0; + } + + statement = statement->next; + } + + return 1; +} + + +/** + * osl_statement_get_nb_iterators function: + * this function returns the number of surroounding iterators of a given + * statement. + * \param statement The statement we want to know the number of iterators. + * \return The number of surrounding iterators for the statement. + */ +int osl_statement_get_nb_iterators(osl_statement_p statement) { + + if (statement->domain == NULL) { + OSL_warning("no statement domain, assuming 0 iterators"); + return 0; + } + else { + return statement->domain->nb_output_dims; + } +} + + +/** + * osl_statement_get_attributes function: + * this function returns, through its parameters, the maximum values of the + * relation attributes (nb_iterators, nb_parameters etc) in the statement. + * HOWEVER, it updates the parameter value iff the attribute is greater than + * the input parameter value. Hence it may be used to get the attributes as + * well as to find the maximum attributes for several statement lists. The + * array identifier 0 is used when there is no array identifier (AND this is + * OK), OSL_UNDEFINED is used to report it is impossible to provide the + * property while it should. This function is not intended for checking, the + * input statement should be correct. + * \param[in] statement The statement to extract attributes values. + * \param[in,out] nb_parameters Number of parameter attribute. + * \param[in,out] nb_iterators Number of iterators attribute. + * \param[in,out] nb_scattdims Number of scattering dimensions attribute. + * \param[in,out] nb_localdims Number of local dimensions attribute. + * \param[in,out] array_id Maximum array identifier attribute. + */ +void osl_statement_get_attributes(osl_statement_p statement, + int * nb_parameters, + int * nb_iterators, + int * nb_scattdims, + int * nb_localdims, + int * array_id) { + int local_nb_parameters = OSL_UNDEFINED; + int local_nb_iterators = OSL_UNDEFINED; + int local_nb_scattdims = OSL_UNDEFINED; + int local_nb_localdims = OSL_UNDEFINED; + int local_array_id = OSL_UNDEFINED; + + while (statement != NULL) { + osl_relation_get_attributes(statement->domain, + &local_nb_parameters, + &local_nb_iterators, + &local_nb_scattdims, + &local_nb_localdims, + &local_array_id); + + osl_relation_get_attributes(statement->scattering, + &local_nb_parameters, + &local_nb_iterators, + &local_nb_scattdims, + &local_nb_localdims, + &local_array_id); + + osl_relation_list_get_attributes(statement->access, + &local_nb_parameters, + &local_nb_iterators, + &local_nb_scattdims, + &local_nb_localdims, + &local_array_id); + // Update. + *nb_parameters = OSL_max(*nb_parameters, local_nb_parameters); + *nb_iterators = OSL_max(*nb_iterators, local_nb_iterators); + *nb_scattdims = OSL_max(*nb_scattdims, local_nb_scattdims); + *nb_localdims = OSL_max(*nb_localdims, local_nb_localdims); + *array_id = OSL_max(*array_id, local_array_id); + statement = statement->next; + } +} + + +/** + * osl_statement_get_body function: + * this function returns the body of the statement. + * \param[in] statement The statement to search the body. + * \return the body if found, NULL otherwise. + */ +osl_body_p osl_statement_get_body(osl_statement_p statement) { + osl_body_p body; + osl_extbody_p ebody; + + if (statement == NULL || statement->extension == NULL) { + return NULL; + } + + body = (osl_body_p)osl_generic_lookup(statement->extension, OSL_URI_BODY); + if (body != NULL) + return body; + ebody = (osl_extbody_p)osl_generic_lookup(statement->extension, + OSL_URI_EXTBODY); + if (ebody != NULL) + return ebody->body; + return NULL; +} diff -Nru cloog-0.18.2/osl/source/strings.c cloog-0.18.4/osl/source/strings.c --- cloog-0.18.2/osl/source/strings.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/strings.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,496 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** strings.c ** + **-----------------------------------------------------------------** + ** First version: 13/07/2011 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +# include +# include +# include +# include + +# include +# include +# include +# include + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_strings_idump function: + * this function displays an array of strings into a file (file, possibly + * stdout) in a way that trends to be understandable. It includes an + * indentation level (level) in order to work with others + * idump functions. + * \param[in] file The file where the information has to be printed. + * \param[in] strings The array of strings that has to be printed. + * \param[in] level Number of spaces before printing, for each line. + */ +void osl_strings_idump(FILE * file, osl_strings_p strings, int level) { + int i, nb_strings; + + for (i = 0; i < level; i++) + fprintf(file, "|\t"); + + if (strings != NULL) { + nb_strings = osl_strings_size(strings); + fprintf(file, "+-- osl_strings_t:"); + for (i = 0; i < nb_strings; i++) + fprintf(file, " %s", strings->string[i]); + fprintf(file, "\n"); + } + else + fprintf(file, "+-- NULL strings\n"); + + // A blank line. + for (i = 0; i <= level; i++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_strings_dump function: + * this function prints the content of an osl_strings_t structure + * (*strings) into a file (file, possibly stdout). + * \param[in] file The file where the information has to be printed. + * \param[in] strings The strings structure which has to be printed. + */ +void osl_strings_dump(FILE * file, osl_strings_p strings) { + osl_strings_idump(file, strings, 0); +} + + +/** + * osl_strings_sprint function: + * this function prints the content of an osl_strings_t structure + * (*strings) into a string (returned) in the OpenScop textual format. + * \param[in] strings The strings structure which has to be printed. + * \return A string containing the OpenScop dump of the strings structure. + */ +char * osl_strings_sprint(osl_strings_p strings) { + size_t i; + int high_water_mark = OSL_MAX_STRING; + char * string = NULL; + char buffer[OSL_MAX_STRING]; + + OSL_malloc(string, char *, high_water_mark * sizeof(char)); + string[0] = '\0'; + + if (strings != NULL) { + for (i = 0; i < osl_strings_size(strings); i++) { + sprintf(buffer, "%s", strings->string[i]); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + if (i < osl_strings_size(strings) - 1) + osl_util_safe_strcat(&string, " ", &high_water_mark); + } + sprintf(buffer, "\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + else { + sprintf(buffer, "# NULL strings\n"); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + } + + return string; +} + + +/** + * osl_strings_print function: + * this function prints the content of an osl_strings_t structure + * (*body) into a file (file, possibly stdout) in the OpenScop format. + * \param[in] file File where informations are printed. + * \param[in] strings The strings whose information has to be printed. + */ +void osl_strings_print(FILE * file, osl_strings_p strings) { + char * string; + + string = osl_strings_sprint(strings); + if (string != NULL) { + fprintf(file, "%s", string); + free(string); + } +} + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_strings_sread function: + * this function reads a strings structure from a string complying to the + * OpenScop textual format and returns a pointer to this strings structure. + * The input string should only contain the list of strings this function + * has to read (comments at the end of the line are accepted). The input + * parameter is updated to the position in the input string this function + * reach right after reading the strings structure. + * \param[in,out] input The input string where to find a strings structure. + * Updated to the position after what has been read. + * \return A pointer to the strings structure that has been read. + */ +osl_strings_p osl_strings_sread(char ** input) { + char tmp[OSL_MAX_STRING]; + char * s; + char ** string = NULL; + int nb_strings; + int i, count; + osl_strings_p strings = NULL; + + // Skip blank/commented lines and spaces before the strings. + osl_util_sskip_blank_and_comments(input); + + // Count the actual number of strings. + nb_strings = 0; + s = *input; + while (1) { + for (count = 0; *s && !isspace(*s) && *s != '#'; count++) + s++; + + if (count != 0) + nb_strings++; + + if ((!*s) || (*s == '#') || (*s == '\n')) + break; + else + s++; + } + + if (nb_strings > 0) { + // Allocate the array of strings. Make it NULL-terminated. + OSL_malloc(string, char **, sizeof(char *) * (nb_strings + 1)); + string[nb_strings] = NULL; + + // Read the desired number of strings. + s = *input; + for (i = 0; i < nb_strings; i++) { + for (count = 0; *s && !isspace(*s) && *s != '#'; count++) + tmp[count] = *(s++); + tmp[count] = '\0'; + OSL_strdup(string[i], tmp); + if (*s != '#') + s++; + } + + // Update the input pointer to the end of the strings structure. + *input = s; + + // Build the strings structure + strings = osl_strings_malloc(); + free(strings->string); + strings->string = string; + } + + return strings; +} + + +/** + * osl_strings_read function. + * this function reads a strings structure from a file (possibly stdin) + * complying to the OpenScop textual format and returns a pointer to this + * structure. + * parameter nb_strings). + * \param[in] file The file where to read the strings structure. + * \return The strings structure that has been read. + */ +osl_strings_p osl_strings_read(FILE * file) { + char buffer[OSL_MAX_STRING], * start; + osl_strings_p strings; + + start = osl_util_skip_blank_and_comments(file, buffer); + strings = osl_strings_sread(&start); + + return strings; +} + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_strings_malloc function: + * This function allocates the memory space for an osl_strings_t + * structure and sets its fields with default values. Then it returns a + * pointer to the allocated space. + * \return A pointer to an empty strings structure with fields set to + * default values. + */ +osl_strings_p osl_strings_malloc() { + osl_strings_p strings; + + OSL_malloc(strings, osl_strings_p, sizeof(osl_strings_t)); + OSL_malloc(strings->string, char**, sizeof(char*)); + strings->string[0] = NULL; + + return strings; +} + + +/** + * osl_strings_free function: + * this function frees the allocated memory for a strings data structure. + * \param[in] strings The strings structure we want to free. + */ +void osl_strings_free(osl_strings_p strings) { + int i; + + if (strings != NULL) { + if (strings->string != NULL) { + i = 0; + while (strings->string[i] != NULL) { + free(strings->string[i]); + i++; + } + free(strings->string); + } + free(strings); + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_strings_clone function. + * this function builds and return a "hard copy" (not a pointer copy) of an + * strings structure provided as parameter. + * \param[in] strings The strings structure to clone. + * \return The clone of the strings structure. + */ +osl_strings_p osl_strings_clone(osl_strings_p strings) { + int i, nb_strings; + osl_strings_p clone = NULL; + + if (strings == NULL) + return NULL; + + clone = osl_strings_malloc(); + if ((nb_strings = osl_strings_size(strings)) == 0) + return clone; + + free(clone->string); + OSL_malloc(clone->string, char **, (nb_strings + 1) * sizeof(char *)); + clone->string[nb_strings] = NULL; + for (i = 0; i < nb_strings; i++) + OSL_strdup(clone->string[i], strings->string[i]); + + return clone; +} + +/** + * osl_strings_find function. + * this function finds the string in the strings. + * \param[in,out] strings The strings structure. + * \param[in] string The string to find in strings. + * \return the index where is the string, osl_strings_size if not found + */ +size_t osl_strings_find(osl_strings_p strings, char const * const string) { + size_t i; + for (i = 0; i < osl_strings_size(strings); ++i) { + if (strcmp(strings->string[i], string) == 0) { return i; } + } + return i; +} + + +/** + * osl_strings_add function. + * this function adds a copy of the string in the strings. + * \param[in,out] strings The strings structure. + * \param[in] string The string to add in strings. + */ +void osl_strings_add(osl_strings_p strings, char const * const string) { + size_t original_size = osl_strings_size(strings); + OSL_realloc(strings->string, char**, sizeof(char*) * (original_size + 1 + 1)); + strings->string[original_size + 1] = NULL; + strings->string[original_size] = malloc(sizeof(char) * (strlen(string) + 1)); + strcpy(strings->string[original_size], string); +} + + +/** + * osl_strings_equal function: + * this function returns true if the two strings structures are the same + * (content-wise), false otherwise. + * \param[in] s1 The first strings structure. + * \param[in] s2 The second strings structure. + * \return 1 if s1 and s2 are the same (content-wise), 0 otherwise. + */ +int osl_strings_equal(osl_strings_p s1, osl_strings_p s2) { + size_t i, nb_s1; + + if (s1 == s2) + return 1; + + if (((s1 == NULL) && (s2 != NULL)) || + ((s1 != NULL) && (s2 == NULL)) || + ((nb_s1 = osl_strings_size(s1)) != osl_strings_size(s2))) + return 0; + + for (i = 0; i < nb_s1; i++) + if (strcmp(s1->string[i], s2->string[i]) != 0) + return 0; + + return 1; +} + + +/** + * osl_strings_size function: + * this function returns the number of elements in the NULL-terminated + * strings array of the strings structure. + * \param[in] strings The strings structure we need to know the size. + * \return The number of strings in the strings structure. + */ +size_t osl_strings_size(osl_const_strings_const_p strings) { + size_t size = 0; + + if ((strings != NULL) && (strings->string != NULL)) { + while (strings->string[size] != NULL) { + size++; + } + } + + return size; +} + + +/** + * osl_strings_encapsulate function: + * this function builds a new strings structure to encapsulate the string + * provided as a parameter (the reference to this string is used directly). + * \param[in] string The string to encapsulate in a strings structure. + * \return A new strings structure containing only the provided string. + */ +osl_strings_p osl_strings_encapsulate(char * string) { + osl_strings_p capsule = osl_strings_malloc(); + free(capsule->string); + OSL_malloc(capsule->string, char **, 2 * sizeof(char *)); + capsule->string[0] = string; + capsule->string[1] = NULL; + + return capsule; +} + + +/** + * osl_strings_interface function: + * this function creates an interface structure corresponding to the strings + * structure and returns it). + * \return An interface structure for the strings structure. + */ +osl_interface_p osl_strings_interface() { + osl_interface_p interface = osl_interface_malloc(); + + OSL_strdup(interface->URI, OSL_URI_STRINGS); + interface->idump = (osl_idump_f)osl_strings_idump; + interface->sprint = (osl_sprint_f)osl_strings_sprint; + interface->sread = (osl_sread_f)osl_strings_sread; + interface->malloc = (osl_malloc_f)osl_strings_malloc; + interface->free = (osl_free_f)osl_strings_free; + interface->clone = (osl_clone_f)osl_strings_clone; + interface->equal = (osl_equal_f)osl_strings_equal; + + return interface; +} + + +/** + * osl_strings_generate function: + * this function generates a new strings structure containing + * 'nb_strings' strings of the form "prefixXX" where XX goes from 1 to + * nb_strings. + * \param[in] prefix The prefix of the generated strings. + * \param[in] nb_strings The number of strings to generate. + * \return A new strings structure containing generated strings. + */ +osl_strings_p osl_strings_generate(char * prefix, int nb_strings) { + char ** strings = NULL; + char buff[strlen(prefix) + 16]; // TODO: better (log10(INT_MAX) ?) :-D. + int i; + osl_strings_p generated; + + if (nb_strings) { + OSL_malloc(strings, char **, sizeof(char *) * (nb_strings + 1)); + strings[nb_strings] = NULL; + for (i = 0; i < nb_strings; i++) { + sprintf(buff, "%s%d", prefix, i + 1); + OSL_strdup(strings[i], buff); + if (strings[i] == NULL) + OSL_error("memory overflow"); + } + } + + generated = osl_strings_malloc(); + free(generated->string); + generated->string = strings; + return generated; +} diff -Nru cloog-0.18.2/osl/source/util.c cloog-0.18.4/osl/source/util.c --- cloog-0.18.2/osl/source/util.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/util.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,721 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** util.c ** + **-----------------------------------------------------------------** + ** First version: 08/10/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#include +#include +#include +#include + +#include +#include + + +/*+*************************************************************************** + * Utility functions * + *****************************************************************************/ + + +/** + * osl_util_skip_blank_and_comments "file skip" function: + * this function reads the open file 'file' line by line and skips + * blank/comment lines and spaces. The first line where there is some + * useful information is stored at the address 'str' (the memory to + * store the line must be allocated before the call to this function + * and must be at least OSL_MAX_STRING * sizeof(char)). The pointer + * to the first useful information in this line is returned by the + * function. + * \param[in] file The (opened) file to read. + * \param[in] str Address of an allocated space to store the first line + * that contains useful information. + * \return The address of the first useful digit in str. + */ +char * osl_util_skip_blank_and_comments(FILE * file, char * str) { + char * start; + + do { + start = fgets(str, OSL_MAX_STRING, file); + while ((start != NULL) && isspace(*start) && (*start != '\n')) + start++; + } + while (start != NULL && (*start == '#' || *start == '\n')); + + return start; +} + + +/** + * osl_util_sskip_blank_and_comments "string skip" function: + * this function updates the str pointer, which initialy points to a string, + * to the first character in this string which is not a space or a comment + * (comments start at '#' and end at '\n'), or to the end of string. + * \param[in,out] str Address of a string, updated to the address of + * the first non-space or comment character. + */ +void osl_util_sskip_blank_and_comments(char ** str) { + do { + // Skip spaces/blanc lines. + while (*str && **str && isspace(**str)) + (*str)++; + + // Skip the comment if any. + if (*str && **str && **str == '#') { + while (**str && **str != '\n') { + (*str)++; + } + } + } + while (*str && **str && **str == '\n'); +} + + +/** + * osl_util_read_int function: + * reads an int on the input 'file' or the input string 'str' depending on + * which one is not NULL (exactly one of them must not be NULL). + * \param[in] file The file where to read an int (if not NULL). + * \param[in,out] str The string where to read an int (if not NULL). This + * pointer is updated to reflect the read and points + * after the int in the input string. + * \return The int that has been read. + */ +int osl_util_read_int(FILE * file, char ** str) { + char s[OSL_MAX_STRING], * start; + int res; + int i = 0; + + if ((file != NULL && str != NULL) || (file == NULL && str == NULL)) + OSL_error("one and only one of the two parameters can be non-NULL"); + + if (file != NULL) { + // Parse from a file. + start = osl_util_skip_blank_and_comments(file, s); + if (sscanf(start, " %d", &res) != 1) + OSL_error("an int was expected"); + } + else { + // Parse from a string. + // Skip blank/commented lines. + osl_util_sskip_blank_and_comments(str); + + // Build the chain to analyze. + while (**str && !isspace(**str) && **str != '\n' && **str != '#') + s[i++] = *((*str)++); + s[i] = '\0'; + if (sscanf(s, "%d", &res) != 1) + OSL_error("an int was expected"); + } + + return res; +} + + +/** + * osl_util_read_string function: + * reads a string on the input 'file' or the input string 'str' depending on + * which one is not NULL (exactly one of them must not be NULL). + * \param[in] file The file where to read a string (if not NULL). + * \param[in,out] str The string where to read a string (if not NULL). This + * pointer is updated to reflect the read and points + * after the string in the input string. + * \return The string that has been read. + */ +char * osl_util_read_string(FILE * file, char ** str) { + char s[OSL_MAX_STRING], * start; + char * res; + int i = 0; + + if ((file != NULL && str != NULL) || (file == NULL && str == NULL)) + OSL_error("one and only one of the two parameters can be non-NULL"); + + OSL_malloc(res, char *, OSL_MAX_STRING * sizeof(char)); + if (file != NULL) { + // Parse from a file. + start = osl_util_skip_blank_and_comments(file, s); + if (sscanf(start, " %s", res) != 1) + OSL_error("a string was expected"); + } + else { + // Parse from a string. + // Skip blank/commented lines. + osl_util_sskip_blank_and_comments(str); + + // Build the chain to analyze. + while (**str && !isspace(**str) && **str != '\n' && **str != '#') + s[i++] = *((*str)++); + s[i] = '\0'; + if (sscanf(s, "%s", res) != 1) + OSL_error("a string was expected"); + } + + OSL_realloc(res, char *, strlen(res) + 1); + return res; +} + + +/** + * osl_util_read_line function: + * reads a line on the input 'file' or the input string 'str' depending on + * which one is not NULL (exactly one of them must not be NULL). A line + * is defined as the array of characters before the comment tag or the end of + * line (it may include spaces). + * \param[in] file The file where to read a line (if not NULL). + * \param[in,out] str The string where to read a line (if not NULL). This + * pointer is updated to reflect the read and points + * after the line in the input string. + * \return The line that has been read. + */ +char * osl_util_read_line(FILE * file, char ** str) { + char s[OSL_MAX_STRING], * start; + char * res; + int i = 0; + + if ((file != NULL && str != NULL) || (file == NULL && str == NULL)) + OSL_error("one and only one of the two parameters can be non-NULL"); + + OSL_malloc(res, char *, OSL_MAX_STRING * sizeof(char)); + if (file != NULL) { + // Parse from a file. + start = osl_util_skip_blank_and_comments(file, s); + while (*start && *start != '\n' && *start != '#' && i < OSL_MAX_STRING) + res[i++] = *start++; + } + else { + // Parse from a string. + osl_util_sskip_blank_and_comments(str); + while (**str && **str != '\n' && **str != '#' && i < OSL_MAX_STRING) + res[i++] = *((*str)++); + } + + res[i] = '\0'; + OSL_realloc(res, char *, strlen(res) + 1); + return res; +} + + +/** + * osl_util_read_int internal function: + * reads a tag (the form of a tag with name "name" is \) on the input + * 'file' or the input string 'str' depending on which one is not NULL (exactly + * one of them must not be NULL). It returns the name of the tag (thus without + * the < and > as a string. Note that in the case of an ending tag, e.g., + * \, the slash is returned as a part of the name, e.g., /foo. If no + * tag is found the function returns NULL. + * \param[in] file The file where to read a tag (if not NULL). + * \param[in,out] str The string where to read a tag (if not NULL). This + * pointer is updated to reflect the read and points + * after the tag in the input string. + * \return The tag name that has been read. + */ +char * osl_util_read_tag(FILE * file, char ** str) { + char s[OSL_MAX_STRING], * start; + char * res; + int i = 0; + + if ((file != NULL && str != NULL) || (file == NULL && str == NULL)) + OSL_error("one and only one of the two parameters can be non-NULL"); + + // Skip blank/commented lines. + if (file != NULL) { + start = osl_util_skip_blank_and_comments(file, s); + str = &start; + } + else { + osl_util_sskip_blank_and_comments(str); + } + + // If the end of the input has been reached, return NULL. + if (((file != NULL) && (feof(file))) || + ((str != NULL) && (**str == '\0'))) + return NULL; + + // Pass the starting '<'. + if (**str != '<') + OSL_error("a \"<\" to start a tag was expected"); + (*str)++; + + // Read the tag. + OSL_malloc(res, char *, (OSL_MAX_STRING + 1) * sizeof(char)); + res[OSL_MAX_STRING] = '\0'; + + while (**str && **str != '>') { + if (((**str >= 'A') && (**str <= 'Z')) || + ((**str >= 'a') && (**str <= 'z')) || + ((**str == '/') && (i == 0)) || + (**str == '_')) { + res[i++] = *((*str)++); + res[i] = '\0'; + } + else { + OSL_error("illegal character in the tag name"); + } + } + + // Check we actually end up with a '>' and pass it. + if (**str != '>') + OSL_error("a \">\" to end a tag was expected"); + (*str)++; + + return res; +} + + +/** + * osl_util_read_uptoflag function: + * this function reads a string up to a given flag (the flag is read) + * on the input 'file' or the input string 'str' depending on which one is + * not NULL (exactly one of them must not be NULL) and returns that string + * without the flag. It returns NULL if the flag is not found. + * \param[in] file The file where to read up to flag (if not NULL). + * \param[in,out] str The string where to read up to flag (if not NULL). This + * pointer is updated to reflect the read and points + * after the flag in the input string. + * \param[in] flag The flag which, when reached, stops the reading. + * \return The string that has been read. + */ +char * osl_util_read_uptoflag(FILE * file, char ** str, char * flag) { + int high_water_mark = OSL_MAX_STRING; + int nb_chars = 0; + int lenflag = strlen(flag), lenstr; + int flag_found = 0; + char * res; + + if ((file != NULL && str != NULL) || (file == NULL && str == NULL)) + OSL_error("one and only one of the two parameters can be non-NULL"); + + OSL_malloc(res, char *, high_water_mark * sizeof(char)); + + // Copy everything to the res string. + if (str != NULL) + lenstr = strlen(*str); + while (((str != NULL) && (nb_chars != lenstr)) || + ((file != NULL) && (!feof(file)))) { + res[nb_chars++] = (str != NULL) ? *((*str)++) : fgetc(file); + + if ((nb_chars >= lenflag) && + (!strncmp(&res[nb_chars - lenflag], flag, lenflag))) { + flag_found = 1; + break; + } + + if (nb_chars >= high_water_mark) { + high_water_mark += high_water_mark; + OSL_realloc(res, char *, high_water_mark * sizeof(char)); + } + } + + if (!flag_found) { + OSL_debug("flag was not found, end of input reached"); + free(res); + return NULL; + } + + // - 0-terminate the string. + OSL_realloc(res, char *, (nb_chars - strlen(flag) + 1) * sizeof(char)); + res[nb_chars - strlen(flag)] = '\0'; + + return res; +} + + +/** + * osl_util_read_uptotag function: + * this function reads a string up to a given (start) tag (the tag is read) + * on the input 'file' or the input string 'str' depending on which one is + * not NULL (exactly one of them must not be NULL) and returns that string + * without the tag. It returns NULL if the tag is not found. + * \param[in] file The file where to read up to tag (if not NULL). + * \param[in,out] str The string where to read up to tag (if not NULL). + * This pointer is updated to reflect the read and points + * after the tag in the input string. + * \param[in] name The name of the tag to the file reading. + * \return The string that has been read from the file. + */ +char * osl_util_read_uptotag(FILE * file, char ** str, char * name) { + char tag[strlen(name) + 3]; + + sprintf(tag, "<%s>", name); + return osl_util_read_uptoflag(file, str, tag); +} + + +/** + * osl_util_read_uptoendtag function: + * this function reads a string up to a given end tag (the end tag is read) + * on the input 'file' or the input string 'str' depending on which one is + * not NULL (exactly one of them must not be NULL) and returns that string + * without the end tag. It returns NULL if the end tag is not found. + * \param[in] file The file where to read up to end tag (if not NULL). + * \param[in,out] str The string where to read up to end tag (if not NULL). + * This pointer is updated to reflect the read and points + * after the end tag in the input string. + * \param[in] name The name of the end tag to the file reading. + * \return The string that has been read from the file. + */ +char * osl_util_read_uptoendtag(FILE * file, char ** str, char * name) { + char endtag[strlen(name) + 4]; + + sprintf(endtag, "", name); + return osl_util_read_uptoflag(file, str, endtag); +} + + +/** + * osl_util_tag_content function: + * this function returns a freshly allocated string containing the + * content, in the given string 'str', between the tag '\' and + * the tag '\'. If the tag '\' is not found, it returns NULL. + * \param[in] str The string where to find a given content. + * \param[in] name The name of the tag we are looking for. + * \return The string between '\' and '\' in 'str'. + */ +char * osl_util_tag_content(char * str, char * name) { + int i; + char * start; + char * stop; + char tag[strlen(name) + 3]; + char endtag[strlen(name) + 4]; + int size = 0; + size_t lentag; + char * res = NULL; + + sprintf(tag, "<%s>", name); + sprintf(endtag, "", name); + + if (str) { + start = str; + lentag = strlen(tag); + for (; start && *start && strncmp(start, tag, lentag); ++start) + continue; + + // The tag 'tag' was not found. + if (! *start) + return NULL; + start += lentag; + stop = start; + lentag = strlen(endtag); + for (size = 0; *stop && strncmp(stop, endtag, lentag); ++stop, ++size) + continue; + + // the tag 'endtag' was not found. + if (! *stop) + return NULL; + OSL_malloc(res, char *, (size + 1) * sizeof(char)); + + // Copy the chain between the two tags. + for (++start, i = 0; start != stop; ++start, ++i) + res[i] = *start; + res[i] = '\0'; + } + + return res; +} + + +/** + * osl_util_safe_strcat function: + * this function concatenates the string src to the string *dst + * and reallocates *dst if necessary. The current size of the + * *dst buffer must be *hwm (high water mark), if there is some + * reallocation, this value is updated. + * \param[in,out] dst pointer to the destination string (may be reallocated). + * \param[in] src string to concatenate to dst. + * \param[in,out] hwm pointer to the size of the *dst buffer (may be updated). + */ +void osl_util_safe_strcat(char ** dst, char * src, int * hwm) { + + while ((int)(strlen(*dst) + strlen(src)) >= *hwm) { + *hwm += OSL_MAX_STRING; + OSL_realloc(*dst, char *, *hwm * sizeof(char)); + } + + strcat(*dst, src); +} + + +/** + * \brief String duplicate + * + * osl_util_strdup function: + * this function return a copy of the string str. + * + * \param[in] str string to be copied. + * + * \return a copy of the string + */ +char * osl_util_strdup(char const * str) { + char * dup = NULL; + OSL_malloc(dup, char *, (strlen(str) + 1) * sizeof(char)); + if (dup) { strcpy(dup, str); } + return dup; +} + + +/** + * osl_util_get_precision function: + * this function returns the precision defined by the precision environment + * variable or the highest available precision if it is not defined. + * \return environment precision if defined or highest available precision. + */ +int osl_util_get_precision() { + int precision = OSL_PRECISION_DP; + char * precision_env; + +#ifdef OSL_GMP_IS_HERE + precision = OSL_PRECISION_MP; +#endif + + precision_env = getenv(OSL_PRECISION_ENV); + if (precision_env != NULL) { + if (!strcmp(precision_env, OSL_PRECISION_ENV_SP)) + precision = OSL_PRECISION_SP; + else if (!strcmp(precision_env, OSL_PRECISION_ENV_DP)) + precision = OSL_PRECISION_DP; + else if (!strcmp(precision_env, OSL_PRECISION_ENV_MP)) { +#ifndef OSL_GMP_IS_HERE + OSL_warning("$OSL_PRECISION says GMP but osl not compiled with " + "GMP support, switching to double precision"); + precision = OSL_PRECISION_DP; +#else + precision = OSL_PRECISION_MP; +#endif + } + else + OSL_warning("bad OSL_PRECISION environment value, see osl's manual"); + } + + return precision; +} + + +/** + * osl_util_print_provided function: + * this function prints a "provided" boolean in a file (file, possibly stdout), + * with a comment title according to the OpenScop specification. + * \param[in] file File where the information has to be printed. + * \param[in] provided The provided boolean to print. + * \param[in] title A string to use as a title for the provided booblean. + */ +void osl_util_print_provided(FILE * file, int provided, char * title) { + if (provided) { + fprintf(file, "# %s provided\n", title); + fprintf(file, "1\n"); + } + else { + fprintf(file, "# %s not provided\n", title); + fprintf(file, "0\n\n"); + } +} + + +/** + * osl_util_identifier_is_here function: + * this function returns 1 if the input "identifier" is found at the + * "index" position in the "expression" input string, 0 otherwise. + * \param[in] expression The input expression. + * \param[in] identifier The identifier to look for. + * \param[in] index The position in the expression where to look. + * \return 1 if the identifier is found at the position in the expression. + */ +static +int osl_util_identifier_is_here(char * expression, char * identifier, + int index) { + // If there is no space enough to find the identifier: no. + if (strlen(identifier) + index > strlen(expression)) + return 0; + + // If there is a character before and it is in [A-Za-z0-9]: no. + if ((index > 0) && + (((expression[index - 1] >= 'A') && (expression[index - 1] <= 'Z')) || + ((expression[index - 1] >= 'a') && (expression[index - 1] <= 'z')) || + ((expression[index - 1] >= '0') && (expression[index - 1] <= '9')))) + return 0; + + // If there is a character after and it is in [A-Za-z0-9]: no. + if ((strlen(identifier) + index < strlen(expression)) && + (((expression[strlen(identifier) + index] >= 'A') && + (expression[strlen(identifier) + index] <= 'Z')) || + ((expression[strlen(identifier) + index] >= 'a') && + (expression[strlen(identifier) + index] <= 'z')) || + ((expression[strlen(identifier) + index] >= '0') && + (expression[strlen(identifier) + index] <= '9')))) + return 0; + + // If the identifier string is not here: no. + if (strncmp(expression + index, identifier, strlen(identifier))) + return 0; + + return 1; +} + + +/** + * osl_util_lazy_isolated_identifier function: + * this function returns 1 if the identifier at the "index" position in the + * "expression" is guaranteed not to need parenthesis around is we + * substitute it with anything. For instance the identifier "i" can be + * always substituted in "A[i]" with no need of parenthesis but not in + * "A[2*i]". This function is lazy in the sense that it just check obvious + * cases, not all of them. The identifier must already be at the indicated + * position, this function does not check that. + * \param[in] expression The input expression. + * \param[in] identifier The identifier to check. + * \param[in] index The position of the identifier in the expression. + * \return 1 if the identifier is isolated, 0 if unsure. + */ +static +int osl_util_lazy_isolated_identifier(char * expression, char * identifier, + int index) { + int look; + + // If the first non-space character before is not in [\[(,\+=]: no. + look = index - 1; + while (look >= 0) { + if (isspace(expression[look])) + look--; + else + break; + } + + if ((look >= 0) && + (expression[look] != '[') && + (expression[look] != '(') && + (expression[look] != '+') && + (expression[look] != '=') && + (expression[look] != ',')) + return 0; + + // If the first non-space character after is not in [\]),;\+]: no. + look = index + strlen(identifier); + while (look < (int)strlen(expression)) { + if (isspace(expression[look])) + look++; + else + break; + } + + if ((look < (int)strlen(expression)) && + (expression[look] != ']') && + (expression[look] != ')') && + (expression[look] != '+') && + (expression[look] != ',') && + (expression[look] != ';')) + return 0; + + return 1; +} + + +/** + * osl_util_identifier_substitution function: + * this function replaces some identifiers in an input expression string and + * returns the final string. The list of identifiers to replace are provided + * as an array of strings. They are replaced from the input string with the + * new substring "@i@" or "(@i@)" where i is the rank of the identifier in the + * array of identifiers. The parentheses are added when it is not obvious that + * the identifier can be replaced with an arbitrary expression without the + * need of parentheses. For instance, let us consider the input expression + * "C[i+j]+=A[2*i]*B[j];" and the array of strings {"i", "j"}: the resulting + * string would be "C[@0@+@1@]+=A[2*(@0@)]*B[@1@];". + * \param[in] expression The original expression. + * \param[in] identifiers NULL-terminated array of identifiers. + * \return A new string where the ith identifier is replaced by \@i\@. + */ +char * osl_util_identifier_substitution(char * expression, + char ** identifiers) { + size_t index; + int j, found; + int high_water_mark = OSL_MAX_STRING; + char buffer[OSL_MAX_STRING]; + char * string; + + OSL_malloc(string, char *, high_water_mark * sizeof(char)); + string[0] = '\0'; + + index = 0; + while (index < strlen(expression)) { + j = 0; + found = 0; + while (identifiers[j] != NULL) { + if (osl_util_identifier_is_here(expression, identifiers[j], index)) { + if (osl_util_lazy_isolated_identifier(expression,identifiers[j],index)) + sprintf(buffer, "@%d@", j); + else + sprintf(buffer, "(@%d@)", j); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + index += strlen(identifiers[j]); + found = 1; + break; + } + j++; + } + if (!found) { + sprintf(buffer, "%c", expression[index]); + osl_util_safe_strcat(&string, buffer, &high_water_mark); + index++; + } + } + + return string; +} + + + diff -Nru cloog-0.18.2/osl/source/vector.c cloog-0.18.4/osl/source/vector.c --- cloog-0.18.2/osl/source/vector.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/source/vector.c 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,387 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** vector.c ** + **-----------------------------------------------------------------** + ** First version: 30/04/2008 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + + +#include +#include +#include + +#include +#include +#include +#include + + +/*+*************************************************************************** + * Structure display function * + *****************************************************************************/ + + +/** + * osl_vector_idump function: + * Displays a osl_vector_t structure (*vector) into a file (file, possibly + * stdout) in a way that trends to be understandable without falling in a deep + * depression or, for the lucky ones, getting a headache... It includes an + * indentation level (level) in order to work with others idump functions. + * \param[in] file File where informations are printed. + * \param[in] vector The vector whose information have to be printed. + * \param[in] level Number of spaces before printing, for each line. + */ +void osl_vector_idump(FILE * file, osl_vector_p vector, int level) { + int j; + + if (vector != NULL) { + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file,"|\t"); + fprintf(file,"+-- osl_vector_t ("); + osl_int_dump_precision(file, vector->precision); + fprintf(file, ")\n"); + + for (j = 0; j <= level; j++) + fprintf(file,"|\t"); + fprintf(file,"%d\n", vector->size); + + // Display the vector. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + + fprintf(file, "[ "); + + for (j = 0; j < vector->size; j++) { + osl_int_print(file, vector->precision, vector->v[j]); + fprintf(file, " "); + } + + fprintf(file, "]\n"); + } + else { + // Go to the right level. + for (j = 0; j < level; j++) + fprintf(file, "|\t"); + fprintf(file, "+-- NULL vector\n"); + } + + // The last line. + for (j = 0; j <= level; j++) + fprintf(file, "|\t"); + fprintf(file, "\n"); +} + + +/** + * osl_vector_dump function: + * This function prints the content of a osl_vector_t structure + * (*vector) into a file (file, possibly stdout). + * \param[in] file File where informations are printed. + * \param[in] vector The vector whose information have to be printed. + */ +void osl_vector_dump(FILE * file, osl_vector_p vector) { + osl_vector_idump(file, vector, 0); +} + + +/*+*************************************************************************** + * Memory allocation/deallocation function * + *****************************************************************************/ + + +/** + * osl_vector_pmalloc function: + * (precision malloc) this function allocates the memory space for an + * osl_vector_t structure and sets its fields with default values. Then + * it returns a pointer to the allocated space. + * \param[in] precision The precision of the vector entries. + * \param[in] size The number of entries of the vector to allocate. + * \return A pointer to the newly allocated osl_vector_t structure. + */ +osl_vector_p osl_vector_pmalloc(int precision, int size) { + osl_vector_p vector; + int i; + + OSL_malloc(vector, osl_vector_p, sizeof(osl_vector_t)); + vector->size = size; + vector->precision = precision; + if (size == 0) { + vector->v = NULL; + } + else { + OSL_malloc(vector->v, osl_int_t*, size * sizeof(osl_int_t)); + for (i = 0; i < size; i++) + osl_int_init_set_si(precision, &vector->v[i], 0); + } + return vector; +} + + +/** + * osl_vector_malloc function: + * This function allocates the memory space for a osl_vector_t structure + * and sets its fields with default values. Then it returns a pointer to the + * allocated space. The precision of the vector elements corresponds to the + * precision environment variable or to the highest available precision if it + * is not defined. + * \param[in] size The number of entries of the vector to allocate. + * \return A pointer to the newly allocated osl_vector_t structure. + */ +osl_vector_p osl_vector_malloc(int size) { + int precision = osl_util_get_precision(); + return osl_vector_pmalloc(precision, size); +} + + +/** + * osl_vector_free function: + * This function frees the allocated memory for a osl_vector_t structure. + * \param[in] vector The pointer to the vector we want to free. + */ +void osl_vector_free(osl_vector_p vector) { + int i; + + if (vector != NULL) { + if (vector->v != NULL) { + for (i = 0; i < vector->size; i++) + osl_int_clear(vector->precision, &vector->v[i]); + + free(vector->v); + } + free(vector); + } +} + + +/*+*************************************************************************** + * Processing functions * + *****************************************************************************/ + + +/** + * osl_vector_add_scalar function: + * This function adds a scalar to the vector representation of an affine + * expression (this means we add the scalar only to the very last entry of the + * vector). It returns a new vector resulting from this addition. + * \param[in] vector The basis vector. + * \param[in] scalar The scalar to add to the vector. + * \return A pointer to a new vector, copy of the basis one plus the scalar. + */ +osl_vector_p osl_vector_add_scalar(osl_vector_p vector, int scalar) { + int i, precision, last; + osl_vector_p result; + + if ((vector == NULL) || (vector->size < 2)) + OSL_error("incompatible vector for addition"); + + precision = vector->precision; + last = vector->size - 1; + + result = osl_vector_pmalloc(precision, vector->size); + for (i = 0; i < vector->size; i++) + osl_int_assign(precision, &result->v[i], vector->v[i]); + osl_int_add_si(precision, &result->v[last], vector->v[last], scalar); + + return result; +} + + +/** + * osl_vector_add function: + * This function achieves the addition of two vectors and returns the + * result as a new vector (the addition means the ith entry of the new vector + * is equal to the ith entry of vector v1 plus the ith entry of vector v2). + * \param v1 The first vector for the addition. + * \param v2 The second vector for the addition. + * \return A pointer to a new vector, corresponding to v1 + v2. + */ +osl_vector_p osl_vector_add(osl_vector_p v1, osl_vector_p v2) { + int i; + osl_vector_p v3; + + if ((v1 == NULL) || (v2 == NULL) || + (v1->size != v2->size) || (v1->precision != v2->precision)) + OSL_error("incompatible vectors for addition"); + + v3 = osl_vector_pmalloc(v1->precision, v1->size); + for (i = 0; i < v1->size; i++) + osl_int_add(v1->precision, &v3->v[i], v1->v[i], v2->v[i]); + + return v3; +} + + +/** + * osl_vector_sub function: + * This function achieves the subtraction of two vectors and returns the + * result as a new vector (the addition means the ith entry of the new vector + * is equal to the ith entry of vector v1 minus the ith entry of vector v2). + * \param v1 The first vector for the subtraction. + * \param v2 The second vector for the subtraction (result is v1-v2). + * \return A pointer to a new vector, corresponding to v1 - v2. + */ +osl_vector_p osl_vector_sub(osl_vector_p v1, osl_vector_p v2) { + int i; + osl_vector_p v3; + + if ((v1 == NULL) || (v2 == NULL) || + (v1->size != v2->size) || (v1->precision != v2->precision)) + OSL_error("incompatible vectors for subtraction"); + + v3 = osl_vector_pmalloc(v1->precision, v1->size); + for (i = 0; i < v1->size; i++) + osl_int_sub(v1->precision, &v3->v[i], v1->v[i], v2->v[i]); + + return v3; +} + + +/** + * osl_vector_tag_inequality function: + * This function tags a vector representation of a contraint as being an + * inequality >=0. This means in the PolyLib format, to set to 1 the very + * first entry of the vector. It modifies directly the vector provided as + * an argument. + * \param vector The vector to be tagged. + */ +void osl_vector_tag_inequality(osl_vector_p vector) { + if ((vector == NULL) || (vector->size < 1)) + OSL_error("vector cannot be tagged"); + osl_int_set_si(vector->precision, &vector->v[0], 1); +} + + +/** + * osl_vector_tag_equality function: + * This function tags a vector representation of a contraint as being an + * equality ==0. This means in the PolyLib format, to set to 0 the very + * first entry of the vector. It modifies directly the vector provided as + * an argument. + * \param vector The vector to be tagged. + */ +void osl_vector_tag_equality(osl_vector_p vector) { + if ((vector == NULL) || (vector->size < 1)) + OSL_error("vector cannot be tagged"); + osl_int_set_si(vector->precision, &vector->v[0], 0); +} + + +/** + * osl_vector_equal function: + * this function returns true if the two vectors are the same, false + * otherwise. + * \param v1 The first vector. + * \param v2 The second vector. + * \return 1 if v1 and v2 are the same (content-wise), 0 otherwise. + */ +int osl_vector_equal(osl_vector_p v1, osl_vector_p v2) { + int i; + + if (v1 == v2) + return 1; + + if ((v1->size != v2->size) || (v1->precision != v2->precision)) + return 0; + + for (i = 0; i < v1->size; i++) + if (osl_int_ne(v1->precision, v1->v[i], v2->v[i])) + return 0; + + return 1; +} + + +/** + * osl_vector_mul_scalar function: + * this function returns a new vector corresponding to the one provided + * as parameter with each entry multiplied by a scalar. + * \param v The vector to multiply. + * \param scalar The scalar coefficient. + * \return A new vector corresponding to scalar * v. + */ +osl_vector_p osl_vector_mul_scalar(osl_vector_p v, int scalar) { + int i; + osl_vector_p result = osl_vector_pmalloc(v->precision, v->size); + + for (i = 0; i < v->size; i++) + osl_int_mul_si(v->precision, &result->v[i], v->v[i], scalar); + + return result; +} + + +/** + * osl_vector_is_scalar function: + * this function returns 1 if the vector represents a scalar value + * (all but its last element is 0), 0 otherwise. + * \param[in] vector The vector to check whether it is scalar or not. + * \return 1 if the vector is scalar, 0 otherwise. + */ +int osl_vector_is_scalar(osl_vector_p vector) { + int i; + + if (vector == NULL) + return 0; + + for (i = 0; i < vector->size - 1; i++) + if (!osl_int_zero(vector->precision, vector->v[i])) + return 0; + return 1; +} + diff -Nru cloog-0.18.2/osl/tests/Makefile.am cloog-0.18.4/osl/tests/Makefile.am --- cloog-0.18.2/osl/tests/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/Makefile.am 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,110 @@ +# +# /*+------------------------------------------------------------------** +# ** OpenScop Library ** +# **------------------------------------------------------------------** +# ** makefile.am ** +# **------------------------------------------------------------------** +# ** First version: 01/10/2010 ** +# **------------------------------------------------------------------** +# +# +# *************************************************************************** +# * OpenScop: Structures and formats for polyhedral tools to talk together * +# *************************************************************************** +# * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * +# * / / / // // // // / / / // // / / // / /|,_, * +# * / / / // // // // / / / // // / / // / / / /\ * +# * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * +# * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * +# * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * +# * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * +# * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * +# * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * +# * | I | | | | e | | | | | | | | | | | | | \ \ \ * +# * | T | | | | | | | | | | | | | | | | | \ \ \ * +# * | E | | | | | | | | | | | | | | | | | \ \ \ * +# * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * +# * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * +# * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * +# * * +# * Copyright (C) 2008 University Paris-Sud 11 and INRIA * +# * * +# * (3-clause BSD license) * +# * Redistribution and use in source and binary forms, with or without * +# * modification, are permitted provided that the following conditions * +# * are met: * +# * * +# * 1. Redistributions of source code must retain the above copyright * +# * notice, this list of conditions and the following disclaimer. * +# * 2. Redistributions in binary form must reproduce the above copyright * +# * notice, this list of conditions and the following disclaimer in the * +# * documentation and/or other materials provided with the distribution. * +# * 3. The name of the author may not be used to endorse or promote * +# * products derived from this software without specific prior written * +# * permission. * +# * * +# * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * +# * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +# * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +# * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, * +# * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +# * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * +# * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * +# * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * +# * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * +# * POSSIBILITY OF SUCH DAMAGE. * +# * * +# * OpenScop Library, a library to manipulate OpenScop formats and data * +# * structures. Written by: * +# * Cedric Bastoul and * +# * Louis-Noel Pouchet * +# * * +# ***************************************************************************/ +# +# Makefile.am (or makefile if generated) of the OpenScop Library. +# Makefile.am is not a makefile, you must run the 'autogen.sh' THEN the +# configure shellscript to generate the Makefile thanks to this file. + + +############################################################################# +SUBDIRS = + +############################################################################# +MAINTAINERCLEANFILES = Makefile.in + +############################################################################# + +noinst_PROGRAMS = osl_test osl_int osl_pluto_unroll osl_relation_set_precision + +TESTS = osl_test osl_int osl_pluto_unroll osl_relation_set_precision + +osl_test_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -static +osl_int_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -static +osl_pluto_unroll_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -static +osl_relation_set_precision_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -static + +osl_test_LDADD = ../libosl.la +osl_int_LDADD = ../libosl.la +osl_pluto_unroll_LDADD = ../libosl.la +osl_relation_set_precision_LDADD = ../libosl.la + +osl_test_SOURCES = \ + osl_test.c \ + polynom.scop \ + test_empty_statement.scop \ + test_just_access.scop \ + test_just_body.scop \ + test_just_extbody.scop \ + test_just_domain.scop \ + test_just_scattering.scop \ + test_coordinates.scop \ + test_matmult.scop \ + test_clay.scop \ + test_no_statement.scop \ + test_scop_list.scop +osl_int_SOURCES = osl_int.c +osl_pluto_unroll_SOURCES = osl_pluto_unroll.c +osl_relation_set_precision_SOURCES = osl_relation_set_precision.c + +MAINTAINERCLEANFILE = ../autoconf/texinfo.tex diff -Nru cloog-0.18.2/osl/tests/Makefile.in cloog-0.18.4/osl/tests/Makefile.in --- cloog-0.18.2/osl/tests/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/Makefile.in 2015-07-24 11:59:27.000000000 +0000 @@ -0,0 +1,1279 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# /*+------------------------------------------------------------------** +# ** OpenScop Library ** +# **------------------------------------------------------------------** +# ** makefile.am ** +# **------------------------------------------------------------------** +# ** First version: 01/10/2010 ** +# **------------------------------------------------------------------** +# +# +# *************************************************************************** +# * OpenScop: Structures and formats for polyhedral tools to talk together * +# *************************************************************************** +# * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * +# * / / / // // // // / / / // // / / // / /|,_, * +# * / / / // // // // / / / // // / / // / / / /\ * +# * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * +# * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * +# * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * +# * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * +# * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * +# * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * +# * | I | | | | e | | | | | | | | | | | | | \ \ \ * +# * | T | | | | | | | | | | | | | | | | | \ \ \ * +# * | E | | | | | | | | | | | | | | | | | \ \ \ * +# * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * +# * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * +# * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * +# * * +# * Copyright (C) 2008 University Paris-Sud 11 and INRIA * +# * * +# * (3-clause BSD license) * +# * Redistribution and use in source and binary forms, with or without * +# * modification, are permitted provided that the following conditions * +# * are met: * +# * * +# * 1. Redistributions of source code must retain the above copyright * +# * notice, this list of conditions and the following disclaimer. * +# * 2. Redistributions in binary form must reproduce the above copyright * +# * notice, this list of conditions and the following disclaimer in the * +# * documentation and/or other materials provided with the distribution. * +# * 3. The name of the author may not be used to endorse or promote * +# * products derived from this software without specific prior written * +# * permission. * +# * * +# * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * +# * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +# * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +# * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, * +# * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +# * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * +# * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * +# * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * +# * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * +# * POSSIBILITY OF SUCH DAMAGE. * +# * * +# * OpenScop Library, a library to manipulate OpenScop formats and data * +# * structures. Written by: * +# * Cedric Bastoul and * +# * Louis-Noel Pouchet * +# * * +# ***************************************************************************/ +# +# Makefile.am (or makefile if generated) of the OpenScop Library. +# Makefile.am is not a makefile, you must run the 'autogen.sh' THEN the +# configure shellscript to generate the Makefile thanks to this file. + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = osl_test$(EXEEXT) osl_int$(EXEEXT) \ + osl_pluto_unroll$(EXEEXT) osl_relation_set_precision$(EXEEXT) +TESTS = osl_test$(EXEEXT) osl_int$(EXEEXT) osl_pluto_unroll$(EXEEXT) \ + osl_relation_set_precision$(EXEEXT) +subdir = tests +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/autoconf/depcomp \ + $(top_srcdir)/autoconf/test-driver +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cc_maxopt.m4 \ + $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ + $(top_srcdir)/m4/ax_check_compiler_flags.m4 \ + $(top_srcdir)/m4/ax_compiler_vendor.m4 \ + $(top_srcdir)/m4/ax_gcc_archflag.m4 \ + $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ + $(top_srcdir)/m4/ax_submodule.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_osl_int_OBJECTS = osl_int-osl_int.$(OBJEXT) +osl_int_OBJECTS = $(am_osl_int_OBJECTS) +osl_int_DEPENDENCIES = ../libosl.la +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am_osl_pluto_unroll_OBJECTS = \ + osl_pluto_unroll-osl_pluto_unroll.$(OBJEXT) +osl_pluto_unroll_OBJECTS = $(am_osl_pluto_unroll_OBJECTS) +osl_pluto_unroll_DEPENDENCIES = ../libosl.la +am_osl_relation_set_precision_OBJECTS = osl_relation_set_precision-osl_relation_set_precision.$(OBJEXT) +osl_relation_set_precision_OBJECTS = \ + $(am_osl_relation_set_precision_OBJECTS) +osl_relation_set_precision_DEPENDENCIES = ../libosl.la +am_osl_test_OBJECTS = osl_test-osl_test.$(OBJEXT) +osl_test_OBJECTS = $(am_osl_test_OBJECTS) +osl_test_DEPENDENCIES = ../libosl.la +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(osl_int_SOURCES) $(osl_pluto_unroll_SOURCES) \ + $(osl_relation_set_precision_SOURCES) $(osl_test_SOURCES) +DIST_SOURCES = $(osl_int_SOURCES) $(osl_pluto_unroll_SOURCES) \ + $(osl_relation_set_precision_SOURCES) $(osl_test_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + check recheck distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/autoconf/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/autoconf/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CD = @CD@ +CFLAGS = @CFLAGS@ +CFLAGS_WARN = @CFLAGS_WARN@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOXYGEN = @DOXYGEN@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PRTDIAG = @PRTDIAG@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TEXI2PDF = @TEXI2PDF@ +VERSION = @VERSION@ +VERSION_MAJOR = @VERSION_MAJOR@ +VERSION_MINOR = @VERSION_MINOR@ +VERSION_REVISION = @VERSION_REVISION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +############################################################################# +SUBDIRS = + +############################################################################# +MAINTAINERCLEANFILES = Makefile.in +osl_test_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -static +osl_int_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -static +osl_pluto_unroll_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -static +osl_relation_set_precision_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -static +osl_test_LDADD = ../libosl.la +osl_int_LDADD = ../libosl.la +osl_pluto_unroll_LDADD = ../libosl.la +osl_relation_set_precision_LDADD = ../libosl.la +osl_test_SOURCES = \ + osl_test.c \ + polynom.scop \ + test_empty_statement.scop \ + test_just_access.scop \ + test_just_body.scop \ + test_just_extbody.scop \ + test_just_domain.scop \ + test_just_scattering.scop \ + test_coordinates.scop \ + test_matmult.scop \ + test_clay.scop \ + test_no_statement.scop \ + test_scop_list.scop + +osl_int_SOURCES = osl_int.c +osl_pluto_unroll_SOURCES = osl_pluto_unroll.c +osl_relation_set_precision_SOURCES = osl_relation_set_precision.c +MAINTAINERCLEANFILE = ../autoconf/texinfo.tex +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign tests/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +osl_int$(EXEEXT): $(osl_int_OBJECTS) $(osl_int_DEPENDENCIES) $(EXTRA_osl_int_DEPENDENCIES) + @rm -f osl_int$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(osl_int_OBJECTS) $(osl_int_LDADD) $(LIBS) + +osl_pluto_unroll$(EXEEXT): $(osl_pluto_unroll_OBJECTS) $(osl_pluto_unroll_DEPENDENCIES) $(EXTRA_osl_pluto_unroll_DEPENDENCIES) + @rm -f osl_pluto_unroll$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(osl_pluto_unroll_OBJECTS) $(osl_pluto_unroll_LDADD) $(LIBS) + +osl_relation_set_precision$(EXEEXT): $(osl_relation_set_precision_OBJECTS) $(osl_relation_set_precision_DEPENDENCIES) $(EXTRA_osl_relation_set_precision_DEPENDENCIES) + @rm -f osl_relation_set_precision$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(osl_relation_set_precision_OBJECTS) $(osl_relation_set_precision_LDADD) $(LIBS) + +osl_test$(EXEEXT): $(osl_test_OBJECTS) $(osl_test_DEPENDENCIES) $(EXTRA_osl_test_DEPENDENCIES) + @rm -f osl_test$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(osl_test_OBJECTS) $(osl_test_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osl_int-osl_int.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osl_pluto_unroll-osl_pluto_unroll.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osl_relation_set_precision-osl_relation_set_precision.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osl_test-osl_test.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +osl_int-osl_int.o: osl_int.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(osl_int_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT osl_int-osl_int.o -MD -MP -MF $(DEPDIR)/osl_int-osl_int.Tpo -c -o osl_int-osl_int.o `test -f 'osl_int.c' || echo '$(srcdir)/'`osl_int.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/osl_int-osl_int.Tpo $(DEPDIR)/osl_int-osl_int.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='osl_int.c' object='osl_int-osl_int.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(osl_int_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o osl_int-osl_int.o `test -f 'osl_int.c' || echo '$(srcdir)/'`osl_int.c + +osl_int-osl_int.obj: osl_int.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(osl_int_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT osl_int-osl_int.obj -MD -MP -MF $(DEPDIR)/osl_int-osl_int.Tpo -c -o osl_int-osl_int.obj `if test -f 'osl_int.c'; then $(CYGPATH_W) 'osl_int.c'; else $(CYGPATH_W) '$(srcdir)/osl_int.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/osl_int-osl_int.Tpo $(DEPDIR)/osl_int-osl_int.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='osl_int.c' object='osl_int-osl_int.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(osl_int_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o osl_int-osl_int.obj `if test -f 'osl_int.c'; then $(CYGPATH_W) 'osl_int.c'; else $(CYGPATH_W) '$(srcdir)/osl_int.c'; fi` + +osl_pluto_unroll-osl_pluto_unroll.o: osl_pluto_unroll.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(osl_pluto_unroll_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT osl_pluto_unroll-osl_pluto_unroll.o -MD -MP -MF $(DEPDIR)/osl_pluto_unroll-osl_pluto_unroll.Tpo -c -o osl_pluto_unroll-osl_pluto_unroll.o `test -f 'osl_pluto_unroll.c' || echo '$(srcdir)/'`osl_pluto_unroll.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/osl_pluto_unroll-osl_pluto_unroll.Tpo $(DEPDIR)/osl_pluto_unroll-osl_pluto_unroll.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='osl_pluto_unroll.c' object='osl_pluto_unroll-osl_pluto_unroll.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(osl_pluto_unroll_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o osl_pluto_unroll-osl_pluto_unroll.o `test -f 'osl_pluto_unroll.c' || echo '$(srcdir)/'`osl_pluto_unroll.c + +osl_pluto_unroll-osl_pluto_unroll.obj: osl_pluto_unroll.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(osl_pluto_unroll_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT osl_pluto_unroll-osl_pluto_unroll.obj -MD -MP -MF $(DEPDIR)/osl_pluto_unroll-osl_pluto_unroll.Tpo -c -o osl_pluto_unroll-osl_pluto_unroll.obj `if test -f 'osl_pluto_unroll.c'; then $(CYGPATH_W) 'osl_pluto_unroll.c'; else $(CYGPATH_W) '$(srcdir)/osl_pluto_unroll.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/osl_pluto_unroll-osl_pluto_unroll.Tpo $(DEPDIR)/osl_pluto_unroll-osl_pluto_unroll.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='osl_pluto_unroll.c' object='osl_pluto_unroll-osl_pluto_unroll.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(osl_pluto_unroll_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o osl_pluto_unroll-osl_pluto_unroll.obj `if test -f 'osl_pluto_unroll.c'; then $(CYGPATH_W) 'osl_pluto_unroll.c'; else $(CYGPATH_W) '$(srcdir)/osl_pluto_unroll.c'; fi` + +osl_relation_set_precision-osl_relation_set_precision.o: osl_relation_set_precision.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(osl_relation_set_precision_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT osl_relation_set_precision-osl_relation_set_precision.o -MD -MP -MF $(DEPDIR)/osl_relation_set_precision-osl_relation_set_precision.Tpo -c -o osl_relation_set_precision-osl_relation_set_precision.o `test -f 'osl_relation_set_precision.c' || echo '$(srcdir)/'`osl_relation_set_precision.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/osl_relation_set_precision-osl_relation_set_precision.Tpo $(DEPDIR)/osl_relation_set_precision-osl_relation_set_precision.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='osl_relation_set_precision.c' object='osl_relation_set_precision-osl_relation_set_precision.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(osl_relation_set_precision_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o osl_relation_set_precision-osl_relation_set_precision.o `test -f 'osl_relation_set_precision.c' || echo '$(srcdir)/'`osl_relation_set_precision.c + +osl_relation_set_precision-osl_relation_set_precision.obj: osl_relation_set_precision.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(osl_relation_set_precision_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT osl_relation_set_precision-osl_relation_set_precision.obj -MD -MP -MF $(DEPDIR)/osl_relation_set_precision-osl_relation_set_precision.Tpo -c -o osl_relation_set_precision-osl_relation_set_precision.obj `if test -f 'osl_relation_set_precision.c'; then $(CYGPATH_W) 'osl_relation_set_precision.c'; else $(CYGPATH_W) '$(srcdir)/osl_relation_set_precision.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/osl_relation_set_precision-osl_relation_set_precision.Tpo $(DEPDIR)/osl_relation_set_precision-osl_relation_set_precision.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='osl_relation_set_precision.c' object='osl_relation_set_precision-osl_relation_set_precision.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(osl_relation_set_precision_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o osl_relation_set_precision-osl_relation_set_precision.obj `if test -f 'osl_relation_set_precision.c'; then $(CYGPATH_W) 'osl_relation_set_precision.c'; else $(CYGPATH_W) '$(srcdir)/osl_relation_set_precision.c'; fi` + +osl_test-osl_test.o: osl_test.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(osl_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT osl_test-osl_test.o -MD -MP -MF $(DEPDIR)/osl_test-osl_test.Tpo -c -o osl_test-osl_test.o `test -f 'osl_test.c' || echo '$(srcdir)/'`osl_test.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/osl_test-osl_test.Tpo $(DEPDIR)/osl_test-osl_test.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='osl_test.c' object='osl_test-osl_test.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(osl_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o osl_test-osl_test.o `test -f 'osl_test.c' || echo '$(srcdir)/'`osl_test.c + +osl_test-osl_test.obj: osl_test.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(osl_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT osl_test-osl_test.obj -MD -MP -MF $(DEPDIR)/osl_test-osl_test.Tpo -c -o osl_test-osl_test.obj `if test -f 'osl_test.c'; then $(CYGPATH_W) 'osl_test.c'; else $(CYGPATH_W) '$(srcdir)/osl_test.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/osl_test-osl_test.Tpo $(DEPDIR)/osl_test-osl_test.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='osl_test.c' object='osl_test-osl_test.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(osl_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o osl_test-osl_test.obj `if test -f 'osl_test.c'; then $(CYGPATH_W) 'osl_test.c'; else $(CYGPATH_W) '$(srcdir)/osl_test.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + else \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +osl_test.log: osl_test$(EXEEXT) + @p='osl_test$(EXEEXT)'; \ + b='osl_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +osl_int.log: osl_int$(EXEEXT) + @p='osl_int$(EXEEXT)'; \ + b='osl_int'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +osl_pluto_unroll.log: osl_pluto_unroll$(EXEEXT) + @p='osl_pluto_unroll$(EXEEXT)'; \ + b='osl_pluto_unroll'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +osl_relation_set_precision.log: osl_relation_set_precision$(EXEEXT) + @p='osl_relation_set_precision$(EXEEXT)'; \ + b='osl_relation_set_precision'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-recursive +all-am: Makefile $(PROGRAMS) +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) check-am install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-TESTS check-am clean clean-generic clean-libtool \ + clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am recheck tags tags-am \ + uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru cloog-0.18.2/osl/tests/osl_int.c cloog-0.18.4/osl/tests/osl_int.c --- cloog-0.18.2/osl/tests/osl_int.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/osl_int.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,420 @@ +// Copyright © 2014 Inria, Written by Lénaïc Bagnères, lenaic.bagneres@inria.fr + +// (3-clause BSD license) +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include + +#include +#include + + +int main(int argc, char** argv) +{ + if (argc > 1) { printf("argv are ignored\n"); } + + unsigned int nb_fail = 0; + + #ifdef OSL_GMP_IS_HERE + + int i; + for (i = SCHAR_MIN; i <= SCHAR_MAX; ++i) { + osl_int_t a_sp; osl_int_init_set_si(OSL_PRECISION_SP, &a_sp, i); + osl_int_t a_dp; osl_int_init_set_si(OSL_PRECISION_DP, &a_dp, i); + osl_int_t a_mp; osl_int_init_set_si(OSL_PRECISION_MP, &a_mp, i); + + int j; + for (j = SCHAR_MIN; j <= SCHAR_MAX; ++j) { + int error = 0; + + osl_int_t b_sp; osl_int_init_set_si(OSL_PRECISION_SP, &b_sp, j); + osl_int_t b_dp; osl_int_init_set_si(OSL_PRECISION_DP, &b_dp, j); + osl_int_t b_mp; osl_int_init_set_si(OSL_PRECISION_MP, &b_mp, j); + + osl_int_t c_sp; osl_int_init(OSL_PRECISION_SP, &c_sp); + osl_int_t c_dp; osl_int_init(OSL_PRECISION_DP, &c_dp); + osl_int_t c_mp; osl_int_init(OSL_PRECISION_MP, &c_mp); + + int const a_sp_i = osl_int_get_si(OSL_PRECISION_SP, a_sp); + int const a_dp_i = osl_int_get_si(OSL_PRECISION_DP, a_dp); + int const a_mp_i = osl_int_get_si(OSL_PRECISION_MP, a_mp); + + int const b_sp_i = osl_int_get_si(OSL_PRECISION_SP, b_sp); + int const b_dp_i = osl_int_get_si(OSL_PRECISION_DP, b_dp); + int const b_mp_i = osl_int_get_si(OSL_PRECISION_MP, b_mp); + + // osl_int_init_set_si & osl_int_init & osl_int_get_si + if (!error) { + int c_sp_i = osl_int_get_si(OSL_PRECISION_SP, c_sp); + int c_dp_i = osl_int_get_si(OSL_PRECISION_DP, c_dp); + int c_mp_i = osl_int_get_si(OSL_PRECISION_MP, c_mp); + + if (a_sp_i != a_dp_i || a_sp_i != a_mp_i) { + error++; printf("Error osl_int_init_set_si or osl_int_get_si\n"); + } + if (b_sp_i != b_dp_i || b_sp_i != b_mp_i) { + error++; printf("Error osl_int_init_set_si or osl_int_get_si\n"); + } + if (c_sp_i != c_dp_i || c_sp_i != c_mp_i || c_sp_i != 0) { + error++; printf("Error osl_int_init or osl_int_get_si\n"); + } + } + + // osl_int_assign + if (!error) { + osl_int_assign(OSL_PRECISION_SP, &c_sp, b_sp); + osl_int_assign(OSL_PRECISION_DP, &c_dp, b_dp); + osl_int_assign(OSL_PRECISION_MP, &c_mp, b_mp); + + if (osl_int_ne(OSL_PRECISION_SP, c_sp, b_sp)) { + error++; printf("Error osl_int_assign\n"); + } + if (osl_int_ne(OSL_PRECISION_DP, c_dp, b_dp)) { + error++; printf("Error osl_int_assign\n"); + } + if (osl_int_ne(OSL_PRECISION_MP, c_mp, b_mp)) { + error++; printf("Error osl_int_assign\n"); + } + } + + // osl_int_swap + + // osl_int_increment + if (!error) { + osl_int_increment(OSL_PRECISION_SP, &c_sp, a_sp); + osl_int_increment(OSL_PRECISION_DP, &c_dp, a_dp); + osl_int_increment(OSL_PRECISION_MP, &c_mp, a_mp); + + int c_sp_i = osl_int_get_si(OSL_PRECISION_SP, c_sp); + int c_dp_i = osl_int_get_si(OSL_PRECISION_DP, c_dp); + int c_mp_i = osl_int_get_si(OSL_PRECISION_MP, c_mp); + + if (c_sp_i != c_dp_i || c_sp_i != c_mp_i || c_sp_i != a_sp_i + 1) { + error++; printf("Error osl_int_increment\n"); + } + } + + // osl_int_decrement + if (!error) { + osl_int_decrement(OSL_PRECISION_SP, &c_sp, a_sp); + osl_int_decrement(OSL_PRECISION_DP, &c_dp, a_dp); + osl_int_decrement(OSL_PRECISION_MP, &c_mp, a_mp); + + int c_sp_i = osl_int_get_si(OSL_PRECISION_SP, c_sp); + int c_dp_i = osl_int_get_si(OSL_PRECISION_DP, c_dp); + int c_mp_i = osl_int_get_si(OSL_PRECISION_MP, c_mp); + + if (c_sp_i != c_dp_i || c_sp_i != c_mp_i || c_sp_i != a_sp_i - 1) { + error++; printf("Error osl_int_decrement\n"); + } + } + + // osl_int_add + if (!error) { + osl_int_add(OSL_PRECISION_SP, &c_sp, a_sp, b_sp); + osl_int_add(OSL_PRECISION_DP, &c_dp, a_dp, b_dp); + osl_int_add(OSL_PRECISION_MP, &c_mp, a_mp, b_mp); + + int c_sp_i = osl_int_get_si(OSL_PRECISION_SP, c_sp); + int c_dp_i = osl_int_get_si(OSL_PRECISION_DP, c_dp); + int c_mp_i = osl_int_get_si(OSL_PRECISION_MP, c_mp); + + if (c_sp_i != c_dp_i || c_sp_i != c_mp_i || c_sp_i != a_sp_i + b_sp_i) { + error++; printf("Error osl_int_add\n"); + } + } + + // osl_int_add_si + + // osl_int_sub + if (!error) { + osl_int_sub(OSL_PRECISION_SP, &c_sp, a_sp, b_sp); + osl_int_sub(OSL_PRECISION_DP, &c_dp, a_dp, b_dp); + osl_int_sub(OSL_PRECISION_MP, &c_mp, a_mp, b_mp); + + int c_sp_i = osl_int_get_si(OSL_PRECISION_SP, c_sp); + int c_dp_i = osl_int_get_si(OSL_PRECISION_DP, c_dp); + int c_mp_i = osl_int_get_si(OSL_PRECISION_MP, c_mp); + + if (c_sp_i != c_dp_i || c_sp_i != c_mp_i || c_sp_i != a_sp_i - b_sp_i) { + error++; printf("Error osl_int_add\n"); + } + } + + // osl_int_mul + if (!error) { + osl_int_mul(OSL_PRECISION_SP, &c_sp, a_sp, b_sp); + osl_int_mul(OSL_PRECISION_DP, &c_dp, a_dp, b_dp); + osl_int_mul(OSL_PRECISION_MP, &c_mp, a_mp, b_mp); + + int c_sp_i = osl_int_get_si(OSL_PRECISION_SP, c_sp); + int c_dp_i = osl_int_get_si(OSL_PRECISION_DP, c_dp); + int c_mp_i = osl_int_get_si(OSL_PRECISION_MP, c_mp); + + if (c_sp_i != c_dp_i || c_sp_i != c_mp_i || c_sp_i != a_sp_i * b_sp_i) { + error++; printf("Error osl_int_mul\n"); + } + } + + // osl_int_mul_si + if (!error) { + osl_int_mul_si(OSL_PRECISION_SP, &c_sp, a_sp, b_sp_i); + osl_int_mul_si(OSL_PRECISION_DP, &c_dp, a_dp, b_dp_i); + osl_int_mul_si(OSL_PRECISION_MP, &c_mp, a_mp, b_mp_i); + + int c_sp_i = osl_int_get_si(OSL_PRECISION_SP, c_sp); + int c_dp_i = osl_int_get_si(OSL_PRECISION_DP, c_dp); + int c_mp_i = osl_int_get_si(OSL_PRECISION_MP, c_mp); + + if (c_sp_i != c_dp_i || c_sp_i != c_mp_i || c_sp_i != a_sp_i * b_sp_i) { + error++; printf("Error osl_int_mul_si\n"); + } + } + + // osl_int_div_exact + if (!error && b_sp_i != 0 && a_sp_i % b_sp_i == 0) { + osl_int_div_exact(OSL_PRECISION_SP, &c_sp, a_sp, b_sp); + osl_int_div_exact(OSL_PRECISION_DP, &c_dp, a_dp, b_dp); + osl_int_div_exact(OSL_PRECISION_MP, &c_mp, a_mp, b_mp); + + int c_sp_i = osl_int_get_si(OSL_PRECISION_SP, c_sp); + int c_dp_i = osl_int_get_si(OSL_PRECISION_DP, c_dp); + int c_mp_i = osl_int_get_si(OSL_PRECISION_MP, c_mp); + + if (c_sp_i != c_dp_i || c_sp_i != c_mp_i || c_sp_i != a_sp_i / b_sp_i) { + error++; printf("Error osl_int_div_exact\n"); + } + } + + // osl_int_floor_div_q + if (!error && b_sp_i != 0) { + osl_int_floor_div_q(OSL_PRECISION_SP, &c_sp, a_sp, b_sp); + osl_int_floor_div_q(OSL_PRECISION_DP, &c_dp, a_dp, b_dp); + osl_int_floor_div_q(OSL_PRECISION_MP, &c_mp, a_mp, b_mp); + + int c_sp_i = osl_int_get_si(OSL_PRECISION_SP, c_sp); + int c_dp_i = osl_int_get_si(OSL_PRECISION_DP, c_dp); + int c_mp_i = osl_int_get_si(OSL_PRECISION_MP, c_mp); + + if (c_sp_i != c_dp_i || c_sp_i != c_mp_i) { + error++; printf("Error osl_int_floor_div_q\n"); + } + } + + // osl_int_floor_div_r + if (!error && b_sp_i != 0) { + osl_int_floor_div_r(OSL_PRECISION_SP, &c_sp, a_sp, b_sp); + osl_int_floor_div_r(OSL_PRECISION_DP, &c_dp, a_dp, b_dp); + osl_int_floor_div_r(OSL_PRECISION_MP, &c_mp, a_mp, b_mp); + + int c_sp_i = osl_int_get_si(OSL_PRECISION_SP, c_sp); + int c_dp_i = osl_int_get_si(OSL_PRECISION_DP, c_dp); + int c_mp_i = osl_int_get_si(OSL_PRECISION_MP, c_mp); + + if (c_sp_i != c_dp_i || c_sp_i != c_mp_i) { + error++; printf("Error osl_int_floor_div_r\n"); + } + } + + // osl_int_floor_div_q_r + if (!error && b_sp_i != 0) { + osl_int_t q_sp; osl_int_init(OSL_PRECISION_SP, &q_sp); + osl_int_t q_dp; osl_int_init(OSL_PRECISION_DP, &q_dp); + osl_int_t q_mp; osl_int_init(OSL_PRECISION_MP, &q_mp); + + osl_int_t r_sp; osl_int_init(OSL_PRECISION_SP, &r_sp); + osl_int_t r_dp; osl_int_init(OSL_PRECISION_DP, &r_dp); + osl_int_t r_mp; osl_int_init(OSL_PRECISION_MP, &r_mp); + + osl_int_floor_div_q_r(OSL_PRECISION_SP, &q_sp, &r_sp, a_sp, b_sp); + osl_int_floor_div_q_r(OSL_PRECISION_DP, &q_dp, &r_dp, a_dp, b_dp); + osl_int_floor_div_q_r(OSL_PRECISION_MP, &q_mp, &r_mp, a_mp, b_mp); + + int q_sp_i = osl_int_get_si(OSL_PRECISION_SP, q_sp); + int q_dp_i = osl_int_get_si(OSL_PRECISION_DP, q_dp); + int q_mp_i = osl_int_get_si(OSL_PRECISION_MP, q_mp); + + int r_sp_i = osl_int_get_si(OSL_PRECISION_SP, r_sp); + int r_dp_i = osl_int_get_si(OSL_PRECISION_DP, r_dp); + int r_mp_i = osl_int_get_si(OSL_PRECISION_MP, r_mp); + + if (q_sp_i != q_dp_i || q_sp_i != q_mp_i) { + error++; printf("Error osl_int_floor_div_q_r\n"); + } + if (r_sp_i != r_dp_i || r_sp_i != r_mp_i) { + error++; printf("Error osl_int_floor_div_q_r\n"); + } + } + + // osl_int_mod + if (!error && b_sp_i != 0) { + osl_int_mod(OSL_PRECISION_SP, &c_sp, a_sp, b_sp); + osl_int_mod(OSL_PRECISION_DP, &c_dp, a_dp, b_dp); + osl_int_mod(OSL_PRECISION_MP, &c_mp, a_mp, b_mp); + + int c_sp_i = osl_int_get_si(OSL_PRECISION_SP, c_sp); + int c_dp_i = osl_int_get_si(OSL_PRECISION_DP, c_dp); + int c_mp_i = osl_int_get_si(OSL_PRECISION_MP, c_mp); + + if (c_sp_i != c_dp_i || c_sp_i != c_mp_i) { + error++; printf("Error osl_int_mod\n"); + } + } + + // osl_int_gcd + if (!error) { + osl_int_gcd(OSL_PRECISION_SP, &c_sp, a_sp, b_sp); + osl_int_gcd(OSL_PRECISION_DP, &c_dp, a_dp, b_dp); + osl_int_gcd(OSL_PRECISION_MP, &c_mp, a_mp, b_mp); + + int c_sp_i = osl_int_get_si(OSL_PRECISION_SP, c_sp); + int c_dp_i = osl_int_get_si(OSL_PRECISION_DP, c_dp); + int c_mp_i = osl_int_get_si(OSL_PRECISION_MP, c_mp); + + if (c_sp_i != c_dp_i || c_sp_i != c_mp_i) { + error++; printf("Error osl_int_gcd\n"); + } + } + + // osl_int_oppose + if (!error) { + osl_int_oppose(OSL_PRECISION_SP, &c_sp, b_sp); + osl_int_oppose(OSL_PRECISION_DP, &c_dp, b_dp); + osl_int_oppose(OSL_PRECISION_MP, &c_mp, b_mp); + + int c_sp_i = osl_int_get_si(OSL_PRECISION_SP, c_sp); + int c_dp_i = osl_int_get_si(OSL_PRECISION_DP, c_dp); + int c_mp_i = osl_int_get_si(OSL_PRECISION_MP, c_mp); + + if (c_sp_i != c_dp_i || c_sp_i != c_mp_i) { + error++; printf("Error osl_int_oppose\n"); + } + } + + // osl_int_abs + if (!error) { + osl_int_abs(OSL_PRECISION_SP, &c_sp, b_sp); + osl_int_abs(OSL_PRECISION_DP, &c_dp, b_dp); + osl_int_abs(OSL_PRECISION_MP, &c_mp, b_mp); + + int c_sp_i = osl_int_get_si(OSL_PRECISION_SP, c_sp); + int c_dp_i = osl_int_get_si(OSL_PRECISION_DP, c_dp); + int c_mp_i = osl_int_get_si(OSL_PRECISION_MP, c_mp); + + if (c_sp_i != c_dp_i || c_sp_i != c_mp_i) { + error++; printf("Error osl_int_abs\n"); + } + } + + // osl_int_size_in_base_2 + if (!error) { + size_t r_sp = osl_int_size_in_base_2(OSL_PRECISION_SP, b_sp); + size_t r_dp = osl_int_size_in_base_2(OSL_PRECISION_DP, b_dp); + size_t r_mp = osl_int_size_in_base_2(OSL_PRECISION_MP, b_mp); + + osl_int_set_si(OSL_PRECISION_SP, &c_sp, r_sp); + osl_int_set_si(OSL_PRECISION_DP, &c_dp, r_dp); + osl_int_set_si(OSL_PRECISION_MP, &c_mp, r_mp); + + if (r_sp != r_dp || r_sp != r_mp) { + error++; printf("Error osl_int_size_in_base_2\n"); + } + } + + // osl_int_size_in_base_10 +// if (!error) { +// size_t r_sp = osl_int_size_in_base_10(OSL_PRECISION_SP, b_sp); +// size_t r_dp = osl_int_size_in_base_10(OSL_PRECISION_DP, b_dp); +// size_t r_mp = osl_int_size_in_base_10(OSL_PRECISION_MP, b_mp); +// +// osl_int_set_si(OSL_PRECISION_SP, &c_sp, r_sp); +// osl_int_set_si(OSL_PRECISION_DP, &c_dp, r_dp); +// osl_int_set_si(OSL_PRECISION_MP, &c_mp, r_mp); +// +// if (r_sp != r_dp || r_sp != r_mp) +// { error++; printf("Error osl_int_size_in_base_10\n"); } +// } + + // osl_int_eq + + // osl_int_ne + + // osl_int_pos + + // osl_int_neg + + // osl_int_zero + + // osl_int_one + + // osl_int_mone + + // osl_int_divisible + + if (error) { + printf("Error with:\n"); + printf("\n"); + + printf("a_sp = "); osl_int_print(stdout, OSL_PRECISION_SP, a_sp); + printf("\n"); + printf("a_dp = "); osl_int_print(stdout, OSL_PRECISION_DP, a_dp); + printf("\n"); + printf("a_mp = "); osl_int_print(stdout, OSL_PRECISION_MP, a_mp); + printf("\n"); + printf("\n"); + + printf("b_sp = "); osl_int_print(stdout, OSL_PRECISION_SP, b_sp); + printf("\n"); + printf("b_dp = "); osl_int_print(stdout, OSL_PRECISION_DP, b_dp); + printf("\n"); + printf("b_mp = "); osl_int_print(stdout, OSL_PRECISION_MP, b_mp); + printf("\n"); + printf("\n"); + + printf("c_sp = "); osl_int_print(stdout, OSL_PRECISION_SP, c_sp); + printf("\n"); + printf("c_dp = "); osl_int_print(stdout, OSL_PRECISION_DP, c_dp); + printf("\n"); + printf("c_mp = "); osl_int_print(stdout, OSL_PRECISION_MP, c_mp); + printf("\n"); + printf("\n"); + + nb_fail += error; + } + } + } + + printf("%s ", argv[0]); + printf("fails = %d\n", nb_fail); + + #else + + printf("%s ", argv[0]); + printf("works only with GMP\n"); + + #endif + + return nb_fail; +} diff -Nru cloog-0.18.2/osl/tests/osl_pluto_unroll.c cloog-0.18.4/osl/tests/osl_pluto_unroll.c --- cloog-0.18.2/osl/tests/osl_pluto_unroll.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/osl_pluto_unroll.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,192 @@ +// Copyright © 2014 Inria, Written by Lénaïc Bagnères, lenaic.bagneres@inria.fr + +// (3-clause BSD license) +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#include +#include + +#include + + +int main(int argc, char** argv) +{ + if (argc > 1) { printf("argv are ignored\n"); } + + int nb_fail = 0; + + osl_pluto_unroll_p p0 = NULL; + osl_pluto_unroll_p p1 = NULL; + osl_pluto_unroll_p pc = NULL; + + // Free without malloc + printf("// Free without malloc\n"); + osl_pluto_unroll_p p = NULL; + osl_pluto_unroll_free(p); + if (p != NULL) { nb_fail++; } + printf("\n"); + + // Malloc and free + printf("// Malloc and free\n"); + p = osl_pluto_unroll_malloc(); + osl_pluto_unroll_dump(stdout, p); + { + char * s = osl_pluto_unroll_sprint(p); + printf("%s\n", s); + free(s); s = NULL; + } + osl_pluto_unroll_free(p); p = NULL; + printf("\n"); + + // Malloc, malloc and free + printf("// Malloc, malloc and free\n"); + p = osl_pluto_unroll_malloc(); + p->next = osl_pluto_unroll_malloc(); + osl_pluto_unroll_dump(stdout, p); + { + char * s = osl_pluto_unroll_sprint(p); + printf("%s\n", s); + free(s); s = NULL; + } + osl_pluto_unroll_free(p); p = NULL; + printf("\n"); + + // osl_pluto_unroll_fill + printf("// osl_pluto_unroll_fill\n"); + p = osl_pluto_unroll_malloc(); + osl_pluto_unroll_fill(p, "iterator_name_0", true, 4); + p->next = osl_pluto_unroll_malloc(); + osl_pluto_unroll_fill(p->next, "iterator_name_1", false, 4); + osl_pluto_unroll_dump(stdout, p); + { + char * s = osl_pluto_unroll_sprint(p); + printf("%s\n", s); + free(s); s = NULL; + } + osl_pluto_unroll_free(p); p = NULL; + printf("\n"); + + // osl_pluto_unroll_fill with NULL + printf("// osl_pluto_unroll_fill with NULL\n"); + p = osl_pluto_unroll_malloc(); + osl_pluto_unroll_fill(p, NULL, true, 4); + p->next = osl_pluto_unroll_malloc(); + osl_pluto_unroll_fill(p->next, "iterator_name_1", false, 4); + osl_pluto_unroll_dump(stdout, p); + { + char * s = osl_pluto_unroll_sprint(p); + printf("%s\n", s); + free(s); s = NULL; + } + osl_pluto_unroll_free(p); p = NULL; + printf("\n"); + + // != + printf("// !=\n"); + p0 = osl_pluto_unroll_malloc(); + p0->next = osl_pluto_unroll_malloc(); + p0->next->next = osl_pluto_unroll_malloc(); + p1 = osl_pluto_unroll_malloc(); + p1->next = osl_pluto_unroll_malloc(); + if (osl_pluto_unroll_equal(p0, p1) == 1) { nb_fail++; } + if (osl_pluto_unroll_equal(p0, p0) == 0) { nb_fail++; } + if (osl_pluto_unroll_equal(p1, p1) == 0) { nb_fail++; } + osl_pluto_unroll_free(p0); p0 = NULL; + osl_pluto_unroll_free(p1); p1 = NULL; + printf("\n"); + + // == + printf("// ==\n"); + p0 = osl_pluto_unroll_malloc(); + p1 = osl_pluto_unroll_malloc(); + if (osl_pluto_unroll_equal(p0, p1) == 0) { nb_fail++; } + if (osl_pluto_unroll_equal(p1, p0) == 0) { nb_fail++; } + p0->next = osl_pluto_unroll_malloc(); + p1->next = osl_pluto_unroll_malloc(); + if (osl_pluto_unroll_equal(p0, p1) == 0) { nb_fail++; } + if (osl_pluto_unroll_equal(p1, p0) == 0) { nb_fail++; } + osl_pluto_unroll_fill(p0->next, "iterator_name_1", false, 4); + if (osl_pluto_unroll_equal(p0, p1) == 1) { nb_fail++; } + osl_pluto_unroll_fill(p1->next, "iterator_name_1", false, 4); + if (osl_pluto_unroll_equal(p0, p1) == 0) { nb_fail++; } + osl_pluto_unroll_fill(p0->next, "iterator_name_2", false, 4); + if (osl_pluto_unroll_equal(p0, p1) == 1) { nb_fail++; } + osl_pluto_unroll_fill(p1->next, "iterator_name_2", false, 4); + if (osl_pluto_unroll_equal(p0, p1) == 0) { nb_fail++; } + osl_pluto_unroll_fill(p1->next, "iterator_name_2", false, 8); + if (osl_pluto_unroll_equal(p0, p1) == 1) { nb_fail++; } + osl_pluto_unroll_fill(p0->next, "iterator_name_2", false, 8); + if (osl_pluto_unroll_equal(p0, p1) == 0) { nb_fail++; } + osl_pluto_unroll_fill(p0->next, "iterator_name_2", true, 8); + if (osl_pluto_unroll_equal(p0, p1) == 1) { nb_fail++; } + osl_pluto_unroll_free(p0); p0 = NULL; + osl_pluto_unroll_free(p1); p1 = NULL; + printf("\n"); + + // Clone NULL + printf("// Clone NULL\n"); + pc = osl_pluto_unroll_clone(p); + printf("\n"); + + // Clone + printf("// Clone\n"); + p = osl_pluto_unroll_malloc(); + osl_pluto_unroll_fill(p, "iterator_name_0", true, 4); + p->next = osl_pluto_unroll_malloc(); + p->next->next = osl_pluto_unroll_malloc(); + osl_pluto_unroll_fill(p->next->next, "iterator_name_2", false, 2); + pc = osl_pluto_unroll_clone(p); + osl_pluto_unroll_dump(stdout, p); + osl_pluto_unroll_dump(stdout, pc); + if (osl_pluto_unroll_equal(p, pc) == 0) { nb_fail++; } + osl_pluto_unroll_free(p); p = NULL; + osl_pluto_unroll_free(pc); pc = NULL; + printf("\n"); + + // osl_pluto_unroll_sread + printf("// osl_pluto_unroll_sread\n"); + p = osl_pluto_unroll_malloc(); + osl_pluto_unroll_fill(p, "iterator_name_0", true, 4); + p->next = osl_pluto_unroll_malloc(); + osl_pluto_unroll_fill(p->next, "iterator_name_1", false, 4); + osl_pluto_unroll_dump(stdout, p); + { + char * s = osl_pluto_unroll_sprint(p); + char * f = s; + pc = osl_pluto_unroll_sread(&s); + free(f); f = NULL; s = NULL; + } + osl_pluto_unroll_dump(stdout, pc); + if (osl_pluto_unroll_equal(p, pc) == 0) { nb_fail++; } + osl_pluto_unroll_free(p); p = NULL; + osl_pluto_unroll_free(pc); pc = NULL; + printf("\n"); + + printf("%s ", argv[0]); + printf("fails = %d\n", nb_fail); + printf("\n"); + + return nb_fail; +} diff -Nru cloog-0.18.2/osl/tests/osl_relation_set_precision.c cloog-0.18.4/osl/tests/osl_relation_set_precision.c --- cloog-0.18.2/osl/tests/osl_relation_set_precision.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/osl_relation_set_precision.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,100 @@ +// Copyright © 2014 Inria, Written by Lénaïc Bagnères, lenaic.bagneres@inria.fr + +// (3-clause BSD license) +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +#include +#include + + +int main(int argc, char** argv) +{ + if (argc > 1) { printf("argv are ignored\n"); } + + unsigned int nb_fail = 0; + + #ifdef OSL_GMP_IS_HERE + + char * string = + "SCATTERING\n" + "11 14 9 2 0 1\n" + "# e/i| c1 c2 c3 c4 c5 c6 c7 c8 c9 | i1 j | n | 1\n" + " 0 -1 0 0 0 0 0 0 0 0 0 0 0 1 ## c1 == 1\n" + " 0 0 0 0 0 0 -1 0 0 0 1 0 0 0 ## c6 == i1\n" + " 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 ## c3 == 0\n" + " 1 0 -32 0 0 0 1 0 0 0 0 0 0 0 ## -32*c2+c6 >= 0\n" + " 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 ## c5 == 0\n" + " 1 0 32 0 0 0 -1 0 0 0 0 0 0 31 ## 32*c2-c6+31 >= 0\n" + " 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 ## c7 == 0\n" + " 1 0 0 0 -32 0 0 0 1 0 0 0 0 0 ## -32*c4+c8 >= 0\n" + " 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 ## c9 == 0\n" + " 1 0 0 0 32 0 0 0 -1 0 0 0 0 31 ## 32*c4-c8+31 >= 0\n" + " 0 0 0 0 0 0 0 0 -1 0 0 1 0 0 ## c8 == j\n"; + char * * p_string = &string; + + osl_relation_p r0 = osl_relation_sread(p_string); + osl_relation_p r1 = osl_relation_clone(r0); + + printf("r0 %d =\n", r0->precision); + osl_relation_print(stdout, r0); + printf("\n"); + + osl_relation_set_precision(OSL_PRECISION_SP, r1); + printf("r1 %d =\n", r1->precision); + osl_relation_print(stdout, r1); + osl_relation_set_same_precision(r0, r1); + nb_fail += osl_relation_equal(r0, r1) ? 0 : 1; + printf("nb fail = %d\n\n", nb_fail); + + osl_relation_set_precision(OSL_PRECISION_DP, r1); + printf("r1 %d =\n", r1->precision); + osl_relation_print(stdout, r1); + osl_relation_set_same_precision(r0, r1); + nb_fail += osl_relation_equal(r0, r1) ? 0 : 1; + printf("nb fail = %d\n\n", nb_fail); + + osl_relation_set_precision(OSL_PRECISION_MP, r1); + printf("r1 %d =\n", r1->precision); + osl_relation_print(stdout, r1); + osl_relation_set_same_precision(r0, r1); + nb_fail += osl_relation_equal(r0, r1) ? 0 : 1; + printf("nb fail = %d\n\n", nb_fail); + + osl_relation_free(r0); + osl_relation_free(r1); + + printf("%s ", argv[0]); + printf("fails = %d\n", nb_fail); + + #else + + printf("%s ", argv[0]); + printf("works only with GMP\n"); + + #endif + + return nb_fail; +} diff -Nru cloog-0.18.2/osl/tests/osl_test.c cloog-0.18.4/osl/tests/osl_test.c --- cloog-0.18.2/osl/tests/osl_test.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/osl_test.c 2014-10-02 15:33:49.000000000 +0000 @@ -0,0 +1,247 @@ + + /*+-----------------------------------------------------------------** + ** OpenScop Library ** + **-----------------------------------------------------------------** + ** test.c ** + **-----------------------------------------------------------------** + ** First version: 01/10/2010 ** + **-----------------------------------------------------------------** + + + ***************************************************************************** + * OpenScop: Structures and formats for polyhedral tools to talk together * + ***************************************************************************** + * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * + * / / / // // // // / / / // // / / // / /|,_, * + * / / / // // // // / / / // // / / // / / / /\ * + * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * + * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * + * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * + * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * + * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * + * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * + * | I | | | | e | | | | | | | | | | | | | \ \ \ * + * | T | | | | | | | | | | | | | | | | | \ \ \ * + * | E | | | | | | | | | | | | | | | | | \ \ \ * + * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * + * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * + * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * + * * + * Copyright (C) 2008 University Paris-Sud 11 and INRIA * + * * + * (3-clause BSD license) * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * OpenScop Library, a library to manipulate OpenScop formats and data * + * structures. Written by: * + * Cedric Bastoul and * + * Louis-Noel Pouchet * + * * + *****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +//#define FORK // Comment that if you want only one process + // (best for debugging with valgrind but bad + // for make check since any error will + // stop the job). + +#define TEST_DIR "." // Directory to scan for OpenScop files +#define TEST_SUFFIX ".scop" // Suffix of OpenScop files + + +/** + * test_file function + * This function tests an onpenscop file. A test has six steps: + * 1. read the file to raise the data up to OpenScop data structures, + * 2. clone the data structures, + * 3. compare the clone and the original one, + * 4. dump the data structures to a new OpenScop file, + * 5. read the generated file, + * 6. compare the data structures. + * If everything went well, the data structure of the two scops are the same. + * \param input_name The name of the input file. + * \param verbose Verbose option (1 to set, 0 not to set). + * \return 1 if the test is successful, 0 otherwise. + */ +int test_file(char* input_name, int verbose) { + int cloning = 0; + int dumping = 0; + int equal = 0; + FILE* input_file; + FILE* output_file; + osl_scop_p input_scop; + osl_scop_p output_scop; + osl_scop_p cloned_scop; + + printf("\nTesting file %s... \n", input_name); + + // PART I. Raise from file. + input_file = fopen(input_name, "r"); + if (input_file == NULL) { + fflush(stdout); + fprintf(stderr, "\nError: unable to open file %s\n", input_name); + exit(2); + } + input_scop = osl_scop_read(input_file); + fclose(input_file); + + if (verbose) + printf("- reading file succeeded\n"); + + // PART II. Clone and test. + cloned_scop = osl_scop_clone(input_scop); + // Compare the two scops. + if ((cloning = osl_scop_equal(input_scop, cloned_scop))) + printf("- cloning succeeded\n"); + else + printf("- cloning failed\n"); + + // PART III. Dump to file and test. + output_file = tmpfile(); + if (output_file == NULL) + OSL_error("cannot open temporary output file for writing"); + //osl_scop_dump(stdout, input_scop); + //osl_scop_print(stdout, input_scop); + osl_scop_print(output_file, input_scop); + + // Raise the generated file to data structures. + rewind(output_file); + output_scop = osl_scop_read(output_file); + //osl_scop_dump(stdout, output_scop); + fclose(output_file); + + if (verbose) { + printf("\n\n*************************************************\n\n"); + osl_scop_dump(stdout, output_scop); + osl_scop_print(stdout, output_scop); + printf("\n*************************************************\n\n"); + } + + // Compare the two scops. + if ((dumping = osl_scop_equal(input_scop, output_scop))) + printf("- dumping succeeded\n"); + else + printf("- dumping failed\n"); + + // PART IV. Report. + if ((equal = (cloning + dumping > 1) ? 1 : 0)) + printf("Success :-)\n"); + else + printf("Failure :-(\n"); + + // Save the planet. + osl_scop_free(input_scop); + osl_scop_free(cloned_scop); + osl_scop_free(output_scop); + + return equal; +} + + +/** + * OpenScop test program. + * Usage: osl_test [-v] [osl_file] + * This program scans a directory for openscop files and test each of them. + * Optionnally the user can provide a file name to check this file only. A + * verbose option is also provided to output more information during tests. + */ +int main(int argc, char* argv[]) { + int total = 0; // Total number of tests. + int success = 0; // Number of successes. + int verbose = 0; // 1 if the verbose option is set, 0 otherwise. + int dirtest = 1; // 1 if we check a whole directory, 0 for a single file. + int fileidx = 0; // Index of the file to check in argv (0 if none). + int d_namlen; + int suffix_length; + DIR * dir; + struct dirent * dp; + + // Process the command line information + if (((argc > 1) && (!strcmp(argv[1], "-v"))) || + ((argc > 2) && (!strcmp(argv[2], "-v")))) + verbose = 1; + + if ((argc > 3) || ((argc == 3) && (!verbose))) { + fprintf(stderr, "usage: osl_test [-v] [osl_file]\n"); + exit(1); + } + + if ((argc - verbose) > 1) { + dirtest = 0; + fileidx = (!strcmp(argv[1], "-v")) ? 2 : 1; + } + + // Proceed with the test(s), either directory or single file + if (dirtest) { + suffix_length = strlen(TEST_SUFFIX); + + // For each file in the directory to check... + dir = opendir(TEST_DIR); + while ((dp = readdir(dir)) != NULL) { + d_namlen = strlen(dp->d_name); + // If the file has the convenient suffix... + if ((d_namlen > suffix_length) && + (!strcmp(dp->d_name+(d_namlen-suffix_length), TEST_SUFFIX))) { + // Test it ! +#ifdef FORK + int report; + if (!fork()) + exit(test_file(dp->d_name, verbose) ? 0 : 1); + wait(&report); + if (!WEXITSTATUS(report)) + success++; +#else + success += test_file(dp->d_name, verbose); +#endif + total++; + } + } + closedir(dir); + } + else { + success = test_file(argv[fileidx], verbose); + total++; + } + + printf("\n +-----------------------+\n"); + printf(" | OpenScop Test Summary |\n"); + printf(" |-----------------------|\n"); + printf(" | total %4d |\n", total); + printf(" | success(es) %4d |\n", success); + printf(" | failure(s) %4d |\n", total - success); + printf(" +-----------------------+\n\n"); + + // Return 0 if all tests were successful, 1 otherwise. + if (total - success) + return 1; + else + return 0; +} diff -Nru cloog-0.18.2/osl/tests/polynom.scop cloog-0.18.4/osl/tests/polynom.scop --- cloog-0.18.2/osl/tests/polynom.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/polynom.scop 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,134 @@ +# +# <| +# A +# /.\ +# <| [""M# +# A | # Clan McCloog Castle +# /.\ [""M# [Generated by the OpenScop Library 0.3.0 64 bits] +# [""M# | # U"U#U +# | # | # \ .:/ +# | # | #___| # +# | "--' .-" +# |"-"-"-"-"-#-#-## +# | # ## ###### +# \ .::::'/ +# \ ::::'/ +# :8a| # # ## +# ::88a ### +# ::::888a 8a ##::. +# ::::::888a88a[]:::: +# :::::::::SUNDOGa8a::::. .. +# :::::8::::888:Y8888:::::::::... +#::':::88::::888::Y88a______________________________________________________ +#:: ::::88a::::88a:Y88a __---__-- __ +#' .: ::Y88a:::::8a:Y88a __----_-- -------_-__ +# :' ::::8P::::::::::88aa. _ _- -- --_ --- __ --- __-- +#.:: :::::::::::::::::::Y88as88a...s88aa. + + + +# =============================================== Global +# Language +C + +# Context +CONTEXT +1 3 0 0 0 1 +# e/i N 1 + 1 1 3 + +# Parameter names are provided +1 +# Parameter names + +N + + +# Number of statements +1 + +# =============================================== Statement 1 +# Number of relations describing the statement +6 + +# ---------------------------------------------- 1.1 Domain +DOMAIN +2 +4 5 2 0 0 1 +# e/i i j N 1 + 1 1 0 0 0 ## i >= 0 + 1 -1 0 1 -1 ## -i+N-1 >= 0 + 1 0 1 0 0 ## j >= 0 + 1 0 -1 1 -1 ## -j+N-1 >= 0 +5 5 2 0 0 1 +# e/i i j N 1 + 1 1 0 0 0 ## i >= 0 + 1 -1 0 1 -1 ## -i+N-1 >= 0 + 1 0 1 0 0 ## j >= 0 + 1 0 -1 1 -1 ## -j+N-1 >= 0 + 1 0 -1 1 -1 ## -j+N-1 >= 0 + +# ---------------------------------------------- 1.2 Scattering +SCATTERING +5 10 5 2 0 1 +# e/i s1 s2 s3 s4 s5 i j N 1 + 0 -1 0 0 0 0 0 0 0 0 ## 0 + 0 0 -1 0 0 0 1 0 0 0 ## i + 0 0 0 -1 0 0 0 0 0 0 ## 0 + 0 0 0 0 -1 0 0 1 0 0 ## j + 0 0 0 0 0 -1 0 0 0 0 ## 0 + +# ---------------------------------------------- 1.3 Access +READ +2 7 2 2 0 1 +# e/i Arr [1] i j N 1 + 0 -1 0 0 0 0 1 ## C[i+j] + 0 0 -1 1 1 0 0 ## + +READ +2 7 2 2 0 1 +# e/i Arr [1] i j N 1 + 0 -1 0 0 0 0 2 ## A[i] + 0 0 -1 1 0 0 0 ## + +READ +2 7 2 2 0 1 +# e/i Arr [1] i j N 1 + 0 -1 0 0 0 0 3 ## B[j] + 0 0 -1 0 1 0 0 ## + +WRITE +2 7 2 2 0 1 +# e/i Arr [1] i j N 1 + 0 -1 0 0 0 0 1 ## C[i+j] + 0 0 -1 1 1 0 0 ## + +# ---------------------------------------------- 1.4 Body +# Statement body is provided +1 + + +# Number of original iterators +2 +# Original iterator names +i j +# Statement body +C[i+j]+=A[i]*B[j]; + + +# =============================================== Options + +3 +1 C +2 A +3 B + + + +hello, world + +HELLO WORLD I SAID + + + + diff -Nru cloog-0.18.2/osl/tests/test_clay.scop cloog-0.18.4/osl/tests/test_clay.scop --- cloog-0.18.2/osl/tests/test_clay.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/test_clay.scop 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,140 @@ +# Matmul example, relation representation + + + +# =============================================== Global +# Backend Language +C + +# Context +CONTEXT +1 3 0 0 0 1 + 1 1 -1 ## N-1 >= 0 + +# Parameter names are provided +1 +# Parameter names + +N + + +# Number of statements +2 + +# =============================================== Statement 1 +# Number of relations describing the statement +3 + +# ---------------------------------------------- 1.1 Domain +DOMAIN +4 5 2 0 0 1 +# e/i i j N 1 + 1 1 0 0 0 ## i >= 0 + 1 -1 0 1 -1 ## -i+N-1 >= 0 + 1 0 1 0 0 ## j >= 0 + 1 0 -1 1 -1 ## -j+N-1 >= 0 + +# ---------------------------------------------- 1.2 Scattering +SCATTERING +5 10 5 2 0 1 +# e/i s1 s2 s3 s4 s5 i j N 1 + 0 -1 0 0 0 0 0 0 0 0 ## s1 = 0 + 0 0 -1 0 0 0 1 0 0 0 ## s2 = i + 0 0 0 -1 0 0 0 0 0 0 ## s3 = 0 + 0 0 0 0 -1 0 0 1 0 0 ## s4 = j + 0 0 0 0 0 -1 0 0 0 0 ## s5 = 0 + +# ---------------------------------------------- 1.3 Access +WRITE +3 8 3 2 0 1 +# e/i Arr [1] [2] i j N 1 + 0 -1 0 0 0 0 0 1 ## C + 0 0 -1 0 1 0 0 0 ## [i] + 0 0 0 -1 0 1 0 0 ## [j] + +# ---------------------------------------------- 1.4 Body +# Statement body is provided +1 + +# Number of original iterators +2 +# Original iterator names +i j +# Statement body +C[i][j] = 0.0; + + +# =============================================== Statement 2 +# Number of relations describing the statement +6 + +# ---------------------------------------------- 2.1 Domain +DOMAIN +6 6 3 0 0 1 +# e/i i j k N 1 + 1 1 0 0 0 0 ## i >= 0 + 1 -1 0 0 1 -1 ## -i+N-1 >= 0 + 1 0 1 0 0 0 ## j >= 0 + 1 0 -1 0 1 -1 ## -j+N-1 >= 0 + 1 0 0 1 0 0 ## k >= 0 + 1 0 0 -1 1 -1 ## -k+N-1 >= 0 + +# ---------------------------------------------- 2.2 Scattering +SCATTERING +7 13 7 3 0 1 +# e/i s1 s2 s3 s4 s5 s6 s7 i j k N 1 + 0 -1 0 0 0 0 0 0 0 0 0 0 0 ## s1 = 0 + 0 0 -1 0 0 0 0 0 1 0 0 0 0 ## s2 = i + 0 0 0 -1 0 0 0 0 0 0 0 0 0 ## s3 = 0 + 0 0 0 0 -1 0 0 0 0 1 0 0 0 ## s4 = j + 0 0 0 0 0 -1 0 0 0 0 0 0 1 ## s5 = 1 + 0 0 0 0 0 0 -1 0 0 0 1 0 0 ## s6 = k + 0 0 0 0 0 0 0 -1 0 0 0 0 0 ## s7 = 0 + +# ---------------------------------------------- 2.3 Access +WRITE +3 9 3 3 0 1 +# e/i Arr [1] [2] i j k N 1 + 0 -1 0 0 0 0 0 0 1 ## C + 0 0 -1 0 1 0 0 0 0 ## [i] + 0 0 0 -1 0 1 0 0 0 ## [j] + +READ +3 9 3 3 0 1 +# e/i Arr [1] [2] i j k N 1 + 0 -1 0 0 0 0 0 0 1 ## C + 0 0 -1 0 1 0 0 0 0 ## [i] + 0 0 0 -1 0 1 0 0 0 ## [j] + +READ +3 9 3 3 0 1 +# e/i Arr [1] [2] i j k N 1 + 0 -1 0 0 0 0 0 0 2 ## A + 0 0 -1 0 1 0 0 0 0 ## [i] + 0 0 0 -1 0 0 1 0 0 ## [k] + +READ +3 9 3 3 0 1 +# e/i Arr [1] [2] i j k N 1 + 0 -1 0 0 0 0 0 0 3 ## B + 0 0 -1 0 0 0 1 0 0 ## [k] + 0 0 0 -1 0 1 0 0 0 ## [j] + +# ---------------------------------------------- 2.4 Body +# Statement body is provided +1 + +# Number of original iterators +3 +# Original iterator names +i j k +# Statement body +C[i][j] = C[i][j] + A[i][k] * B[k][j]; + + +# =============================================== Options + +fission([0,0], 1); + + + diff -Nru cloog-0.18.2/osl/tests/test_coordinates.scop cloog-0.18.4/osl/tests/test_coordinates.scop --- cloog-0.18.2/osl/tests/test_coordinates.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/test_coordinates.scop 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,32 @@ + + +# =============================================== Global +# Language +C + +# Context +CONTEXT +0 2 0 0 0 0 + +# Parameter names are not provided +0 + +# No statement +0 + +# =============================================== Options + +# File name +./ax-do.c + +# Starting line and column +9 4 + +# Ending line and column +15 8 + +# Indentation +2 + + + diff -Nru cloog-0.18.2/osl/tests/test_empty_statement.scop cloog-0.18.4/osl/tests/test_empty_statement.scop --- cloog-0.18.2/osl/tests/test_empty_statement.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/test_empty_statement.scop 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,35 @@ + + +# =============================================== Global +# Language +C + +# Context +CONTEXT +0 2 0 0 0 0 + +# Parameter names are not provided +0 + +# One statement +1 + +# =============================================== Statement 1 +# Number of relations describing the statement +0 + +# ---------------------------------------------- 1.1 Domain +# NULL Domain + +# ---------------------------------------------- 1.2 Scattering +# NULL Scattering + +# ---------------------------------------------- 1.3 Access +# NULL Access + +# ---------------------------------------------- 1.4 Body +# Statement body is not provided +0 + + + diff -Nru cloog-0.18.2/osl/tests/test_just_access.scop cloog-0.18.4/osl/tests/test_just_access.scop --- cloog-0.18.2/osl/tests/test_just_access.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/test_just_access.scop 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,38 @@ + + +# =============================================== Global +# Language +C + +# Context +CONTEXT +0 2 0 0 0 0 + +# Parameter names are not provided +0 + +# One statement +1 + +# =============================================== Statement 1 +# Number of relations describing the statement +1 + +# ---------------------------------------------- 1.1 Domain +# NULL Domain + +# ---------------------------------------------- 1.2 Scattering +# NULL Scattering + +# ---------------------------------------------- 1.3 Access +WRITE +1 3 1 0 0 0 +# e/i Arr 1 + 0 -1 1 + +# ---------------------------------------------- 1.4 Body +# Statement body is not provided +0 + + + diff -Nru cloog-0.18.2/osl/tests/test_just_body.scop cloog-0.18.4/osl/tests/test_just_body.scop --- cloog-0.18.2/osl/tests/test_just_body.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/test_just_body.scop 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,41 @@ + + +# =============================================== Global +# Language +C + +# Context +CONTEXT +0 2 0 0 0 0 + +# Parameter names are not provided +0 + +# One statement +1 + +# =============================================== Statement 1 +# Number of relations describing the statement +0 + +# ---------------------------------------------- 1.1 Domain +# NULL Domain + +# ---------------------------------------------- 1.2 Scattering +# NULL Scattering + +# ---------------------------------------------- 1.3 Access +# NULL Access + +# ---------------------------------------------- 1.4 Body +# Statement body is provided +1 + +# Number of original iterators +0 +# Statement body +foo = bar; + + + + diff -Nru cloog-0.18.2/osl/tests/test_just_domain.scop cloog-0.18.4/osl/tests/test_just_domain.scop --- cloog-0.18.2/osl/tests/test_just_domain.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/test_just_domain.scop 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,37 @@ + + +# =============================================== Global +# Language +C + +# Context +CONTEXT +0 2 0 0 0 0 + +# Parameter names are not provided +0 + +# One statement +1 + +# =============================================== Statement 1 +# Number of relations describing the statement +1 + +# ---------------------------------------------- 1.1 Domain +DOMAIN +0 2 0 0 0 0 + +# ---------------------------------------------- 1.2 Scattering +# NULL Scattering + +# ---------------------------------------------- 1.3 Access +# NULL Access + +# ---------------------------------------------- 1.4 Body +# Statement body is not provided +0 + + + + diff -Nru cloog-0.18.2/osl/tests/test_just_extbody.scop cloog-0.18.4/osl/tests/test_just_extbody.scop --- cloog-0.18.2/osl/tests/test_just_extbody.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/test_just_extbody.scop 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,47 @@ + + +# =============================================== Global +# Language +C + +# Context +CONTEXT +0 2 0 0 0 0 + +# Parameter names are not provided +0 + +# One statement +1 + +# =============================================== Statement 1 +# Number of relations describing the statement +0 + +# ---------------------------------------------- 1.1 Domain +# NULL Domain + +# ---------------------------------------------- 1.2 Scattering +# NULL Scattering + +# ---------------------------------------------- 1.3 Access +# NULL Access + +# ---------------------------------------------- 1.4 Body +# Statement body is provided +1 + +# Number of accesses +2 +# Access coordinates (start/length) +0 3 +6 3 + +# Basic body +# Number of original iterators +0 +# Statement body +foo = bar; + + + diff -Nru cloog-0.18.2/osl/tests/test_just_scattering.scop cloog-0.18.4/osl/tests/test_just_scattering.scop --- cloog-0.18.2/osl/tests/test_just_scattering.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/test_just_scattering.scop 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,36 @@ + + +# =============================================== Global +# Language +C + +# Context +CONTEXT +0 2 0 0 0 0 + +# Parameter names are not provided +0 + +# One statement +1 + +# =============================================== Statement 1 +# Number of relations describing the statement +1 + +# ---------------------------------------------- 1.1 Domain +# NULL Domain + +# ---------------------------------------------- 1.2 Scattering +SCATTERING +0 2 0 0 0 0 + +# ---------------------------------------------- 1.3 Access +# NULL Access + +# ---------------------------------------------- 1.4 Body +# Statement body is not provided +0 + + + diff -Nru cloog-0.18.2/osl/tests/test_matmult.scop cloog-0.18.4/osl/tests/test_matmult.scop --- cloog-0.18.2/osl/tests/test_matmult.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/test_matmult.scop 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,136 @@ +# Matmul example, relation representation + + + +# =============================================== Global +# Backend Language +C + +# Context +CONTEXT +1 3 0 0 0 1 + 1 1 -1 ## N-1 >= 0 + +# Parameter names are provided +1 +# Parameter names + +N + + +# Number of statements +2 + +# =============================================== Statement 1 +# Number of relations describing the statement +3 + +# ---------------------------------------------- 1.1 Domain +DOMAIN +4 5 2 0 0 1 +# e/i i j N 1 + 1 1 0 0 0 ## i >= 0 + 1 -1 0 1 -1 ## -i+N-1 >= 0 + 1 0 1 0 0 ## j >= 0 + 1 0 -1 1 -1 ## -j+N-1 >= 0 + +# ---------------------------------------------- 1.2 Scattering +SCATTERING +5 10 5 2 0 1 +# e/i s1 s2 s3 s4 s5 i j N 1 + 0 -1 0 0 0 0 0 0 0 0 ## s1 = 0 + 0 0 -1 0 0 0 1 0 0 0 ## s2 = i + 0 0 0 -1 0 0 0 0 0 0 ## s3 = 0 + 0 0 0 0 -1 0 0 1 0 0 ## s4 = j + 0 0 0 0 0 -1 0 0 0 0 ## s5 = 0 + +# ---------------------------------------------- 1.3 Access +WRITE +3 8 3 2 0 1 +# e/i Arr [1] [2] i j N 1 + 0 -1 0 0 0 0 0 1 ## C + 0 0 -1 0 1 0 0 0 ## [i] + 0 0 0 -1 0 1 0 0 ## [j] + +# ---------------------------------------------- 1.4 Body +# Statement body is provided +1 + +# Number of original iterators +2 +# Original iterator names +i j +# Statement body +C[i][j] = 0.0; + + +# =============================================== Statement 2 +# Number of relations describing the statement +6 + +# ---------------------------------------------- 2.1 Domain +DOMAIN +6 6 3 0 0 1 +# e/i i j k N 1 + 1 1 0 0 0 0 ## i >= 0 + 1 -1 0 0 1 -1 ## -i+N-1 >= 0 + 1 0 1 0 0 0 ## j >= 0 + 1 0 -1 0 1 -1 ## -j+N-1 >= 0 + 1 0 0 1 0 0 ## k >= 0 + 1 0 0 -1 1 -1 ## -k+N-1 >= 0 + +# ---------------------------------------------- 2.2 Scattering +SCATTERING +7 13 7 3 0 1 +# e/i s1 s2 s3 s4 s5 s6 s7 i j k N 1 + 0 -1 0 0 0 0 0 0 0 0 0 0 0 ## s1 = 0 + 0 0 -1 0 0 0 0 0 1 0 0 0 0 ## s2 = i + 0 0 0 -1 0 0 0 0 0 0 0 0 0 ## s3 = 0 + 0 0 0 0 -1 0 0 0 0 1 0 0 0 ## s4 = j + 0 0 0 0 0 -1 0 0 0 0 0 0 1 ## s5 = 1 + 0 0 0 0 0 0 -1 0 0 0 1 0 0 ## s6 = k + 0 0 0 0 0 0 0 -1 0 0 0 0 0 ## s7 = 0 + +# ---------------------------------------------- 2.3 Access +WRITE +3 9 3 3 0 1 +# e/i Arr [1] [2] i j k N 1 + 0 -1 0 0 0 0 0 0 1 ## C + 0 0 -1 0 1 0 0 0 0 ## [i] + 0 0 0 -1 0 1 0 0 0 ## [j] + +READ +3 9 3 3 0 1 +# e/i Arr [1] [2] i j k N 1 + 0 -1 0 0 0 0 0 0 1 ## C + 0 0 -1 0 1 0 0 0 0 ## [i] + 0 0 0 -1 0 1 0 0 0 ## [j] + +READ +3 9 3 3 0 1 +# e/i Arr [1] [2] i j k N 1 + 0 -1 0 0 0 0 0 0 2 ## A + 0 0 -1 0 1 0 0 0 0 ## [i] + 0 0 0 -1 0 0 1 0 0 ## [k] + +READ +3 9 3 3 0 1 +# e/i Arr [1] [2] i j k N 1 + 0 -1 0 0 0 0 0 0 3 ## B + 0 0 -1 0 0 0 1 0 0 ## [k] + 0 0 0 -1 0 1 0 0 0 ## [j] + +# ---------------------------------------------- 2.4 Body +# Statement body is provided +1 + +# Number of original iterators +3 +# Original iterator names +i j k +# Statement body +C[i][j] = C[i][j] + A[i][k] * B[k][j]; + + + + diff -Nru cloog-0.18.2/osl/tests/test_no_statement.scop cloog-0.18.4/osl/tests/test_no_statement.scop --- cloog-0.18.2/osl/tests/test_no_statement.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/test_no_statement.scop 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,18 @@ + + +# =============================================== Global +# Language +C + +# Context +CONTEXT +0 2 0 0 0 0 + +# Parameter names are not provided +0 + +# No statement +0 + + + diff -Nru cloog-0.18.2/osl/tests/test_scop_list.scop cloog-0.18.4/osl/tests/test_scop_list.scop --- cloog-0.18.2/osl/tests/test_scop_list.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/tests/test_scop_list.scop 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,70 @@ + + +# =============================================== Global +# Language +C + +# Context +CONTEXT +0 2 0 0 0 0 + +# Parameter names are not provided +0 + +# One statement +1 + +# =============================================== Statement 1 +# Number of relations describing the statement +0 + +# ---------------------------------------------- 1.1 Domain +# NULL Domain + +# ---------------------------------------------- 1.2 Scattering +# NULL Scattering + +# ---------------------------------------------- 1.3 Access +# NULL Access + +# ---------------------------------------------- 1.4 Body +# Statement body is not provided +0 + + + + + +# =============================================== Global +# Language +C + +# Context +CONTEXT +0 2 0 0 0 0 + +# Parameter names are not provided +0 + +# One statement +1 + +# =============================================== Statement 1 +# Number of relations describing the statement +0 + +# ---------------------------------------------- 1.1 Domain +# NULL Domain + +# ---------------------------------------------- 1.2 Scattering +# NULL Scattering + +# ---------------------------------------------- 1.3 Access +# NULL Access + +# ---------------------------------------------- 1.4 Body +# Statement body is not provided +0 + + + diff -Nru cloog-0.18.2/osl/THANKS cloog-0.18.4/osl/THANKS --- cloog-0.18.2/osl/THANKS 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/osl/THANKS 2014-10-02 14:12:12.000000000 +0000 @@ -0,0 +1,12 @@ +THANKS +====== + +The authors would like to gratefully thank the people that have +been involved in the (lively) discussions for the definition of +the OpenScop formats and data structures, in particular: + +Uday Bondhugula +Albert Cohen +Tobias Grosser +Sebastian Pop +Sven Verdoolaege diff -Nru cloog-0.18.2/source/clast.c cloog-0.18.4/source/clast.c --- cloog-0.18.2/source/clast.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/source/clast.c 2014-10-02 14:03:59.000000000 +0000 @@ -213,6 +213,7 @@ cloog_clast_free(f->body); if (f->private_vars) free(f->private_vars); if (f->reduction_vars) free(f->reduction_vars); + if (f->time_var_name) free(f->time_var_name); free(f); } @@ -231,6 +232,7 @@ f->parallel = CLAST_PARALLEL_NOT; f->private_vars = NULL; f->reduction_vars = NULL; + f->time_var_name = NULL; cloog_int_init(f->stride); if (stride) cloog_int_set(f->stride, stride->stride); diff -Nru cloog-0.18.2/source/input.c cloog-0.18.4/source/input.c --- cloog-0.18.2/source/input.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/source/input.c 2014-10-02 14:33:50.000000000 +0000 @@ -71,6 +71,10 @@ cloog_options_copy_from_osl_scop(scop, options); return input; } +#else + if (options->openscop) { + cloog_die("CLooG has not been compiled with OpenScop support.\n"); + } #endif /* First of all, we read the language to use. */ diff -Nru cloog-0.18.2/source/isl/constraints.c cloog-0.18.4/source/isl/constraints.c --- cloog-0.18.2/source/isl/constraints.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/source/isl/constraints.c 2015-07-26 07:32:52.000000000 +0000 @@ -5,11 +5,51 @@ #include #include #include +#include +#include #define ALLOC(type) (type*)malloc(sizeof(type)) #define ALLOCN(type,n) (type*)malloc((n)*sizeof(type)) +__isl_give isl_val *cloog_int_to_isl_val(isl_ctx* ctx, cloog_int_t c) +{ + isl_val *v; +#if defined(CLOOG_INT_INT) + v = isl_val_int_from_si(ctx, c); +#elif defined(CLOOG_INT_LONG) + v = isl_val_int_from_si(ctx, c); +#elif defined(CLOOG_INT_LONG_LONG) + v = isl_val_int_from_si(ctx, c); +#elif defined(CLOOG_INT_GMP) + v = isl_val_int_from_gmp(ctx, c); +#else +#error "No integer type defined" +#endif + return v; +} + +/* + * CLooG'll be dealing in integers so we expect numerator/1 form + * from isl_val. Thus get numerator to assign to cloog_int + */ +void isl_val_to_cloog_int(__isl_keep isl_val *val, cloog_int_t *cint) +{ + assert(isl_val_is_int(val)); +#if defined(CLOOG_INT_INT) + *cint = isl_val_get_num_si(val); +#elif defined(CLOOG_INT_LONG) + *cint = isl_val_get_num_si(val); +#elif defined(CLOOG_INT_LONG_LONG) + *cint = isl_val_get_num_si(val); +#elif defined(CLOOG_INT_GMP) + isl_val_get_num_gmp(val, *cint); +#else +#error "No integer type defined" +#endif +} + + CloogConstraintSet *cloog_constraint_set_from_isl_basic_set(struct isl_basic_set *bset) { return (CloogConstraintSet *)bset; @@ -266,53 +306,65 @@ static int cloog_constraint_equal_type(CloogConstraint *cc, int level) { int i; - isl_int c; + isl_val *c; int type = EQTYPE_NONE; struct isl_constraint *constraint = cloog_constraint_to_isl(cc); - isl_int_init(c); - isl_constraint_get_constant(constraint, &c); - if (!isl_int_is_zero(c)) + c = isl_constraint_get_constant_val(constraint); + if (!isl_val_is_zero(c)) type = EQTYPE_CONSTANT; - isl_constraint_get_coefficient(constraint, isl_dim_set, level - 1, &c); - if (!isl_int_is_one(c) && !isl_int_is_negone(c)) + isl_val_free(c); + c = isl_constraint_get_coefficient_val(constraint, isl_dim_set, level - 1); + if (!isl_val_is_one(c) && !isl_val_is_negone(c)) type = EQTYPE_EXAFFINE; + isl_val_free(c); for (i = 0; i < isl_constraint_dim(constraint, isl_dim_param); ++i) { - isl_constraint_get_coefficient(constraint, isl_dim_param, i, &c); - if (isl_int_is_zero(c)) + c = isl_constraint_get_coefficient_val(constraint, isl_dim_param, i); + if (isl_val_is_zero(c)){ + isl_val_free(c); continue; - if ((!isl_int_is_one(c) && !isl_int_is_negone(c)) || + } + if ((!isl_val_is_one(c) && !isl_val_is_negone(c)) || type != EQTYPE_NONE) { type = EQTYPE_EXAFFINE; + isl_val_free(c); break; } type = EQTYPE_PUREITEM; + isl_val_free(c); } for (i = 0; i < isl_constraint_dim(constraint, isl_dim_set); ++i) { if (i == level - 1) continue; - isl_constraint_get_coefficient(constraint, isl_dim_set, i, &c); - if (isl_int_is_zero(c)) + c = isl_constraint_get_coefficient_val(constraint, isl_dim_set, i); + if (isl_val_is_zero(c)){ + isl_val_free(c); continue; - if ((!isl_int_is_one(c) && !isl_int_is_negone(c)) || + } + if ((!isl_val_is_one(c) && !isl_val_is_negone(c)) || type != EQTYPE_NONE) { type = EQTYPE_EXAFFINE; + isl_val_free(c); break; } type = EQTYPE_PUREITEM; + isl_val_free(c); } for (i = 0; i < isl_constraint_dim(constraint, isl_dim_div); ++i) { - isl_constraint_get_coefficient(constraint, isl_dim_div, i, &c); - if (isl_int_is_zero(c)) + c = isl_constraint_get_coefficient_val(constraint, isl_dim_div, i); + if (isl_val_is_zero(c)){ + isl_val_free(c); continue; - if ((!isl_int_is_one(c) && !isl_int_is_negone(c)) || + } + if ((!isl_val_is_one(c) && !isl_val_is_negone(c)) || type != EQTYPE_NONE) { type = EQTYPE_EXAFFINE; + isl_val_free(c); break; } type = EQTYPE_PUREITEM; + isl_val_free(c); } - isl_int_clear(c); if (type == EQTYPE_NONE) type = EQTYPE_CONSTANT; @@ -389,14 +441,17 @@ /** * cloog_constraint_set_copy function: - * this functions builds and returns a "hard copy" (not a pointer copy) of a - * CloogConstraintSet data structure. + * this functions builds and returns a "soft copy" of a CloogConstraintSet data + * structure. + * + * NOTE: this function used to return a "hard copy" (not a pointer copy) but isl + * doesn't provide isl_basic_set_dup() anymore and a soft copy works as well. */ CloogConstraintSet *cloog_constraint_set_copy(CloogConstraintSet *constraints) { isl_basic_set *bset; bset = cloog_constraints_set_to_isl(constraints); - return cloog_constraint_set_from_isl_basic_set(isl_basic_set_dup(bset)); + return cloog_constraint_set_from_isl_basic_set(isl_basic_set_copy(bset)); } @@ -447,27 +502,31 @@ { int i, nb_elts; unsigned dim = cloog_constraint_total_dimension(constraint); - cloog_int_t c; + isl_val *c; struct clast_reduction *r; struct clast_expr *e = NULL; isl_aff *div; + cloog_int_t cint; + cloog_int_init(cint); div = isl_constraint_get_div(cloog_constraint_to_isl(constraint), pos); - cloog_int_init(c); for (i = 0, nb_elts = 0; i < dim; ++i) { struct cloog_isl_dim dim; dim = constraint_cloog_dim_to_isl_dim(constraint, i); if (dim.type == isl_dim_set) dim.type = isl_dim_in; - isl_aff_get_coefficient(div, dim.type, dim.pos, &c); - if (!cloog_int_is_zero(c)) + c = isl_aff_get_coefficient_val(div, dim.type, dim.pos); + if (!isl_val_is_zero(c)) ++nb_elts; + + isl_val_free(c); } - isl_aff_get_constant(div, &c); - if (!cloog_int_is_zero(c)) + c = isl_aff_get_constant_val(div); + if (!isl_val_is_zero(c)) ++nb_elts; + isl_val_free(c); r = new_clast_reduction(clast_red_sum, nb_elts); for (i = 0, nb_elts = 0; i < dim; ++i) { @@ -477,22 +536,35 @@ dim = constraint_cloog_dim_to_isl_dim(constraint, i); if (dim.type == isl_dim_set) dim.type = isl_dim_in; - isl_aff_get_coefficient(div, dim.type, dim.pos, &c); - if (cloog_int_is_zero(c)) + c = isl_aff_get_coefficient_val(div, dim.type, dim.pos); + if (isl_val_is_zero(c)){ + isl_val_free(c); continue; + } v = cloog_constraint_variable_expr(constraint, 1 + i, names); - r->elts[nb_elts++] = &new_clast_term(c, v)->expr; + /* We are interested only in the numerator */ + cloog_int_set_si(cint, isl_val_get_num_si(c)); + r->elts[nb_elts++] = &new_clast_term(cint, v)->expr; + + isl_val_free(c); + } + + c = isl_aff_get_constant_val(div); + if (!isl_val_is_zero(c)) { + /* We are interested only in the numerator */ + cloog_int_set_si(cint, isl_val_get_num_si(c)); + r->elts[nb_elts++] = &new_clast_term(cint, NULL)->expr; } - isl_aff_get_constant(div, &c); - if (!cloog_int_is_zero(c)) - r->elts[nb_elts++] = &new_clast_term(c, NULL)->expr; + isl_val_free(c); - isl_aff_get_denominator(div, &c); - e = &new_clast_binary(clast_bin_fdiv, &r->expr, c)->expr; + c = isl_aff_get_denominator_val(div); + isl_val_to_cloog_int(c, &cint); + isl_val_free(c); + e = &new_clast_binary(clast_bin_fdiv, &r->expr, cint)->expr; - cloog_int_clear(c); + cloog_int_clear(cint); isl_aff_free(div); @@ -529,37 +601,34 @@ */ int cloog_constraint_involves(CloogConstraint *constraint, int v) { - isl_int c; + isl_val *c; int res; - isl_int_init(c); - cloog_constraint_coefficient_get(constraint, v, &c); - res = !isl_int_is_zero(c); - isl_int_clear(c); + c = cloog_constraint_coefficient_get_val(constraint, v); + res = !isl_val_is_zero(c); + isl_val_free(c); return res; } int cloog_constraint_is_lower_bound(CloogConstraint *constraint, int v) { - isl_int c; + isl_val *c; int res; - isl_int_init(c); - cloog_constraint_coefficient_get(constraint, v, &c); - res = isl_int_is_pos(c); - isl_int_clear(c); + c = cloog_constraint_coefficient_get_val(constraint, v); + res = isl_val_is_pos(c); + isl_val_free(c); return res; } int cloog_constraint_is_upper_bound(CloogConstraint *constraint, int v) { - isl_int c; + isl_val *c; int res; - isl_int_init(c); - cloog_constraint_coefficient_get(constraint, v, &c); - res = isl_int_is_neg(c); - isl_int_clear(c); + c = cloog_constraint_coefficient_get_val(constraint, v); + res = isl_val_is_neg(c); + isl_val_free(c); return res; } @@ -585,15 +654,37 @@ { struct cloog_isl_dim dim; isl_constraint *c; + isl_val *ival; + + if (!constraint) + val = NULL; + + dim = constraint_cloog_dim_to_isl_dim(constraint, var); + c = cloog_constraint_to_isl(constraint); + ival = isl_constraint_get_coefficient_val(c, dim.type, dim.pos); + + isl_val_to_cloog_int(ival, val); + isl_val_free(ival); +} + +isl_val *cloog_constraint_coefficient_get_val(CloogConstraint *constraint, + int var) +{ + struct cloog_isl_dim dim; + isl_constraint *c; + isl_val *val; if (!constraint) - return; + return NULL; dim = constraint_cloog_dim_to_isl_dim(constraint, var); c = cloog_constraint_to_isl(constraint); - isl_constraint_get_coefficient(c, dim.type, dim.pos, val); + val = isl_constraint_get_coefficient_val(c, dim.type, dim.pos); + return val; } + + void cloog_constraint_coefficient_set(CloogConstraint *constraint, int var, cloog_int_t val) { @@ -604,14 +695,26 @@ dim = constraint_cloog_dim_to_isl_dim(constraint, var); c = cloog_constraint_to_isl(constraint); - isl_constraint_set_coefficient(c, dim.type, dim.pos, val); + isl_constraint_set_coefficient_val(c, dim.type, dim.pos, + cloog_int_to_isl_val(isl_constraint_get_ctx(c), val)); } void cloog_constraint_constant_get(CloogConstraint *constraint, cloog_int_t *val) { - isl_constraint_get_constant(cloog_constraint_to_isl(constraint), val); + isl_val *ival; + ival = isl_constraint_get_constant_val(cloog_constraint_to_isl(constraint)); + isl_val_to_cloog_int(ival, val); + isl_val_free(ival); +} + + +__isl_give isl_val *cloog_constraint_constant_get_val(CloogConstraint *constraint) +{ + return isl_constraint_get_constant_val(cloog_constraint_to_isl(constraint)); } + + /** * Copy the coefficient of constraint c into dst in PolyLib order, * i.e., first the coefficients of the variables, then the coefficients @@ -700,15 +803,11 @@ static int add_constant_term(CloogConstraint *c, void *user) { - isl_int *bound = (isl_int *)user; - isl_int v; + isl_val **bound = (isl_val **)user; + isl_val *v; - isl_int_init(v); - - cloog_constraint_constant_get(c, &v); - isl_int_add(*bound, *bound, v); - - isl_int_clear(v); + v = cloog_constraint_constant_get_val(c); + *bound = isl_val_add(*bound, v); return 0; } @@ -822,11 +921,14 @@ c = isl_constraint_set_coefficient_si(c, isl_dim_set, dim.pos, -1); bset = isl_basic_set_add_constraint(bset, c); - isl_int_set_si(*bound, 0); + cloog_int_set_si(*bound, 0); + isl_val *v = cloog_int_to_isl_val(isl_basic_set_get_ctx(bset), *bound); constraints = cloog_constraint_set_from_isl_basic_set(bset); cloog_constraint_set_foreach_constraint(constraints, - add_constant_term, bound); + add_constant_term, &v); + isl_val_to_cloog_int(v, bound); //return the value to bound + isl_val_free(v); isl_basic_set_free(orig); return cloog_constraint_set_from_isl_basic_set(bset); } @@ -896,31 +998,27 @@ isl_space *dim = isl_constraint_get_space(c); isl_local_space *ls = isl_local_space_from_space(dim); isl_aff *offset = isl_aff_zero_on_domain(ls); - isl_int u; + isl_val *u; unsigned nparam, nvar; - isl_int_init(u); - nparam = isl_constraint_dim(c, isl_dim_param); nvar = isl_constraint_dim(c, isl_dim_set); for (i = 0; i < nparam; ++i) { - isl_constraint_get_coefficient(c, isl_dim_param, i, &u); - isl_int_mul(u, u, stride->factor); - offset = isl_aff_set_coefficient(offset, isl_dim_param, i, u); + u = isl_constraint_get_coefficient_val(c, isl_dim_param, i); + u = isl_val_mul(u, cloog_int_to_isl_val(isl_constraint_get_ctx(c), stride->factor)); + offset = isl_aff_set_coefficient_val(offset, isl_dim_param, i, u); } for (i = 0; i < nvar; ++i) { if (i == level - 1) continue; - isl_constraint_get_coefficient(c, isl_dim_set, i, &u); - isl_int_mul(u, u, stride->factor); - offset = isl_aff_set_coefficient(offset, isl_dim_in, i, u); - } - isl_constraint_get_constant(c, &u); - isl_int_mul(u, u, stride->factor); - offset = isl_aff_set_constant(offset, u); - - isl_int_clear(u); + u = isl_constraint_get_coefficient_val(c, isl_dim_set, i); + u = isl_val_mul(u, cloog_int_to_isl_val(isl_constraint_get_ctx(c), stride->factor)); + offset = isl_aff_set_coefficient_val(offset, isl_dim_in, i, u); + } + u = isl_constraint_get_constant_val(c); + u = isl_val_mul(u, cloog_int_to_isl_val(isl_constraint_get_ctx(c), stride->factor)); + offset = isl_aff_set_constant_val(offset, u); return offset; } @@ -953,9 +1051,9 @@ offset = extract_stride_offset(stride_c, level, stride); lower = isl_aff_sub(lower, isl_aff_copy(offset)); - lower = isl_aff_scale_down(lower, stride->stride); + lower = isl_aff_scale_down_val(lower, cloog_int_to_isl_val(isl_constraint_get_ctx(stride_c), stride->stride)); lower = isl_aff_ceil(lower); - lower = isl_aff_scale(lower, stride->stride); + lower = isl_aff_scale_val(lower, cloog_int_to_isl_val(isl_constraint_get_ctx(stride_c), stride->stride)); lower = isl_aff_add(lower, offset); lower = isl_aff_neg(lower); lower = isl_aff_add_coefficient_si(lower, isl_dim_in, level - 1, 1); diff -Nru cloog-0.18.2/source/isl/domain.c cloog-0.18.4/source/isl/domain.c --- cloog-0.18.2/source/isl/domain.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/source/isl/domain.c 2015-07-26 07:32:52.000000000 +0000 @@ -7,7 +7,11 @@ #include #include #include +#include #include +#include +#include +#include #ifdef OSL_SUPPORT #include @@ -64,25 +68,34 @@ void cloog_domain_print_constraints(FILE *foo, CloogDomain *domain, int print_number) { + isl_printer *p; isl_basic_set *bset; isl_set *set = isl_set_from_cloog_domain(domain); - if (print_number) - isl_set_print(set, foo, 0, ISL_FORMAT_EXT_POLYLIB); - else { + p = isl_printer_to_file(isl_set_get_ctx(set), foo); + if (print_number) { + p = isl_printer_set_output_format(p, ISL_FORMAT_EXT_POLYLIB); + p = isl_printer_print_set(p, set); + } else { assert(isl_set_n_basic_set(set) == 1); bset = isl_set_copy_basic_set(set); - isl_basic_set_print(bset, foo, - 0, NULL, NULL, ISL_FORMAT_POLYLIB); + p = isl_printer_set_output_format(p, ISL_FORMAT_POLYLIB); + p = isl_printer_print_basic_set(p, bset); isl_basic_set_free(bset); } + isl_printer_free(p); } void cloog_scattering_print_constraints(FILE *foo, CloogScattering *scattering) { isl_map *map = isl_map_from_cloog_scattering(scattering); - isl_map_print(map, foo, 0, ISL_FORMAT_EXT_POLYLIB); + isl_printer *p; + + p = isl_printer_to_file(isl_map_get_ctx(map), foo); + p = isl_printer_set_output_format(p, ISL_FORMAT_EXT_POLYLIB); + p = isl_printer_print_map(p, map); + isl_printer_free(p); } @@ -341,6 +354,7 @@ { int i ; isl_set *set = isl_set_from_cloog_domain(domain); + isl_printer *p; /* Go to the right level. */ for (i = 0; i < level; i++) @@ -354,7 +368,9 @@ for (i = 0; i < level+1; ++i) fprintf(file, "|\t"); - isl_set_print(set, file, 0, ISL_FORMAT_ISL); + p = isl_printer_to_file(isl_set_get_ctx(set), file); + p = isl_printer_print_set(p, set); + isl_printer_free(p); fprintf(file, "\n"); } @@ -510,15 +526,18 @@ else constraint = isl_inequality_alloc(ls); - for (j = 0; j < nvariables; ++j) - isl_constraint_set_coefficient(constraint, isl_dim_out, j, - row[1 + j]); - - for (j = 0; j < nparam; ++j) - isl_constraint_set_coefficient(constraint, isl_dim_param, j, - row[1 + nvariables + j]); + for (j = 0; j < nvariables; ++j) { + isl_val *val = cloog_int_to_isl_val(isl_constraint_get_ctx(constraint), row[1 + j]); + isl_constraint_set_coefficient_val(constraint, isl_dim_out, j, val); + } - isl_constraint_set_constant(constraint, row[1 + nvariables + nparam]); + for (j = 0; j < nparam; ++j) { + isl_val *val = cloog_int_to_isl_val(isl_constraint_get_ctx(constraint), row[1 + nvariables + j]); + isl_constraint_set_coefficient_val(constraint, isl_dim_param, j, val); + } + + isl_val *val = cloog_int_to_isl_val(isl_constraint_get_ctx(constraint), row[1 + nvariables + nparam]); + isl_constraint_set_constant_val(constraint, val); return constraint; } @@ -618,9 +637,6 @@ CloogDomain *domain = NULL; if (relation != NULL) { - if (relation->precision != OSL_PRECISION_MP) - cloog_die("Non-GMP precision is not supported yet.\n"); - str = osl_relation_spprint_polylib(relation, NULL); set = isl_set_read_from_str(ctx, str); free(str); @@ -631,7 +647,6 @@ return domain; } - /** * Converts an openscop scattering relation to a CLooG scattering. * \param[in,out] state CLooG state. @@ -646,9 +661,6 @@ CloogScattering *scattering = NULL; if (relation != NULL) { - if (relation->precision != OSL_PRECISION_MP) - cloog_die("Non-GMP precision is not supported yet.\n"); - if (relation->type != OSL_TYPE_SCATTERING) cloog_die("Cannot convert a non-scattering relation to a scattering.\n"); @@ -779,10 +791,22 @@ void cloog_domain_stride(CloogDomain *domain, int strided_level, cloog_int_t *stride, cloog_int_t *offset) { + int ret = -1; isl_set *set = isl_set_from_cloog_domain(domain); - isl_set_dim_residue_class(set, strided_level - 1, stride, offset); - if (!isl_int_is_zero(*offset)) - isl_int_sub(*offset, *stride, *offset); + isl_val *stride_val = NULL; + isl_val *offset_val = NULL; + ret = isl_set_dim_residue_class_val(set, strided_level - 1, &stride_val, &offset_val); + if (ret != 0) + cloog_die("failure to compute stride.\n"); + isl_val_to_cloog_int(stride_val, stride); + isl_val_to_cloog_int(offset_val, offset); + + if (!cloog_int_is_zero(*offset)) + cloog_int_sub(*offset, *stride, *offset); + + isl_val_free(stride_val); + isl_val_free(offset_val); + return; } @@ -796,7 +820,7 @@ { struct cloog_can_stride *ccs = (struct cloog_can_stride *)user; int i; - isl_int v; + isl_val *v; unsigned n_div; if (isl_constraint_is_equality(c)) { @@ -804,21 +828,22 @@ return 0; } - isl_int_init(v); - isl_constraint_get_coefficient(c, isl_dim_set, ccs->level - 1, &v); - if (isl_int_is_pos(v)) { + v = isl_constraint_get_coefficient_val(c, isl_dim_set, ccs->level - 1); + if (isl_val_is_pos(v)) { n_div = isl_constraint_dim(c, isl_dim_div); + for (i = 0; i < n_div; ++i) { - isl_constraint_get_coefficient(c, isl_dim_div, i, &v); - if (!isl_int_is_zero(v)) + isl_val_free(v); + v = isl_constraint_get_coefficient_val(c, isl_dim_div, i); + if (!isl_val_is_zero(v)) break; } if (i < n_div) ccs->can_stride = 0; } - isl_int_clear(v); - isl_constraint_free(c); + isl_val_free(v); + isl_constraint_free(c); return 0; } @@ -903,7 +928,7 @@ static int constraint_stride_lower(__isl_take isl_constraint *c, void *user) { struct cloog_stride_lower *csl = (struct cloog_stride_lower *)user; - isl_int v; + isl_val *v; isl_constraint *bound; isl_aff *b; @@ -912,31 +937,31 @@ return 0; } - isl_int_init(v); - isl_constraint_get_coefficient(c, isl_dim_set, csl->level - 1, &v); - if (!isl_int_is_pos(v)) { - isl_int_clear(v); + v = isl_constraint_get_coefficient_val(c, isl_dim_set, csl->level - 1); + if (!isl_val_is_pos(v)) { + isl_val_free(v); isl_constraint_free(c); return 0; } + isl_val_free(v); b = isl_constraint_get_bound(c, isl_dim_set, csl->level - 1); b = isl_aff_neg(b); - b = isl_aff_add_constant(b, csl->stride->offset); - b = isl_aff_scale_down(b, csl->stride->stride); + b = isl_aff_add_constant_val(b, cloog_int_to_isl_val(isl_constraint_get_ctx(c), csl->stride->offset)); + b = isl_aff_scale_down_val(b, cloog_int_to_isl_val(isl_constraint_get_ctx(c), csl->stride->stride)); b = isl_aff_floor(b); - b = isl_aff_scale(b, csl->stride->stride); - isl_int_neg(v, csl->stride->offset); - b = isl_aff_add_constant(b, v); + b = isl_aff_scale_val(b, cloog_int_to_isl_val(isl_constraint_get_ctx(c), csl->stride->stride)); + v = cloog_int_to_isl_val(isl_constraint_get_ctx(c), csl->stride->offset); + v = isl_val_neg(v); + b = isl_aff_add_constant_val(b, v); b = isl_aff_add_coefficient_si(b, isl_dim_in, csl->level - 1, 1); bound = isl_inequality_from_aff(b); csl->bounds = isl_basic_set_add_constraint(csl->bounds, bound); - isl_int_clear(v); isl_constraint_free(c); return 0; @@ -960,7 +985,7 @@ static int constraint_stride_lower_c(__isl_take isl_constraint *c, void *user) { struct cloog_stride_lower *csl = (struct cloog_stride_lower *)user; - isl_int v; + isl_val *v; isl_constraint *bound; isl_constraint *csl_c; isl_aff *d, *b; @@ -970,10 +995,9 @@ return 0; } - isl_int_init(v); - isl_constraint_get_coefficient(c, isl_dim_set, csl->level - 1, &v); - if (!isl_int_is_pos(v)) { - isl_int_clear(v); + v = isl_constraint_get_coefficient_val(c, isl_dim_set, csl->level - 1); + if (!isl_val_is_pos(v)) { + isl_val_free(v); isl_constraint_free(c); return 0; @@ -984,15 +1008,15 @@ d = isl_constraint_get_aff(csl_c); d = isl_aff_drop_dims(d, isl_dim_div, 0, isl_aff_dim(d, isl_dim_div)); d = isl_aff_set_coefficient_si(d, isl_dim_in, csl->level - 1, 0); - d = isl_aff_scale(d, csl->stride->factor); + d = isl_aff_scale_val(d, cloog_int_to_isl_val(isl_constraint_get_ctx(csl_c), csl->stride->factor)); b = isl_constraint_get_bound(c, isl_dim_set, csl->level - 1); b = isl_aff_neg(b); b = isl_aff_add(b, isl_aff_copy(d)); - b = isl_aff_scale_down(b, csl->stride->stride); + b = isl_aff_scale_down_val(b, cloog_int_to_isl_val(isl_constraint_get_ctx(csl_c), csl->stride->stride)); b = isl_aff_floor(b); - b = isl_aff_scale(b, csl->stride->stride); + b = isl_aff_scale_val(b, cloog_int_to_isl_val(isl_constraint_get_ctx(csl_c), csl->stride->stride)); b = isl_aff_sub(b, d); b = isl_aff_add_coefficient_si(b, isl_dim_in, csl->level - 1, 1); @@ -1000,7 +1024,7 @@ csl->bounds = isl_basic_set_add_constraint(csl->bounds, bound); - isl_int_clear(v); + isl_val_free(v); isl_constraint_free(c); return 0; @@ -1077,7 +1101,7 @@ { isl_set *set1 = isl_set_from_cloog_domain(d1); isl_set *set2 = isl_set_from_cloog_domain(d2); - return isl_set_fast_is_equal(set1, set2); + return isl_set_plain_is_equal(set1, set2); } struct cloog_bound_split { @@ -1090,28 +1114,30 @@ static int constraint_bound_split(__isl_take isl_constraint *c, void *user) { struct cloog_bound_split *cbs = (struct cloog_bound_split *)user; - isl_int v; + isl_val *v; int i; int handle = 0; - isl_int_init(v); - isl_constraint_get_coefficient(c, isl_dim_set, cbs->level - 1, &v); - if (!cbs->lower && isl_int_is_pos(v)) + v = isl_constraint_get_coefficient_val(c, isl_dim_set, cbs->level - 1); + if (!cbs->lower && isl_val_is_pos(v)) cbs->lower = handle = 1; - else if (!cbs->upper && isl_int_is_neg(v)) + else if (!cbs->upper && isl_val_is_neg(v)) cbs->upper = handle = 1; + if (handle) { for (i = 0; i < isl_set_dim(cbs->set, isl_dim_param); ++i) { - isl_constraint_get_coefficient(c, isl_dim_param, i, &v); - if (isl_int_is_zero(v)) + isl_val_free(v); + v = isl_constraint_get_coefficient_val(c, isl_dim_param, i); + if (isl_val_is_zero(v)) continue; + cbs->set = isl_set_split_dims(cbs->set, isl_dim_param, i, 1); } } - isl_int_clear(v); - isl_constraint_free(c); + isl_val_free(v); + isl_constraint_free(c); return (cbs->lower && cbs->upper) ? -1 : 0; } @@ -1203,7 +1229,7 @@ * - scattdims is the total number of scattering dimentions. */ int cloog_scattering_lazy_block(CloogScattering *s1, CloogScattering *s2, - CloogScatteringList *scattering, int scattdims) + CloogScatteringList *scattering, int scattdims) { int i; struct isl_space *dim; @@ -1211,8 +1237,8 @@ struct isl_set *delta; isl_map *map1 = isl_map_from_cloog_scattering(s1); isl_map *map2 = isl_map_from_cloog_scattering(s2); - int fixed, block; - isl_int cst; + int block; + isl_val *cst; unsigned n_scat; n_scat = isl_map_dim(map1, isl_dim_out); @@ -1225,22 +1251,33 @@ rel = isl_map_apply_domain(rel, isl_map_copy(map1)); rel = isl_map_apply_range(rel, isl_map_copy(map2)); delta = isl_map_deltas(rel); - isl_int_init(cst); + cst = NULL; for (i = 0; i < n_scat; ++i) { - fixed = isl_set_fast_dim_is_fixed(delta, i, &cst); - if (fixed != 1) + cst = isl_set_plain_get_val_if_fixed(delta, isl_dim_set, i); + if (!cst){ + isl_val_free(cst); break; - if (isl_int_is_zero(cst)) + } + if (isl_val_is_zero(cst)){ + isl_val_free(cst); continue; - if (i + 1 < n_scat) + } + if (i + 1 < n_scat){ + isl_val_free(cst); break; - if (!isl_int_is_one(cst)) + } + if (!isl_val_is_one(cst)){ + isl_val_free(cst); break; - if (!injective_scattering(scattering)) + } + if (!injective_scattering(scattering)){ + isl_val_free(cst); break; + } + + isl_val_free(cst); } block = i >= n_scat; - isl_int_clear(cst); isl_set_free(delta); return block; } @@ -1255,7 +1292,7 @@ { isl_set *set1 = isl_set_from_cloog_domain(d1); isl_set *set2 = isl_set_from_cloog_domain(d2); - return isl_set_fast_is_disjoint(set1, set2); + return isl_set_plain_is_disjoint(set1, set2); } @@ -1273,7 +1310,7 @@ one_map = isl_map_from_cloog_scattering(one->scatt); for (other = one->next; other; other = other->next) { other_map = isl_map_from_cloog_scattering(other->scatt); - if (isl_map_fast_is_equal(one_map, other_map)) + if (isl_map_plain_is_equal(one_map, other_map)) return 1; } } @@ -1345,10 +1382,25 @@ * If value is not NULL, then it is set to the constant value of dimension. */ int cloog_scattering_lazy_isscalar(CloogScattering *scatt, int dimension, - cloog_int_t *value) + cloog_int_t *value) { isl_map *map = isl_map_from_cloog_scattering(scatt); - return isl_map_fast_is_fixed(map, isl_dim_out, dimension, value); + isl_val *v = isl_map_plain_get_val_if_fixed(map, isl_dim_out, dimension); + if (v != NULL) { + if (!isl_val_is_nan(v)){ + if (value != NULL) + isl_val_to_cloog_int(v, value); + + isl_val_free(v); + return 1; + } + else { + isl_val_free(v); + return 0; + } + } + + return 0; } @@ -1362,7 +1414,22 @@ cloog_int_t *value) { isl_set *set = isl_set_from_cloog_domain(domain); - return isl_set_fast_dim_is_fixed(set, dimension, value); + isl_val *cst = isl_set_plain_get_val_if_fixed(set, isl_dim_set, dimension); + if (cst != NULL) { + if (!isl_val_is_nan(cst)){ + if (value != NULL) + isl_val_to_cloog_int(cst, value); + + isl_val_free(cst); + return 1; + } + else { + isl_val_free(cst); + return 0; + } + } + + return 0; } @@ -1389,20 +1456,24 @@ int dim, cloog_int_t min, cloog_int_t max) { int i; - struct isl_basic_set *cube; - struct isl_basic_set *interval; - struct isl_basic_set_list *list; + isl_space *space; + isl_set *cube; + isl_val *min_v; + isl_val *max_v; if (dim == 0) return cloog_domain_universe(state, dim); - interval = isl_basic_set_interval(state->backend->ctx, min, max); - list = isl_basic_set_list_alloc(state->backend->ctx, dim); - for (i = 0; i < dim; ++i) - list = isl_basic_set_list_add(list, isl_basic_set_copy(interval)); - isl_basic_set_free(interval); - cube = isl_basic_set_list_product(list); - return cloog_domain_from_isl_set(isl_set_from_basic_set(cube)); + space = isl_space_set_alloc(state->backend->ctx, 0, dim); + cube = isl_set_universe(space); + for (i = 0; i < dim; ++i) { + min_v = cloog_int_to_isl_val(isl_set_get_ctx(cube), min); + max_v = cloog_int_to_isl_val(isl_set_get_ctx(cube), max); + cube = isl_set_lower_bound_val(cube, isl_dim_set, i, min_v); + cube = isl_set_upper_bound_val(cube, isl_dim_set, i, max_v); + } + + return cloog_domain_from_isl_set(cube); } @@ -1595,7 +1666,7 @@ cloog_int_mul(tmp, tmp, d); cloog_int_sub(c, c, tmp); cloog_int_swap(c, d); - cloog_int_swap(e, f); + cloog_int_swap(e, f); } cloog_int_set(*g, c); if (cloog_int_is_zero(a)) @@ -1631,49 +1702,70 @@ static CloogStride *construct_stride(isl_constraint *c, int level) { int i, n, sign; - isl_int v, m, gcd, stride, factor; + isl_val *v, *m, *gcd, *stride; + isl_val *v_copy, *m_copy, *gcd_copy; + cloog_int_t c_v, c_m, c_gcd, c_stride, c_factor; CloogStride *s; + isl_ctx *ctx = isl_constraint_get_ctx(c);; if (!c) return NULL; - isl_int_init(v); - isl_int_init(m); - isl_int_init(gcd); - isl_int_init(factor); - isl_int_init(stride); - - isl_constraint_get_coefficient(c, isl_dim_set, level - 1, &v); - sign = isl_int_sgn(v); - isl_int_abs(m, v); + v = isl_constraint_get_coefficient_val(c, isl_dim_set, level - 1); + + sign = isl_val_sgn(v); + m = isl_val_abs(v); /* *takes* v. */ - isl_int_set_si(gcd, 0); + gcd = isl_val_int_from_si(ctx, 0); n = isl_constraint_dim(c, isl_dim_div); for (i = 0; i < n; ++i) { - isl_constraint_get_coefficient(c, isl_dim_div, i, &v); - isl_int_gcd(gcd, gcd, v); + v = isl_constraint_get_coefficient_val(c, isl_dim_div, i); + gcd = isl_val_gcd(gcd, v); } - isl_int_gcd(v, m, gcd); - isl_int_divexact(stride, gcd, v); + m_copy = isl_val_copy(m); + gcd_copy = isl_val_copy(gcd); + + v = isl_val_gcd(m, gcd); - if (isl_int_is_zero(stride) || isl_int_is_one(stride)) + v_copy = isl_val_copy(v); + gcd = isl_val_copy(gcd_copy); + stride = isl_val_div(gcd, v); + + if (isl_val_is_zero(stride) || isl_val_is_one(stride)) s = NULL; else { - Euclid(m, stride, &factor, &v, &gcd); + cloog_int_init(c_m); + cloog_int_init(c_stride); + cloog_int_init(c_v); + cloog_int_init(c_gcd); + cloog_int_init(c_factor); + + isl_val_to_cloog_int(m_copy, &c_m); + isl_val_to_cloog_int(stride, &c_stride); + isl_val_to_cloog_int(v_copy, &c_v); + isl_val_to_cloog_int(gcd_copy, &c_gcd); + + Euclid(c_m, c_stride, &c_factor, &c_v, &c_gcd); if (sign > 0) - isl_int_neg(factor, factor); + cloog_int_neg(c_factor, c_factor); c = isl_constraint_copy(c); - s = cloog_stride_alloc_from_constraint(stride, - cloog_constraint_from_isl_constraint(c), factor); + s = cloog_stride_alloc_from_constraint(c_stride, + cloog_constraint_from_isl_constraint(c), c_factor); + + + cloog_int_clear(c_m); + cloog_int_clear(c_stride); + cloog_int_clear(c_v); + cloog_int_clear(c_gcd); + cloog_int_clear(c_factor); } - isl_int_clear(stride); - isl_int_clear(factor); - isl_int_clear(gcd); - isl_int_clear(m); - isl_int_clear(v); + isl_val_free(stride); + isl_val_free(gcd_copy); + isl_val_free(m_copy); + isl_val_free(v_copy); return s; } @@ -1694,7 +1786,7 @@ { struct cloog_isl_find_stride_data *data; int n; - isl_int v; + isl_val *v; if (!isl_constraint_is_equality(c)) { isl_constraint_free(c); @@ -1714,13 +1806,11 @@ return 0; } - isl_int_init(v); - - isl_constraint_get_coefficient(c, isl_dim_set, data->level - 1, &v); - if (!isl_int_is_zero(v)) + v = isl_constraint_get_coefficient_val(c, isl_dim_set, data->level - 1); + if (!isl_val_is_zero(v)) data->stride = construct_stride(c, data->level); - isl_int_clear(v); + isl_val_free(v); isl_constraint_free(c); @@ -1769,7 +1859,7 @@ int level; isl_constraint *c; isl_set *set; - isl_int *n; + isl_val *n; }; @@ -1782,11 +1872,11 @@ * with l the given lower bound and i the iterator identified by level. */ static int is_valid_unrolling_lower_bound(struct cloog_can_unroll *ccu, - __isl_keep isl_constraint *c, isl_int *v) + __isl_keep isl_constraint *c, isl_val **v) { unsigned n_div; isl_aff *aff; - enum isl_lp_result res; + enum isl_lp_result; n_div = isl_constraint_dim(c, isl_dim_div); if (isl_constraint_involves_dims(c, isl_dim_div, 0, n_div)) @@ -1796,15 +1886,19 @@ aff = isl_aff_ceil(aff); aff = isl_aff_neg(aff); aff = isl_aff_add_coefficient_si(aff, isl_dim_in, ccu->level - 1, 1); - res = isl_set_max(ccu->set, aff, v); + *v = isl_set_max_val(ccu->set, aff); isl_aff_free(aff); - if (res == isl_lp_unbounded) - return 0; + if (!*v || isl_val_is_nan(*v)) + cloog_die("Fail to decide about unrolling (cannot find max)"); - assert(res == isl_lp_ok); + if (isl_val_is_infty(*v) || isl_val_is_neginfty(*v)){ + isl_val_free(*v); + *v = NULL; + return 0; + } - cloog_int_add_ui(*v, *v, 1); + *v = isl_val_add_ui(*v, 1); return 1; } @@ -1818,21 +1912,21 @@ static int constraint_can_unroll(__isl_take isl_constraint *c, void *user) { struct cloog_can_unroll *ccu = (struct cloog_can_unroll *)user; - isl_int v; - isl_int count; + isl_val *v; + isl_val *count = NULL; - isl_int_init(v); - isl_int_init(count); - isl_constraint_get_coefficient(c, isl_dim_set, ccu->level - 1, &v); - if (isl_int_is_pos(v) && - is_valid_unrolling_lower_bound(ccu, c, &count) && - (!ccu->c || isl_int_lt(count, *ccu->n))) { + v = isl_constraint_get_coefficient_val(c, isl_dim_set, ccu->level - 1); + if (isl_val_is_pos(v) && + is_valid_unrolling_lower_bound(ccu, c, &count) && + (!ccu->c || (isl_val_lt(count, ccu->n))) ) { isl_constraint_free(ccu->c); ccu->c = isl_constraint_copy(c); - isl_int_set(*ccu->n, count); + if (ccu->n) + isl_val_free(ccu->n); + ccu->n = isl_val_copy(count); } - isl_int_clear(count); - isl_int_clear(v); + isl_val_free(count); + isl_val_free(v); isl_constraint_free(c); return 0; @@ -1872,7 +1966,8 @@ CloogConstraint **lb) { isl_set *set = isl_set_from_cloog_domain(domain); - struct cloog_can_unroll ccu = { 1, level, NULL, set, n }; + isl_val *v = cloog_int_to_isl_val(isl_set_get_ctx(set), *n); + struct cloog_can_unroll ccu = { 1, level, NULL, set, v }; int r; *lb = NULL; @@ -1887,6 +1982,11 @@ *lb = cloog_constraint_from_isl_constraint(ccu.c); + isl_val_to_cloog_int(ccu.n, n); + /* Note: we have to free ccu.n and not v because v has been + * freed and replaced in ccu during isl_set_foreach_basic_set + */ + isl_val_free(ccu.n); return ccu.can_unroll; } @@ -1904,6 +2004,7 @@ { isl_aff *aff; isl_set *set = isl_set_from_cloog_domain(domain); + isl_ctx *ctx = isl_set_get_ctx(set); isl_constraint *c; isl_constraint *eq; @@ -1911,7 +2012,7 @@ aff = isl_constraint_get_bound(c, isl_dim_set, level - 1); aff = isl_aff_ceil(aff); aff = isl_aff_add_coefficient_si(aff, isl_dim_in, level - 1, -1); - aff = isl_aff_add_constant(aff, offset); + aff = isl_aff_add_constant_val(aff, cloog_int_to_isl_val(ctx, offset)); eq = isl_equality_from_aff(aff); set = isl_set_add_constraint(set, eq); diff -Nru cloog-0.18.2/source/loop.c cloog-0.18.4/source/loop.c --- cloog-0.18.2/source/loop.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/source/loop.c 2015-07-27 11:52:03.000000000 +0000 @@ -316,7 +316,8 @@ /* To read that stupid "0 0 0" line. */ while (fgets(s,MAX_STRING,foo) == 0) ; while ((*s=='#' || *s=='\n') || (sscanf(s," %d %d %d",&op1,&op2,&op3)<3)) - fgets(s,MAX_STRING,foo) ; + if (fgets(s, MAX_STRING, foo)) + continue; return cloog_loop_from_domain(state, domain, number); } diff -Nru cloog-0.18.2/source/names.c cloog-0.18.4/source/names.c --- cloog-0.18.2/source/names.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/source/names.c 2015-07-27 11:52:03.000000000 +0000 @@ -271,7 +271,8 @@ /* We first read name option. */ while (fgets(s,MAX_STRING,file) == 0) ; while ((*s=='#' || *s=='\n') || (sscanf(s," %d",&option)<1)) - fgets(s,MAX_STRING,file) ; + if (fgets(s, MAX_STRING, file)) + continue; /* If there is no item to read, then return NULL. */ if (nb_items == 0) diff -Nru cloog-0.18.2/source/pprint.c cloog-0.18.4/source/pprint.c --- cloog-0.18.2/source/pprint.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/source/pprint.c 2014-10-02 14:33:50.000000000 +0000 @@ -312,14 +312,7 @@ stmt = stmt->next; /* Ensure it has a printable body. */ - body = NULL; - if (osl_generic_has_URI(stmt->body, OSL_URI_BODY)) { - body = stmt->body->data; - } else if (osl_generic_has_URI(stmt->body, OSL_URI_EXTBODY)) { - if (stmt->body->data != NULL) { - body = ((osl_extbody_p)(stmt->body->data))->body; - } - } + body = osl_statement_get_body(stmt); if ((body != NULL) && (body->expression != NULL) && (body->iterators != NULL)) { @@ -348,9 +341,33 @@ return 0; } +/* pprint_parentheses_are_safer function: + * this function returns 1 if it decides that it would be safer to put + * parentheses around the clast_assignment when it is used as a macro + * parameter, 0 otherwise. + * \param[in] s Pointer to the clast_assignment to check. + * \return 1 if we should print parentheses around s, 0 otherwise. + */ +static int pprint_parentheses_are_safer(struct clast_assignment * s) { + /* Expressions of the form X = Y should not be used in macros, so we + * consider readability first for them and avoid parentheses. + * Also, expressions having only one term can live without parentheses. + */ + if ((s->LHS) || + (s->RHS->type == clast_expr_term) || + ((s->RHS->type == clast_expr_red) && + (((struct clast_reduction *)(s->RHS))->n == 1) && + (((struct clast_reduction *)(s->RHS))->elts[0]->type == + clast_expr_term))) + return 0; + + return 1; +} + void pprint_user_stmt(struct cloogoptions *options, FILE *dst, struct clast_user_stmt *u) { + int parenthesis_to_close = 0; struct clast_stmt *t; if (pprint_osl_body(options, dst, u)) @@ -363,10 +380,21 @@ fprintf(dst, "("); for (t = u->substitutions; t; t = t->next) { assert(CLAST_STMT_IS_A(t, stmt_ass)); + if (pprint_parentheses_are_safer((struct clast_assignment *)t)) { + fprintf(dst, "("); + parenthesis_to_close = 1; + } pprint_assignment(options, dst, (struct clast_assignment *)t); - if (t->next) + if (t->next) { + if (parenthesis_to_close) { + fprintf(dst, ")"); + parenthesis_to_close = 0; + } fprintf(dst, ","); + } } + if (parenthesis_to_close) + fprintf(dst, ")"); fprintf(dst, ")"); if (options->language != CLOOG_LANGUAGE_FORTRAN) fprintf(dst, ";"); @@ -414,6 +442,10 @@ struct clast_for *f) { if (options->language == CLOOG_LANGUAGE_C) { + if (f->time_var_name) { + fprintf(dst, "IF_TIME(%s_start = cloog_util_rtclock());\n", + (f->time_var_name) ? f->time_var_name : ""); + } if ((f->parallel & CLAST_PARALLEL_OMP) && !(f->parallel & CLAST_PARALLEL_MPI)) { if (f->LB) { fprintf(dst, "lbp="); @@ -537,6 +569,14 @@ fprintf(dst,"END DO\n") ; else fprintf(dst,"}\n") ; + + if (options->language == CLOOG_LANGUAGE_C) { + if (f->time_var_name) { + fprintf(dst, "IF_TIME(%s += cloog_util_rtclock() - %s_start);\n", + (f->time_var_name) ? f->time_var_name : "", + (f->time_var_name) ? f->time_var_name : ""); + } + } } void pprint_stmt_list(struct cloogoptions *options, FILE *dst, int indent, @@ -579,3 +619,9 @@ { pprint_stmt_list(options, foo, indent, root); } + + +void clast_pprint_expr(struct cloogoptions *i, FILE *dst, struct clast_expr *e) +{ + pprint_expr(i, dst, e); +} diff -Nru cloog-0.18.2/source/program.c cloog-0.18.4/source/program.c --- cloog-0.18.2/source/program.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/source/program.c 2015-07-24 11:54:00.000000000 +0000 @@ -56,6 +56,7 @@ #ifdef OSL_SUPPORT #include #include +#include #endif /****************************************************************************** @@ -289,31 +290,63 @@ "#define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d))\n"); fprintf(file, "#define max(x,y) ((x) > (y) ? (x) : (y))\n") ; fprintf(file, "#define min(x,y) ((x) < (y) ? (x) : (y))\n\n") ; + fprintf(file, "#ifdef TIME \n#define IF_TIME(foo) foo; \n" + "#else\n#define IF_TIME(foo)\n#endif\n\n"); } -static void print_declarations(FILE *file, int n, char **names) +static void print_declarations(FILE *file, int n, char **names, int indentation) { int i; - fprintf(file, " int %s", names[0]); + for (i = 0; i < indentation; i++) + fprintf(file, " "); + fprintf(file, "int %s", names[0]); for (i = 1; i < n; i++) - fprintf(file, ", %s", names[i]); - + fprintf(file, ", %s", names[i]); fprintf(file, ";\n"); } +static void print_scattering_declarations(FILE *file, CloogProgram *program, + int indentation) +{ + int i, j, found = 0; + int nb_scatnames = 0; + CloogNames *names = program->names; + + // Copy pointer only to those scatering names that do not duplicate + // iterator names. + char **scatnames = (char **) malloc(sizeof(char *) * names->nb_scattering); + for (i = 0; i < names->nb_scattering; ++i) { + for (j = 0; j < names->nb_iterators; ++j) { + found = 0; + if (strcmp(names->scattering[i], names->iterators[j]) == 0) { + found = 1; + } + } + if (!found) { + // Save a pointer (intentional!) to the names in the new array. + scatnames[nb_scatnames++] = names->scattering[i]; + } + } + + if (nb_scatnames) { + for (i = 0; i < indentation; i++) + fprintf(file, " "); + fprintf(file, "/* Scattering iterators. */\n"); + print_declarations(file, nb_scatnames, scatnames, indentation); + } + free(scatnames); +} + static void print_iterator_declarations(FILE *file, CloogProgram *program, CloogOptions *options) { CloogNames *names = program->names; - if (names->nb_scattering) { - fprintf(file, " /* Scattering iterators. */\n"); - print_declarations(file, names->nb_scattering, names->scattering); - } + print_scattering_declarations(file, program, 2); if (names->nb_iterators) { fprintf(file, " /* Original iterators. */\n"); - print_declarations(file, names->nb_iterators, names->iterators); + print_declarations(file, names->nb_iterators, names->iterators, 2); } } @@ -359,6 +392,109 @@ fprintf(file, "}\n"); } +#ifdef OSL_SUPPORT +static int get_osl_loop_flags (osl_scop_p scop) { + int flags = 0; + osl_loop_p ll = osl_generic_lookup(scop->extension, OSL_URI_LOOP); + while (ll) { + flags |= ll->directive; + ll = ll->next; + } + + return flags; +} + +static void print_iterator_declarations_osl(FILE *file, CloogProgram *program, + int indent, CloogOptions *options) +{ + osl_coordinates_p co = NULL; + int i; + int loopflags = 0; + char* vecvar[2] = {"lbv", "ubv"}; + char* parvar[2] = {"lbp", "ubp"}; + + osl_scop_p scop = options->scop; + CloogNames *names = program->names; + + print_scattering_declarations(file, program, indent); + + co = osl_generic_lookup(scop->extension, OSL_URI_COORDINATES); + if (co==NULL //if coordinates exist then iterators already declared in file + && names->nb_iterators) { + for (i = 0; i < indent; i++) + fprintf(file, " "); + fprintf(file, "/* Original iterators. */\n"); + print_declarations(file, names->nb_iterators, names->iterators, indent); + } + + loopflags = get_osl_loop_flags(scop); + if(loopflags & CLAST_PARALLEL_OMP) + print_declarations(file, 2, parvar, indent); + if(loopflags & CLAST_PARALLEL_VEC) + print_declarations(file, 2, vecvar, indent); + + fprintf(file, "\n"); +} + +/* +* add tags clast loops according to information in scop's osl_loop extension +*/ +static int annotate_loops(osl_scop_p program, struct clast_stmt *root){ + + int j, nclastloops, nclaststmts; + struct clast_for **clastloops = NULL; + int *claststmts = NULL; + int ret = 0; + + if (program == NULL) { + return ret; + } + + osl_loop_p ll = osl_generic_lookup(program->extension, OSL_URI_LOOP); + while (ll) { + //for each loop + osl_loop_p loop = ll; + ClastFilter filter = { loop->iter, loop->stmt_ids, + loop->nb_stmts, subset}; + + clast_filter(root, filter, &clastloops, &nclastloops, + &claststmts, &nclaststmts); + + /* There should be at least one */ + if (nclastloops==0) { //FROM PLUTO + /* Sometimes loops may disappear (1) tile size larger than trip count + * 2) it's a scalar dimension but can't be determined from the + * trans matrix */ + printf("Warning: parallel poly loop not found in AST\n"); + ll = ll->next; + continue; + } + for (j=0; jdirective & CLAST_PARALLEL_VEC) { + clastloops[j]->parallel |= CLAST_PARALLEL_VEC; + ret |= CLAST_PARALLEL_VEC; + } + + if (loop->directive & CLAST_PARALLEL_OMP) { + clastloops[j]->parallel |= CLAST_PARALLEL_OMP; + ret |= CLAST_PARALLEL_OMP; + if (loop->private_vars) { + clastloops[j]->private_vars = strdup(loop->private_vars); + } + } + } + + if (clastloops) { free(clastloops); clastloops=NULL;} + if (claststmts) { free(claststmts); claststmts=NULL;} + + ll = ll->next; + } + + return ret; +} +#endif + /** * cloog_program_osl_pprint function: * this function pretty-prints the C or FORTRAN code generated from an @@ -378,27 +514,38 @@ int lines = 0; int columns = 0; int read = 1; + int indentation = 0; char c; osl_scop_p scop = options->scop; osl_coordinates_p coordinates; struct clast_stmt *root; - FILE * original; + FILE* original = NULL; if (scop && !options->compilable && !options->callable) { +#ifdef CLOOG_RUSAGE + print_comment(file, options, "Generated from %s by %s in %.2fs.", + options->name, cloog_version(), options->time); +#else + print_comment(file, options, "Generated from %s by %s.", + options->name, cloog_version()); +#endif coordinates = osl_generic_lookup(scop->extension, OSL_URI_COORDINATES); if (coordinates) { original = fopen(coordinates->name, "r"); + indentation = coordinates->indent; if (!original) { cloog_msg(options, CLOOG_WARNING, "unable to open the file specified in the SCoP " "coordinates\n"); - return 0; + coordinates = NULL; } + } - /* Print the macros the generated code may need. */ - print_macros(file); + /* Print the macros the generated code may need. */ + print_macros(file); - /* Print what was before the SCoP in the original file. */ + /* Print what was before the SCoP in the original file (if any). */ + if (coordinates) { while (((lines < coordinates->line_start - 1) || (columns < coordinates->column_start - 1)) && (read != EOF)) { read = fscanf(original, "%c", &c); @@ -415,13 +562,17 @@ /* Carriage return to preserve indentation if necessary. */ if (coordinates->column_start > 0) fprintf(file, "\n"); + } - /* Generate the clast from the pseudo-AST then pretty-print it. */ - root = cloog_clast_create(program, options); - clast_pprint(file, root, coordinates->indent, options); - cloog_clast_free(root); + /* Generate the clast from the pseudo-AST then pretty-print it. */ + root = cloog_clast_create(program, options); + annotate_loops(options->scop, root); + print_iterator_declarations_osl(file, program, indentation, options); + clast_pprint(file, root, indentation, options); + cloog_clast_free(root); - /* Print what was after the SCoP in the original file. */ + /* Print what was after the SCoP in the original file (if any). */ + if (coordinates) { while (read != EOF) { read = fscanf(original, "%c", &c); columns++; @@ -438,8 +589,9 @@ } fclose(original); - return 1; } + + return 1; } #endif return 0; diff -Nru cloog-0.18.2/source/util.c cloog-0.18.4/source/util.c --- cloog-0.18.2/source/util.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/source/util.c 2014-10-02 14:03:59.000000000 +0000 @@ -0,0 +1,56 @@ + + /**-------------------------------------------------------------------** + ** CLooG ** + **-------------------------------------------------------------------** + ** util.c ** + **-------------------------------------------------------------------** + ** First version: January 8th 2014 ** + **-------------------------------------------------------------------**/ + + +/****************************************************************************** + * CLooG : the Chunky Loop Generator (experimental) * + ****************************************************************************** + * * + * Copyright (C) 2002-2005 Cedric Bastoul * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2.1 of the License, or (at your option) any later version. * + * * + * This library 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 * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + * CLooG, the Chunky Loop Generator * + * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * + * * + ******************************************************************************/ + +#include +#include +#include +#include "../include/cloog/cloog.h" + +/** + * cloog_util_rtclock function: + * this function returns the value, in seconds, of the real time clock of + * the operating system. The reference point between calls is consistent, + * making time comparison possible. + * \return The real time clock of the operating system in seconds. + */ +double cloog_util_rtclock() { + struct timezone Tzp; + struct timeval Tp; + int stat = gettimeofday(&Tp, &Tzp); + if (stat != 0) + cloog_msg(NULL, CLOOG_WARNING, "Error return from gettimeofday: %d", stat); + return (Tp.tv_sec + Tp.tv_usec*1.0e-6); +} diff -Nru cloog-0.18.2/test/1point-2.c cloog-0.18.4/test/1point-2.c --- cloog-0.18.2/test/1point-2.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/1point-2.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,2 +1,2 @@ -/* Generated from ../../../git/cloog/test/1point-2.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ -S1(2*M,N+2) ; +/* Generated from ./1point-2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ +S1(2*M,(N+2)); diff -Nru cloog-0.18.2/test/byu98-1-2-3.c cloog-0.18.4/test/byu98-1-2-3.c --- cloog-0.18.2/test/byu98-1-2-3.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/byu98-1-2-3.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated from /home/skimo/git/cloog/test/byu98-1-2-3.cloog by CLooG 0.14.0-284-ga90f184 gmp bits in 0.01s. */ +/* Generated from ./byu98-1-2-3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ for (i=2;i<=3;i++) { for (j=-i+6;j<=6;j++) { S1(i,j); @@ -11,11 +11,11 @@ } } if (i >= 6) { - S2(i,-i+9); + S2(i,(-i+9)); } if (i <= 5) { - S1(i,-i+9); - S2(i,-i+9); + S1(i,(-i+9)); + S2(i,(-i+9)); } for (j=max(-i+10,i-1);j<=6;j++) { S1(i,j); diff -Nru cloog-0.18.2/test/check_c.sh cloog-0.18.4/test/check_c.sh --- cloog-0.18.2/test/check_c.sh 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/check_c.sh 2014-10-02 14:03:59.000000000 +0000 @@ -35,4 +35,4 @@ # * * # *****************************************************************************/ -$CHECKER "C" "$CLOOGTEST_C" "" "cloog" "c" "0" +$CHECKER "C" "$CLOOGTEST_C" "" "cloog" "c" "${1:-generate}" diff -Nru cloog-0.18.2/test/checker.sh cloog-0.18.4/test/checker.sh --- cloog-0.18.2/test/checker.sh 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/checker.sh 2014-10-02 14:03:59.000000000 +0000 @@ -57,8 +57,15 @@ TEST_OUTPUT_EXTENSION="$5" ## Extension of the generated file -TEST_RUN="$6" ## "1" if the checking policy is to generate, - ## compile and run, generate only otherwise +TEST_TYPE="$6" ## - "generate" to simply test code generation + ## (default) + ## - "regenerate" to replace the original file with + ## the generated one in the case of a check fail + ## !!! USE WITH CARE !!! + ## - "valgrind" to test the valgrind output on + ## code generation + ## - "run" if the checking policy is to generate, + ## compile and run, generate only otherwise failedtest=0; cloog=$top_builddir/cloog$EXEEXT @@ -79,7 +86,7 @@ echo "(options $options), \c"; fi; - if [ "$TEST_RUN" = "1" ]; then + if [ "$TEST_TYPE" = "run" ]; then generate_test=$srcdir/generate_test$EXEEXT test_run=$srcdir/test_run$EXEEXT good="$srcdir/$name.good.$TEST_OUTPUT_EXTENSION"; @@ -102,16 +109,39 @@ $test_run; result=$?; rm -f $test_run; + elif [ "$TEST_TYPE" = "valgrind" ]; then + echo "generating... \c"; +# valgrind --leak-check=full --error-exitcode=1 \ + libtool --mode=execute valgrind --error-exitcode=1 \ + $cloog $options -q $input > /dev/null 2> cloog_temp; + errors=$?; + leaks=`grep "in use at exit" cloog_temp | cut -f 2 -d ':'` + if [ "$errors" = "1" ]; then + echo -e "\033[31mMemory error detected... \033[0m"; + cat cloog_temp; + result="1"; + elif [ "$leaks" != " 0 bytes in 0 blocks" ]; then + echo -e "\033[31mMemory leak detected... \033[0m"; + cat cloog_temp; + result="1"; + else + result="0"; + fi; + rm -f cloog_temp; else echo "generating... \c"; $cloog $options -q $input > cloog_temp; - diff -u -w --ignore-matching-lines='CLooG' cloog_temp $output; + diff -u -w --ignore-matching-lines='CLooG' $output cloog_temp; result=$?; + if [ "$result" -ne "0" ] && [ "$TEST_TYPE" = "regenerate" ]; then + echo -e "\033[31mREGENERATING... \033[0m"; + cp cloog_temp $output; + fi; rm -f cloog_temp; fi; if [ "$result" -ne "0" ]; then - echo -e "\033[31mFAIL: $output is not the same\033[0m"; + echo -e "\033[31mFAIL: $output has a problem\033[0m"; failedtest=`expr $failedtest + 1`; else echo "PASS"; diff -Nru cloog-0.18.2/test/check_fortran.sh cloog-0.18.4/test/check_fortran.sh --- cloog-0.18.2/test/check_fortran.sh 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/check_fortran.sh 2014-10-02 14:03:59.000000000 +0000 @@ -35,4 +35,4 @@ # * * # *****************************************************************************/ -$CHECKER "FORTRAN" "$CLOOGTEST_FORTRAN" "" "cloog" "f" "0" +$CHECKER "FORTRAN" "$CLOOGTEST_FORTRAN" "" "cloog" "f" "${1:-generate}" diff -Nru cloog-0.18.2/test/check_openscop.sh cloog-0.18.4/test/check_openscop.sh --- cloog-0.18.2/test/check_openscop.sh 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/check_openscop.sh 2014-10-02 14:03:59.000000000 +0000 @@ -35,4 +35,4 @@ # * * # *****************************************************************************/ -$CHECKER "OPENSCOP" "$CLOOGTEST_OPENSCOP" "-openscop" "scop" "c" "0" +$CHECKER "OPENSCOP" "$CLOOGTEST_OPENSCOP" "-openscop" "scop" "c" "${1:-generate}" diff -Nru cloog-0.18.2/test/check_run.sh cloog-0.18.4/test/check_run.sh --- cloog-0.18.2/test/check_run.sh 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/check_run.sh 2014-10-02 14:03:59.000000000 +0000 @@ -44,12 +44,12 @@ sed "s/#/ /g" | \ sed "s/'//g"` -$CHECKER "RUN C" "$FINITE_CLOOGTEST_C" "" "cloog" "c" "1" +$CHECKER "RUN C" "$FINITE_CLOOGTEST_C" "" "cloog" "c" "run" failedtest=$?; -$CHECKER "RUN SPECIAL" "$special_refactored" "" "cloog" "c" "1" +$CHECKER "RUN SPECIAL" "$special_refactored" "" "cloog" "c" "run" failedtest=`expr $failedtest + $?`; -$CHECKER "RUN SPECIAL -sh 1" "$special_refactored" "-sh 1" "cloog" "c" "1" +$CHECKER "RUN SPECIAL -sh 1" "$special_refactored" "-sh 1" "cloog" "c" "run" failedtest=`expr $failedtest + $?`; return $failedtest; diff -Nru cloog-0.18.2/test/check_special.sh cloog-0.18.4/test/check_special.sh --- cloog-0.18.2/test/check_special.sh 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/check_special.sh 2014-10-02 14:03:59.000000000 +0000 @@ -44,4 +44,4 @@ sed "s/#/ /g" | \ sed "s/'//g"` -$CHECKER "SPECIAL" "$special_refactored" "" "cloog" "c" "0" +$CHECKER "SPECIAL" "$special_refactored" "" "cloog" "c" "${1:-generate}" diff -Nru cloog-0.18.2/test/check_strided.sh cloog-0.18.4/test/check_strided.sh --- cloog-0.18.2/test/check_strided.sh 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/check_strided.sh 2014-10-02 14:03:59.000000000 +0000 @@ -35,4 +35,4 @@ # * * # *****************************************************************************/ -$CHECKER "STRIDED" "$CLOOGTEST_STRIDED" "-strides 1" "cloog" "c" "0" +$CHECKER "STRIDED" "$CLOOGTEST_STRIDED" "-strides 1" "cloog" "c" "${1:-generate}" diff -Nru cloog-0.18.2/test/cholesky2.c cloog-0.18.4/test/cholesky2.c --- cloog-0.18.2/test/cholesky2.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/cholesky2.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated from ../../../git/cloog/test/cholesky2.cloog by CLooG 0.16.1-2-g33ac553 gmp bits in 0.02s. */ +/* Generated from ./cholesky2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.02s. */ if (M >= 1) { for (c2=1;c2<=M-1;c2++) { S1(c2); @@ -22,44 +22,44 @@ } for (c1=3;c1<=3*M-7;c1++) { if ((c1+2)%3 == 0) { - S3((c1+2)/3); + S3(((c1+2)/3)); } if (c1%3 == 0) { - S2((c1+3)/3,c1/3); + S2(((c1+3)/3),(c1/3)); } if ((c1+1)%3 == 0) { - S6((c1+1)/3,(c1+4)/3); + S6(((c1+1)/3),((c1+4)/3)); } if (c1%3 == 0) { - S2((c1+6)/3,c1/3); + S2(((c1+6)/3),(c1/3)); } for (c2=ceild(c1+7,3);c2<=M;c2++) { if ((c1+1)%3 == 0) { - S6((c1+1)/3,c2); + S6(((c1+1)/3),c2); } if (c1%3 == 0) { - S2(c2,c1/3); + S2(c2,(c1/3)); } if ((c1+1)%3 == 0) { for (i=ceild(c1+4,3);i<=c2-1;i++) { - S5(i,c2,(c1+1)/3); + S5(i,c2,((c1+1)/3)); } } } } if (M >= 3) { for (c2=M-1;c2<=M;c2++) { - S2(c2,M-2); + S2(c2,(M-2)); } } if (M >= 3) { - S3(M-1); + S3((M-1)); } if (M >= 3) { - S6(M-1,M); + S6((M-1),M); } if (M >= 2) { - S2(M,M-1); + S2(M,(M-1)); } if (M >= 2) { S3(M); diff -Nru cloog-0.18.2/test/christian.c cloog-0.18.4/test/christian.c --- cloog-0.18.2/test/christian.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/christian.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,17 +1,17 @@ -/* Generated from ../../../git/cloog/test/christian.cloog by CLooG 0.16.2-5-g3b3bf96 gmp bits in 0.01s. */ +/* Generated from ./christian.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ if (N >= 1) { - S1(0,N-1); + S1(0,(N-1)); for (p=-N+2;p<=N-1;p++) { if (p >= 1) { - S2(p-1,0); + S2((p-1),0); } for (i=max(0,p);i<=min(N-1,p+N-2);i++) { - S1(i,-p+i); - S2(i,-p+i+1); + S1(i,(-p+i)); + S2(i,(-p+i+1)); } if (p <= 0) { - S1(p+N-1,N-1); + S1((p+N-1),(N-1)); } } - S2(N-1,0); + S2((N-1),0); } diff -Nru cloog-0.18.2/test/classen2.c cloog-0.18.4/test/classen2.c --- cloog-0.18.2/test/classen2.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/classen2.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,9 +1,9 @@ -/* Generated from ../../../git/cloog/test/classen2.cloog by CLooG 0.14.0-271-gaa1e292 gmp bits in 0.14s. */ +/* Generated from ./classen2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.08s. */ if ((M >= 2) && (N >= 3) && (outerProcTileScatter1 >= outerProcTileScatter2) && (5*outerProcTileScatter1 <= M+2*N-4) && (5*outerProcTileScatter1 <= 5*outerProcTileScatter2+N+2) && (outerProcTileScatter2 >= 0) && (5*outerProcTileScatter2 <= M+N-2) && (outerTimeTileScatter >= outerProcTileScatter1) && (outerTimeTileScatter <= 2*outerProcTileScatter1) && (outerTimeTileScatter <= outerProcTileScatter1+outerProcTileScatter2+1) && (5*outerTimeTileScatter <= 2*M+2*N-6) && (5*outerTimeTileScatter <= 5*outerProcTileScatter1+M+2) && (5*outerTimeTileScatter >= 10*outerProcTileScatter1-2*N-2) && (5*outerTimeTileScatter <= 5*outerProcTileScatter2+M+N) && (5*outerTimeTileScatter >= 10*outerProcTileScatter2-N-3) && (5*outerTimeTileScatter <= 10*outerProcTileScatter2+N+3) && (5*outerTimeTileScatter >= 5*outerProcTileScatter1+5*outerProcTileScatter2-N-4)) { for (compScatter1=max(max(max(max(max(4,5*outerTimeTileScatter),5*outerProcTileScatter2+1),5*outerProcTileScatter1+5*outerProcTileScatter2-N),10*outerProcTileScatter1-2*N+2),10*outerProcTileScatter2-N+1);compScatter1<=min(min(min(min(min(5*outerTimeTileScatter+4,2*M+2*N-6),5*outerProcTileScatter1+M+2),5*outerProcTileScatter1+5*outerProcTileScatter2+5),5*outerProcTileScatter2+M+N),10*outerProcTileScatter2+N+3);compScatter1++) { for (compScatter2=max(max(max(max(ceild(compScatter1+4,2),5*outerProcTileScatter1),5*outerProcTileScatter2+1),compScatter1-M+2),compScatter1-5*outerProcTileScatter2-1);compScatter2<=min(min(min(min(floord(compScatter1+2*N-2,2),compScatter1),5*outerProcTileScatter1+4),compScatter1-5*outerProcTileScatter2+N),5*outerProcTileScatter2+N+2);compScatter2++) { for (compScatter3=max(max(5*outerProcTileScatter2,compScatter1-compScatter2+3),compScatter2-N+2);compScatter3<=min(min(compScatter2-1,5*outerProcTileScatter2+4),compScatter1-compScatter2+N);compScatter3++) { - S1(compScatter1-compScatter2+1,-compScatter1+compScatter2+compScatter3-2,compScatter2-compScatter3,compScatter1,compScatter2,compScatter3); + S1((compScatter1-compScatter2+1),(-compScatter1+compScatter2+compScatter3-2),(compScatter2-compScatter3),compScatter1,compScatter2,compScatter3); } } } diff -Nru cloog-0.18.2/test/classen.c cloog-0.18.4/test/classen.c --- cloog-0.18.2/test/classen.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/classen.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated from /home/skimo/git/cloog/test/classen.cloog by CLooG 0.14.0-284-ga90f184 gmp bits in 0.45s. */ +/* Generated from ./classen.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.25s. */ if (m >= 1) { if (m >= 2) { S1(0,1,1,1); @@ -13,52 +13,52 @@ } for (glT1=1;glT1<=2*m-4;glT1++) { if (glT1 <= m-2) { - S5(glT1-1,1,glT1,1,glT1,1,glT1+1,1); - S1(glT1,1,glT1+1,1); - S2(glT1,1,glT1+1,1,glT1+1,1,glT1+2,1); - S3(glT1,1,glT1+1,2,glT1+1,1,glT1+1,2); - S4(glT1,1,glT1+2,2,glT1+1,1,glT1+2,2); + S5((glT1-1),1,glT1,1,glT1,1,(glT1+1),1); + S1(glT1,1,(glT1+1),1); + S2(glT1,1,(glT1+1),1,(glT1+1),1,(glT1+2),1); + S3(glT1,1,(glT1+1),2,(glT1+1),1,(glT1+1),2); + S4(glT1,1,(glT1+2),2,(glT1+1),1,(glT1+2),2); } if (glT1 >= m) { - S5(glT1-1,glT1-m+2,glT1,glT1-m+2,m-1,glT1-m+2,m,glT1-m+2); - S6(glT1-1,glT1-m+1,glT1,glT1-m+2,m,glT1-m+1,m,glT1-m+2); - S1(glT1,glT1-m+2,m,glT1-m+2); - S3(glT1,glT1-m+2,glT1+1,glT1-m+3,m,glT1-m+2,m,glT1-m+3); + S5((glT1-1),(glT1-m+2),glT1,(glT1-m+2),(m-1),(glT1-m+2),m,(glT1-m+2)); + S6((glT1-1),(glT1-m+1),glT1,(glT1-m+2),m,(glT1-m+1),m,(glT1-m+2)); + S1(glT1,(glT1-m+2),m,(glT1-m+2)); + S3(glT1,(glT1-m+2),(glT1+1),(glT1-m+3),m,(glT1-m+2),m,(glT1-m+3)); } if (glT1 == m-1) { - S5(m-2,1,m-1,1,m-1,1,m,1); - S1(m-1,1,m,1); - S3(m-1,1,m,2,m,1,m,2); + S5((m-2),1,(m-1),1,(m-1),1,m,1); + S1((m-1),1,m,1); + S3((m-1),1,m,2,m,1,m,2); } for (rp1=max(2,glT1-m+3);rp1<=min(glT1,m-1);rp1++) { - S5(glT1-1,rp1,glT1,rp1,glT1-rp1+1,rp1,glT1-rp1+2,rp1); - S6(glT1-1,rp1-1,glT1,rp1,glT1-rp1+2,rp1-1,glT1-rp1+2,rp1); - S7(glT1-1,rp1-1,glT1+1,rp1,glT1-rp1+2,rp1-1,glT1-rp1+3,rp1); - S1(glT1,rp1,glT1-rp1+2,rp1); - S2(glT1,rp1,glT1+1,rp1,glT1-rp1+2,rp1,glT1-rp1+3,rp1); - S3(glT1,rp1,glT1+1,rp1+1,glT1-rp1+2,rp1,glT1-rp1+2,rp1+1); - S4(glT1,rp1,glT1+2,rp1+1,glT1-rp1+2,rp1,glT1-rp1+3,rp1+1); + S5((glT1-1),rp1,glT1,rp1,(glT1-rp1+1),rp1,(glT1-rp1+2),rp1); + S6((glT1-1),(rp1-1),glT1,rp1,(glT1-rp1+2),(rp1-1),(glT1-rp1+2),rp1); + S7((glT1-1),(rp1-1),(glT1+1),rp1,(glT1-rp1+2),(rp1-1),(glT1-rp1+3),rp1); + S1(glT1,rp1,(glT1-rp1+2),rp1); + S2(glT1,rp1,(glT1+1),rp1,(glT1-rp1+2),rp1,(glT1-rp1+3),rp1); + S3(glT1,rp1,(glT1+1),(rp1+1),(glT1-rp1+2),rp1,(glT1-rp1+2),(rp1+1)); + S4(glT1,rp1,(glT1+2),(rp1+1),(glT1-rp1+2),rp1,(glT1-rp1+3),(rp1+1)); } if (glT1 <= m-2) { - S6(glT1-1,glT1,glT1,glT1+1,1,glT1,1,glT1+1); - S7(glT1-1,glT1,glT1+1,glT1+1,1,glT1,2,glT1+1); - S1(glT1,glT1+1,1,glT1+1); - S2(glT1,glT1+1,glT1+1,glT1+1,1,glT1+1,2,glT1+1); - S3(glT1,glT1+1,glT1+1,glT1+2,1,glT1+1,1,glT1+2); - S4(glT1,glT1+1,glT1+2,glT1+2,1,glT1+1,2,glT1+2); + S6((glT1-1),glT1,glT1,(glT1+1),1,glT1,1,(glT1+1)); + S7((glT1-1),glT1,(glT1+1),(glT1+1),1,glT1,2,(glT1+1)); + S1(glT1,(glT1+1),1,(glT1+1)); + S2(glT1,(glT1+1),(glT1+1),(glT1+1),1,(glT1+1),2,(glT1+1)); + S3(glT1,(glT1+1),(glT1+1),(glT1+2),1,(glT1+1),1,(glT1+2)); + S4(glT1,(glT1+1),(glT1+2),(glT1+2),1,(glT1+1),2,(glT1+2)); } if (glT1 >= m) { - S5(glT1-1,m,glT1,m,glT1-m+1,m,glT1-m+2,m); - S6(glT1-1,m-1,glT1,m,glT1-m+2,m-1,glT1-m+2,m); - S7(glT1-1,m-1,glT1+1,m,glT1-m+2,m-1,glT1-m+3,m); - S1(glT1,m,glT1-m+2,m); - S2(glT1,m,glT1+1,m,glT1-m+2,m,glT1-m+3,m); + S5((glT1-1),m,glT1,m,(glT1-m+1),m,(glT1-m+2),m); + S6((glT1-1),(m-1),glT1,m,(glT1-m+2),(m-1),(glT1-m+2),m); + S7((glT1-1),(m-1),(glT1+1),m,(glT1-m+2),(m-1),(glT1-m+3),m); + S1(glT1,m,(glT1-m+2),m); + S2(glT1,m,(glT1+1),m,(glT1-m+2),m,(glT1-m+3),m); } if (glT1 == m-1) { - S6(m-2,m-1,m-1,m,1,m-1,1,m); - S7(m-2,m-1,m,m,1,m-1,2,m); - S1(m-1,m,1,m); - S2(m-1,m,m,m,1,m,2,m); + S6((m-2),(m-1),(m-1),m,1,(m-1),1,m); + S7((m-2),(m-1),m,m,1,(m-1),2,m); + S1((m-1),m,1,m); + S2((m-1),m,m,m,1,m,2,m); } for (coordP1=max(1,glT1-m+2);coordP1<=min(m,glT1+1);coordP1++) { S8(glT1,coordP1); @@ -66,10 +66,10 @@ } if (m >= 2) { if (m >= 3) { - S5(2*m-4,m-1,2*m-3,m-1,m-1,m-1,m,m-1); - S6(2*m-4,m-2,2*m-3,m-1,m,m-2,m,m-1); - S1(2*m-3,m-1,m,m-1); - S3(2*m-3,m-1,2*m-2,m,m,m-1,m,m); + S5((2*m-4),(m-1),(2*m-3),(m-1),(m-1),(m-1),m,(m-1)); + S6((2*m-4),(m-2),(2*m-3),(m-1),m,(m-2),m,(m-1)); + S1((2*m-3),(m-1),m,(m-1)); + S3((2*m-3),(m-1),(2*m-2),m,m,(m-1),m,m); } if (m == 2) { S5(0,1,1,1,1,1,2,1); @@ -77,25 +77,25 @@ S3(1,1,2,2,2,1,2,2); } if (m >= 3) { - S5(2*m-4,m,2*m-3,m,m-2,m,m-1,m); - S6(2*m-4,m-1,2*m-3,m,m-1,m-1,m-1,m); - S7(2*m-4,m-1,2*m-2,m,m-1,m-1,m,m); - S1(2*m-3,m,m-1,m); + S5((2*m-4),m,(2*m-3),m,(m-2),m,(m-1),m); + S6((2*m-4),(m-1),(2*m-3),m,(m-1),(m-1),(m-1),m); + S7((2*m-4),(m-1),(2*m-2),m,(m-1),(m-1),m,m); + S1((2*m-3),m,(m-1),m); } if (m == 2) { S6(0,1,1,2,1,1,1,2); S7(0,1,2,2,1,1,2,2); S1(1,2,1,2); } - S2(2*m-3,m,2*m-2,m,m-1,m,m,m); + S2((2*m-3),m,(2*m-2),m,(m-1),m,m,m); for (coordP1=m-1;coordP1<=m;coordP1++) { - S8(2*m-3,coordP1); + S8((2*m-3),coordP1); } } if (m >= 2) { - S5(2*m-3,m,2*m-2,m,m-1,m,m,m); - S6(2*m-3,m-1,2*m-2,m,m,m-1,m,m); - S1(2*m-2,m,m,m); - S8(2*m-2,m); + S5((2*m-3),m,(2*m-2),m,(m-1),m,m,m); + S6((2*m-3),(m-1),(2*m-2),m,m,(m-1),m,m); + S1((2*m-2),m,m,m); + S8((2*m-2),m); } } diff -Nru cloog-0.18.2/test/darte.c cloog-0.18.4/test/darte.c --- cloog-0.18.2/test/darte.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/darte.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,15 +1,15 @@ -/* Generated from /home/skimo/git/cloog/test/darte.cloog by CLooG 0.14.0-284-ga90f184 gmp bits in 0.05s. */ +/* Generated from ./darte.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.02s. */ if (n >= 1) { for (t3=n+3;t3<=3*n+1;t3++) { if ((t3+n+1)%2 == 0) { - S1(1,n,(t3-n-1)/2); + S1(1,n,((t3-n-1)/2)); } } for (t1=-n+2;t1<=n-1;t1++) { if (t1 >= 0) { for (t3=t1+4;t3<=t1+2*n+2;t3++) { if ((t1+t3)%2 == 0) { - S1(t1+1,1,(-t1+t3-2)/2); + S1((t1+1),1,((-t1+t3-2)/2)); } } } @@ -17,7 +17,7 @@ for (t3=t2+2;t3<=t2+2*n;t3++) { if ((t1+t2)%2 == 0) { if ((t1+t3)%2 == 0) { - S1((t1+t2)/2,(-t1+t2)/2,(-t2+t3)/2); + S1(((t1+t2)/2),((-t1+t2)/2),((-t2+t3)/2)); } } } @@ -25,36 +25,36 @@ for (t2=max(-t1+5,t1+3);t2<=min(-t1+2*n,t1+2*n);t2++) { for (t3=1;t3<=min(n,t2+1);t3++) { if ((t1+t2+1)%2 == 0) { - S2((t1+t2-3)/2,(-t1+t2-1)/2,t3); + S2(((t1+t2-3)/2),((-t1+t2-1)/2),t3); } } for (t3=t2+2;t3<=n;t3++) { if ((t1+t2+1)%2 == 0) { - S2((t1+t2-3)/2,(-t1+t2-1)/2,t3); + S2(((t1+t2-3)/2),((-t1+t2-1)/2),t3); } if ((t1+t2)%2 == 0) { if ((t1+t3)%2 == 0) { - S1((t1+t2)/2,(-t1+t2)/2,(-t2+t3)/2); + S1(((t1+t2)/2),((-t1+t2)/2),((-t2+t3)/2)); } } } for (t3=max(n+1,t2+2);t3<=t2+2*n;t3++) { if ((t1+t2)%2 == 0) { if ((t1+t3)%2 == 0) { - S1((t1+t2)/2,(-t1+t2)/2,(-t2+t3)/2); + S1(((t1+t2)/2),((-t1+t2)/2),((-t2+t3)/2)); } } } } if (t1 <= -1) { for (t3=1;t3<=n;t3++) { - S2(t1+n-1,n,t3); + S2((t1+n-1),n,t3); } } for (t2=-t1+2*n+1;t2<=min(-t1+2*n+3,t1+2*n+1);t2++) { for (t3=1;t3<=n;t3++) { if ((t1+t2+1)%2 == 0) { - S2((t1+t2-3)/2,(-t1+t2-1)/2,t3); + S2(((t1+t2-3)/2),((-t1+t2-1)/2),t3); } } } diff -Nru cloog-0.18.2/test/dartef.f cloog-0.18.4/test/dartef.f --- cloog-0.18.2/test/dartef.f 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/dartef.f 2014-10-02 14:03:59.000000000 +0000 @@ -1,15 +1,15 @@ -! Generated from /home/skimo/git/cloog/test/dartef.cloog by CLooG 0.14.0-284-ga90f184 gmp bits in 0.08s. +! Generated from ./dartef.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.03s. IF (n >= 1) THEN DO t3=n+3, 3*n+1 IF (MOD(t3+n+1, 2) == 0) THEN - S1(1,n,(t3-n-1)/2) + S1(1,n,((t3-n-1)/2)) END IF END DO DO t1=-n+2, n-1 IF (t1 >= 0) THEN DO t3=t1+4, t1+2*n+2 IF (MOD(t1+t3, 2) == 0) THEN - S1(t1+1,1,(-t1+t3-2)/2) + S1((t1+1),1,((-t1+t3-2)/2)) END IF END DO END IF @@ -17,7 +17,7 @@ DO t3=t2+2, t2+2*n IF (MOD(t1+t2, 2) == 0) THEN IF (MOD(t1+t3, 2) == 0) THEN - S1((t1+t2)/2,(-t1+t2)/2,(-t2+t3)/2) + S1(((t1+t2)/2),((-t1+t2)/2),((-t2+t3)/2)) END IF END IF END DO @@ -25,36 +25,36 @@ DO t2=MAX(-t1+5,t1+3), MIN(-t1+2*n,t1+2*n) DO t3=1, MIN(n,t2+1) IF (MOD(t1+t2+1, 2) == 0) THEN - S2((t1+t2-3)/2,(-t1+t2-1)/2,t3) + S2(((t1+t2-3)/2),((-t1+t2-1)/2),t3) END IF END DO DO t3=t2+2, n IF (MOD(t1+t2+1, 2) == 0) THEN - S2((t1+t2-3)/2,(-t1+t2-1)/2,t3) + S2(((t1+t2-3)/2),((-t1+t2-1)/2),t3) END IF IF (MOD(t1+t2, 2) == 0) THEN IF (MOD(t1+t3, 2) == 0) THEN - S1((t1+t2)/2,(-t1+t2)/2,(-t2+t3)/2) + S1(((t1+t2)/2),((-t1+t2)/2),((-t2+t3)/2)) END IF END IF END DO DO t3=MAX(n+1,t2+2), t2+2*n IF (MOD(t1+t2, 2) == 0) THEN IF (MOD(t1+t3, 2) == 0) THEN - S1((t1+t2)/2,(-t1+t2)/2,(-t2+t3)/2) + S1(((t1+t2)/2),((-t1+t2)/2),((-t2+t3)/2)) END IF END IF END DO END DO IF (t1 <= -1) THEN DO t3=1, n - S2(t1+n-1,n,t3) + S2((t1+n-1),n,t3) END DO END IF DO t2=-t1+2*n+1, MIN(-t1+2*n+3,t1+2*n+1) DO t3=1, n IF (MOD(t1+t2+1, 2) == 0) THEN - S2((t1+t2-3)/2,(-t1+t2-1)/2,t3) + S2(((t1+t2-3)/2),((-t1+t2-1)/2),t3) END IF END DO END DO diff -Nru cloog-0.18.2/test/durbin_e_s.c cloog-0.18.4/test/durbin_e_s.c --- cloog-0.18.2/test/durbin_e_s.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/durbin_e_s.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated from ../../../git/cloog/test/durbin_e_s.cloog by CLooG 0.14.0-238-gb1cb779 gmp bits in 0.01s. */ +/* Generated from ./durbin_e_s.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ S4(1,0,0); S7(1,0,0); S8(1,0,3); @@ -7,7 +7,7 @@ for (j=-7;j<=i-9;j++) { S3(i,j,1); } - S6(i,i-9,2); + S6(i,(i-9),2); S8(i,0,3); for (j=1;j<=i-1;j++) { S5(i,j,3); diff -Nru cloog-0.18.2/test/equality2.c cloog-0.18.4/test/equality2.c --- cloog-0.18.2/test/equality2.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/equality2.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,13 +1,13 @@ -/* Generated from ../../../git/cloog/test/equality2.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.07s. */ +/* Generated from ./equality2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ for (i0=1;i0<=10000;i0++) { for (i1=1000;i1<=1016;i1++) { for (i2=1;i2<=min(-2*i1+2033,2*i1-1999);i2++) { if (2*i1 == i2+1999) { - S2(i0,i1,i2,1,i0,2*i1-1000,1,2,i0,i1-499,2*i1-1999,i0,2*i1-1999,i1-999,i1-999) ; + S2(i0,i1,i2,1,i0,(2*i1-1000),1,2,i0,(i1-499),(2*i1-1999),i0,(2*i1-1999),(i1-999),(i1-999)); } if (i2 == 1) { if (i1%2 == 0) { - S1(i0,i1,i2,2,i0,(i1+2)/2,i1-999,i0,i1-999,(i1-998)/2,(i1-998)/2) ; + S1(i0,i1,i2,2,i0,((i1+2)/2),(i1-999),i0,(i1-999),((i1-998)/2),((i1-998)/2)); } } } diff -Nru cloog-0.18.2/test/forwardsub-3-1-2.c cloog-0.18.4/test/forwardsub-3-1-2.c --- cloog-0.18.2/test/forwardsub-3-1-2.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/forwardsub-3-1-2.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,23 +1,23 @@ -/* Generated from ../../../git/cloog/test/forwardsub-3-1-2.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.02s. */ -S3(2,1) ; -S1(3,1) ; -S1(4,1) ; -S4(4,2) ; +/* Generated from ./forwardsub-3-1-2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ +S3(2,1); +S1(3,1); +S1(4,1); +S4(4,2); for (i=5;i<=M+1;i++) { - S1(i,1) ; + S1(i,1); for (j=2;j<=floord(i-1,2);j++) { - S2(i,j) ; + S2(i,j); } if (i%2 == 0) { - S4(i,i/2) ; + S4(i,(i/2)); } } for (i=M+2;i<=2*M-1;i++) { for (j=i-M;j<=floord(i-1,2);j++) { - S2(i,j) ; + S2(i,j); } if (i%2 == 0) { - S4(i,i/2) ; + S4(i,(i/2)); } } -S4(2*M,M) ; +S4(2*M,M); diff -Nru cloog-0.18.2/test/gesced2.c cloog-0.18.4/test/gesced2.c --- cloog-0.18.2/test/gesced2.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/gesced2.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated from /home/skimo/git/cloog/test/gesced2.cloog by CLooG 0.14.0-284-ga90f184 gmp bits in 0.03s. */ +/* Generated from ./gesced2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ for (c1=1;c1<=4;c1++) { for (c2=5;c2<=M-10;c2++) { S1(c1,c2); @@ -6,17 +6,17 @@ } for (c1=5;c1<=M-10;c1++) { for (c2=-c1+1;c2<=4;c2++) { - S2(c1+c2,c1); + S2((c1+c2),c1); } for (c2=5;c2<=min(M-10,-c1+M);c2++) { S1(c1,c2); - S2(c1+c2,c1); + S2((c1+c2),c1); } for (c2=-c1+M+1;c2<=M-10;c2++) { S1(c1,c2); } for (c2=M-9;c2<=-c1+M;c2++) { - S2(c1+c2,c1); + S2((c1+c2),c1); } } for (c1=M-9;c1<=M;c1++) { diff -Nru cloog-0.18.2/test/gesced3.c cloog-0.18.4/test/gesced3.c --- cloog-0.18.2/test/gesced3.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/gesced3.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,11 +1,11 @@ -/* Generated from ../../../git/cloog/test/gesced3.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.02s. */ +/* Generated from ./gesced3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ for (c1=M+1;c1<=2*M;c1++) { - S1(c1-M) ; + S1((c1-M)); } for (c1=2*M+1;c1<=M+N;c1++) { - S2(c1-2*M) ; - S1(c1-M) ; + S2((c1-2*M)); + S1((c1-M)); } for (c1=M+N+1;c1<=2*M+N;c1++) { - S2(c1-2*M) ; + S2((c1-2*M)); } diff -Nru cloog-0.18.2/test/gesced.c cloog-0.18.4/test/gesced.c --- cloog-0.18.2/test/gesced.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/gesced.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,20 +1,20 @@ -/* Generated from ../../../git/cloog/test/gesced.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.05s. */ +/* Generated from ./gesced.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ for (c1=1;c1<=N;c1++) { - S1(c1) ; + S1(c1); } for (c1=N+1;c1<=2*N;c1++) { for (i=1;i<=N;i++) { - S2(i,c1-N) ; + S2(i,(c1-N)); } } for (c1=2*N+1;c1<=M+N;c1++) { for (i=1;i<=N;i++) { - S3(i,c1-2*N) ; - S2(i,c1-N) ; + S3(i,(c1-2*N)); + S2(i,(c1-N)); } } for (c1=M+N+1;c1<=M+2*N;c1++) { for (i=1;i<=N;i++) { - S3(i,c1-2*N) ; + S3(i,(c1-2*N)); } } diff -Nru cloog-0.18.2/test/isl/jacobi-shared.c cloog-0.18.4/test/isl/jacobi-shared.c --- cloog-0.18.2/test/isl/jacobi-shared.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/isl/jacobi-shared.c 2014-10-02 16:33:52.000000000 +0000 @@ -1,10 +1,10 @@ -/* Generated from ../../../git/cloog/test/isl/jacobi-shared.cloog by CLooG 0.16.3-2-g5511bef gmp bits in 1.82s. */ +/* Generated from ./isl/jacobi-shared.cloog by CLooG gmp bits in 0.31s. */ if ((h0+1)%2 == 0) { if ((16*floord(t0-1,16) >= -N+g1+t0+1) && (16*floord(g1+t0-3,16) >= -N+g1+t0+1) && (32*floord(t1-1,32) >= -N+g2+t1+1) && (32*floord(g2+t1-3,32) >= t1-32)) { for (c0=max(-16*floord(t0-1,16)+t0,-16*floord(g1+t0-3,16)+t0);c0<=min(32,N-g1-1);c0+=16) { for (c1=-32*floord(t1-1,32)+t1;c1<=min(32,N-g2-1);c1+=32) { - if ((c1 >= 1) && (c1 <= 32)) { - S1(c0+g1-1,c1+g2-1); + if (c1 >= 1) { + S1((c0+g1-1),(c1+g2-1)); } } } diff -Nru cloog-0.18.2/test/isl/mxm-shared.c cloog-0.18.4/test/isl/mxm-shared.c --- cloog-0.18.2/test/isl/mxm-shared.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/isl/mxm-shared.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,8 +1,8 @@ -/* Generated from ../../../git/cloog/test/isl/mxm-shared.cloog by CLooG 0.16.1-5-gcba2a9f gmp bits in 0.34s. */ +/* Generated from ./isl/mxm-shared.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.17s. */ if (g4%4 == 0) { if ((N >= g0+t1+1) && (N >= g1+t0+1) && (t1 <= 7)) { for (c0=t0;c0<=min(127,N-g1-1);c0+=16) { - S1(g0+t1,c0+g1); + S1((g0+t1),(c0+g1)); } } } diff -Nru cloog-0.18.2/test/isl/unroll2.c cloog-0.18.4/test/isl/unroll2.c --- cloog-0.18.2/test/isl/unroll2.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/isl/unroll2.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,7 +1,7 @@ -/* Generated from ../../../git/cloog/test/isl/unroll2.cloog by CLooG 0.16.3-13-g27516e4 gmp bits in 0.00s. */ +/* Generated from ./isl/unroll2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ if ((M >= -1) && (M <= 9)) { if (M >= 0) { S1(M); } - S1(M+1); + S1((M+1)); } diff -Nru cloog-0.18.2/test/levenshtein-1-2-3.c cloog-0.18.4/test/levenshtein-1-2-3.c --- cloog-0.18.2/test/levenshtein-1-2-3.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/levenshtein-1-2-3.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,37 +1,37 @@ -/* Generated from ../../../git/cloog/test/levenshtein-1-2-3.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.12s. */ -S1(0,0) ; -S2(1,0) ; -S3(1,1) ; +/* Generated from ./levenshtein-1-2-3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ +S1(0,0); +S2(1,0); +S3(1,1); for (i=2;i<=N;i++) { - S2(i,0) ; + S2(i,0); for (j=1;j<=i-1;j++) { - S6(i,j) ; + S6(i,j); } - S3(i,i) ; + S3(i,i); } -S7(N+1,0) ; +S7((N+1),0); for (j=1;j<=N;j++) { - S6(N+1,j) ; - S8(N+1,j) ; + S6((N+1),j); + S8((N+1),j); } for (i=N+2;i<=2*M-N-2;i++) { - j = floord(i-N-1,2) ; - S7(i,j) ; + j = floord(i-N-1,2); + S7(i,j); if ((i+N)%2 == 0) { - S5(i,(i-N)/2) ; - S8(i,(i-N)/2) ; + S5(i,((i-N)/2)); + S8(i,((i-N)/2)); } for (j=ceild(i-N+1,2);j<=floord(i+N-1,2);j++) { - S6(i,j) ; - S8(i,j) ; + S6(i,j); + S8(i,j); } if ((i+N)%2 == 0) { - S4(i,(i+N)/2) ; - S8(i,(i+N)/2) ; + S4(i,((i+N)/2)); + S8(i,((i+N)/2)); } } for (i=2*M-N-1;i<=2*M-2;i++) { for (j=i-M+1;j<=M-1;j++) { - S6(i,j) ; + S6(i,j); } } diff -Nru cloog-0.18.2/test/levenshtein-1-2-3f.f cloog-0.18.4/test/levenshtein-1-2-3f.f --- cloog-0.18.2/test/levenshtein-1-2-3f.f 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/levenshtein-1-2-3f.f 2014-10-02 14:03:59.000000000 +0000 @@ -1,4 +1,4 @@ -! Generated from ../../../git/cloog/test/levenshtein-1-2-3f.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.11s. +! Generated from ./levenshtein-1-2-3f.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. S1(0,0) S2(1,0) S3(1,1) @@ -9,25 +9,25 @@ END DO S3(i,i) END DO -S7(N+1,0) +S7((N+1),0) DO j=1, N - S6(N+1,j) - S8(N+1,j) + S6((N+1),j) + S8((N+1),j) END DO DO i=N+2, 2*M-N-2 j = FLOOR(REAL(i-N-1)/REAL(2)) S7(i,j) IF (MOD(i+N, 2) == 0) THEN - S5(i,(i-N)/2) - S8(i,(i-N)/2) + S5(i,((i-N)/2)) + S8(i,((i-N)/2)) END IF DO j=CEILING(REAL(i-N+1)/REAL(2)), FLOOR(REAL(i+N-1)/REAL(2)) S6(i,j) S8(i,j) END DO IF (MOD(i+N, 2) == 0) THEN - S4(i,(i+N)/2) - S8(i,(i+N)/2) + S4(i,((i+N)/2)) + S8(i,((i+N)/2)) END IF END DO DO i=2*M-N-1, 2*M-2 diff -Nru cloog-0.18.2/test/lineality-2-1-2.c cloog-0.18.4/test/lineality-2-1-2.c --- cloog-0.18.2/test/lineality-2-1-2.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/lineality-2-1-2.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,14 +1,14 @@ -/* Generated from /home/skimo/git/cloog/test/lineality-2-1-2.cloog by CLooG 0.14.0-284-ga90f184 gmp bits in 0.00s. */ +/* Generated from ./lineality-2-1-2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ for (i=1;i<=M;i++) { for (j=1;j<=min(M,i+1);j++) { S1(i,j); } if (i >= M-1) { - S2(i,i+2); + S2(i,(i+2)); } if (i <= M-2) { - S1(i,i+2); - S2(i,i+2); + S1(i,(i+2)); + S2(i,(i+2)); } for (j=i+3;j<=M;j++) { S1(i,j); diff -Nru cloog-0.18.2/test/Makefile.am cloog-0.18.4/test/Makefile.am --- cloog-0.18.2/test/Makefile.am 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/Makefile.am 2015-07-24 11:54:00.000000000 +0000 @@ -210,7 +210,10 @@ CLOOGTEST_OPENSCOP = \ openscop/matmult \ openscop/empty \ - openscop/union + openscop/loops \ + openscop/union \ + openscop/coordinates \ + openscop/clay endif SPECIAL_TESTS = \ @@ -285,18 +288,7 @@ $(top_builddir)/cloog$(EXEEXT) -callable 1 $$options $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \ done; done -valgrind: - @echo " /*-----------------------------------------------*" - @echo " * Checking files by Valgrind *" - @echo " *-----------------------------------------------*/" - for x in $(CLOOGTEST_C) ; do \ - echo "Valgrinding $$x.c" ; \ - valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \ - done ; \ - for x in $(CLOOGTEST_FORTRAN) ; do \ - echo "Valgrinding $$x.f" ; \ - valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \ - done +valcheck: test_valgrind CHECKER := "$(srcdir)/checker.sh" @@ -315,8 +307,21 @@ SPECIAL_OPTIONS="$(SPECIAL_OPTIONS)" test_run: generate_test$(EXEEXT) - $(TESTS_ENVIRONMENT) \ - $(srcdir)/check_run.sh + $(TESTS_ENVIRONMENT) $(srcdir)/check_run.sh + +test_valgrind: + $(TESTS_ENVIRONMENT) $(srcdir)/check_c.sh valgrind ; \ + $(TESTS_ENVIRONMENT) $(srcdir)/check_fortran.sh valgrind ; \ + $(TESTS_ENVIRONMENT) $(srcdir)/check_strided.sh valgrind ; \ + $(TESTS_ENVIRONMENT) $(srcdir)/check_openscop.sh valgrind ; \ + $(TESTS_ENVIRONMENT) $(srcdir)/check_special.sh valgrind + +test_regenerate: + $(TESTS_ENVIRONMENT) $(srcdir)/check_c.sh regenerate ; \ + $(TESTS_ENVIRONMENT) $(srcdir)/check_fortran.sh regenerate ; \ + $(TESTS_ENVIRONMENT) $(srcdir)/check_strided.sh regenerate ; \ + $(TESTS_ENVIRONMENT) $(srcdir)/check_openscop.sh regenerate ; \ + $(TESTS_ENVIRONMENT) $(srcdir)/check_special.sh regenerate check_SCRIPTS = \ check_c.sh \ @@ -342,4 +347,6 @@ $(CLOOGTEST_OPENSCOP:%=%.c) \ $(SPECIAL_TESTS:%=%.cloog) \ $(SPECIAL_TESTS:%=%.c) \ - $(SPECIAL_TESTS:%=%.good.c) + $(SPECIAL_TESTS:%=%.good.c) \ + openscop/clay_orig.c \ + openscop/coordinates_orig.c diff -Nru cloog-0.18.2/test/Makefile.in cloog-0.18.4/test/Makefile.in --- cloog-0.18.2/test/Makefile.in 2013-12-18 12:36:08.000000000 +0000 +++ cloog-0.18.4/test/Makefile.in 2015-07-27 12:06:01.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -55,6 +54,51 @@ # *****************************************************************************/ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -75,7 +119,9 @@ host_triplet = @host@ noinst_PROGRAMS = $(am__EXEEXT_1) subdir = test -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/autoconf/depcomp \ + $(top_srcdir)/autoconf/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cc_maxopt.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ @@ -102,6 +148,19 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp am__depfiles_maybe = depfiles @@ -114,26 +173,246 @@ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(generate_test_SOURCES) DIST_SOURCES = $(generate_test_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags -am__tty_colors = \ -red=; grn=; lgn=; blu=; std= +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/autoconf/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/autoconf/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -428,7 +707,10 @@ @NO_OSL_FALSE@CLOOGTEST_OPENSCOP = \ @NO_OSL_FALSE@ openscop/matmult \ @NO_OSL_FALSE@ openscop/empty \ -@NO_OSL_FALSE@ openscop/union +@NO_OSL_FALSE@ openscop/loops \ +@NO_OSL_FALSE@ openscop/union \ +@NO_OSL_FALSE@ openscop/coordinates \ +@NO_OSL_FALSE@ openscop/clay @NO_OSL_TRUE@CLOOGTEST_OPENSCOP = SPECIAL_TESTS = \ @@ -501,12 +783,14 @@ $(CLOOGTEST_OPENSCOP:%=%.c) \ $(SPECIAL_TESTS:%=%.cloog) \ $(SPECIAL_TESTS:%=%.c) \ - $(SPECIAL_TESTS:%=%.good.c) + $(SPECIAL_TESTS:%=%.good.c) \ + openscop/clay_orig.c \ + openscop/coordinates_orig.c all: all-am .SUFFIXES: -.SUFFIXES: .c .lo .o .obj +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -546,6 +830,7 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list + generate_test$(EXEEXT): $(generate_test_OBJECTS) $(generate_test_DEPENDENCIES) $(EXTRA_generate_test_DEPENDENCIES) @rm -f generate_test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(generate_test_OBJECTS) $(generate_test_LDADD) $(LIBS) @@ -563,14 +848,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -585,26 +870,15 @@ clean-libtool: -rm -rf .libs _libs -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -616,15 +890,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -633,102 +903,215 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; skip=0; \ - srcdir=$(srcdir); export srcdir; \ - list=' $(TESTS) '; \ - $(am__tty_colors); \ - if test -n "$$list"; then \ - for tst in $$list; do \ - if test -f ./$$tst; then dir=./; \ - elif test -f $$tst; then dir=; \ - else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xpass=`expr $$xpass + 1`; \ - failed=`expr $$failed + 1`; \ - col=$$red; res=XPASS; \ - ;; \ - *) \ - col=$$grn; res=PASS; \ - ;; \ - esac; \ - elif test $$? -ne 77; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xfail=`expr $$xfail + 1`; \ - col=$$lgn; res=XFAIL; \ - ;; \ - *) \ - failed=`expr $$failed + 1`; \ - col=$$red; res=FAIL; \ - ;; \ - esac; \ - else \ - skip=`expr $$skip + 1`; \ - col=$$blu; res=SKIP; \ - fi; \ - echo "$${col}$$res$${std}: $$tst"; \ - done; \ - if test "$$all" -eq 1; then \ - tests="test"; \ - All=""; \ - else \ - tests="tests"; \ - All="All "; \ +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ - if test "$$failed" -eq 0; then \ - if test "$$xfail" -eq 0; then \ - banner="$$All$$all $$tests passed"; \ - else \ - if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ - banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ - fi; \ - else \ - if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all $$tests failed"; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + else \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ else \ - if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ - banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ - fi; \ - dashes="$$banner"; \ - skipped=""; \ - if test "$$skip" -ne 0; then \ - if test "$$skip" -eq 1; then \ - skipped="($$skip test was not run)"; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ else \ - skipped="($$skip tests were not run)"; \ + color_start= color_end=; \ fi; \ - test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$skipped"; \ - fi; \ - report=""; \ - if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ - report="Please report to $(PACKAGE_BUGREPORT)"; \ - test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$report"; \ - fi; \ - dashes=`echo "$$dashes" | sed s/./=/g`; \ - if test "$$failed" -eq 0; then \ - col="$$grn"; \ - else \ - col="$$red"; \ - fi; \ - echo "$${col}$$dashes$${std}"; \ - echo "$${col}$$banner$${std}"; \ - test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ - test -z "$$report" || echo "$${col}$$report$${std}"; \ - echo "$${col}$$dashes$${std}"; \ - test "$$failed" -eq 0; \ - else :; fi + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_SCRIPTS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +check_c.sh.log: check_c.sh + @p='check_c.sh'; \ + b='check_c.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +check_fortran.sh.log: check_fortran.sh + @p='check_fortran.sh'; \ + b='check_fortran.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +check_strided.sh.log: check_strided.sh + @p='check_strided.sh'; \ + b='check_strided.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +check_openscop.sh.log: check_openscop.sh + @p='check_openscop.sh'; \ + b='check_openscop.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +check_special.sh.log: check_special.sh + @p='check_special.sh'; \ + b='check_special.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -786,6 +1169,9 @@ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: @@ -869,9 +1255,9 @@ .MAKE: check-am install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ - clean-generic clean-libtool clean-noinstPROGRAMS ctags \ - distclean distclean-compile distclean-generic \ +.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ + clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ @@ -881,7 +1267,7 @@ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am + recheck tags tags-am uninstall uninstall-am FORCE: @@ -928,22 +1314,24 @@ $(top_builddir)/cloog$(EXEEXT) -callable 1 $$options $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \ done; done -valgrind: - @echo " /*-----------------------------------------------*" - @echo " * Checking files by Valgrind *" - @echo " *-----------------------------------------------*/" - for x in $(CLOOGTEST_C) ; do \ - echo "Valgrinding $$x.c" ; \ - valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \ - done ; \ - for x in $(CLOOGTEST_FORTRAN) ; do \ - echo "Valgrinding $$x.f" ; \ - valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \ - done +valcheck: test_valgrind test_run: generate_test$(EXEEXT) - $(TESTS_ENVIRONMENT) \ - $(srcdir)/check_run.sh + $(TESTS_ENVIRONMENT) $(srcdir)/check_run.sh + +test_valgrind: + $(TESTS_ENVIRONMENT) $(srcdir)/check_c.sh valgrind ; \ + $(TESTS_ENVIRONMENT) $(srcdir)/check_fortran.sh valgrind ; \ + $(TESTS_ENVIRONMENT) $(srcdir)/check_strided.sh valgrind ; \ + $(TESTS_ENVIRONMENT) $(srcdir)/check_openscop.sh valgrind ; \ + $(TESTS_ENVIRONMENT) $(srcdir)/check_special.sh valgrind + +test_regenerate: + $(TESTS_ENVIRONMENT) $(srcdir)/check_c.sh regenerate ; \ + $(TESTS_ENVIRONMENT) $(srcdir)/check_fortran.sh regenerate ; \ + $(TESTS_ENVIRONMENT) $(srcdir)/check_strided.sh regenerate ; \ + $(TESTS_ENVIRONMENT) $(srcdir)/check_openscop.sh regenerate ; \ + $(TESTS_ENVIRONMENT) $(srcdir)/check_special.sh regenerate # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru cloog-0.18.2/test/mod4.c cloog-0.18.4/test/mod4.c --- cloog-0.18.2/test/mod4.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/mod4.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,6 +1,6 @@ -/* Generated from /home/skimo/git/cloog/test/mod4.cloog by CLooG 0.14.0-225-g6e2d019 gmp bits in 0.00s. */ +/* Generated from ./mod4.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ for (j=2;j<=10;j+=3) { - S1(j,(j+1)/3,(j+1)/3,2,(j-2)/3); - S2(j,(j+1)/3,(j+1)/3,2,(j-2)/3); - S3(j,(j+1)/3,(j+1)/3,2,(j-2)/3); + S1(j,((j+1)/3),((j+1)/3),2,((j-2)/3)); + S2(j,((j+1)/3),((j+1)/3),2,((j-2)/3)); + S3(j,((j+1)/3),((j+1)/3),2,((j-2)/3)); } diff -Nru cloog-0.18.2/test/multi-stride2.c cloog-0.18.4/test/multi-stride2.c --- cloog-0.18.2/test/multi-stride2.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/multi-stride2.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated from ../../../git/cloog/test/multi-stride2.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ +/* Generated from ./multi-stride2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ for (i=5;i<=100;i+=6) { - S1(i,(i-1)/2,(i-2)/3) ; + S1(i,((i-1)/2),((i-2)/3)); } diff -Nru cloog-0.18.2/test/no_lindep.c cloog-0.18.4/test/no_lindep.c --- cloog-0.18.2/test/no_lindep.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/no_lindep.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,2 +1,2 @@ -/* Generated from ../../../git/cloog/test/no_lindep.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ -S1(N+2) ; +/* Generated from ./no_lindep.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ +S1((N+2)); diff -Nru cloog-0.18.2/test/non_optimal/nul_complex1.c cloog-0.18.4/test/non_optimal/nul_complex1.c --- cloog-0.18.2/test/non_optimal/nul_complex1.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/non_optimal/nul_complex1.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,9 +1,9 @@ -/* Generated from ../../../git/cloog/test/./non_optimal/nul_complex1.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ +/* Generated from ./non_optimal/nul_complex1.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ if (n >= 0) { for (c1=0;c1<=5*n;c1++) { for (c2=max(ceild(2*c1,3),c1-n);c2<=min(floord(2*c1+2*n,3),c1);c2++) { if (c2%2 == 0) { - S1((-2*c1+3*c2)/2,c1-c2) ; + S1(((-2*c1+3*c2)/2),(c1-c2)); } } } diff -Nru cloog-0.18.2/test/nul_basic1.c cloog-0.18.4/test/nul_basic1.c --- cloog-0.18.2/test/nul_basic1.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/nul_basic1.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,6 +1,6 @@ -/* Generated from ../../../git/cloog/test/nul_basic1.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ +/* Generated from ./nul_basic1.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ if (M >= 0) { for (i=0;i<=M;i+=2) { - S1(i,i/2) ; + S1(i,(i/2)); } } diff -Nru cloog-0.18.2/test/nul_basic2.c cloog-0.18.4/test/nul_basic2.c --- cloog-0.18.2/test/nul_basic2.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/nul_basic2.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,7 +1,7 @@ -/* Generated from ../../../git/cloog/test/nul_basic2.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ +/* Generated from ./nul_basic2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ for (i=2;i<=n;i+=2) { if (i%4 == 0) { - S2(i,i/4) ; + S2(i,(i/4)); } - S1(i,i/2) ; + S1(i,(i/2)); } diff -Nru cloog-0.18.2/test/nul_lcpc.c cloog-0.18.4/test/nul_lcpc.c --- cloog-0.18.2/test/nul_lcpc.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/nul_lcpc.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,15 +1,15 @@ -/* Generated from ../../../git/cloog/test/nul_lcpc.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.03s. */ +/* Generated from ./nul_lcpc.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ for (i=1;i<=6;i+=2) { for (j=1;j<=i;j++) { - S1(i,(i-1)/2,j) ; - S2(i,(i-1)/2,j) ; + S1(i,((i-1)/2),j); + S2(i,((i-1)/2),j); } for (j=i+1;j<=p;j++) { - S1(i,(i-1)/2,j) ; + S1(i,((i-1)/2),j); } } for (i=7;i<=m;i+=2) { for (j=1;j<=p;j++) { - S1(i,(i-1)/2,j) ; + S1(i,((i-1)/2),j); } } diff -Nru cloog-0.18.2/test/openscop/clay.c cloog-0.18.4/test/openscop/clay.c --- cloog-0.18.2/test/openscop/clay.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/test/openscop/clay.c 2015-07-24 11:54:00.000000000 +0000 @@ -0,0 +1,20 @@ +/* Useful macros. */ +#define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) +#define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) +#define max(x,y) ((x) > (y) ? (x) : (y)) +#define min(x,y) ((x) < (y) ? (x) : (y)) + +#ifdef TIME +#define IF_TIME(foo) foo; +#else +#define IF_TIME(foo) +#endif + + /* Scattering iterators. */ + int __ii0; + +for (__ii0=0;__ii0<=10;__ii0++) { + for (i=4*__ii0;i<=min(41,4*__ii0+3);i++) { + S(i); + } +} diff -Nru cloog-0.18.2/test/openscop/clay_orig.c cloog-0.18.4/test/openscop/clay_orig.c --- cloog-0.18.2/test/openscop/clay_orig.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/test/openscop/clay_orig.c 2015-07-24 11:54:00.000000000 +0000 @@ -0,0 +1,9 @@ +int i; +#pragma scop +/* Clay + stripmine([0,0],1,4,1); + */ +for (i = 0; i < 42; i++) { + S(i); +} +#pragma endscop diff -Nru cloog-0.18.2/test/openscop/clay.scop cloog-0.18.4/test/openscop/clay.scop --- cloog-0.18.2/test/openscop/clay.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/test/openscop/clay.scop 2015-07-24 11:54:00.000000000 +0000 @@ -0,0 +1,89 @@ +# [File generated by the OpenScop Library 0.9.0] + + + +# =============================================== Global +# Language +C + +# Context +CONTEXT +0 2 0 0 0 0 + +# Parameters are not provided +0 + + +# Number of statements +1 + +# =============================================== Statement 1 +# Number of relations describing the statement: +3 + +# ---------------------------------------------- 1.1 Domain +DOMAIN +2 3 1 0 0 0 +# e/i| i | 1 + 1 1 0 ## i >= 0 + 1 -1 41 ## -i+41 >= 0 + +# ---------------------------------------------- 1.2 Scattering +SCATTERING +6 8 5 1 0 0 +# e/i| c1 c2 c3 c4 c5 | i | 1 + 0 -1 0 0 0 0 0 0 ## c1 == 0 + 1 0 -4 0 1 0 0 0 ## -4*c2+c4 >= 0 + 1 0 4 0 -1 0 0 3 ## 4*c2-c4+3 >= 0 + 0 0 0 -1 0 0 0 0 ## c3 == 0 + 0 0 0 0 -1 0 1 0 ## c4 == i + 0 0 0 0 0 -1 0 0 ## c5 == 0 + +# ---------------------------------------------- 1.3 Access +READ +1 4 1 1 0 0 +# e/i| Arr| i | 1 + 0 -1 0 1 ## Arr == i + +# ---------------------------------------------- 1.4 Statement Extensions +# Number of Statement Extensions +2 + +1 + + + +# Number of original iterators +1 +# List of original iterators +i +# Statement body expression +S(i); + + +# =============================================== Extensions + +__b0 __ii0 b0 i b1 + + + +# Number of arrays +2 +# Mapping array-identifiers/array-names +1 i +2 S + + + +# File name +clay_orig.c +# Starting line and column +3 0 +# Ending line and column +9 0 +# Indentation +0 + + + + diff -Nru cloog-0.18.2/test/openscop/coordinates.c cloog-0.18.4/test/openscop/coordinates.c --- cloog-0.18.2/test/openscop/coordinates.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/test/openscop/coordinates.c 2015-07-24 11:54:00.000000000 +0000 @@ -0,0 +1,16 @@ +/* Useful macros. */ +#define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) +#define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) +#define max(x,y) ((x) > (y) ? (x) : (y)) +#define min(x,y) ((x) < (y) ? (x) : (y)) + +#ifdef TIME +#define IF_TIME(foo) foo; +#else +#define IF_TIME(foo) +#endif + + +for (i=0;i<=41;i++) { + S1(i); +} diff -Nru cloog-0.18.2/test/openscop/coordinates_orig.c cloog-0.18.4/test/openscop/coordinates_orig.c --- cloog-0.18.2/test/openscop/coordinates_orig.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/test/openscop/coordinates_orig.c 2015-07-24 11:54:00.000000000 +0000 @@ -0,0 +1,5 @@ +#pragma scop +for (i = 0; i < 42; i++) { + S1(i); +} +#pragma endscop diff -Nru cloog-0.18.2/test/openscop/coordinates.scop cloog-0.18.4/test/openscop/coordinates.scop --- cloog-0.18.2/test/openscop/coordinates.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/test/openscop/coordinates.scop 2015-07-24 11:54:00.000000000 +0000 @@ -0,0 +1,86 @@ +# [File generated by the OpenScop Library 0.9.0] + + + +# =============================================== Global +# Language +C + +# Context +CONTEXT +0 2 0 0 0 0 + +# Parameters are not provided +0 + + +# Number of statements +1 + +# =============================================== Statement 1 +# Number of relations describing the statement: +3 + +# ---------------------------------------------- 1.1 Domain +DOMAIN +2 3 1 0 0 0 +# e/i| i | 1 + 1 1 0 ## i >= 0 + 1 -1 41 ## -i+41 >= 0 + +# ---------------------------------------------- 1.2 Scattering +SCATTERING +3 6 3 1 0 0 +# e/i| c1 c2 c3 | i | 1 + 0 -1 0 0 0 0 ## c1 == 0 + 0 0 -1 0 1 0 ## c2 == i + 0 0 0 -1 0 0 ## c3 == 0 + +# ---------------------------------------------- 1.3 Access +READ +1 4 1 1 0 0 +# e/i| Arr| i | 1 + 0 -1 0 1 ## Arr == i + +# ---------------------------------------------- 1.4 Statement Extensions +# Number of Statement Extensions +2 + +# Number of original iterators +1 +# List of original iterators +i +# Statement body expression +S1(i); + + + +1 + + +# =============================================== Extensions + +b0 i b1 + + + +# Number of arrays +2 +# Mapping array-identifiers/array-names +1 i +2 S1 + + + +# File name +coordinates_orig.c +# Starting line and column +2 0 +# Ending line and column +5 0 +# Indentation +0 + + + + diff -Nru cloog-0.18.2/test/openscop/empty.c cloog-0.18.4/test/openscop/empty.c --- cloog-0.18.2/test/openscop/empty.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/test/openscop/empty.c 2015-07-24 11:54:00.000000000 +0000 @@ -0,0 +1,14 @@ +/* Generated from ./openscop/empty.scop by CLooG 0.18.3 gmp bits in 0.00s. */ +/* Useful macros. */ +#define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) +#define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) +#define max(x,y) ((x) > (y) ? (x) : (y)) +#define min(x,y) ((x) < (y) ? (x) : (y)) + +#ifdef TIME +#define IF_TIME(foo) foo; +#else +#define IF_TIME(foo) +#endif + + diff -Nru cloog-0.18.2/test/openscop/empty.scop cloog-0.18.4/test/openscop/empty.scop --- cloog-0.18.2/test/openscop/empty.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/test/openscop/empty.scop 2014-10-02 14:03:59.000000000 +0000 @@ -0,0 +1,35 @@ + + +# =============================================== Global +# Language +C + +# Context +CONTEXT +0 2 0 0 0 0 + +# Parameter names are not provided +0 + +# One statement +1 + +# =============================================== Statement 1 +# Number of relations describing the statement +0 + +# ---------------------------------------------- 1.1 Domain +# NULL Domain + +# ---------------------------------------------- 1.2 Scattering +# NULL Scattering + +# ---------------------------------------------- 1.3 Access +# NULL Access + +# ---------------------------------------------- 1.4 Body +# Statement body is not provided +0 + + + diff -Nru cloog-0.18.2/test/openscop/loops.c cloog-0.18.4/test/openscop/loops.c --- cloog-0.18.2/test/openscop/loops.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/test/openscop/loops.c 2015-07-24 11:54:00.000000000 +0000 @@ -0,0 +1,58 @@ +/* Generated from ./openscop/loops.scop by CLooG 0.18.3 gmp bits in 0.04s. */ +/* Useful macros. */ +#define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) +#define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) +#define max(x,y) ((x) > (y) ? (x) : (y)) +#define min(x,y) ((x) < (y) ? (x) : (y)) + +#ifdef TIME +#define IF_TIME(foo) foo; +#else +#define IF_TIME(foo) +#endif + +/* Scattering iterators. */ +int t2, t3, t4, t5, t6, t9; +/* Original iterators. */ +int i, j, k, l, m, n; +int lbp, ubp; +int lbv, ubv; + +if (N >= 1) { + lbp=0; + ubp=floord(N-1,32); +#pragma omp parallel for private(lbv,ubv,t3,t4,t5,t6,t7,t8,t9) + for (t2=lbp;t2<=ubp;t2++) { + for (t3=0;t3<=floord(N-1,32);t3++) { + for (t4=32*t2;t4<=min(N-1,32*t2+31);t4++) { + lbv=32*t3; + ubv=min(N-1,32*t3+31); + #pragma ivdep + #pragma vector always + for (t9=lbv;t9<=ubv;t9++) { + c[t4][t9] = 0.0; + } + } + } + } + lbp=0; + ubp=floord(N-1,32); +#pragma omp parallel for private(lbv,ubv,t3,t4,t5,t6,t7,t8,t9) + for (t2=lbp;t2<=ubp;t2++) { + for (t3=0;t3<=floord(N-1,32);t3++) { + for (t4=0;t4<=floord(N-1,32);t4++) { + for (t5=32*t2;t5<=min(N-1,32*t2+31);t5++) { + for (t6=32*t4;t6<=min(N-1,32*t4+31);t6++) { + lbv=32*t3; + ubv=min(N-1,32*t3+31); + #pragma ivdep + #pragma vector always + for (t9=lbv;t9<=ubv;t9++) { + c[t5][t9] = c[t5][t9] + a[t5][t6]*b[t6][t9]; + } + } + } + } + } + } +} diff -Nru cloog-0.18.2/test/openscop/loops.scop cloog-0.18.4/test/openscop/loops.scop --- cloog-0.18.2/test/openscop/loops.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/test/openscop/loops.scop 2015-07-24 11:54:00.000000000 +0000 @@ -0,0 +1,223 @@ +# [File generated by the OpenScop Library 0.8.4] + + + +# =============================================== Global +# Language +C + +# Context +CONTEXT +0 3 0 0 0 1 + +# Parameters are provided +1 + +N + + +# Number of statements +2 + +# =============================================== Statement 1 +# Number of relations describing the statement: +3 + +# ---------------------------------------------- 1.1 Domain +DOMAIN +10 7 4 0 0 1 +# e/i| fk0 fk1 i j | N | 1 + 1 0 0 1 0 0 0 ## i >= 0 + 1 0 0 -1 0 1 -1 ## -i+N-1 >= 0 + 1 0 0 0 0 1 -1 ## N-1 >= 0 + 1 0 0 0 1 0 0 ## j >= 0 + 1 0 0 0 -1 1 -1 ## -j+N-1 >= 0 + 0 0 0 0 0 0 0 ## 0 == 0 + 1 0 -32 1 0 0 0 ## -32*fk1+i >= 0 + 1 0 32 -1 0 0 31 ## 32*fk1-i+31 >= 0 + 1 -32 0 0 1 0 0 ## -32*fk0+j >= 0 + 1 32 0 0 -1 0 31 ## 32*fk0-j+31 >= 0 + +# ---------------------------------------------- 1.2 Scattering +SCATTERING +9 16 9 4 0 1 +# e/i| c1 c2 c3 c4 c5 c6 c7 c8 c9 | fk0 fk1 i j | N | 1 + 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ## c1 == 0 + 0 0 -1 0 0 0 0 0 0 0 0 1 0 0 0 0 ## c2 == fk1 + 0 0 0 -1 0 0 0 0 0 0 1 0 0 0 0 0 ## c3 == fk0 + 0 0 0 0 -1 0 0 0 0 0 0 0 1 0 0 0 ## c4 == i + 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 ## c5 == 0 + 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 ## c6 == 0 + 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 ## c7 == 0 + 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 ## c8 == 0 + 0 0 0 0 0 0 0 0 0 -1 0 0 0 1 0 0 ## c9 == j + +# ---------------------------------------------- 1.3 Access +WRITE +3 10 3 4 0 1 +# e/i| Arr [1] [2]| fk0 fk1 i j | N | 1 + 0 -1 0 0 0 0 0 0 0 4 ## Arr == c + 0 0 -1 0 0 0 1 0 0 0 ## [1] == i + 0 0 0 -1 0 0 0 1 0 0 ## [2] == j + +# ---------------------------------------------- 1.4 Body +# Statement body is provided +1 + +# Number of original iterators +4 +# List of original iterators +fk0 fk1 i j +# Statement body expression +c[i][j] = 0.0; + + +# =============================================== Statement 2 +# Number of relations describing the statement: +6 + +# ---------------------------------------------- 2.1 Domain +DOMAIN +13 9 6 0 0 1 +# e/i| fk0 fk1 fk2 i j k | N | 1 + 1 0 0 0 1 0 0 0 0 ## i >= 0 + 1 0 0 0 -1 0 0 1 -1 ## -i+N-1 >= 0 + 1 0 0 0 0 0 0 1 -1 ## N-1 >= 0 + 1 0 0 0 0 1 0 0 0 ## j >= 0 + 1 0 0 0 0 -1 0 1 -1 ## -j+N-1 >= 0 + 1 0 0 0 0 0 1 0 0 ## k >= 0 + 1 0 0 0 0 0 -1 1 -1 ## -k+N-1 >= 0 + 1 0 0 -32 1 0 0 0 0 ## -32*fk2+i >= 0 + 1 0 0 32 -1 0 0 0 31 ## 32*fk2-i+31 >= 0 + 1 0 -32 0 0 1 0 0 0 ## -32*fk1+j >= 0 + 1 0 32 0 0 -1 0 0 31 ## 32*fk1-j+31 >= 0 + 1 -32 0 0 0 0 1 0 0 ## -32*fk0+k >= 0 + 1 32 0 0 0 0 -1 0 31 ## 32*fk0-k+31 >= 0 + +# ---------------------------------------------- 2.2 Scattering +SCATTERING +9 18 9 6 0 1 +# e/i| c1 c2 c3 c4 c5 c6 c7 c8 c9 | fk0 fk1 fk2 i j k | N | 1 + 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 ## c1 == 1 + 0 0 -1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 ## c2 == fk2 + 0 0 0 -1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 ## c3 == fk1 + 0 0 0 0 -1 0 0 0 0 0 1 0 0 0 0 0 0 0 ## c4 == fk0 + 0 0 0 0 0 -1 0 0 0 0 0 0 0 1 0 0 0 0 ## c5 == i + 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 1 0 0 ## c6 == k + 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 ## c7 == 0 + 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 ## c8 == 0 + 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 1 0 0 0 ## c9 == j + +# ---------------------------------------------- 2.3 Access +WRITE +3 12 3 6 0 1 +# e/i| Arr [1] [2]| fk0 fk1 fk2 i j k | N | 1 + 0 -1 0 0 0 0 0 0 0 0 0 4 ## Arr == c + 0 0 -1 0 0 0 0 1 0 0 0 0 ## [1] == i + 0 0 0 -1 0 0 0 0 1 0 0 0 ## [2] == j + +READ +3 12 3 6 0 1 +# e/i| Arr [1] [2]| fk0 fk1 fk2 i j k | N | 1 + 0 -1 0 0 0 0 0 0 0 0 0 4 ## Arr == c + 0 0 -1 0 0 0 0 1 0 0 0 0 ## [1] == i + 0 0 0 -1 0 0 0 0 1 0 0 0 ## [2] == j + +READ +3 12 3 6 0 1 +# e/i| Arr [1] [2]| fk0 fk1 fk2 i j k | N | 1 + 0 -1 0 0 0 0 0 0 0 0 0 6 ## Arr == a + 0 0 -1 0 0 0 0 1 0 0 0 0 ## [1] == i + 0 0 0 -1 0 0 0 0 0 1 0 0 ## [2] == k + +READ +3 12 3 6 0 1 +# e/i| Arr [1] [2]| fk0 fk1 fk2 i j k | N | 1 + 0 -1 0 0 0 0 0 0 0 0 0 7 ## Arr == b + 0 0 -1 0 0 0 0 0 0 1 0 0 ## [1] == k + 0 0 0 -1 0 0 0 0 1 0 0 0 ## [2] == j + +# ---------------------------------------------- 2.4 Body +# Statement body is provided +1 + +# Number of original iterators +6 +# List of original iterators +fk0 fk1 fk2 i j k +# Statement body expression +c[i][j] = c[i][j] + a[i][k]*b[k][j]; + + +# =============================================== Extensions + +# Number of arrays +7 +# Mapping array-identifiers/array-names +1 i +2 N +3 j +4 c +5 k +6 a +7 b + + + +t1 t2 t3 t4 t5 t6 t7 t8 t9 + + + +# Number of loops +4 +# =========================================== +# Loop number 1 +# Iterator name +t2 +# Number of stmts +1 +# Statement identifiers +1 +# Private variables +lbv,ubv,t3,t4,t5,t6,t7,t8,t9 +# Directive +1 +# =========================================== +# Loop number 2 +# Iterator name +t2 +# Number of stmts +1 +# Statement identifiers +2 +# Private variables +lbv,ubv,t3,t4,t5,t6,t7,t8,t9 +# Directive +1 +# =========================================== +# Loop number 3 +# Iterator name +t9 +# Number of stmts +1 +# Statement identifiers +1 +# Private variables +(null) +# Directive +4 +# =========================================== +# Loop number 4 +# Iterator name +t9 +# Number of stmts +1 +# Statement identifiers +2 +# Private variables +(null) +# Directive +4 + + + diff -Nru cloog-0.18.2/test/openscop/matmult.c cloog-0.18.4/test/openscop/matmult.c --- cloog-0.18.2/test/openscop/matmult.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/test/openscop/matmult.c 2015-07-24 11:54:00.000000000 +0000 @@ -0,0 +1,26 @@ +/* Generated from ./openscop/matmult.scop by CLooG 0.18.3 gmp bits in 0.01s. */ +/* Useful macros. */ +#define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) +#define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) +#define max(x,y) ((x) > (y) ? (x) : (y)) +#define min(x,y) ((x) < (y) ? (x) : (y)) + +#ifdef TIME +#define IF_TIME(foo) foo; +#else +#define IF_TIME(foo) +#endif + +/* Scattering iterators. */ +int c2, c4, c6; +/* Original iterators. */ +int i, j, k; + +for (c2=0;c2<=N-1;c2++) { + for (c4=0;c4<=N-1;c4++) { + C[c2][c4] = 0.0; + for (c6=0;c6<=N-1;c6++) { + C[c2][c4] = C[c2][c4] + A[c2][c6] * B[c6][c4]; + } + } +} diff -Nru cloog-0.18.2/test/openscop/matmult.scop cloog-0.18.4/test/openscop/matmult.scop --- cloog-0.18.2/test/openscop/matmult.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/test/openscop/matmult.scop 2014-10-02 14:03:59.000000000 +0000 @@ -0,0 +1,140 @@ +# [File generated by the OpenScop Library 0.8.0] + + + +# =============================================== Global +# Language +C + +# Context +CONTEXT +1 3 0 0 0 1 +# e/i| N | 1 + 1 1 -1 ## N-1 >= 0 + +# Parameters are provided +1 + +N + + +# Number of statements +2 + +# =============================================== Statement 1 +# Number of relations describing the statement: +3 + +# ---------------------------------------------- 1.1 Domain +DOMAIN +4 5 2 0 0 1 +# e/i| i j | N | 1 + 1 1 0 0 0 ## i >= 0 + 1 -1 0 1 -1 ## -i+N-1 >= 0 + 1 0 1 0 0 ## j >= 0 + 1 0 -1 1 -1 ## -j+N-1 >= 0 + +# ---------------------------------------------- 1.2 Scattering +SCATTERING +5 10 5 2 0 1 +# e/i| c1 c2 c3 c4 c5 | i j | N | 1 + 0 -1 0 0 0 0 0 0 0 0 ## c1 == 0 + 0 0 -1 0 0 0 1 0 0 0 ## c2 == i + 0 0 0 -1 0 0 0 0 0 0 ## c3 == 0 + 0 0 0 0 -1 0 0 1 0 0 ## c4 == j + 0 0 0 0 0 -1 0 0 0 0 ## c5 == 0 + +# ---------------------------------------------- 1.3 Access +WRITE +3 8 3 2 0 1 +# e/i| A1 [1] [2]| i j | N | 1 + 0 -1 0 0 0 0 0 1 ## A1 + 0 0 -1 0 1 0 0 0 ## [1] == i + 0 0 0 -1 0 1 0 0 ## [2] == j + +# ---------------------------------------------- 1.4 Body +# Statement body is provided +1 + +# Number of original iterators +2 +# Original iterators +i j +# Body expression +C[i][j] = 0.0; + + + +# =============================================== Statement 2 +# Number of relations describing the statement: +6 + +# ---------------------------------------------- 2.1 Domain +DOMAIN +6 6 3 0 0 1 +# e/i| i j k | N | 1 + 1 1 0 0 0 0 ## i >= 0 + 1 -1 0 0 1 -1 ## -i+N-1 >= 0 + 1 0 1 0 0 0 ## j >= 0 + 1 0 -1 0 1 -1 ## -j+N-1 >= 0 + 1 0 0 1 0 0 ## k >= 0 + 1 0 0 -1 1 -1 ## -k+N-1 >= 0 + +# ---------------------------------------------- 2.2 Scattering +SCATTERING +7 13 7 3 0 1 +# e/i| c1 c2 c3 c4 c5 c6 c7 | i j k | N | 1 + 0 -1 0 0 0 0 0 0 0 0 0 0 0 ## c1 == 0 + 0 0 -1 0 0 0 0 0 1 0 0 0 0 ## c2 == i + 0 0 0 -1 0 0 0 0 0 0 0 0 0 ## c3 == 0 + 0 0 0 0 -1 0 0 0 0 1 0 0 0 ## c4 == j + 0 0 0 0 0 -1 0 0 0 0 0 0 1 ## c5 == 1 + 0 0 0 0 0 0 -1 0 0 0 1 0 0 ## c6 == k + 0 0 0 0 0 0 0 -1 0 0 0 0 0 ## c7 == 0 + +# ---------------------------------------------- 2.3 Access +WRITE +3 9 3 3 0 1 +# e/i| A1 [1] [2]| i j k | N | 1 + 0 -1 0 0 0 0 0 0 1 ## A1 + 0 0 -1 0 1 0 0 0 0 ## [1] == i + 0 0 0 -1 0 1 0 0 0 ## [2] == j + +READ +3 9 3 3 0 1 +# e/i| A1 [1] [2]| i j k | N | 1 + 0 -1 0 0 0 0 0 0 1 ## A1 + 0 0 -1 0 1 0 0 0 0 ## [1] == i + 0 0 0 -1 0 1 0 0 0 ## [2] == j + +READ +3 9 3 3 0 1 +# e/i| A2 [1] [2]| i j k | N | 1 + 0 -1 0 0 0 0 0 0 2 ## A2 + 0 0 -1 0 1 0 0 0 0 ## [1] == i + 0 0 0 -1 0 0 1 0 0 ## [2] == k + +READ +3 9 3 3 0 1 +# e/i| A3 [1] [2]| i j k | N | 1 + 0 -1 0 0 0 0 0 0 3 ## A3 + 0 0 -1 0 0 0 1 0 0 ## [1] == k + 0 0 0 -1 0 1 0 0 0 ## [2] == j + +# ---------------------------------------------- 2.4 Body +# Statement body is provided +1 + +# Number of original iterators +3 +# Original iterators +i j k +# Body expression +C[i][j] = C[i][j] + A[i][k] * B[k][j]; + + + +# =============================================== Extensions + + + diff -Nru cloog-0.18.2/test/openscop/union.c cloog-0.18.4/test/openscop/union.c --- cloog-0.18.2/test/openscop/union.c 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/test/openscop/union.c 2015-07-24 11:54:00.000000000 +0000 @@ -0,0 +1,28 @@ +/* Generated from ./openscop/union.scop by CLooG 0.18.3 gmp bits in 0.01s. */ +/* Useful macros. */ +#define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) +#define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) +#define max(x,y) ((x) > (y) ? (x) : (y)) +#define min(x,y) ((x) < (y) ? (x) : (y)) + +#ifdef TIME +#define IF_TIME(foo) foo; +#else +#define IF_TIME(foo) +#endif + +/* Scattering iterators. */ +int c2, c4; +/* Original iterators. */ +int i, j; + +if (N >= 1) { + for (c2=0;c2<=N-1;c2++) { + for (c4=0;c4<=min(10,N-1);c4++) { + C[c2+c4]+=A[c2]*B[c4]; + } + for (c4=20;c4<=N-1;c4++) { + C[c2+c4]+=A[c2]*B[c4]; + } + } +} diff -Nru cloog-0.18.2/test/openscop/union.scop cloog-0.18.4/test/openscop/union.scop --- cloog-0.18.2/test/openscop/union.scop 1970-01-01 00:00:00.000000000 +0000 +++ cloog-0.18.4/test/openscop/union.scop 2014-10-02 14:03:59.000000000 +0000 @@ -0,0 +1,106 @@ +# [File generated by the OpenScop Library 0.8.0] + + + +# =============================================== Global +# Language +C + +# Context +CONTEXT +1 3 0 0 0 1 +# e/i| N | 1 + 1 1 3 ## N+3 >= 0 + +# Parameters are provided +1 + +N + + +# Number of statements +1 + +# =============================================== Statement 1 +# Number of relations describing the statement: +6 + +# ---------------------------------------------- 1.1 Domain +DOMAIN +# Union with 2 parts +2 +# Union part No.1 +5 5 2 0 0 1 +# e/i| i j | N | 1 + 1 1 0 0 0 ## i >= 0 + 1 -1 0 1 -1 ## -i+N-1 >= 0 + 1 0 1 0 0 ## j >= 0 + 1 0 -1 1 -1 ## -j+N-1 >= 0 + 1 0 1 0 -20 ## j-20 >= 0 +# Union part No.2 +5 5 2 0 0 1 +# e/i| i j | N | 1 + 1 1 0 0 0 ## i >= 0 + 1 -1 0 1 -1 ## -i+N-1 >= 0 + 1 0 1 0 0 ## j >= 0 + 1 0 -1 1 -1 ## -j+N-1 >= 0 + 1 0 -1 0 10 ## -j+10 >= 0 + +# ---------------------------------------------- 1.2 Scattering +SCATTERING +5 10 5 2 0 1 +# e/i| c1 c2 c3 c4 c5 | i j | N | 1 + 0 -1 0 0 0 0 0 0 0 0 ## c1 == 0 + 0 0 -1 0 0 0 1 0 0 0 ## c2 == i + 0 0 0 -1 0 0 0 0 0 0 ## c3 == 0 + 0 0 0 0 -1 0 0 1 0 0 ## c4 == j + 0 0 0 0 0 -1 0 0 0 0 ## c5 == 0 + +# ---------------------------------------------- 1.3 Access +READ +2 7 2 2 0 1 +# e/i| A1 [1]| i j | N | 1 + 0 -1 0 0 0 0 1 ## A1 + 0 0 -1 1 1 0 0 ## [1] == i+j + +READ +2 7 2 2 0 1 +# e/i| A2 [1]| i j | N | 1 + 0 -1 0 0 0 0 2 ## A2 + 0 0 -1 1 0 0 0 ## [1] == i + +READ +2 7 2 2 0 1 +# e/i| A3 [1]| i j | N | 1 + 0 -1 0 0 0 0 3 ## A3 + 0 0 -1 0 1 0 0 ## [1] == j + +WRITE +2 7 2 2 0 1 +# e/i| A1 [1]| i j | N | 1 + 0 -1 0 0 0 0 1 ## A1 + 0 0 -1 1 1 0 0 ## [1] == i+j + +# ---------------------------------------------- 1.4 Body +# Statement body is provided +1 + +# Number of original iterators +2 +# Original iterators +i j +# Body expression +C[i+j]+=A[i]*B[j]; + + + +# =============================================== Extensions + +hello, world + +HELLO WORLD I SAID + + + + + diff -Nru cloog-0.18.2/test/orc.c cloog-0.18.4/test/orc.c --- cloog-0.18.2/test/orc.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/orc.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,21 +1,21 @@ -/* Generated from ../../../git/cloog/test/orc.cloog by CLooG 0.16.2-5-g590827b gmp bits in 0.03s. */ +/* Generated from ./orc.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ S1(0); S2(0,0); for (p2=1;p2<=22;p2++) { if ((p2+1)%2 == 0) { - S3(0,(p2-1)/2); + S3(0,((p2-1)/2)); } if (p2%2 == 0) { - S2(0,p2/2); + S2(0,(p2/2)); } } S3(0,11); for (p1=2;p1<=6;p1++) { if ((p1+1)%3 == 0) { - S4((p1-2)/3); + S4(((p1-2)/3)); } if (p1%3 == 0) { - S1(p1/3); + S1((p1/3)); } if (p1 == 4) { S2(1,0); @@ -23,10 +23,10 @@ if (p1 == 4) { for (p2=1;p2<=20;p2++) { if ((p2+1)%2 == 0) { - S3(1,(p2-1)/2); + S3(1,((p2-1)/2)); } if (p2%2 == 0) { - S2(1,p2/2); + S2(1,(p2/2)); } } } @@ -37,10 +37,10 @@ S2(2,0); for (p2=1;p2<=18;p2++) { if ((p2+1)%2 == 0) { - S3(2,(p2-1)/2); + S3(2,((p2-1)/2)); } if (p2%2 == 0) { - S2(2,p2/2); + S2(2,(p2/2)); } } S3(2,9); @@ -51,14 +51,14 @@ } for (p1=2;p1<=42;p1++) { if ((p1+1)%3 == 0) { - S7((p1-2)/3); + S7(((p1-2)/3)); } if (p1%3 == 0) { - S5(p1/3); + S5((p1/3)); } for (p2=0;p2<=9;p2++) { if ((p1+2)%3 == 0) { - S6((p1-1)/3,p2); + S6(((p1-1)/3),p2); } } } diff -Nru cloog-0.18.2/test/pouchet.c cloog-0.18.4/test/pouchet.c --- cloog-0.18.2/test/pouchet.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/pouchet.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,18 +1,18 @@ -/* Generated from ../../../git/cloog/test/pouchet.cloog by CLooG 0.16.2-3-gc1aebd7 gmp bits in 0.03s. */ +/* Generated from ./pouchet.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.02s. */ if (Ny >= 2) { for (c0=1;c0<=floord(Ny+4,2);c0++) { for (c1=max(ceild(c0+1,2),c0-1);c1<=min(floord(2*c0+Ny,4),c0);c1++) { if (c0 >= ceild(4*c1-Ny+1,2)) { for (c2=1;c2<=2;c2++) { - S1(c0-c1,c1,2*c0-2*c1,-2*c0+4*c1,c2); - S2(c0-c1,c1,2*c0-2*c1,-2*c0+4*c1-1,c2); + S1((c0-c1),c1,(2*c0-2*c1),(-2*c0+4*c1),c2); + S2((c0-c1),c1,(2*c0-2*c1),(-2*c0+4*c1-1),c2); } } if (2*c0 == 4*c1-Ny) { for (c2=1;c2<=2;c2++) { if (Ny%2 == 0) { if ((2*c0+3*Ny)%4 == 0) { - S2((2*c0-Ny)/4,(2*c0+Ny)/4,(2*c0-Ny)/2,Ny-1,c2); + S2(((2*c0-Ny)/4),((2*c0+Ny)/4),((2*c0-Ny)/2),(Ny-1),c2); } } } diff -Nru cloog-0.18.2/test/rectangle.c cloog-0.18.4/test/rectangle.c --- cloog-0.18.2/test/rectangle.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/rectangle.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,6 +1,6 @@ -/* Generated from ../../../git/cloog/test/rectangle.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ +/* Generated from ./rectangle.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ for (c1=0;c1<=2*n;c1++) { for (i=max(0,c1-n);i<=min(c1,n);i++) { - S1(i,c1-i) ; + S1(i,(c1-i)); } } diff -Nru cloog-0.18.2/test/reservoir/bastoul3.c cloog-0.18.4/test/reservoir/bastoul3.c --- cloog-0.18.2/test/reservoir/bastoul3.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/bastoul3.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,6 +1,6 @@ -/* Generated from ../../../git/cloog/test/reservoir/bastoul3.cloog by CLooG 0.16.3 gmp bits in 0.01s. */ +/* Generated from ./reservoir/bastoul3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ for (i=3;i<=9;i++) { for (j=max(i-6,i-2*floord(i+1,2)+2);j<=min(3,i-2);j+=2) { - S1(i,j,(i-j)/2); + S1(i,j,((i-j)/2)); } } diff -Nru cloog-0.18.2/test/reservoir/cholesky2.c cloog-0.18.4/test/reservoir/cholesky2.c --- cloog-0.18.2/test/reservoir/cholesky2.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/cholesky2.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated from ../../../git/cloog/test/reservoir/cholesky2.cloog by CLooG 0.14.0-283-g7c18f7a gmp bits in 0.04s. */ +/* Generated from ./reservoir/cholesky2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ if (M >= 1) { if (M >= 2) { S1(1); @@ -11,21 +11,21 @@ } for (c2=4;c2<=3*M-4;c2++) { if ((c2+1)%3 == 0) { - S1((c2+1)/3); + S1(((c2+1)/3)); } for (c4=ceild(c2+2,3);c4<=min(M,c2-2);c4++) { for (c6=ceild(c2-c4+2,2);c6<=min(c4,c2-c4);c6++) { - S3(c2-c4-c6+1,c4,c6); + S3((c2-c4-c6+1),c4,c6); } } for (c4=ceild(c2+4,3);c4<=min(M,c2);c4++) { if ((c2+c4)%2 == 0) { - S2((c2-c4+2)/2,c4); + S2(((c2-c4+2)/2),c4); } } } for (c2=max(2*M,3*M-3);c2<=3*M-2;c2++) { - S3(c2-2*M+1,M,M); + S3((c2-2*M+1),M,M); } if (M >= 2) { S1(M); diff -Nru cloog-0.18.2/test/reservoir/fusion2.c cloog-0.18.4/test/reservoir/fusion2.c --- cloog-0.18.2/test/reservoir/fusion2.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/fusion2.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,17 +1,17 @@ -/* Generated from ../../../git/cloog/test/./reservoir/fusion2.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.02s. */ +/* Generated from ./reservoir/fusion2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ if ((M >= 1) && (N >= 1)) { for (c4=1;c4<=M;c4++) { - S1(1,c4) ; + S1(1,c4); } for (c2=2;c2<=N;c2++) { for (c4=1;c4<=M;c4++) { - S2(c2-1,c4) ; + S2((c2-1),c4); } for (c4=1;c4<=M;c4++) { - S1(c2,c4) ; + S1(c2,c4); } } for (c4=1;c4<=M;c4++) { - S2(N,c4) ; + S2(N,c4); } } diff -Nru cloog-0.18.2/test/reservoir/jacobi3.c cloog-0.18.4/test/reservoir/jacobi3.c --- cloog-0.18.2/test/reservoir/jacobi3.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/jacobi3.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,29 +1,29 @@ -/* Generated from ../../../git/cloog/test/./reservoir/jacobi3.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.02s. */ +/* Generated from ./reservoir/jacobi3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ if ((M >= 1) && (N >= 3)) { for (c4=2;c4<=N-1;c4++) { for (c6=2;c6<=N-1;c6++) { - S1(1,c4,c6) ; + S1(1,c4,c6); } } for (c2=3;c2<=2*M;c2++) { for (c4=2;c4<=N-1;c4++) { for (c6=2;c6<=N-1;c6++) { if (c2%2 == 0) { - S1(c2/2,c4,c6) ; + S1((c2/2),c4,c6); } } } for (c4=2;c4<=N-1;c4++) { for (c6=2;c6<=N-1;c6++) { if ((c2+1)%2 == 0) { - S2((c2-1)/2,c4,c6) ; + S2(((c2-1)/2),c4,c6); } } } } for (c4=2;c4<=N-1;c4++) { for (c6=2;c6<=N-1;c6++) { - S2(M,c4,c6) ; + S2(M,c4,c6); } } } diff -Nru cloog-0.18.2/test/reservoir/lim-lam1.c cloog-0.18.4/test/reservoir/lim-lam1.c --- cloog-0.18.2/test/reservoir/lim-lam1.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/lim-lam1.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,25 +1,25 @@ -/* Generated from /home/skimo/git/cloog/test/./reservoir/lim-lam1.cloog by CLooG 0.14.0-284-ga90f184 gmp bits in 0.01s. */ +/* Generated from ./reservoir/lim-lam1.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ S1(1,100); for (c2=-98;c2<=99;c2++) { if (c2 <= 0) { - S1(1,-c2+1); + S1(1,(-c2+1)); } if (c2 >= 1) { S2(c2,1); } for (c4=max(2,-2*c2+3);c4<=min(199,-2*c2+200);c4++) { if (c4%2 == 0) { - S1((2*c2+c4)/2,c4/2); + S1(((2*c2+c4)/2),(c4/2)); } if ((c4+1)%2 == 0) { - S2((2*c2+c4-1)/2,(c4+1)/2); + S2(((2*c2+c4-1)/2),((c4+1)/2)); } } if (c2 <= 0) { - S1(c2+100,100); + S1((c2+100),100); } if (c2 >= 1) { - S2(100,-c2+101); + S2(100,(-c2+101)); } } S2(100,1); diff -Nru cloog-0.18.2/test/reservoir/lim-lam3.c cloog-0.18.4/test/reservoir/lim-lam3.c --- cloog-0.18.2/test/reservoir/lim-lam3.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/lim-lam3.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,33 +1,33 @@ -/* Generated from ../../../git/cloog/test/reservoir/lim-lam3.cloog by CLooG 0.16.2-8-g1421b58 gmp bits in 0.03s. */ +/* Generated from ./reservoir/lim-lam3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ S4(1); for (c2=9;c2<=min(13,5*M-1);c2++) { if (c2 <= M+7) { - S2(c2-7,1); + S2((c2-7),1); } if (c2 == 10) { S4(2); } if (c2 <= 3*M+3) { if (c2%3 == 0) { - S3((c2-3)/3,1); + S3(((c2-3)/3),1); } } } for (c2=14;c2<=5*M-1;c2++) { for (c4=max(2,ceild(c2-M-3,4));c4<=min(floord(c2-8,3),M-1);c4++) { for (c6=max(1,ceild(c2-2*c4-M-5,2));c6<=min(floord(c2-3*c4-6,2),c4-1);c6++) { - S1(c2-2*c4-2*c6-5,c4,c6); + S1((c2-2*c4-2*c6-5),c4,c6); } } for (c4=max(1,ceild(c2-M-3,4));c4<=floord(c2-4,5);c4++) { - S2(c2-4*c4-3,c4); + S2((c2-4*c4-3),c4); } if (c2%5 == 0) { - S4(c2/5); + S4((c2/5)); } for (c4=max(1,ceild(c2-3*M-1,2));c4<=floord(c2-4,5);c4++) { if ((c2+c4+2)%3 == 0) { - S3((c2-2*c4-1)/3,c4); + S3(((c2-2*c4-1)/3),c4); } } } diff -Nru cloog-0.18.2/test/reservoir/lim-lam4.c cloog-0.18.4/test/reservoir/lim-lam4.c --- cloog-0.18.2/test/reservoir/lim-lam4.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/lim-lam4.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,17 +1,17 @@ -/* Generated from ../../../git/cloog/test/./reservoir/lim-lam4.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.04s. */ +/* Generated from ./reservoir/lim-lam4.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ if (M >= 2) { - S1(1,0,0) ; + S1(1,0,0); for (c2=2;c2<=2*M-2;c2++) { for (c4=max(-M+1,-c2+1);c4<=-1;c4++) { for (i=max(1,c2-M+1);i<=min(M-1,c2+c4);i++) { - S1(i,c2+c4-i,-c4) ; + S1(i,(c2+c4-i),-c4); } for (c6=max(-c4,c2-M+1);c6<=min(M-1,c2-1);c6++) { - S2(c2-c6,c4+c6,c6) ; + S2((c2-c6),(c4+c6),c6); } } for (i=max(1,c2-M+1);i<=min(c2,M-1);i++) { - S1(i,c2-i,0) ; + S1(i,(c2-i),0); } } } diff -Nru cloog-0.18.2/test/reservoir/liu-zhuge1.c cloog-0.18.4/test/reservoir/liu-zhuge1.c --- cloog-0.18.2/test/reservoir/liu-zhuge1.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/liu-zhuge1.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,46 +1,46 @@ -/* Generated from /home/skimo/git/cloog/test/./reservoir/liu-zhuge1.cloog by CLooG 0.14.0-284-ga90f184 gmp bits in 0.02s. */ +/* Generated from ./reservoir/liu-zhuge1.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.02s. */ if ((M >= 0) && (N >= 0)) { for (c2=-4;c2<=min(-1,3*M+N-4);c2++) { for (c4=max(0,c2-3*M+4);c4<=min(N,c2+4);c4++) { if ((c2+2*c4+1)%3 == 0) { - S1((c2-c4+4)/3,c4); + S1(((c2-c4+4)/3),c4); } } } for (c2=0;c2<=3*M+N-4;c2++) { for (c4=max(0,c2-3*M);c4<=min(c2,c2-3*M+3);c4++) { if ((c2+2*c4)%3 == 0) { - S2((c2-c4)/3,c4); + S2(((c2-c4)/3),c4); } } for (c4=max(0,c2-3*M+4);c4<=min(N,c2);c4++) { if ((c2+2*c4)%3 == 0) { - S2((c2-c4)/3,c4); + S2(((c2-c4)/3),c4); } if ((c2+2*c4+1)%3 == 0) { - S1((c2-c4+4)/3,c4); + S1(((c2-c4+4)/3),c4); } } for (c4=max(c2+1,c2-3*M+4);c4<=min(N,c2+4);c4++) { if ((c2+2*c4+1)%3 == 0) { - S1((c2-c4+4)/3,c4); + S1(((c2-c4+4)/3),c4); } } for (c4=max(0,c2-3*M);c4<=min(N,c2);c4++) { if ((c2+2*c4)%3 == 0) { - S3((c2-c4)/3,c4); + S3(((c2-c4)/3),c4); } } } for (c2=max(0,3*M+N-3);c2<=3*M+N;c2++) { for (c4=max(0,c2-3*M);c4<=min(N,c2);c4++) { if ((c2+2*c4)%3 == 0) { - S2((c2-c4)/3,c4); + S2(((c2-c4)/3),c4); } } for (c4=max(0,c2-3*M);c4<=min(N,c2);c4++) { if ((c2+2*c4)%3 == 0) { - S3((c2-c4)/3,c4); + S3(((c2-c4)/3),c4); } } } diff -Nru cloog-0.18.2/test/reservoir/loechner3.c cloog-0.18.4/test/reservoir/loechner3.c --- cloog-0.18.2/test/reservoir/loechner3.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/loechner3.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,9 +1,9 @@ -/* Generated from ../../../git/cloog/test/./reservoir/loechner3.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ +/* Generated from ./reservoir/loechner3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ if (M >= 1) { for (c2=1;c2<=M;c2++) { for (c4=2;c4<=c2+M;c4++) { for (c6=max(1,-c2+c4);c6<=min(M,c4-1);c6++) { - S1(c2,c6,c4-c6) ; + S1(c2,c6,(c4-c6)); } } } diff -Nru cloog-0.18.2/test/reservoir/loechner4.c cloog-0.18.4/test/reservoir/loechner4.c --- cloog-0.18.2/test/reservoir/loechner4.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/loechner4.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,10 +1,10 @@ -/* Generated from ../../../git/cloog/test/./reservoir/loechner4.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.02s. */ +/* Generated from ./reservoir/loechner4.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ if (M >= 1) { for (c2=2;c2<=2*M;c2++) { for (c4=1;c4<=M;c4++) { for (c6=1;c6<=M;c6++) { for (c8=max(1,c2-M);c8<=min(M,c2-1);c8++) { - S1(c6,c4,c8,c2-c8) ; + S1(c6,c4,c8,(c2-c8)); } } } diff -Nru cloog-0.18.2/test/reservoir/mg-interp.c cloog-0.18.4/test/reservoir/mg-interp.c --- cloog-0.18.2/test/reservoir/mg-interp.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/mg-interp.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated from ../../../git/cloog/test/reservoir/mg-interp.cloog by CLooG 0.16.2-5-g590827b gmp bits in 0.29s. */ +/* Generated from ./reservoir/mg-interp.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.16s. */ if ((M >= 2) && (N >= 2)) { for (c2=1;c2<=O-1;c2++) { for (c6=1;c6<=M;c6++) { @@ -55,58 +55,58 @@ for (c4=3;c4<=2*N-5;c4++) { for (c6=1;c6<=M-1;c6++) { if ((c4+1)%2 == 0) { - S10(c2,(c4-1)/2,c6); + S10(c2,((c4-1)/2),c6); } } for (c6=1;c6<=M;c6++) { if ((c4+1)%2 == 0) { - S3(c2,(c4+1)/2,c6); + S3(c2,((c4+1)/2),c6); } } for (c6=1;c6<=M-1;c6++) { if (c4%2 == 0) { - S6(c2,(c4+2)/2,c6); + S6(c2,((c4+2)/2),c6); } if ((c4+1)%2 == 0) { - S1(c2,(c4+3)/2,c6); + S1(c2,((c4+3)/2),c6); } if (c4%2 == 0) { - S7(c2,(c4+2)/2,c6); + S7(c2,((c4+2)/2),c6); } } if ((c4+1)%2 == 0) { - S1(c2,(c4+3)/2,M); + S1(c2,((c4+3)/2),M); } for (c6=1;c6<=M-1;c6++) { if (c4%2 == 0) { - S11(c2,c4/2,c6); + S11(c2,(c4/2),c6); } } } if (N >= 4) { for (c6=1;c6<=M-1;c6++) { - S6(c2,N-1,c6); - S7(c2,N-1,c6); + S6(c2,(N-1),c6); + S7(c2,(N-1),c6); } for (c6=1;c6<=M-1;c6++) { - S11(c2,N-2,c6); + S11(c2,(N-2),c6); } } if (N >= 3) { for (c6=1;c6<=M-1;c6++) { - S10(c2,N-2,c6); + S10(c2,(N-2),c6); } for (c6=1;c6<=M;c6++) { - S3(c2,N-1,c6); + S3(c2,(N-1),c6); } } if (N >= 3) { for (c6=1;c6<=M-1;c6++) { - S11(c2,N-1,c6); + S11(c2,(N-1),c6); } } for (c6=1;c6<=M-1;c6++) { - S10(c2,N-1,c6); + S10(c2,(N-1),c6); } } } @@ -115,13 +115,13 @@ S1(c2,1,1); for (c4=1;c4<=2*N-5;c4++) { if ((c4+1)%2 == 0) { - S3(c2,(c4+1)/2,1); + S3(c2,((c4+1)/2),1); } if ((c4+1)%2 == 0) { - S1(c2,(c4+3)/2,1); + S1(c2,((c4+3)/2),1); } } - S3(c2,N-1,1); + S3(c2,(N-1),1); } } if ((M >= 2) && (N >= 2)) { @@ -135,22 +135,22 @@ for (c4=3;c4<=2*N-2;c4++) { for (c6=1;c6<=M;c6++) { if (c4%2 == 0) { - S2(c2,c4/2,c6); + S2(c2,(c4/2),c6); } } for (c6=1;c6<=M-1;c6++) { if (c4%2 == 0) { - S8(c2,c4/2,c6); + S8(c2,(c4/2),c6); } } for (c6=1;c6<=M-1;c6++) { if ((c4+1)%2 == 0) { - S9(c2,(c4-1)/2,c6); + S9(c2,((c4-1)/2),c6); } } } for (c6=1;c6<=M-1;c6++) { - S9(c2,N-1,c6); + S9(c2,(N-1),c6); } } } @@ -158,7 +158,7 @@ for (c2=1;c2<=O-1;c2++) { for (c4=2;c4<=2*N-2;c4++) { if (c4%2 == 0) { - S2(c2,c4/2,1); + S2(c2,(c4/2),1); } } } diff -Nru cloog-0.18.2/test/reservoir/mg-psinv.c cloog-0.18.4/test/reservoir/mg-psinv.c --- cloog-0.18.2/test/reservoir/mg-psinv.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/mg-psinv.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated from /home/skimo/git/cloog/test/./reservoir/mg-psinv.cloog by CLooG 0.14.0-284-ga90f184 gmp bits in 0.02s. */ +/* Generated from ./reservoir/mg-psinv.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.02s. */ if ((M >= 1) && (N >= 3) && (O >= 3)) { if (M >= 3) { for (c2=2;c2<=O-1;c2++) { @@ -9,18 +9,18 @@ for (c4=4;c4<=2*N-3;c4++) { for (c6=1;c6<=M;c6++) { if ((c4+1)%2 == 0) { - S1(c2,(c4+1)/2,c6); - S2(c2,(c4+1)/2,c6); + S1(c2,((c4+1)/2),c6); + S2(c2,((c4+1)/2),c6); } } for (c6=2;c6<=M-1;c6++) { if (c4%2 == 0) { - S3(c2,c4/2,c6); + S3(c2,(c4/2),c6); } } } for (c6=2;c6<=M-1;c6++) { - S3(c2,N-1,c6); + S3(c2,(N-1),c6); } } } @@ -29,8 +29,8 @@ for (c4=3;c4<=2*N-3;c4++) { for (c6=1;c6<=M;c6++) { if ((c4+1)%2 == 0) { - S1(c2,(c4+1)/2,c6); - S2(c2,(c4+1)/2,c6); + S1(c2,((c4+1)/2),c6); + S2(c2,((c4+1)/2),c6); } } } diff -Nru cloog-0.18.2/test/reservoir/mg-resid.c cloog-0.18.4/test/reservoir/mg-resid.c --- cloog-0.18.2/test/reservoir/mg-resid.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/mg-resid.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated from /home/skimo/git/cloog/test/./reservoir/mg-resid.cloog by CLooG 0.14.0-284-ga90f184 gmp bits in 0.03s. */ +/* Generated from ./reservoir/mg-resid.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.02s. */ if ((M >= 1) && (N >= 3) && (O >= 3)) { if (M >= 3) { for (c2=2;c2<=O-1;c2++) { @@ -9,18 +9,18 @@ for (c4=4;c4<=2*N-3;c4++) { for (c6=1;c6<=M;c6++) { if ((c4+1)%2 == 0) { - S1(c2,(c4+1)/2,c6); - S2(c2,(c4+1)/2,c6); + S1(c2,((c4+1)/2),c6); + S2(c2,((c4+1)/2),c6); } } for (c6=2;c6<=M-1;c6++) { if (c4%2 == 0) { - S3(c2,c4/2,c6); + S3(c2,(c4/2),c6); } } } for (c6=2;c6<=M-1;c6++) { - S3(c2,N-1,c6); + S3(c2,(N-1),c6); } } } @@ -29,8 +29,8 @@ for (c4=3;c4<=2*N-3;c4++) { for (c6=1;c6<=M;c6++) { if ((c4+1)%2 == 0) { - S1(c2,(c4+1)/2,c6); - S2(c2,(c4+1)/2,c6); + S1(c2,((c4+1)/2),c6); + S2(c2,((c4+1)/2),c6); } } } diff -Nru cloog-0.18.2/test/reservoir/mg-rprj3.c cloog-0.18.4/test/reservoir/mg-rprj3.c --- cloog-0.18.2/test/reservoir/mg-rprj3.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/mg-rprj3.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated from /home/skimo/git/cloog/test/./reservoir/mg-rprj3.cloog by CLooG 0.14.0-284-ga90f184 gmp bits in 0.10s. */ +/* Generated from ./reservoir/mg-rprj3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.05s. */ if ((M >= 2) && (N >= 3) && (O >= 3)) { if (M >= 3) { for (c2=2;c2<=O-1;c2++) { @@ -7,41 +7,41 @@ } for (c4=3;c4<=N-1;c4++) { for (c6=2;c6<=M;c6++) { - S2(c2,c4-1,c6); + S2(c2,(c4-1),c6); } - S4(c2,c4-1,2); + S4(c2,(c4-1),2); for (c6=2;c6<=M-2;c6++) { - S3(c2,c4-1,c6); - S5(c2,c4-1,c6); - S4(c2,c4-1,c6+1); + S3(c2,(c4-1),c6); + S5(c2,(c4-1),c6); + S4(c2,(c4-1),(c6+1)); } - S3(c2,c4-1,M-1); - S5(c2,c4-1,M-1); + S3(c2,(c4-1),(M-1)); + S5(c2,(c4-1),(M-1)); for (c6=2;c6<=M;c6++) { S1(c2,c4,c6); } } for (c6=2;c6<=M;c6++) { - S2(c2,N-1,c6); + S2(c2,(N-1),c6); } - S4(c2,N-1,2); + S4(c2,(N-1),2); for (c6=2;c6<=M-2;c6++) { - S3(c2,N-1,c6); - S5(c2,N-1,c6); - S4(c2,N-1,c6+1); + S3(c2,(N-1),c6); + S5(c2,(N-1),c6); + S4(c2,(N-1),(c6+1)); } - S3(c2,N-1,M-1); - S5(c2,N-1,M-1); + S3(c2,(N-1),(M-1)); + S5(c2,(N-1),(M-1)); } } if (M == 2) { for (c2=2;c2<=O-1;c2++) { S1(c2,2,2); for (c4=3;c4<=N-1;c4++) { - S2(c2,c4-1,2); + S2(c2,(c4-1),2); S1(c2,c4,2); } - S2(c2,N-1,2); + S2(c2,(N-1),2); } } } diff -Nru cloog-0.18.2/test/reservoir/pingali1.c cloog-0.18.4/test/reservoir/pingali1.c --- cloog-0.18.2/test/reservoir/pingali1.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/pingali1.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,14 +1,14 @@ -/* Generated from /home/skimo/git/cloog/test/./reservoir/pingali1.cloog by CLooG 0.14.0-225-g6e2d019 gmp bits in 0.01s. */ +/* Generated from ./reservoir/pingali1.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ if ((M >= 1) && (N >= 1)) { if (N >= 2) { for (c2=1;c2<=M;c2++) { S2(c2,1); for (c4=3;c4<=2*N-1;c4++) { for (c6=max(1,c4-N);c6<=floord(c4-1,2);c6++) { - S1(c2,c4-c6,c6); + S1(c2,(c4-c6),c6); } if ((c4+1)%2 == 0) { - S2(c2,(c4+1)/2); + S2(c2,((c4+1)/2)); } } } diff -Nru cloog-0.18.2/test/reservoir/pingali5.c cloog-0.18.4/test/reservoir/pingali5.c --- cloog-0.18.2/test/reservoir/pingali5.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/pingali5.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,21 +1,21 @@ -/* Generated from /home/skimo/git/cloog/test/./reservoir/pingali5.cloog by CLooG 0.14.0-225-g6e2d019 gmp bits in 0.02s. */ +/* Generated from ./reservoir/pingali5.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ if (M >= 2) { for (c2=3;c2<=2*M-3;c2++) { for (c4=ceild(c2+3,2);c4<=M;c4++) { for (i=ceild(c2+1,2);i<=min(c2-1,c4-1);i++) { - S1(i,c2-i,c4); + S1(i,(c2-i),c4); } } for (c4=max(1,c2-M);c4<=floord(c2-1,2);c4++) { - S2(c2-c4,c4); + S2((c2-c4),c4); } for (c4=ceild(c2+3,2);c4<=M;c4++) { for (i=ceild(c2+1,2);i<=min(c2-1,c4-1);i++) { - S3(i,c2-i,c4); + S3(i,(c2-i),c4); } } } for (c2=max(M+1,2*M-2);c2<=2*M-1;c2++) { - S2(M,c2-M); + S2(M,(c2-M)); } } diff -Nru cloog-0.18.2/test/reservoir/pingali6.c cloog-0.18.4/test/reservoir/pingali6.c --- cloog-0.18.2/test/reservoir/pingali6.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/pingali6.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,29 +1,29 @@ -/* Generated from ../../../git/cloog/test/./reservoir/pingali6.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.04s. */ +/* Generated from ./reservoir/pingali6.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ if (N >= 3) { for (c4=2;c4<=N-1;c4++) { for (c6=2;c6<=N-1;c6++) { - S1(1,c4,c6) ; + S1(1,c4,c6); } } for (c2=3;c2<=2*M;c2++) { for (c4=2;c4<=N-1;c4++) { for (c6=2;c6<=N-1;c6++) { if (c2%2 == 0) { - S1(c2/2,c4,c6) ; + S1((c2/2),c4,c6); } } } for (c4=2;c4<=N-1;c4++) { for (c6=2;c6<=N-1;c6++) { if ((c2+1)%2 == 0) { - S2((c2-1)/2,c4,c6) ; + S2(((c2-1)/2),c4,c6); } } } } for (c4=2;c4<=N-1;c4++) { for (c6=2;c6<=N-1;c6++) { - S2(M,c4,c6) ; + S2(M,c4,c6); } } } diff -Nru cloog-0.18.2/test/reservoir/QR.c cloog-0.18.4/test/reservoir/QR.c --- cloog-0.18.2/test/reservoir/QR.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/QR.c 2014-10-02 14:33:50.000000000 +0000 @@ -1,117 +1,117 @@ -/* Generated from ../../../git/cloog/test/./reservoir/QR.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.21s. */ +/* Generated from ./reservoir/QR.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.07s. */ if (N >= 1) { - S1(0) ; + S1(0); + if ((M <= 0) && (N >= 2)) { + S3(0); + S10(0); + S1(1); + S5(0); + } if ((M >= 1) && (N == 1)) { for (c4=0;c4<=M-1;c4++) { - S2(0,c4) ; + S2(0,c4); } - S3(0) ; + S3(0); for (c4=0;c4<=M-1;c4++) { - S4(0,c4) ; + S4(0,c4); } - S10(0) ; - S5(0) ; + S10(0); + S5(0); } if ((M <= 0) && (N == 1)) { - S3(0) ; - S10(0) ; - S5(0) ; + S3(0); + S10(0); + S5(0); } if ((M >= 1) && (N >= 2)) { for (c4=0;c4<=M-1;c4++) { - S2(0,c4) ; + S2(0,c4); } - S3(0) ; + S3(0); for (c4=0;c4<=M-1;c4++) { - S4(0,c4) ; + S4(0,c4); } - S10(0) ; - S1(1) ; - S5(0) ; - } - if ((M <= 0) && (N >= 2)) { - S3(0) ; - S10(0) ; - S1(1) ; - S5(0) ; + S10(0); + S1(1); + S5(0); } for (c2=2;c2<=min(M,N-1);c2++) { for (c4=c2-1;c4<=N-1;c4++) { - S6(c2-2,c4) ; + S6((c2-2),c4); for (c6=c2-2;c6<=M-1;c6++) { - S7(c2-2,c4,c6) ; + S7((c2-2),c4,c6); } - S8(c2-2,c4) ; + S8((c2-2),c4); for (c6=c2-2;c6<=M-1;c6++) { - S9(c2-2,c4,c6) ; + S9((c2-2),c4,c6); } } for (c4=c2-1;c4<=M-1;c4++) { - S2(c2-1,c4) ; + S2((c2-1),c4); } - S3(c2-1) ; + S3((c2-1)); for (c4=c2-1;c4<=M-1;c4++) { - S4(c2-1,c4) ; + S4((c2-1),c4); } - S10(c2-1) ; - S1(c2) ; - S5(c2-1) ; + S10((c2-1)); + S1(c2); + S5((c2-1)); } if ((M >= 1) && (M <= N-2)) { for (c4=M;c4<=N-1;c4++) { - S6(M-1,c4) ; - S7(M-1,c4,M-1) ; - S8(M-1,c4) ; - S9(M-1,c4,M-1) ; - } - S3(M) ; - S10(M) ; - S1(M+1) ; - S5(M) ; + S6((M-1),c4); + S7((M-1),c4,(M-1)); + S8((M-1),c4); + S9((M-1),c4,(M-1)); + } + S3(M); + S10(M); + S1((M+1)); + S5(M); } for (c2=max(2,M+2);c2<=N-1;c2++) { for (c4=c2-1;c4<=N-1;c4++) { - S6(c2-2,c4) ; - S8(c2-2,c4) ; + S6((c2-2),c4); + S8((c2-2),c4); } - S3(c2-1) ; - S10(c2-1) ; - S1(c2) ; - S5(c2-1) ; + S3((c2-1)); + S10((c2-1)); + S1(c2); + S5((c2-1)); } if ((M >= N) && (N >= 2)) { - S6(N-2,N-1) ; + S6((N-2),(N-1)); for (c6=N-2;c6<=M-1;c6++) { - S7(N-2,N-1,c6) ; + S7((N-2),(N-1),c6); } - S8(N-2,N-1) ; + S8((N-2),(N-1)); for (c6=N-2;c6<=M-1;c6++) { - S9(N-2,N-1,c6) ; + S9((N-2),(N-1),c6); } for (c4=N-1;c4<=M-1;c4++) { - S2(N-1,c4) ; + S2((N-1),c4); } - S3(N-1) ; + S3((N-1)); for (c4=N-1;c4<=M-1;c4++) { - S4(N-1,c4) ; + S4((N-1),c4); } - S10(N-1) ; - S5(N-1) ; + S10((N-1)); + S5((N-1)); } if ((M == N-1) && (M >= 1)) { - S6(M-1,M) ; - S7(M-1,M,M-1) ; - S8(M-1,M) ; - S9(M-1,M,M-1) ; - S3(M) ; - S10(M) ; - S5(M) ; + S6((M-1),M); + S7((M-1),M,(M-1)); + S8((M-1),M); + S9((M-1),M,(M-1)); + S3(M); + S10(M); + S5(M); } if ((M <= N-2) && (N >= 2)) { - S6(N-2,N-1) ; - S8(N-2,N-1) ; - S3(N-1) ; - S10(N-1) ; - S5(N-1) ; + S6((N-2),(N-1)); + S8((N-2),(N-1)); + S3((N-1)); + S10((N-1)); + S5((N-1)); } } diff -Nru cloog-0.18.2/test/reservoir/stride2.c cloog-0.18.4/test/reservoir/stride2.c --- cloog-0.18.2/test/reservoir/stride2.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/stride2.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,6 +1,6 @@ -/* Generated from ../../../git/cloog/test/reservoir/stride2.cloog by CLooG 0.16.1-2-g0ae5c85 gmp bits in 0.00s. */ +/* Generated from ./reservoir/stride2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ if (M >= 2) { for (c2=2;c2<=M;c2+=7) { - S1(c2,(c2-2)/7); + S1(c2,((c2-2)/7)); } } diff -Nru cloog-0.18.2/test/reservoir/stride.c cloog-0.18.4/test/reservoir/stride.c --- cloog-0.18.2/test/reservoir/stride.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/stride.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,6 +1,6 @@ -/* Generated from ../../../git/cloog/test/reservoir/stride.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ +/* Generated from ./reservoir/stride.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ if (M >= 2) { for (c2=2;c2<=M;c2+=7) { - S1(c2,(c2-2)/7) ; + S1(c2,((c2-2)/7)); } } diff -Nru cloog-0.18.2/test/reservoir/tang-xue1.c cloog-0.18.4/test/reservoir/tang-xue1.c --- cloog-0.18.2/test/reservoir/tang-xue1.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/reservoir/tang-xue1.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,11 +1,11 @@ -/* Generated from ../../../git/cloog/test/reservoir/tang-xue1.cloog by CLooG 0.14.0-165-g01eb246 gmp bits in 0.01s. */ +/* Generated from ./reservoir/tang-xue1.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ for (c2=0;c2<=9;c2++) { for (c4=max(-1,c2-9);c4<=min(4,c2+3);c4++) { for (c6=max(max(1,c2),c2-c4);c6<=min(min(9,c2+1),c2-c4+4);c6++) { for (c8=max(1,-c2+c4+c6);c8<=min(4,-c2+c4+c6+1);c8++) { if (c2%2 == 0) { if (c4%2 == 0) { - S1(c2/2,(-c2+c4)/2,-c2+c6,-c4+c8); + S1((c2/2),((-c2+c4)/2),(-c2+c6),(-c4+c8)); } } } diff -Nru cloog-0.18.2/test/sor1d.c cloog-0.18.4/test/sor1d.c --- cloog-0.18.2/test/sor1d.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/sor1d.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,16 +1,16 @@ -/* Generated from ../../../git/cloog/test/sor1d.cloog by CLooG 0.14.0-278-gcf1f323 gmp bits in 0.11s. */ +/* Generated from ./sor1d.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.13s. */ if ((M >= 1) && (N >= 3)) { for (glT1=-1;glT1<=floord(3*M+N-5,100);glT1++) { for (rp1=max(max(0,ceild(100*glT1-2*M-N+5,100)),ceild(100*glT1-N-193,300));rp1<=min(min(floord(glT1+1,3),floord(M,100)),glT1);rp1++) { for (vT1=max(max(100*glT1-100*rp1,200*rp1-3),200*rp1-N+1);vT1<=min(min(min(2*M+N-5,100*glT1-100*rp1+99),200*rp1+N+193),100*glT1-100*rp1+N+95);vT1++) { if (rp1 >= max(1,ceild(vT1-N+7,200))) { - S3(glT1-rp1,rp1-1,rp1,100*rp1-1,-200*rp1+vT1+6); + S3((glT1-rp1),(rp1-1),rp1,(100*rp1-1),(-200*rp1+vT1+6)); } for (vP1=max(max(1,ceild(vT1-N+5,2)),100*rp1);vP1<=min(min(floord(vT1+2,2),M),100*rp1+99);vP1++) { - S1(glT1-rp1,rp1,vP1,vT1-2*vP1+4); + S1((glT1-rp1),rp1,vP1,(vT1-2*vP1+4)); } if (rp1 <= min(floord(M-100,100),floord(vT1-197,200))) { - S2(glT1-rp1,rp1,rp1+1,100*rp1+99,-200*rp1+vT1-194); + S2((glT1-rp1),rp1,(rp1+1),(100*rp1+99),(-200*rp1+vT1-194)); } } } diff -Nru cloog-0.18.2/test/stride2.c cloog-0.18.4/test/stride2.c --- cloog-0.18.2/test/stride2.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/stride2.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,7 +1,7 @@ -/* Generated from stride2.cloog by CLooG 0.14.0-200-g26bdb56 gmp bits in 0.00s. */ +/* Generated from ./stride2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ for (c1=3;c1<=100;c1+=3) { if (c1 == 27) { S1(27); } - S2(c1,c1/3); + S2(c1,(c1/3)); } diff -Nru cloog-0.18.2/test/stride3.c cloog-0.18.4/test/stride3.c --- cloog-0.18.2/test/stride3.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/stride3.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,6 +1,6 @@ -/* Generated from ../../../git/cloog/test/stride3.cloog by CLooG 0.14.0-291-g5879c32 gmp bits in 0.00s. */ +/* Generated from ./stride3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ if ((m <= n) && (n >= 1)) { for (p1=max(50,50*m);p1<=50*n;p1+=50) { - S1(p1/50); + S1((p1/50)); } } diff -Nru cloog-0.18.2/test/stride.c cloog-0.18.4/test/stride.c --- cloog-0.18.2/test/stride.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/stride.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,9 +1,9 @@ -/* Generated from stride.cloog by CLooG 0.14.0-200-g26bdb56 gmp bits in 0.01s. */ +/* Generated from ./stride.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ for (c1=3;c1<=100;c1++) { if (c1 == 25) { S1(25); } if (c1%3 == 0) { - S2(c1,c1/3); + S2(c1,(c1/3)); } } diff -Nru cloog-0.18.2/test/thomasset.c cloog-0.18.4/test/thomasset.c --- cloog-0.18.2/test/thomasset.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/thomasset.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated from /home/skimo/git/cloog/test/thomasset.cloog by CLooG 0.14.0-292-g2bfd6ac gmp bits in 0.04s. */ +/* Generated from ./thomasset.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.02s. */ if (n >= 1) { for (c1=0;c1<=floord(n-4,3);c1++) { for (i=3*c1+1;i<=3*c1+3;i++) { @@ -25,14 +25,14 @@ if (3*c1 == n-3) { for (i=n-2;i<=n;i++) { if (n%3 == 0) { - S1(i,(n-3)/3); + S1(i,((n-3)/3)); } } } if (c1 >= ceild(n-2,3)) { for (c2=1;c2<=n-1;c2++) { for (j=1;j<=2;j++) { - S2(c2+1,j,0,c1,0); + S2((c2+1),j,0,c1,0); } } } @@ -41,7 +41,7 @@ for (j=max(1,3*c1-n);j<=min(n,3*c1-n+4);j++) { p = max(ceild(3*c1-j,3),ceild(n-2,3)); if (p <= min(floord(n,3),floord(3*c1-j+2,3))) { - S2(c2+1,j,0,p,c1-p); + S2((c2+1),j,0,p,(c1-p)); } } } diff -Nru cloog-0.18.2/test/vasilache.c cloog-0.18.4/test/vasilache.c --- cloog-0.18.2/test/vasilache.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/vasilache.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated from ../../../git/cloog/test/vasilache.cloog by CLooG 0.14.0-162-g1e599e0 gmp bits in 0.03s. */ +/* Generated from ./vasilache.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.02s. */ S1(); S2(); for (p1=0;p1<=N-1;p1++) { @@ -12,14 +12,14 @@ for (p5=0;p5<=floord(N-1,32);p5++) { S7(p1,p3,p5,32*p5); for (p7=32*p5+1;p7<=min(N-1,32*p5+31);p7++) { - S6(p1,p3,p5,p7-1); + S6(p1,p3,p5,(p7-1)); S7(p1,p3,p5,p7); } if (p5 >= ceild(N-31,32)) { - S6(p1,p3,p5,N-1); + S6(p1,p3,p5,(N-1)); } if (p5 <= floord(N-32,32)) { - S6(p1,p3,p5,32*p5+31); + S6(p1,p3,p5,(32*p5+31)); } } } diff -Nru cloog-0.18.2/test/vivien2.c cloog-0.18.4/test/vivien2.c --- cloog-0.18.2/test/vivien2.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/vivien2.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,7 +1,7 @@ -/* Generated from /home/skimo/git/cloog/test/vivien2.cloog by CLooG 0.14.0-292-g2bfd6ac gmp bits in 0.10s. */ +/* Generated from ./vivien2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.08s. */ for (p1=-54*n+4;p1<=4;p1++) { if (p1%2 == 0) { - S1((p1-2)/2); + S1(((p1-2)/2)); } } S3(1); @@ -22,87 +22,87 @@ S3(2); } if ((p1+1)%2 == 0) { - S2((p1-3)/2,1); + S2(((p1-3)/2),1); } } for (p1=10;p1<=2*n+58;p1++) { p2 = ceild(-p1+2,4); if (p2 <= min(floord(-p1+2*n,2),floord(-p1+5,4))) { if (p1%2 == 0) { - S4(-p2,(p1+2*p2)/2); + S4(-p2,((p1+2*p2)/2)); } } if (p1 >= 4*n-4) { if (p1%2 == 0) { for (p3=1;p3<=floord(p1-2*n-2,2);p3++) { - S5((p1-2*n)/2,n,p3); + S5(((p1-2*n)/2),n,p3); } } } p2 = ceild(-p1+6,4); if (p2 <= min(floord(-p1+2*n,2),floord(-p1+9,4))) { if (p1%2 == 0) { - S4(-p2,(p1+2*p2)/2); + S4(-p2,((p1+2*p2)/2)); } for (p3=1;p3<=-p2;p3++) { if (p1%2 == 0) { - S5(-p2+1,(p1+2*p2-2)/2,p3); + S5((-p2+1),((p1+2*p2-2)/2),p3); } } } for (p2=ceild(-p1+10,4);p2<=min(-1,floord(-p1+2*n,2));p2++) { if (p1%2 == 0) { - S4(-p2,(p1+2*p2)/2); + S4(-p2,((p1+2*p2)/2)); } if (p1%2 == 0) { - S6(-p2+2,(p1+2*p2-4)/2); + S6((-p2+2),((p1+2*p2-4)/2)); } for (p3=1;p3<=-p2;p3++) { if (p1%2 == 0) { - S5(-p2+1,(p1+2*p2-2)/2,p3); + S5((-p2+1),((p1+2*p2-2)/2),p3); } } } if ((p1 >= 2*n+4) && (p1 <= 4*n-6)) { if (p1%2 == 0) { - S6((p1-2*n+2)/2,n-1); + S6(((p1-2*n+2)/2),(n-1)); for (p3=1;p3<=floord(p1-2*n-2,2);p3++) { - S5((p1-2*n)/2,n,p3); + S5(((p1-2*n)/2),n,p3); } } } if (p1 >= 2*n+6) { if (p1%2 == 0) { - S6((p1-2*n)/2,n); + S6(((p1-2*n)/2),n); } } if (p1 <= 2*n+4) { if (p1%2 == 0) { - S6(2,(p1-4)/2); + S6(2,((p1-4)/2)); } if ((p1+3)%4 == 0) { - S3((p1-1)/4); + S3(((p1-1)/4)); } if (p1%2 == 0) { - S1((p1-2)/2); + S1(((p1-2)/2)); } } if (p1 >= 2*n+5) { if ((p1+3)%4 == 0) { - S3((p1-1)/4); + S3(((p1-1)/4)); } if (p1%2 == 0) { - S1((p1-2)/2); + S1(((p1-2)/2)); } } if (p1 <= 2*n+2) { if (p1%2 == 0) { - S6(1,(p1-2)/2); + S6(1,((p1-2)/2)); } } for (p2=max(1,ceild(p1-2*n-1,2));p2<=floord(p1-3,4);p2++) { if ((p1+1)%2 == 0) { - S2((p1-2*p2-1)/2,p2); + S2(((p1-2*p2-1)/2),p2); } } } @@ -110,59 +110,59 @@ p2 = ceild(-p1+2,4); if (p2 <= min(floord(-p1+2*n,2),floord(-p1+5,4))) { if (p1%2 == 0) { - S4(-p2,(p1+2*p2)/2); + S4(-p2,((p1+2*p2)/2)); } } if (p1 >= 4*n-4) { if (p1%2 == 0) { for (p3=1;p3<=floord(p1-2*n-2,2);p3++) { - S5((p1-2*n)/2,n,p3); + S5(((p1-2*n)/2),n,p3); } } } p2 = ceild(-p1+6,4); if (p2 <= min(floord(-p1+2*n,2),floord(-p1+9,4))) { if (p1%2 == 0) { - S4(-p2,(p1+2*p2)/2); + S4(-p2,((p1+2*p2)/2)); } for (p3=1;p3<=-p2;p3++) { if (p1%2 == 0) { - S5(-p2+1,(p1+2*p2-2)/2,p3); + S5((-p2+1),((p1+2*p2-2)/2),p3); } } } for (p2=ceild(-p1+10,4);p2<=floord(-p1+2*n,2);p2++) { if (p1%2 == 0) { - S4(-p2,(p1+2*p2)/2); + S4(-p2,((p1+2*p2)/2)); } if (p1%2 == 0) { - S6(-p2+2,(p1+2*p2-4)/2); + S6((-p2+2),((p1+2*p2-4)/2)); } for (p3=1;p3<=-p2;p3++) { if (p1%2 == 0) { - S5(-p2+1,(p1+2*p2-2)/2,p3); + S5((-p2+1),((p1+2*p2-2)/2),p3); } } } if (p1 <= 4*n-6) { if (p1%2 == 0) { - S6((p1-2*n+2)/2,n-1); + S6(((p1-2*n+2)/2),(n-1)); for (p3=1;p3<=floord(p1-2*n-2,2);p3++) { - S5((p1-2*n)/2,n,p3); + S5(((p1-2*n)/2),n,p3); } } } if (p1%2 == 0) { - S6((p1-2*n)/2,n); + S6(((p1-2*n)/2),n); } if ((p1+3)%4 == 0) { - S3((p1-1)/4); + S3(((p1-1)/4)); } for (p2=ceild(p1-2*n-1,2);p2<=floord(p1-3,4);p2++) { if ((p1+1)%2 == 0) { - S2((p1-2*p2-1)/2,p2); + S2(((p1-2*p2-1)/2),p2); } } } -S2(n,n-1); +S2(n,(n-1)); S3(n); diff -Nru cloog-0.18.2/test/vivien.c cloog-0.18.4/test/vivien.c --- cloog-0.18.2/test/vivien.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/vivien.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,8 +1,8 @@ -/* Generated from /home/skimo/git/cloog/test/vivien.cloog by CLooG 0.14.0-292-g2bfd6ac gmp bits in 0.12s. */ +/* Generated from ./vivien.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.07s. */ if (n >= 0) { for (p1=-54*n+4;p1<=4;p1++) { if (p1%2 == 0) { - S1((p1-2)/2); + S1(((p1-2)/2)); } } if (n >= 1) { @@ -30,164 +30,164 @@ S3(2); } if ((p1+1)%2 == 0) { - S2((p1-3)/2,1); + S2(((p1-3)/2),1); } } for (p1=10;p1<=min(2*n+58,4*n-2);p1++) { p2 = ceild(-p1+2,4); if (p2 <= min(floord(-p1+2*n,2),floord(-p1+5,4))) { if (p1%2 == 0) { - S4(-p2,(p1+2*p2)/2); + S4(-p2,((p1+2*p2)/2)); } } if (p1 >= 4*n-4) { if (p1%2 == 0) { for (p3=1;p3<=floord(p1-2*n-2,2);p3++) { - S5((p1-2*n)/2,n,p3); + S5(((p1-2*n)/2),n,p3); } } } p2 = ceild(-p1+6,4); if (p2 <= min(floord(-p1+2*n,2),floord(-p1+9,4))) { if (p1%2 == 0) { - S4(-p2,(p1+2*p2)/2); + S4(-p2,((p1+2*p2)/2)); } for (p3=1;p3<=-p2;p3++) { if (p1%2 == 0) { - S5(-p2+1,(p1+2*p2-2)/2,p3); + S5((-p2+1),((p1+2*p2-2)/2),p3); } } } for (p2=ceild(-p1+10,4);p2<=min(-1,floord(-p1+2*n,2));p2++) { if (p1%2 == 0) { - S4(-p2,(p1+2*p2)/2); + S4(-p2,((p1+2*p2)/2)); } if (p1%2 == 0) { - S6(-p2+2,(p1+2*p2-4)/2); + S6((-p2+2),((p1+2*p2-4)/2)); } for (p3=1;p3<=-p2;p3++) { if (p1%2 == 0) { - S5(-p2+1,(p1+2*p2-2)/2,p3); + S5((-p2+1),((p1+2*p2-2)/2),p3); } } } if ((p1 >= 2*n+4) && (p1 <= 4*n-6)) { if (p1%2 == 0) { - S6((p1-2*n+2)/2,n-1); + S6(((p1-2*n+2)/2),(n-1)); for (p3=1;p3<=floord(p1-2*n-2,2);p3++) { - S5((p1-2*n)/2,n,p3); + S5(((p1-2*n)/2),n,p3); } } } if (p1 >= 2*n+6) { if (p1%2 == 0) { - S6((p1-2*n)/2,n); + S6(((p1-2*n)/2),n); } } if (p1 <= 2*n+4) { if (p1%2 == 0) { - S6(2,(p1-4)/2); + S6(2,((p1-4)/2)); } if ((p1+3)%4 == 0) { - S3((p1-1)/4); + S3(((p1-1)/4)); } if (p1%2 == 0) { - S1((p1-2)/2); + S1(((p1-2)/2)); } } if (p1 >= 2*n+5) { if ((p1+3)%4 == 0) { - S3((p1-1)/4); + S3(((p1-1)/4)); } if (p1%2 == 0) { - S1((p1-2)/2); + S1(((p1-2)/2)); } } if (p1 <= 2*n+2) { if (p1%2 == 0) { - S6(1,(p1-2)/2); + S6(1,((p1-2)/2)); } } for (p2=max(1,ceild(p1-2*n-1,2));p2<=floord(p1-3,4);p2++) { if ((p1+1)%2 == 0) { - S2((p1-2*p2-1)/2,p2); + S2(((p1-2*p2-1)/2),p2); } } } if ((n >= 2) && (n <= 29)) { - S2(n,n-1); + S2(n,(n-1)); } if ((n >= 2) && (n <= 29)) { - S1(2*n-1); + S1((2*n-1)); } if ((n >= 2) && (n <= 28)) { S3(n); } for (p1=max(7,4*n+2);p1<=2*n+58;p1++) { if (p1%2 == 0) { - S1((p1-2)/2); + S1(((p1-2)/2)); } } for (p1=2*n+59;p1<=4*n-2;p1++) { p2 = ceild(-p1+2,4); if (p2 <= min(floord(-p1+2*n,2),floord(-p1+5,4))) { if (p1%2 == 0) { - S4(-p2,(p1+2*p2)/2); + S4(-p2,((p1+2*p2)/2)); } } if (p1 >= 4*n-4) { if (p1%2 == 0) { for (p3=1;p3<=floord(p1-2*n-2,2);p3++) { - S5((p1-2*n)/2,n,p3); + S5(((p1-2*n)/2),n,p3); } } } p2 = ceild(-p1+6,4); if (p2 <= min(floord(-p1+2*n,2),floord(-p1+9,4))) { if (p1%2 == 0) { - S4(-p2,(p1+2*p2)/2); + S4(-p2,((p1+2*p2)/2)); } for (p3=1;p3<=-p2;p3++) { if (p1%2 == 0) { - S5(-p2+1,(p1+2*p2-2)/2,p3); + S5((-p2+1),((p1+2*p2-2)/2),p3); } } } for (p2=ceild(-p1+10,4);p2<=floord(-p1+2*n,2);p2++) { if (p1%2 == 0) { - S4(-p2,(p1+2*p2)/2); + S4(-p2,((p1+2*p2)/2)); } if (p1%2 == 0) { - S6(-p2+2,(p1+2*p2-4)/2); + S6((-p2+2),((p1+2*p2-4)/2)); } for (p3=1;p3<=-p2;p3++) { if (p1%2 == 0) { - S5(-p2+1,(p1+2*p2-2)/2,p3); + S5((-p2+1),((p1+2*p2-2)/2),p3); } } } if (p1 <= 4*n-6) { if (p1%2 == 0) { - S6((p1-2*n+2)/2,n-1); + S6(((p1-2*n+2)/2),(n-1)); for (p3=1;p3<=floord(p1-2*n-2,2);p3++) { - S5((p1-2*n)/2,n,p3); + S5(((p1-2*n)/2),n,p3); } } } if (p1%2 == 0) { - S6((p1-2*n)/2,n); + S6(((p1-2*n)/2),n); } if ((p1+3)%4 == 0) { - S3((p1-1)/4); + S3(((p1-1)/4)); } for (p2=ceild(p1-2*n-1,2);p2<=floord(p1-3,4);p2++) { if ((p1+1)%2 == 0) { - S2((p1-2*p2-1)/2,p2); + S2(((p1-2*p2-1)/2),p2); } } } if (n >= 30) { - S2(n,n-1); + S2(n,(n-1)); } if (n >= 29) { S3(n); diff -Nru cloog-0.18.2/test/walters3.c cloog-0.18.4/test/walters3.c --- cloog-0.18.2/test/walters3.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/walters3.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,8 +1,8 @@ -/* Generated from ../../../git/cloog/test/walters3.cloog by CLooG 0.14.0-338-g99c7504 gmp bits in 0.00s. */ +/* Generated from ./walters3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ for (j=2;j<=8;j++) { if (j%2 == 0) { - S1(j,j/2,j/2); - S2(j,j/2,j/2); + S1(j,(j/2),(j/2)); + S2(j,(j/2),(j/2)); } } S2(10,5,5); diff -Nru cloog-0.18.2/test/walters.c cloog-0.18.4/test/walters.c --- cloog-0.18.2/test/walters.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/walters.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,21 +1,21 @@ -/* Generated from ../../../git/cloog/test/walters.cloog by CLooG 0.16.1-3-g354eed5 gmp bits in 0.01s. */ +/* Generated from ./walters.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ S2(1,0,1,0); S4(1,0,1,0); S3(2,0,1,1); S4(2,0,1,1); for (i=3;i<=10;i++) { if ((i+1)%3 == 0) { - S3(i,(i-2)/3,(i+1)/3,(i+1)/3); + S3(i,((i-2)/3),((i+1)/3),((i+1)/3)); } if ((i+2)%3 == 0) { - S2(i,(i-1)/3,(i+2)/3,(i-1)/3); + S2(i,((i-1)/3),((i+2)/3),((i-1)/3)); } if (i%3 == 0) { - S1(i,i/3,i/3,i/3); + S1(i,(i/3),(i/3),(i/3)); } div36 = floord(i,3); div37 = ceild(2*i-3*div36-1,3); if (div37 <= floord(i+2,3)) { - S4(i,div36,div37,i-div36-div37); + S4(i,div36,div37,(i-div36-div37)); } } diff -Nru cloog-0.18.2/test/wavefront.c cloog-0.18.4/test/wavefront.c --- cloog-0.18.2/test/wavefront.c 2013-12-18 12:27:49.000000000 +0000 +++ cloog-0.18.4/test/wavefront.c 2014-10-02 14:03:59.000000000 +0000 @@ -1,8 +1,8 @@ -/* Generated from ../../../git/cloog/test/wavefront.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ +/* Generated from ./wavefront.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ if ((m >= 1) && (n >= 1)) { for (c1=2;c1<=n+m;c1++) { for (c2=max(1,c1-m);c2<=min(n,c1-1);c2++) { - S1(c2,c1-c2) ; + S1(c2,(c1-c2)); } } }